@activepieces/piece-quickbooks 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +3 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var Fu=Object.create;var bt=Object.defineProperty;var Vu=Object.getOwnPropertyDescriptor;var Zu=Object.getOwnPropertyNames;var qu=Object.getPrototypeOf,Hu=Object.prototype.hasOwnProperty;var i=(e,t)=>bt(e,"name",{value:t,configurable:!0});var z=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Kn=(e,t)=>{for(var r in t)bt(e,r,{get:t[r],enumerable:!0})},Jn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zu(t))!Hu.call(e,o)&&o!==r&&bt(e,o,{get:()=>t[o],enumerable:!(n=Vu(t,o))||n.enumerable});return e};var Se=(e,t,r)=>(r=e!=null?Fu(qu(e)):{},Jn(t||!e||!e.__esModule?bt(r,"default",{value:e,enumerable:!0}):r,e)),Gu=e=>Jn(bt({},"__esModule",{value:!0}),e);var Pi=z((xi,gr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function l(p,m){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let y=0,f=-1,v=(p.match(c.zoneIndex)||[])[0],b,B;for(v&&(v=v.substring(1),p=p.replace(/%.+$/,""));(f=p.indexOf(":",f+1))>=0;)y++;if(p.substr(0,2)==="::"&&y--,p.substr(-2,2)==="::"&&y--,y>m)return null;for(B=m-y,b=":";B--;)b+="0:";return p=p.replace("::",b),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),m=(function(){let ce=p.split(":"),ve=[];for(let ze=0;ze<ce.length;ze++)ve.push(parseInt(ce[ze],16));return ve})(),{parts:m,zoneId:v}}i(l,"expandIPv6");function g(p,m,y,f){if(p.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;f>0;){if(b=y-f,b<0&&(b=0),p[v]>>b!==m[v]>>b)return!1;f-=y,v+=1}return!0}i(g,"matchCIDR");function x(p){if(o.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(n.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}i(x,"parseIntAuto");function E(p,m){for(;p.length<m;)p=`0${p}`;return p}i(E,"padPart");let P={};P.IPv4=(function(){function p(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<m.length;y++)if(f=m[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return i(p,"IPv4"),p.prototype.SpecialRanges={unspecified:[[new p([0,0,0,0]),8]],broadcast:[[new p([255,255,255,255]),32]],multicast:[[new p([224,0,0,0]),4]],linkLocal:[[new p([169,254,0,0]),16]],loopback:[[new p([127,0,0,0]),8]],carrierGradeNat:[[new p([100,64,0,0]),10]],private:[[new p([10,0,0,0]),8],[new p([172,16,0,0]),12],[new p([192,168,0,0]),16]],reserved:[[new p([192,0,0,0]),24],[new p([192,0,2,0]),24],[new p([192,88,99,0]),24],[new p([198,18,0,0]),15],[new p([198,51,100,0]),24],[new p([203,0,113,0]),24],[new p([240,0,0,0]),4]],as112:[[new p([192,175,48,0]),24],[new p([192,31,196,0]),24]],amt:[[new p([192,52,193,0]),24]]},p.prototype.kind=function(){return"ipv4"},p.prototype.match=function(m,y){let f;if(y===void 0&&(f=m,m=f[0],y=f[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,m.octets,8,y)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,B;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in f){if(B=f[b],y&&B!==0)return null;B!==8&&(y=!0),m+=B}else return null;return 32-m},p.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return P.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p})(),P.IPv4.broadcastAddressFromCIDR=function(p){try{let m=this.parseCIDR(p),y=m[0].toByteArray(),f=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(y[b],10)|parseInt(f[b],10)^255),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.isIPv4=function(p){return this.parser(p)!==null},P.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},P.IPv4.isValidCIDR=function(p){try{return this.parseCIDR(p),!0}catch{return!1}},P.IPv4.isValidFourPartDecimal=function(p){return!!(P.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},P.IPv4.isValidCIDRFourPartDecimal=function(p){let m=p.match(/^(.+)\/(\d+)$/);return!P.IPv4.isValidCIDR(p)||!m?!1:P.IPv4.isValidFourPartDecimal(m[1])},P.IPv4.networkAddressFromCIDR=function(p){let m,y,f,v,b;try{for(m=this.parseCIDR(p),f=m[0].toByteArray(),b=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(f[y],10)&parseInt(b[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.parse=function(p){let m=this.parser(p);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},P.IPv4.parseCIDR=function(p){let m;if(m=p.match(/^(.+)\/(\d+)$/)){let y=parseInt(m[2]);if(y>=0&&y<=32){let f=[this.parse(m[1]),y];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},P.IPv4.parser=function(p){let m,y,f;if(m=p.match(r.fourOctet))return(function(){let v=m.slice(1,6),b=[];for(let B=0;B<v.length;B++)y=v[B],b.push(x(y));return b})();if(m=p.match(r.longValue)){if(f=x(m[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(f>>b&255);return v})().reverse()}else return(m=p.match(r.twoOctet))?(function(){let v=m.slice(1,4),b=[];if(f=x(v[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return b.push(x(v[0])),b.push(f>>16&255),b.push(f>>8&255),b.push(f&255),b})():(m=p.match(r.threeOctet))?(function(){let v=m.slice(1,5),b=[];if(f=x(v[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return b.push(x(v[0])),b.push(x(v[1])),b.push(f>>8&255),b.push(f&255),b})():null},P.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");let m=[0,0,0,0],y=0,f=Math.floor(p/8);for(;y<f;)m[y]=255,y++;return f<4&&(m[f]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},P.IPv6=(function(){function p(m,y){let f,v;if(m.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(m[f]<<8|m[f+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(v=this.parts[f],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(p,"IPv6"),p.prototype.SpecialRanges={unspecified:[new p([0,0,0,0,0,0,0,0]),128],linkLocal:[new p([65152,0,0,0,0,0,0,0]),10],multicast:[new p([65280,0,0,0,0,0,0,0]),8],loopback:[new p([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new p([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new p([0,0,0,0,0,65535,0,0]),96],discard:[new p([256,0,0,0,0,0,0,0]),64],rfc6145:[new p([0,0,0,0,65535,0,0,0]),96],rfc6052:[new p([100,65435,0,0,0,0,0,0]),96],"6to4":[new p([8194,0,0,0,0,0,0,0]),16],teredo:[new p([8193,0,0,0,0,0,0,0]),32],benchmarking:[new p([8193,2,0,0,0,0,0,0]),48],amt:[new p([8193,3,0,0,0,0,0,0]),32],as112v6:[[new p([8193,4,274,0,0,0,0,0]),48],[new p([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new p([8193,16,0,0,0,0,0,0]),28],orchid2:[new p([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new p([8193,48,0,0,0,0,0,0]),28],reserved:[[new p([8193,0,0,0,0,0,0,0]),23],[new p([8193,3512,0,0,0,0,0,0]),32]]},p.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},p.prototype.kind=function(){return"ipv6"},p.prototype.match=function(m,y){let f;if(y===void 0&&(f=m,m=f[0],y=f[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,m.parts,16,y)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1,f={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,b;for(let B=7;B>=0;B-=1)if(v=this.parts[B],v in f){if(b=f[v],y&&b!==0)return null;b!==16&&(y=!0),m+=b}else return null;return 128-m},p.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let m,y=[],f=this.parts;for(let v=0;v<f.length;v++)m=f[v],y.push(m>>8),y.push(m&255);return y},p.prototype.toFixedLengthString=function(){let m=(function(){let f=[];for(let v=0;v<this.parts.length;v++)f.push(E(this.parts[v].toString(16),4));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},p.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let m=this.parts.slice(-2),y=m[0],f=m[1];return new P.IPv4([y>>8,y&255,f>>8,f&255])},p.prototype.toNormalizedString=function(){let m=(function(){let f=[];for(let v=0;v<this.parts.length;v++)f.push(this.parts[v].toString(16));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},p.prototype.toRFC5952String=function(){let m=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,v=-1,b;for(;b=m.exec(y);)b[0].length>v&&(f=b.index,v=b[0].length);return v<0?y:`${y.substring(0,f)}::${y.substring(f+v)}`},p.prototype.toString=function(){return this.toRFC5952String()},p})(),P.IPv6.broadcastAddressFromCIDR=function(p){try{let m=this.parseCIDR(p),y=m[0].toByteArray(),f=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(y[b],10)|parseInt(f[b],10)^255),b++;return new this(v)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},P.IPv6.isIPv6=function(p){return this.parser(p)!==null},P.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{let m=this.parser(p);return new this(m.parts,m.zoneId),!0}catch{return!1}},P.IPv6.isValidCIDR=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{return this.parseCIDR(p),!0}catch{return!1}},P.IPv6.networkAddressFromCIDR=function(p){let m,y,f,v,b;try{for(m=this.parseCIDR(p),f=m[0].toByteArray(),b=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(f[y],10)&parseInt(b[y],10)),y++;return new this(v)}catch(B){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${B})`)}},P.IPv6.parse=function(p){let m=this.parser(p);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},P.IPv6.parseCIDR=function(p){let m,y,f;if((y=p.match(/^(.+)\/(\d+)$/))&&(m=parseInt(y[2]),m>=0&&m<=128))return f=[this.parse(y[1]),m],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},P.IPv6.parser=function(p){let m,y,f,v,b,B;if(f=p.match(c.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(c.native.test(p))return l(p,8);if((f=p.match(c.transitional))&&(B=f[6]||"",m=f[1],f[1].endsWith("::")||(m=m.slice(0,-1)),m=l(m+B,6),m.parts)){for(b=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<b.length;y++)if(v=b[y],!(0<=v&&v<=255))return null;return m.parts.push(b[0]<<8|b[1]),m.parts.push(b[2]<<8|b[3]),{parts:m.parts,zoneId:m.zoneId}}return null},P.IPv6.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>128)throw new Error("ipaddr: invalid IPv6 prefix length");let m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(p/8);for(;y<f;)m[y]=255,y++;return f<16&&(m[f]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},P.fromByteArray=function(p){let m=p.length;if(m===4)return new P.IPv4(p);if(m===16)return new P.IPv6(p);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},P.isValid=function(p){return P.IPv6.isValid(p)||P.IPv4.isValid(p)},P.isValidCIDR=function(p){return P.IPv6.isValidCIDR(p)||P.IPv4.isValidCIDR(p)},P.parse=function(p){if(P.IPv6.isValid(p))return P.IPv6.parse(p);if(P.IPv4.isValid(p))return P.IPv4.parse(p);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},P.parseCIDR=function(p){try{return P.IPv6.parseCIDR(p)}catch{try{return P.IPv4.parseCIDR(p)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},P.process=function(p){let m=this.parse(p);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},P.subnetMatch=function(p,m,y){let f,v,b,B;y==null&&(y="unicast");for(v in m)if(Object.prototype.hasOwnProperty.call(m,v)){for(b=m[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),f=0;f<b.length;f++)if(B=b[f],p.kind()===B[0].kind()&&p.match.apply(p,B))return v}return y},typeof gr<"u"&&gr.exports?gr.exports=P:e.ipaddr=P})(xi)});var ba=z((uk,_a)=>{var Pa=require("stream").Stream,kl=require("util");_a.exports=ke;function ke(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(ke,"DelayedStream");kl.inherits(ke,Pa);ke.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ke.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});ke.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ke.prototype.resume=function(){this._released||this.release(),this.source.resume()};ke.prototype.pause=function(){this.source.pause()};ke.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ke.prototype.pipe=function(){var e=Pa.prototype.pipe.apply(this,arguments);return this.resume(),e};ke.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)};ke.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 Aa=z((pk,Ea)=>{var zl=require("util"),Ia=require("stream").Stream,Ta=ba();Ea.exports=ue;function ue(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(ue,"CombinedStream");zl.inherits(ue,Ia);ue.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};ue.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};ue.prototype.append=function(e){var t=ue.isStreamLike(e);if(t){if(!(e instanceof Ta)){var r=Ta.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};ue.prototype.pipe=function(e,t){return Ia.prototype.pipe.call(this,e,t),this.resume(),e};ue.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}};ue.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=ue.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ue.prototype._pipeNext=function(e){this._currentStream=e;var t=ue.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()};ue.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ue.prototype.write=function(e){this.emit("data",e)};ue.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ue.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")};ue.prototype.end=function(){this._reset(),this.emit("end")};ue.prototype.destroy=function(){this._reset(),this.emit("close")};ue.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ue.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};ue.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)};ue.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var $a=z((dk,Sa)=>{"use strict";Sa.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 Oa=z(_e=>{"use strict";var Pr=$a(),Ol=require("path").extname,ka=/^\s*([^;\s]*)(?:;|\s|$)/,Rl=/^text\//i;_e.charset=za;_e.charsets={lookup:za};_e.contentType=wl;_e.extension=Dl;_e.extensions=Object.create(null);_e.lookup=Nl;_e.types=Object.create(null);Cl(_e.extensions,_e.types);function za(e){if(!e||typeof e!="string")return!1;var t=ka.exec(e),r=t&&Pr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Rl.test(t[1])?"UTF-8":!1}i(za,"charset");function wl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?_e.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=_e.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(wl,"contentType");function Dl(e){if(!e||typeof e!="string")return!1;var t=ka.exec(e),r=t&&_e.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Dl,"extension");function Nl(e){if(!e||typeof e!="string")return!1;var t=Ol("x."+e).toLowerCase().substr(1);return t&&_e.types[t]||!1}i(Nl,"lookup");function Cl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Pr).forEach(i(function(o){var s=Pr[o],u=s.extensions;if(!(!u||!u.length)){e[o]=u;for(var c=0;c<u.length;c++){var l=u[c];if(t[l]){var g=r.indexOf(Pr[t[l]].source),x=r.indexOf(s.source);if(t[l]!=="application/octet-stream"&&(g>x||g===x&&t[l].substr(0,12)==="application/"))continue}t[l]=o}}},"forEachMimeType"))}i(Cl,"populateMaps")});var wa=z((gk,Ra)=>{Ra.exports=Ul;function Ul(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(Ul,"defer")});var bn=z((hk,Na)=>{var Da=wa();Na.exports=Ml;function Ml(e){var t=!1;return Da(function(){t=!0}),i(function(n,o){t?e(n,o):Da(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Ml,"async")});var Tn=z((xk,Ca)=>{Ca.exports=Ll;function Ll(e){Object.keys(e.jobs).forEach(jl.bind(e)),e.jobs={}}i(Ll,"abort");function jl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(jl,"clean")});var In=z((_k,Ma)=>{var Ua=bn(),Bl=Tn();Ma.exports=Fl;function Fl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Vl(t,o,e[o],function(s,u){o in r.jobs&&(delete r.jobs[o],s?Bl(r):r.results[o]=u,n(s,r.results))})}i(Fl,"iterate");function Vl(e,t,r,n){var o;return e.length==2?o=e(r,Ua(n)):o=e(r,t,Ua(n)),o}i(Vl,"runJob")});var En=z((Tk,La)=>{La.exports=Zl;function Zl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,s){return t(e[o],e[s])}),n}i(Zl,"state")});var An=z((Ek,ja)=>{var ql=Tn(),Hl=bn();ja.exports=Gl;function Gl(e){Object.keys(this.jobs).length&&(this.index=this.size,ql(this),Hl(e)(null,this.results))}i(Gl,"terminator")});var Fa=z((Sk,Ba)=>{var Wl=In(),Kl=En(),Jl=An();Ba.exports=Ql;function Ql(e,t,r){for(var n=Kl(e);n.index<(n.keyedList||e).length;)Wl(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Jl.bind(n,r)}i(Ql,"parallel")});var Sn=z((kk,_r)=>{var Va=In(),Xl=En(),Yl=An();_r.exports=ed;_r.exports.ascending=Za;_r.exports.descending=td;function ed(e,t,r,n){var o=Xl(e,r);return Va(e,t,o,i(function s(u,c){if(u){n(u,c);return}if(o.index++,o.index<(o.keyedList||e).length){Va(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),Yl.bind(o,n)}i(ed,"serialOrdered");function Za(e,t){return e<t?-1:e>t?1:0}i(Za,"ascending");function td(e,t){return-1*Za(e,t)}i(td,"descending")});var Ha=z((Ok,qa)=>{var rd=Sn();qa.exports=nd;function nd(e,t,r){return rd(e,t,null,r)}i(nd,"serial")});var Wa=z((wk,Ga)=>{Ga.exports={parallel:Fa(),serial:Ha(),serialOrdered:Sn()}});var $n=z((Dk,Ka)=>{"use strict";Ka.exports=Object});var Qa=z((Nk,Ja)=>{"use strict";Ja.exports=Error});var Ya=z((Ck,Xa)=>{"use strict";Xa.exports=EvalError});var ts=z((Uk,es)=>{"use strict";es.exports=RangeError});var ns=z((Mk,rs)=>{"use strict";rs.exports=ReferenceError});var is=z((Lk,os)=>{"use strict";os.exports=SyntaxError});var br=z((jk,as)=>{"use strict";as.exports=TypeError});var us=z((Bk,ss)=>{"use strict";ss.exports=URIError});var ps=z((Fk,cs)=>{"use strict";cs.exports=Math.abs});var ds=z((Vk,ls)=>{"use strict";ls.exports=Math.floor});var fs=z((Zk,ms)=>{"use strict";ms.exports=Math.max});var ys=z((qk,gs)=>{"use strict";gs.exports=Math.min});var vs=z((Hk,hs)=>{"use strict";hs.exports=Math.pow});var Ps=z((Gk,xs)=>{"use strict";xs.exports=Math.round});var bs=z((Wk,_s)=>{"use strict";_s.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Is=z((Jk,Ts)=>{"use strict";var od=bs();Ts.exports=i(function(t){return od(t)||t===0?t:t<0?-1:1},"sign")});var As=z((Xk,Es)=>{"use strict";Es.exports=Object.getOwnPropertyDescriptor});var kn=z((Yk,Ss)=>{"use strict";var Tr=As();if(Tr)try{Tr([],"length")}catch{Tr=null}Ss.exports=Tr});var ks=z((ez,$s)=>{"use strict";var Ir=Object.defineProperty||!1;if(Ir)try{Ir({},"a",{value:1})}catch{Ir=!1}$s.exports=Ir});var zn=z((tz,zs)=>{"use strict";zs.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==o||c.enumerable!==!0)return!1}return!0},"hasSymbols")});var ws=z((nz,Rs)=>{"use strict";var Os=typeof Symbol<"u"&&Symbol,id=zn();Rs.exports=i(function(){return typeof Os!="function"||typeof Symbol!="function"||typeof Os("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:id()},"hasNativeSymbols")});var On=z((iz,Ds)=>{"use strict";Ds.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Rn=z((az,Ns)=>{"use strict";var ad=$n();Ns.exports=ad.getPrototypeOf||null});var Ms=z((sz,Us)=>{"use strict";var sd="Function.prototype.bind called on incompatible ",ud=Object.prototype.toString,cd=Math.max,pd="[object Function]",Cs=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),ld=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),dd=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Us.exports=i(function(t){var r=this;if(typeof r!="function"||ud.apply(r)!==pd)throw new TypeError(sd+r);for(var n=ld(arguments,1),o,s=i(function(){if(this instanceof o){var x=r.apply(this,Cs(n,arguments));return Object(x)===x?x:this}return r.apply(t,Cs(n,arguments))},"binder"),u=cd(0,r.length-n.length),c=[],l=0;l<u;l++)c[l]="$"+l;if(o=Function("binder","return function ("+dd(c,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=i(function(){},"Empty");g.prototype=r.prototype,o.prototype=new g,g.prototype=null}return o},"bind")});var ft=z((cz,Ls)=>{"use strict";var md=Ms();Ls.exports=Function.prototype.bind||md});var Er=z((pz,js)=>{"use strict";js.exports=Function.prototype.call});var wn=z((lz,Bs)=>{"use strict";Bs.exports=Function.prototype.apply});var Vs=z((dz,Fs)=>{"use strict";Fs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var qs=z((mz,Zs)=>{"use strict";var fd=ft(),gd=wn(),yd=Er(),hd=Vs();Zs.exports=hd||fd.call(yd,gd)});var Gs=z((fz,Hs)=>{"use strict";var vd=ft(),xd=br(),Pd=Er(),_d=qs();Hs.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new xd("a function is required");return _d(vd,Pd,t)},"callBindBasic")});var Ys=z((yz,Xs)=>{"use strict";var bd=Gs(),Ws=kn(),Js;try{Js=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Dn=!!Js&&Ws&&Ws(Object.prototype,"__proto__"),Qs=Object,Ks=Qs.getPrototypeOf;Xs.exports=Dn&&typeof Dn.get=="function"?bd([Dn.get]):typeof Ks=="function"?i(function(t){return Ks(t==null?t:Qs(t))},"getDunder"):!1});var ou=z((vz,nu)=>{"use strict";var eu=On(),tu=Rn(),ru=Ys();nu.exports=eu?i(function(t){return eu(t)},"getProto"):tu?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return tu(t)},"getProto"):ru?i(function(t){return ru(t)},"getProto"):null});var Nn=z((Pz,iu)=>{"use strict";var Td=Function.prototype.call,Id=Object.prototype.hasOwnProperty,Ed=ft();iu.exports=Ed.call(Td,Id)});var du=z((_z,lu)=>{"use strict";var K,Ad=$n(),Sd=Qa(),$d=Ya(),kd=ts(),zd=ns(),vt=is(),ht=br(),Od=us(),Rd=ps(),wd=ds(),Dd=fs(),Nd=ys(),Cd=vs(),Ud=Ps(),Md=Is(),cu=Function,Cn=i(function(e){try{return cu('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),qt=kn(),Ld=ks(),Un=i(function(){throw new ht},"throwTypeError"),jd=qt?(function(){try{return arguments.callee,Un}catch{try{return qt(arguments,"callee").get}catch{return Un}}})():Un,gt=ws()(),ye=ou(),Bd=Rn(),Fd=On(),pu=wn(),Ht=Er(),yt={},Vd=typeof Uint8Array>"u"||!ye?K:ye(Uint8Array),nt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":gt&&ye?ye([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":yt,"%AsyncGenerator%":yt,"%AsyncGeneratorFunction%":yt,"%AsyncIteratorPrototype%":yt,"%Atomics%":typeof Atomics>"u"?K:Atomics,"%BigInt%":typeof BigInt>"u"?K:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?K:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?K:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?K:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Sd,"%eval%":eval,"%EvalError%":$d,"%Float16Array%":typeof Float16Array>"u"?K:Float16Array,"%Float32Array%":typeof Float32Array>"u"?K:Float32Array,"%Float64Array%":typeof Float64Array>"u"?K:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?K:FinalizationRegistry,"%Function%":cu,"%GeneratorFunction%":yt,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":gt&&ye?ye(ye([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!gt||!ye?K:ye(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ad,"%Object.getOwnPropertyDescriptor%":qt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":kd,"%ReferenceError%":zd,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!gt||!ye?K:ye(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":gt&&ye?ye(""[Symbol.iterator]()):K,"%Symbol%":gt?Symbol:K,"%SyntaxError%":vt,"%ThrowTypeError%":jd,"%TypedArray%":Vd,"%TypeError%":ht,"%Uint8Array%":typeof Uint8Array>"u"?K:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?K:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?K:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?K:Uint32Array,"%URIError%":Od,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":Ht,"%Function.prototype.apply%":pu,"%Object.defineProperty%":Ld,"%Object.getPrototypeOf%":Bd,"%Math.abs%":Rd,"%Math.floor%":wd,"%Math.max%":Dd,"%Math.min%":Nd,"%Math.pow%":Cd,"%Math.round%":Ud,"%Math.sign%":Md,"%Reflect.getPrototypeOf%":Fd};if(ye)try{null.error}catch(e){au=ye(ye(e)),nt["%Error.prototype%"]=au}var au,Zd=i(function e(t){var r;if(t==="%AsyncFunction%")r=Cn("async function () {}");else if(t==="%GeneratorFunction%")r=Cn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Cn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ye&&(r=ye(o.prototype))}return nt[t]=r,r},"doEval"),su={__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"]},Gt=ft(),Ar=Nn(),qd=Gt.call(Ht,Array.prototype.concat),Hd=Gt.call(pu,Array.prototype.splice),uu=Gt.call(Ht,String.prototype.replace),Sr=Gt.call(Ht,String.prototype.slice),Gd=Gt.call(Ht,RegExp.prototype.exec),Wd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Kd=/\\(\\)?/g,Jd=i(function(t){var r=Sr(t,0,1),n=Sr(t,-1);if(r==="%"&&n!=="%")throw new vt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new vt("invalid intrinsic syntax, expected opening `%`");var o=[];return uu(t,Wd,function(s,u,c,l){o[o.length]=c?uu(l,Kd,"$1"):u||s}),o},"stringToPath"),Qd=i(function(t,r){var n=t,o;if(Ar(su,n)&&(o=su[n],n="%"+o[0]+"%"),Ar(nt,n)){var s=nt[n];if(s===yt&&(s=Zd(n)),typeof s>"u"&&!r)throw new ht("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new vt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");lu.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new ht("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ht('"allowMissing" argument must be a boolean');if(Gd(/^%?[^%]*%?$/,t)===null)throw new vt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Jd(t),o=n.length>0?n[0]:"",s=Qd("%"+o+"%",r),u=s.name,c=s.value,l=!1,g=s.alias;g&&(o=g[0],Hd(n,qd([0,1],g)));for(var x=1,E=!0;x<n.length;x+=1){var P=n[x],p=Sr(P,0,1),m=Sr(P,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new vt("property names with quotes must have matching quotes");if((P==="constructor"||!E)&&(l=!0),o+="."+P,u="%"+o+"%",Ar(nt,u))c=nt[u];else if(c!=null){if(!(P in c)){if(!r)throw new ht("base intrinsic for "+t+" exists, but the property is not available.");return}if(qt&&x+1>=n.length){var y=qt(c,P);E=!!y,E&&"get"in y&&!("originalValue"in y.get)?c=y.get:c=c[P]}else E=Ar(c,P),c=c[P];E&&!l&&(nt[u]=c)}}return c},"GetIntrinsic")});var fu=z((Tz,mu)=>{"use strict";var Xd=zn();mu.exports=i(function(){return Xd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var hu=z((Ez,yu)=>{"use strict";var Yd=du(),gu=Yd("%Object.defineProperty%",!0),em=fu()(),tm=Nn(),rm=br(),$r=em?Symbol.toStringTag:null;yu.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new rm("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");$r&&(n||!tm(t,$r))&&(gu?gu(t,$r,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[$r]=r)},"setToStringTag")});var xu=z((Sz,vu)=>{"use strict";var nm=Function.prototype.call,om=Object.prototype.hasOwnProperty,im=ft();vu.exports=im.call(nm,om)});var _u=z(($z,Pu)=>{"use strict";Pu.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Iu=z((kz,Tu)=>{"use strict";var Bn=Aa(),am=require("util"),Mn=require("path"),sm=require("http"),um=require("https"),cm=require("url").parse,pm=require("fs"),lm=require("stream").Stream,dm=require("crypto"),Ln=Oa(),mm=Wa(),fm=hu(),Qe=xu(),jn=_u();function bu(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(bu,"escapeHeaderParam");function Q(e){if(!(this instanceof Q))return new Q(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Bn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(Q,"FormData");am.inherits(Q,Bn);Q.LINE_BREAK=`\r
|
|
2
|
-
`;Q.DEFAULT_CONTENT_TYPE="application/octet-stream";Q.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Bn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};Q.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)+Q.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Qe(t,"httpVersion"))&&!(t instanceof lm))&&(r.knownLength||this._valuesToMeasure.push(t))};Q.prototype._lengthRetriever=function(e,t){Qe(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):pm.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):Qe(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Qe(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Q.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",u={"Content-Disposition":["form-data",'name="'+bu(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&jn(u,r.header);var c;for(var l in u)if(Qe(u,l)){if(c=u[l],c==null)continue;Array.isArray(c)||(c=[c]),c.length&&(s+=l+": "+c.join("; ")+Q.LINE_BREAK)}return"--"+this.getBoundary()+Q.LINE_BREAK+s+Q.LINE_BREAK};Q.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Mn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Mn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Qe(e,"httpVersion")&&(r=Mn.basename(e.client._httpMessage.path||"")),r)return'filename="'+bu(r)+'"'};Q.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Ln.lookup(e.name)),!r&&e&&e.path&&(r=Ln.lookup(e.path)),!r&&e&&e.readable&&Qe(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Ln.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Q.DEFAULT_CONTENT_TYPE),r};Q.prototype._multiPartFooter=function(){return function(e){var t=Q.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Q.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Q.LINE_BREAK};Q.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Qe(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Q.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Q.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Q.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(Q.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Q.prototype._generateBoundary=function(){this._boundary="--------------------------"+dm.randomBytes(12).toString("hex")};Q.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};Q.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Q.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}mm.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};Q.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=cm(e),n=jn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=jn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=um.request(n):r=sm.request(n),this.getLength(function(s,u){if(s&&s!=="Unknown stream"){this._error(s);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var c,l=i(function(g,x){return r.removeListener("error",l),r.removeListener("response",c),t.call(this,g,x)},"callback");c=l.bind(this,null),r.on("error",l),r.on("response",c)}}.bind(this)),r};Q.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Q.prototype.toString=function(){return"[object FormData]"};fm(Q.prototype,"FormData");Tu.exports=Q});var xt=z((Fn,Vn)=>{(function(e,t){typeof Fn=="object"&&typeof Vn<"u"?Vn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Fn,(function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",s="minute",u="hour",c="day",l="week",g="month",x="quarter",E="year",P="date",p="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:i(function(M){var I=["th","st","nd","rd"],T=M%100;return"["+M+(I[(T-20)%10]||I[T]||I[0])+"]"},"ordinal")},v=i(function(M,I,T){var $=String(M);return!$||$.length>=I?M:""+Array(I+1-$.length).join(T)+M},"m"),b={s:v,z:i(function(M){var I=-M.utcOffset(),T=Math.abs(I),$=Math.floor(T/60),A=T%60;return(I<=0?"+":"-")+v($,2,"0")+":"+v(A,2,"0")},"z"),m:i(function M(I,T){if(I.date()<T.date())return-M(T,I);var $=12*(T.year()-I.year())+(T.month()-I.month()),A=I.clone().add($,g),F=T-A<0,V=I.clone().add($+(F?-1:1),g);return+(-($+(T-A)/(F?A-V:V-A))||0)},"t"),a:i(function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},"a"),p:i(function(M){return{M:g,y:E,w:l,d:c,D:P,h:u,m:s,s:o,ms:n,Q:x}[M]||String(M||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(M){return M===void 0},"u")},B="en",ce={};ce[B]=f;var ve=i(function(M){return M instanceof ot},"p"),ze=i(function M(I,T,$){var A;if(!I)return B;if(typeof I=="string"){var F=I.toLowerCase();ce[F]&&(A=F),T&&(ce[F]=T,A=F);var V=I.split("-");if(!A&&V.length>1)return M(V[0])}else{var te=I.name;ce[te]=I,A=te}return!$&&A&&(B=A),A||!$&&B},"t"),ee=i(function(M,I){if(ve(M))return M.clone();var T=typeof I=="object"?I:{};return T.date=M,T.args=arguments,new ot(T)},"w"),q=b;q.l=ze,q.i=ve,q.w=function(M,I){return ee(M,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var ot=(function(){function M(T){this.$L=ze(T.locale,null,!0),this.parse(T)}i(M,"M");var I=M.prototype;return I.parse=function(T){this.$d=(function($){var A=$.date,F=$.utc;if(A===null)return new Date(NaN);if(q.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var V=A.match(m);if(V){var te=V[2]-1||0,pe=(V[7]||"0").substring(0,3);return F?new Date(Date.UTC(V[1],te,V[3]||1,V[4]||0,V[5]||0,V[6]||0,pe)):new Date(V[1],te,V[3]||1,V[4]||0,V[5]||0,V[6]||0,pe)}}return new Date(A)})(T),this.$x=T.x||{},this.init()},I.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},I.$utils=function(){return q},I.isValid=function(){return this.$d.toString()!==p},I.isSame=function(T,$){var A=ee(T);return this.startOf($)<=A&&A<=this.endOf($)},I.isAfter=function(T,$){return ee(T)<this.startOf($)},I.isBefore=function(T,$){return this.endOf($)<ee(T)},I.$g=function(T,$,A){return q.u(T)?this[$]:this.set(A,T)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(T,$){var A=this,F=!!q.u($)||$,V=q.p(T),te=i(function(et,Pe){var Be=q.w(A.$u?Date.UTC(A.$y,Pe,et):new Date(A.$y,Pe,et),A);return F?Be:Be.endOf(c)},"l"),pe=i(function(et,Pe){return q.w(A.toDate()[et].apply(A.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(Pe)),A)},"$"),fe=this.$W,he=this.$M,Ie=this.$D,it="set"+(this.$u?"UTC":"");switch(V){case E:return F?te(1,0):te(31,11);case g:return F?te(1,he):te(0,he+1);case l:var Ye=this.$locale().weekStart||0,Pt=(fe<Ye?fe+7:fe)-Ye;return te(F?Ie-Pt:Ie+(6-Pt),he);case c:case P:return pe(it+"Hours",0);case u:return pe(it+"Minutes",1);case s:return pe(it+"Seconds",2);case o:return pe(it+"Milliseconds",3);default:return this.clone()}},I.endOf=function(T){return this.startOf(T,!1)},I.$set=function(T,$){var A,F=q.p(T),V="set"+(this.$u?"UTC":""),te=(A={},A[c]=V+"Date",A[P]=V+"Date",A[g]=V+"Month",A[E]=V+"FullYear",A[u]=V+"Hours",A[s]=V+"Minutes",A[o]=V+"Seconds",A[n]=V+"Milliseconds",A)[F],pe=F===c?this.$D+($-this.$W):$;if(F===g||F===E){var fe=this.clone().set(P,1);fe.$d[te](pe),fe.init(),this.$d=fe.set(P,Math.min(this.$D,fe.daysInMonth())).$d}else te&&this.$d[te](pe);return this.init(),this},I.set=function(T,$){return this.clone().$set(T,$)},I.get=function(T){return this[q.p(T)]()},I.add=function(T,$){var A,F=this;T=Number(T);var V=q.p($),te=i(function(he){var Ie=ee(F);return q.w(Ie.date(Ie.date()+Math.round(he*T)),F)},"y");if(V===g)return this.set(g,this.$M+T);if(V===E)return this.set(E,this.$y+T);if(V===c)return te(1);if(V===l)return te(7);var pe=(A={},A[s]=t,A[u]=r,A[o]=e,A)[V]||1,fe=this.$d.getTime()+T*pe;return q.w(fe,this)},I.subtract=function(T,$){return this.add(-1*T,$)},I.format=function(T){var $=this,A=this.$locale();if(!this.isValid())return A.invalidDate||p;var F=T||"YYYY-MM-DDTHH:mm:ssZ",V=q.z(this),te=this.$H,pe=this.$m,fe=this.$M,he=A.weekdays,Ie=A.months,it=A.meridiem,Ye=i(function(Pe,Be,_t,Wt){return Pe&&(Pe[Be]||Pe($,F))||_t[Be].slice(0,Wt)},"h"),Pt=i(function(Pe){return q.s(te%12||12,Pe,"0")},"d"),et=it||function(Pe,Be,_t){var Wt=Pe<12?"AM":"PM";return _t?Wt.toLowerCase():Wt};return F.replace(y,(function(Pe,Be){return Be||(function(_t){switch(_t){case"YY":return String($.$y).slice(-2);case"YYYY":return q.s($.$y,4,"0");case"M":return fe+1;case"MM":return q.s(fe+1,2,"0");case"MMM":return Ye(A.monthsShort,fe,Ie,3);case"MMMM":return Ye(Ie,fe);case"D":return $.$D;case"DD":return q.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Ye(A.weekdaysMin,$.$W,he,2);case"ddd":return Ye(A.weekdaysShort,$.$W,he,3);case"dddd":return he[$.$W];case"H":return String(te);case"HH":return q.s(te,2,"0");case"h":return Pt(1);case"hh":return Pt(2);case"a":return et(te,pe,!0);case"A":return et(te,pe,!1);case"m":return String(pe);case"mm":return q.s(pe,2,"0");case"s":return String($.$s);case"ss":return q.s($.$s,2,"0");case"SSS":return q.s($.$ms,3,"0");case"Z":return V}return null})(Pe)||V.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(T,$,A){var F,V=this,te=q.p($),pe=ee(T),fe=(pe.utcOffset()-this.utcOffset())*t,he=this-pe,Ie=i(function(){return q.m(V,pe)},"D");switch(te){case E:F=Ie()/12;break;case g:F=Ie();break;case x:F=Ie()/3;break;case l:F=(he-fe)/6048e5;break;case c:F=(he-fe)/864e5;break;case u:F=he/r;break;case s:F=he/t;break;case o:F=he/e;break;default:F=he}return A?F:q.a(F)},I.daysInMonth=function(){return this.endOf(g).$D},I.$locale=function(){return ce[this.$L]},I.locale=function(T,$){if(!T)return this.$L;var A=this.clone(),F=ze(T,$,!0);return F&&(A.$L=F),A},I.clone=function(){return q.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},M})(),Xe=ot.prototype;return ee.prototype=Xe,[["$ms",n],["$s",o],["$m",s],["$H",u],["$W",c],["$M",g],["$y",E],["$D",P]].forEach((function(M){Xe[M[1]]=function(I){return this.$g(I,M[0],M[1])}})),ee.extend=function(M,I){return M.$i||(M(I,ot,ee),M.$i=!0),ee},ee.locale=ze,ee.isDayjs=ve,ee.unix=function(M){return ee(1e3*M)},ee.en=ce[B],ee.Ls=ce,ee.p={},ee}))});var Em={};Kn(Em,{quickbooks:()=>Im});module.exports=Gu(Em);var Wu=Object.freeze({status:"aborted"});function S(e,t,r){function n(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:u,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);let g=u.prototype,x=Object.keys(g);for(let E=0;E<x.length;E++){let P=x[E];P in c||(c[P]=g[P].bind(c))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function u(c){var l;let g=r?.Parent?new s:this;n(g,c),(l=g._zod).deferred??(l.deferred=[]);for(let x of g._zod.deferred)x();return g}return i(u,"_"),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:i(c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e),"value")}),Object.defineProperty(u,"name",{value:e}),u}i(S,"$constructor");var Oe=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Kt=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Cr={};function Ne(e){return e&&Object.assign(Cr,e),Cr}i(Ne,"config");function Mr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(Mr,"getEnumValues");function Xn(e,t){return typeof t=="bigint"?t.toString():t}i(Xn,"jsonStringifyReplacer");function Qt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Qt,"cached");function Yn(e){return e==null}i(Yn,"nullish");function Xt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Xt,"cleanRegex");var Qn=Symbol("evaluating");function de(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Qn)return n===void 0&&(n=Qn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(de,"defineLazy");var Lr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(Tt,"isObject");var Ku=Qt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function eo(e){if(Tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(eo,"isPlainObject");var to=new Set(["string","number","symbol"]);function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(at,"escapeRegex");function Yt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(Yt,"clone");function ne(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(ne,"normalizeParams");function ro(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(ro,"optionalKeys");var no={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 st(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(st,"aborted");function Fe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Fe,"prefixIssues");function Jt(e){return typeof e=="string"?e:e?.message}i(Jt,"unwrapMessage");function Ve(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Jt(e.inst?._zod.def?.error?.(e))??Jt(t?.error?.(e))??Jt(r.customError?.(e))??Jt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ve,"finalizeIssue");function oo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(oo,"getLengthableOrigin");function jr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(jr,"issue");var io=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Xn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),ao=S("$ZodError",io),It=S("$ZodError",io,{Parent:Error});var Qu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise)throw new Oe;if(u.issues.length){let c=new(o?.Err??e)(u.issues.map(l=>Ve(l,s,Ne())));throw Lr(c,o?.callee),c}return u.value},"_parse"),er=Qu(It),Xu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise&&(u=await u),u.issues.length){let c=new(o?.Err??e)(u.issues.map(l=>Ve(l,s,Ne())));throw Lr(c,o?.callee),c}return u.value},"_parseAsync"),tr=Xu(It),Yu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Oe;return s.issues.length?{success:!1,error:new(e??ao)(s.issues.map(u=>Ve(u,o,Ne())))}:{success:!0,data:s.value}},"_safeParse"),Et=Yu(It),ec=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(u=>Ve(u,o,Ne())))}:{success:!0,data:s.value}},"_safeParseAsync"),At=ec(It);var tc="(?:(?:\\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])))",rc=new RegExp(`^${tc}$`);var so=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),uo=/^-?\d+n?$/,co=/^-?\d+$/,Br=/^-?\d+(?:\.\d+)?$/,po=/^(?:true|false)$/i;var Ze=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),nc={number:"number",bigint:"bigint",object:"date"};var lo=S("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=nc[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.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 mo=S("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=no[t.format];e._zod.onattach.push(u=>{let c=u._zod.bag;c.format=t.format,c.minimum=o,c.maximum=s,r&&(c.pattern=co)}),e._zod.check=u=>{let c=u.value;if(r){if(!Number.isInteger(c)){u.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?u.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):u.issues.push({input:c,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}}c<o&&u.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&u.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var fo=S("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Yn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let u=oo(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Fr=S("$ZodCheckStringFormat",(e,t)=>{var r,n;Ze.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),go=S("$ZodCheckRegex",(e,t)=>{Fr.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 ho={major:4,minor:3,patch:6};var ie=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ho;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((u,c,l)=>{let g=st(u),x;for(let E of c){if(E._zod.def.when){if(!E._zod.def.when(u))continue}else if(g)continue;let P=u.issues.length,p=E._zod.check(u);if(p instanceof Promise&&l?.async===!1)throw new Oe;if(x||p instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await p,u.issues.length!==P&&(g||(g=st(u,P)))});else{if(u.issues.length===P)continue;g||(g=st(u,P))}}return x?x.then(()=>u):u},"runChecks"),s=i((u,c,l)=>{if(st(u))return u.aborted=!0,u;let g=o(c,n,l);if(g instanceof Promise){if(l.async===!1)throw new Oe;return g.then(x=>e._zod.parse(x,l))}return e._zod.parse(g,l)},"handleCanaryResult");e._zod.run=(u,c)=>{if(c.skipChecks)return e._zod.parse(u,c);if(c.direction==="backward"){let g=e._zod.parse({value:u.value,issues:[]},{...c,skipChecks:!0});return g instanceof Promise?g.then(x=>s(x,u,c)):s(g,u,c)}let l=e._zod.parse(u,c);if(l instanceof Promise){if(c.async===!1)throw new Oe;return l.then(g=>o(g,n,c))}return o(l,n,c)}}de(e,"~standard",()=>({validate:i(o=>{try{let s=Et(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return At(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},"validate"),vendor:"zod",version:1}))}),or=S("$ZodString",(e,t)=>{ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??so(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}}),Vr=S("$ZodStringFormat",(e,t)=>{Fr.init(e,t),or.init(e,t)});var bo=S("$ZodURL",(e,t)=>{Vr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Zr=S("$ZodNumber",(e,t)=>{ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??Br,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),To=S("$ZodNumberFormat",(e,t)=>{mo.init(e,t),Zr.init(e,t)}),qr=S("$ZodBoolean",(e,t)=>{ie.init(e,t),e._zod.pattern=po,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Io=S("$ZodBigInt",(e,t)=>{ie.init(e,t),e._zod.pattern=uo,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Eo=S("$ZodAny",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r}),Ao=S("$ZodUnknown",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r});var So=S("$ZodVoid",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),$o=S("$ZodDate",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function vo(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}i(vo,"handleArrayResult");var ko=S("$ZodArray",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let u=0;u<o.length;u++){let c=o[u],l=t.element._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(g=>vo(g,r,u))):vo(l,r,u)}return s.length?Promise.all(s).then(()=>r):r}});function nr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Fe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(nr,"handlePropertyResult");function oc(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=ro(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(oc,"normalizeDef");function ic(e,t,r,n,o,s){let u=[],c=o.keySet,l=o.catchall._zod,g=l.def.type,x=l.optout==="optional";for(let E in t){if(c.has(E))continue;if(g==="never"){u.push(E);continue}let P=l.run({value:t[E],issues:[]},n);P instanceof Promise?e.push(P.then(p=>nr(p,r,E,t,x))):nr(P,r,E,t,x)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(ic,"handleCatchall");var zo=S("$ZodObject",(e,t)=>{if(ie.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let l={...c};return Object.defineProperty(t,"shape",{value:l}),l},"get")})}let n=Qt(()=>oc(t));de(e._zod,"propValues",()=>{let c=t.shape,l={};for(let g in c){let x=c[g]._zod;if(x.values){l[g]??(l[g]=new Set);for(let E of x.values)l[g].add(E)}}return l});let o=Tt,s=t.catchall,u;e._zod.parse=(c,l)=>{u??(u=n.value);let g=c.value;if(!o(g))return c.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),c;c.value={};let x=[],E=u.shape;for(let P of u.keys){let p=E[P],m=p._zod.optout==="optional",y=p._zod.run({value:g[P],issues:[]},l);y instanceof Promise?x.push(y.then(f=>nr(f,c,P,g,m))):nr(y,c,P,g,m)}return s?ic(x,g,c,l,n.value,e):x.length?Promise.all(x).then(()=>c):c}});function xo(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!st(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(u=>Ve(u,n,Ne())))}),t)}i(xo,"handleUnionResults");var Hr=S("$ZodUnion",(e,t)=>{ie.init(e,t),de(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),de(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),de(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),de(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Xt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let u=!1,c=[];for(let l of t.options){let g=l._zod.run({value:o.value,issues:[]},s);if(g instanceof Promise)c.push(g),u=!0;else{if(g.issues.length===0)return g;c.push(g)}}return u?Promise.all(c).then(l=>xo(l,o,e,s)):xo(c,o,e,s)}});var Oo=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Hr.init(e,t);let r=e._zod.parse;de(e._zod,"propValues",()=>{let o={};for(let s of t.options){let u=s._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[c,l]of Object.entries(u)){o[c]||(o[c]=new Set);for(let g of l)o[c].add(g)}}return o});let n=Qt(()=>{let o=t.options,s=new Map;for(let u of o){let c=u._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let l of c){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,u)}}return s});e._zod.parse=(o,s)=>{let u=o.value;if(!Tt(u))return o.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),o;let c=n.value.get(u?.[t.discriminator]);return c?c._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),o)}});var Ro=S("$ZodRecord",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!eo(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],u=t.keyType._zod.values;if(u){r.value={};let c=new Set;for(let g of u)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){c.add(typeof g=="number"?g.toString():g);let x=t.valueType._zod.run({value:o[g],issues:[]},n);x instanceof Promise?s.push(x.then(E=>{E.issues.length&&r.issues.push(...Fe(g,E.issues)),r.value[g]=E.value})):(x.issues.length&&r.issues.push(...Fe(g,x.issues)),r.value[g]=x.value)}let l;for(let g in o)c.has(g)||(l=l??[],l.push(g));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=t.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Br.test(c)&&l.issues.length){let E=t.keyType._zod.run({value:Number(c),issues:[]},n);if(E instanceof Promise)throw new Error("Async schemas not supported in object keys currently");E.issues.length===0&&(l=E)}if(l.issues.length){t.mode==="loose"?r.value[c]=o[c]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(E=>Ve(E,n,Ne())),input:c,path:[c],inst:e});continue}let x=t.valueType._zod.run({value:o[c],issues:[]},n);x instanceof Promise?s.push(x.then(E=>{E.issues.length&&r.issues.push(...Fe(c,E.issues)),r.value[l.value]=E.value})):(x.issues.length&&r.issues.push(...Fe(c,x.issues)),r.value[l.value]=x.value)}}return s.length?Promise.all(s).then(()=>r):r}});var wo=S("$ZodEnum",(e,t)=>{ie.init(e,t);let r=Mr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>to.has(typeof o)).map(o=>typeof o=="string"?at(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let u=o.value;return n.has(u)||o.issues.push({code:"invalid_value",values:r,input:u,inst:e}),o}}),Do=S("$ZodLiteral",(e,t)=>{if(ie.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"?at(n):n?at(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var No=S("$ZodTransform",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Kt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(r.value=u,r));if(o instanceof Promise)throw new Oe;return r.value=o,r}});function Po(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Po,"handleOptionalResult");var Co=S("$ZodOptional",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),de(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Xt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Po(s,r.value)):Po(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Uo=S("$ZodNullable",(e,t)=>{ie.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Xt(r.source)}|null)$`):void 0}),de(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 Mo=S("$ZodPipe",(e,t)=>{ie.init(e,t),de(e._zod,"values",()=>t.in._zod.values),de(e._zod,"optin",()=>t.in._zod.optin),de(e._zod,"optout",()=>t.out._zod.optout),de(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(u=>rr(u,t.in,n)):rr(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>rr(s,t.out,n)):rr(o,t.out,n)}});function rr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(rr,"handlePipeResult");var Lo=S("$ZodCustom",(e,t)=>{Ze.init(e,t),ie.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>_o(s,r,n,e));_o(o,r,n,e)}});function _o(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(jr(o))}}i(_o,"handleRefineResult");var Bo;var Gr=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Fo(){return new Gr}i(Fo,"registry");(Bo=globalThis).__zod_globalRegistry??(Bo.__zod_globalRegistry=Fo());var Wr=globalThis.__zod_globalRegistry;function Vo(e,t){return new e({type:"string",...ne(t)})}i(Vo,"_string");function Zo(e,t){return new e({type:"string",coerce:!0,...ne(t)})}i(Zo,"_coercedString");function qo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}i(qo,"_url");function Ho(e,t){return new e({type:"number",checks:[],...ne(t)})}i(Ho,"_number");function Go(e,t){return new e({type:"number",coerce:!0,checks:[],...ne(t)})}i(Go,"_coercedNumber");function Wo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}i(Wo,"_int");function Ko(e,t){return new e({type:"boolean",...ne(t)})}i(Ko,"_boolean");function Jo(e,t){return new e({type:"boolean",coerce:!0,...ne(t)})}i(Jo,"_coercedBoolean");function Qo(e,t){return new e({type:"bigint",coerce:!0,...ne(t)})}i(Qo,"_coercedBigint");function Xo(e){return new e({type:"any"})}i(Xo,"_any");function Yo(e){return new e({type:"unknown"})}i(Yo,"_unknown");function ei(e,t){return new e({type:"void",...ne(t)})}i(ei,"_void");function ti(e,t){return new e({type:"date",coerce:!0,...ne(t)})}i(ti,"_coercedDate");function ir(e,t){return new lo({check:"greater_than",...ne(t),value:e,inclusive:!0})}i(ir,"_gte");function $e(e,t){return new fo({check:"min_length",...ne(t),minimum:e})}i($e,"_minLength");function qe(e,t){return new go({check:"string_format",format:"regex",...ne(t),pattern:e})}i(qe,"_regex");function ri(e,t,r){let n=ne(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(ri,"_custom");var me=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ie.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>er(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Et(e,r,n),e.parseAsync=async(r,n)=>tr(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>At(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)=>Yt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),sr=S("ZodMiniString",(e,t)=>{or.init(e,t),me.init(e,t)});function a(e){return Vo(sr,e)}i(a,"string");var ni=S("ZodMiniStringFormat",(e,t)=>{Vr.init(e,t),sr.init(e,t)});var vc=S("ZodMiniURL",(e,t)=>{bo.init(e,t),ni.init(e,t)});function oi(e){return qo(vc,e)}i(oi,"url");var ur=S("ZodMiniNumber",(e,t)=>{Zr.init(e,t),me.init(e,t)});function xe(e){return Ho(ur,e)}i(xe,"number");var xc=S("ZodMiniNumberFormat",(e,t)=>{To.init(e,t),ur.init(e,t)});function ii(e){return Wo(xc,e)}i(ii,"int");var Kr=S("ZodMiniBoolean",(e,t)=>{qr.init(e,t),me.init(e,t)});function X(e){return Ko(Kr,e)}i(X,"boolean");var ai=S("ZodMiniBigInt",(e,t)=>{Io.init(e,t),me.init(e,t)});var Pc=S("ZodMiniAny",(e,t)=>{Eo.init(e,t),me.init(e,t)});function $t(){return Xo(Pc)}i($t,"any");var _c=S("ZodMiniUnknown",(e,t)=>{Ao.init(e,t),me.init(e,t)});function N(){return Yo(_c)}i(N,"unknown");var bc=S("ZodMiniVoid",(e,t)=>{So.init(e,t),me.init(e,t)});function si(e){return ei(bc,e)}i(si,"_void");var ui=S("ZodMiniDate",(e,t)=>{$o.init(e,t),me.init(e,t)});var Tc=S("ZodMiniArray",(e,t)=>{ko.init(e,t),me.init(e,t)});function L(e,t){return new Tc({type:"array",element:e,...ne(t)})}i(L,"array");var Ic=S("ZodMiniObject",(e,t)=>{zo.init(e,t),me.init(e,t),de(e,"shape",()=>t.shape)});function d(e,t){let r={type:"object",shape:e??{},...ne(t)};return new Ic(r)}i(d,"object");var Ec=S("ZodMiniUnion",(e,t)=>{Hr.init(e,t),me.init(e,t)});function j(e,t){return new Ec({type:"union",options:e,...ne(t)})}i(j,"union");var Ac=S("ZodMiniDiscriminatedUnion",(e,t)=>{Oo.init(e,t),me.init(e,t)});function He(e,t,r){return new Ac({type:"union",options:t,discriminator:e,...ne(r)})}i(He,"discriminatedUnion");var Sc=S("ZodMiniRecord",(e,t)=>{Ro.init(e,t),me.init(e,t)});function C(e,t,r){return new Sc({type:"record",keyType:e,valueType:t,...ne(r)})}i(C,"record");var $c=S("ZodMiniEnum",(e,t)=>{wo.init(e,t),me.init(e,t),e.options=Object.values(t.entries)});function H(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new $c({type:"enum",entries:r,...ne(t)})}i(H,"_enum");var kc=S("ZodMiniLiteral",(e,t)=>{Do.init(e,t),me.init(e,t)});function O(e,t){return new kc({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}i(O,"literal");var zc=S("ZodMiniTransform",(e,t)=>{No.init(e,t),me.init(e,t)});function Ge(e){return new zc({type:"transform",transform:e})}i(Ge,"transform");var Oc=S("ZodMiniOptional",(e,t)=>{Co.init(e,t),me.init(e,t)});function h(e){return new Oc({type:"optional",innerType:e})}i(h,"optional");var Rc=S("ZodMiniNullable",(e,t)=>{Uo.init(e,t),me.init(e,t)});function kt(e){return new Rc({type:"nullable",innerType:e})}i(kt,"nullable");var wc=S("ZodMiniPipe",(e,t)=>{Mo.init(e,t),me.init(e,t)});function We(e,t){return new wc({type:"pipe",in:e,out:t})}i(We,"pipe");var Dc=S("ZodMiniCustom",(e,t)=>{Lo.init(e,t),me.init(e,t)});function cr(e,t){return ri(Dc,e??(()=>!0),t)}i(cr,"custom");var zt={};Kn(zt,{bigint:()=>jc,boolean:()=>Lc,date:()=>Bc,number:()=>Mc,string:()=>Uc});function Uc(e){return Zo(sr,e)}i(Uc,"string");function Mc(e){return Go(ur,e)}i(Mc,"number");function Lc(e){return Jo(Kr,e)}i(Lc,"boolean");function jc(e){return Qo(ai,e)}i(jc,"bigint");function Bc(e){return ti(ui,e)}i(Bc,"date");var Qr=d({retryOnFailure:d({defaultValue:h(X()),hide:h(X())}),continueOnFailure:d({defaultValue:h(X()),hide:h(X())})}),Jr=class{constructor(t,r,n,o,s,u,c,l,g,x,E){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=u;this.requireAuth=c;this.errorHandlingOptions=l;this.outputSchema=g;this.audience=x;this.aiMetadata=E}static{i(this,"IAction")}},ae=i(e=>new Jr(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 Y=d({displayName:a(),description:h(a())}),Z=i((e,t)=>d({type:O(t),required:X(),defaultValue:h($t())}),"TPropertyValue");var be=d({...Y.shape,...Z(a(),"SHORT_TEXT").shape}),Ce=d({...Y.shape,...Z(a(),"LONG_TEXT").shape});var pi=d({label:a(),value:N()}),pr=d({disabled:h(X()),placeholder:h(a()),options:L(pi)});var Te=d({...Y.shape,options:pr,...Z(N(),"STATIC_DROPDOWN").shape}),Ue=d({...Y.shape,options:pr,...Z(L(N()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Xr=d({...Y.shape,...Z(N(),"DROPDOWN").shape,refreshers:L(a())}),Ot=d({...Y.shape,...Z(L(N()),"MULTI_SELECT_DROPDOWN").shape,refreshers:L(a())});var Me=d({...Y.shape,...Z(X(),"CHECKBOX").shape});var Le=d({...Y.shape,...Z(xe(),"NUMBER").shape});var Rt=d({...Y.shape,streaming:h(X()),...Z(N(),"FILE").shape});var wt=d({...Y.shape,...Z(a(),"DATE_TIME").shape});var li=C(a(),j([be,Ce,Te,Ot,Ue,Me,Le,Rt,wt])),Dt=d({...Y.shape,properties:li,...Z(L(N()),"ARRAY").shape});var Nt=d({...Y.shape,...Z(j([C(a(),N())]),"JSON").shape});var di=j([be,Te,Nt,Dt,Ue]),Vc=C(a(),di),Yr=d({refreshers:L(a()),...Y.shape,...Z(N(),"DYNAMIC").shape});var lr=d({...Y.shape,...Z(si(),"MARKDOWN").shape});var Ct=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Ct||{}),ut=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ut||{}),Ut=(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))(Ut||{});var Mt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Mt||{}),en="both_client_credentials_and_authorization_code";var Ee=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ee||{}),Lt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(Lt||{}),Zc=d({strategy:H(Lt),paramName:h(a())}),jt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(jt||{});var dr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(dr||{}),mi=d({status:h(xe()),body:h(N()),headers:h(C(a(),a()))}),fi=d({type:O("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(H(dr))}),gi=d({type:O("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:mi,handlerId:h(a()),streamStepProgress:h(H(dr))}),qc=j([fi,gi]);var Hc=d({body:N(),rawBody:h(N()),headers:C(a(),a()),queryParams:C(a(),a())});function le(e){return e==null}i(le,"isNil");function Bt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(Bt,"isEmpty");function mr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(mr,"assertNotNullOrUndefined");var tn=Se(require("crypto"),1);var Gc=128,Ke,ct,Wc=i(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!Ke||Ke.length<e?(Ke=Buffer.allocUnsafe(e*Gc),tn.default.randomFillSync(Ke),ct=0):ct+e>Ke.length&&(tn.default.randomFillSync(Ke),ct=0)}catch(t){throw Ke=void 0,t}ct+=e},"fillPool"),Kc=i(e=>(Wc(e|=0),Ke.subarray(ct-e,ct)),"random"),Jc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{if(s<=0)return"";let u="";for(;;){let c=r(o),l=o;for(;l--;)if(u+=e[c[l]&n]||"",u.length===s)return u}}},"customRandom"),hi=i((e,t=21)=>Jc(e,t,Kc),"customAlphabet");var Qc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",vi=21,aT=a().check(qe(new RegExp(`^[0-9a-zA-Z]{${vi}}$`))),Xc=hi(Qc,vi);var Je=We(Ge(e=>e instanceof Date?e.toISOString():e),a()),Ae={id:a(),created:Je,updated:Je},oe=i(e=>h(kt(e)),"Nullable");function rn(e){return h(kt(H(e)))}i(rn,"NullableEnum");var cT=We(Ge(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(X())),fr=i(e=>We(Ge(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(L(e))),"OptionalArrayFromQuery");var dT=C(a(),N());var Ft=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(Ft||{});var IT=a().check(qe(/^#[0-9A-Fa-f]{6}$/));var AT=d({filename:a(),data:N(),type:O("file"),mimetype:h(a())});var Yc=Se(Pi());var wT=d({...Ae,name:a(),permissions:L(a()),platformId:oe(a()),type:a(),userCount:h(xe())});var _i=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(_i||{}),nn=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(nn||{}),on=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(on||{});var an=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(an||{});var sn=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(sn||{});var ep=d({mode:H(_i),value:N()}),tp=d({auth:h(a()),fields:C(a(),ep)}),rp=d({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(tp)}),np=d({type:O("PIECE"),toolName:a().check($e(1)),pieceMetadata:rp}),op=d({type:O("none")}),ip=d({type:O("access_token"),accessToken:a()}),ap=d({type:O("api_key"),apiKey:a(),apiKeyHeader:a()}),sp=d({type:O("headers"),headers:C(a(),a())}),up=He("type",[op,ip,ap,sp]),bi=d({type:O("FLOW"),toolName:a().check($e(1)),externalFlowId:a(),flowDisplayName:h(a())}),Ti=d({type:O("MCP"),toolName:a().check($e(1)),serverUrl:oi(),protocol:H(on),auth:up}),Ii=d({type:O("KNOWLEDGE_BASE"),toolName:a().check($e(1)),sourceType:H(nn),sourceId:a(),sourceName:a()}),cp=He("type",[np,bi,Ti,Ii]),pp=d({displayName:a(),description:h(a()),type:H(an)}),Ei=d({type:O("MARKDOWN"),markdown:a()}),pt={type:O("TOOL_CALL"),input:oe(C(a(),N())),output:h(N()),toolName:a(),status:H(sn),toolCallId:a(),startTime:a(),endTime:h(a())},pI=d(pt),Ai=He("toolCallType",[d({...pt,toolCallType:O("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),d({...pt,toolCallType:O("FLOW"),displayName:a(),externalFlowId:a()}),d({...pt,toolCallType:O("MCP"),displayName:a(),serverUrl:a()}),d({...pt,toolCallType:O("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),d({...pt,toolCallType:O("UNKNOWN"),displayName:a()})]),lp=j([Ei,Ai]);var un=(r=>(r.IMAGE="image",r.TEXT="text",r))(un||{}),je=d({apiKey:a()}),dp=je,mp=d({apiKey:a(),apiKeyHash:a()}),fp=je,gp=je,yp=je,hp=je,vp=je,xp=je,Pp=je,Oi=d({accessKeyId:a().check($e(1)),secretAccessKey:a().check($e(1))}),_p=d({}),bp=d({}),Tp=d({}),Ip=d({}),Ep=d({}),Ap=d({}),Ri=d({modelId:a(),modelName:a(),modelType:H(un)}),wi=d({apiKeyHeader:a(),baseUrl:a(),models:L(Ri),defaultHeaders:h(C(a(),a()))}),Di=d({accountId:a(),gatewayId:a(),models:L(Ri),vertexProject:h(a()),vertexRegion:h(a())}),Ni=d({resourceName:a(),apiVersion:We(Ge(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Ci=d({region:a().check($e(1))}),Sp=j([dp,yp,hp,vp,xp,gp,fp,mp,Oi,Pp]),Ui=j([wi,Di,Ni,Ci,_p,Tp,Ip,Ep,bp,Ap]),$p=d({id:a(),name:a(),type:H(un)}),kp=d({id:a(),name:a(),provider:H(Ft),config:Ui,enabledForChat:X()}),zp=d({provider:H(Ft),config:Ui,auth:Sp,platformId:a()});var fI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Si=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Op=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Rp=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],$i=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],wp=["grok-4.20","grok-4.1-fast"],Dp={openai:Si,anthropic:Op,google:$i,activepieces:[...Rp.map(e=>`anthropic/${e}`),...Si.map(e=>`openai/${e}`),...$i.map(e=>`google/${e}`),...wp.map(e=>`x-ai/${e}`)]};var ki=128e3,Np={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Cp({provider:e}){return e?Np[e]??ki:ki}i(Cp,"getMaxContextTokens");var zi={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"},Up={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Mp=new Set(["anthropic","mistral"]);function Re(e){return{chatModels:Dp[e],maxContextTokens:Cp({provider:e}),defaultEmbeddingModel:zi[e],supportsEmbedding:zi[e]!==void 0,supportsImageGeneration:!Mp.has(e),webSearch:Up[e]}}i(Re,"buildProviderCapabilities");var Lp={openai:Re("openai"),anthropic:Re("anthropic"),openrouter:Re("openrouter"),azure:Re("azure"),google:Re("google"),"cloudflare-gateway":Re("cloudflare-gateway"),custom:Re("custom"),bedrock:Re("bedrock"),mistral:Re("mistral"),activepieces:Re("activepieces")};var jp=d({base64Url:a(),fileName:a(),extension:h(a())}),Bp=d({mimeType:a(),url:a(),fileName:h(a())}),cn=j([jp,Bp]);var Fp=j([d({type:O("file"),value:cn}),d({type:O("markdown"),value:a(),files:h(L(cn))})]),Vp=d({sessionId:a(),message:a(),files:h(L(a()))});var Li=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Li||{}),ji=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ji||{}),pn=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(pn||{});var Zp=j([d({...Ae,name:a(),externalId:a(),type:O("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:d({options:L(d({value:a()}))})}),d({...Ae,name:a(),externalId:a(),type:j([O("TEXT"),O("NUMBER"),O("DATE"),O("DATETIME")]),tableId:a(),projectId:a()})]),qp=d({...Ae,name:a(),folderId:oe(a()),projectId:a(),externalId:a(),status:rn(ji),trigger:rn(Li)}),Hp=d({...Ae,tableId:a(),projectId:a(),cells:C(a(),d({updated:a(),created:a(),value:N(),fieldName:a()}))}),Gp=d({events:L(H(pn)),webhookUrl:a(),flowId:a()}),Wp=d({fields:L(d({id:a(),name:a()})),rows:L(C(a(),a())),name:a()}),Kp=d({projectId:a(),limit:h(zt.number()),cursor:h(a()),name:h(a()),externalIds:fr(a()),folderId:h(a()),folderIds:fr(a())}),Jp=d({records:L(L(d({fieldId:a(),value:Fi()}))),tableId:a()}),Qp=d({cells:h(L(d({fieldId:a(),value:Fi()}))),tableId:a(),agentUpdate:h(X())}),Bi=He("operator",[tt("eq"),tt("neq"),tt("gt"),tt("gte"),tt("lt"),tt("lte"),tt("co"),Mi("exists"),Mi("not_exists")]),Xp=d({tableId:a(),limit:h(zt.number()),cursor:h(a()),filters:fr(Bi)});function Fi(){return We(Ge(e=>e==null?e:String(e)),kt(a()))}i(Fi,"coerceToString");function tt(e){return d({fieldId:a(),operator:O(e),value:a()})}i(tt,"valueFilter");function Mi(e){return d({fieldId:a(),operator:O(e)})}i(Mi,"existenceFilter");var Yp=d({status:h(xe()),body:h(N()),headers:h(C(a(),a()))}),el=d({...Ae,deleted:oe(Je),ownerId:a(),displayName:a(),platformId:a(),externalId:oe(a())});var Vi=d({name:a(),description:h(a()),type:a(),required:X()}),tl=d({pieceName:a(),triggerName:a(),input:d({toolName:a(),toolDescription:a(),inputSchema:L(Vi),returnsResponse:X()})});var Zi="^[0-9]+\\.[0-9]+\\.[0-9]+$",wI=new RegExp(Zi),nl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",DI=a().check(qe(new RegExp(Zi))),NI=a().check(qe(new RegExp(nl))),ol=d({packageType:O("ARCHIVE"),pieceType:H(ut),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),qi=d({packageType:O("REGISTRY"),pieceType:O("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Hi=d({packageType:O("REGISTRY"),pieceType:O("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),CI=j([qi,Hi]),UI=j([ol,qi,Hi]);var il=He("type",[d({type:O("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),d({type:O("INTERVAL"),intervalMs:ii().check(ir(6e4))})]),MI=d({...Ae,type:H(Ee),projectId:a(),flowId:a(),triggerName:a(),schedule:oe(il),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:oe(a()),simulate:X()}),Gi=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(Gi||{}),Wi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Wi||{}),Ki=(r=>(r.S3="S3",r.DB="DB",r))(Ki||{}),LI=d({...Ae,projectId:oe(a()),platformId:oe(a()),type:H(Gi),compression:H(Wi),data:h(N()),location:H(Ki),size:oe(xe()),fileName:oe(a()),s3Key:oe(a()),metadata:oe(C(a(),a()))}),Ji=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ji||{}),Qi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Qi||{}),jI=d({id:a(),email:a(),firstName:a(),status:H(Qi),externalId:oe(a()),platformId:oe(a()),platformRole:H(Ji),lastName:a(),created:Je,updated:Je,lastActiveDate:oe(Je),imageUrl:oe(a())});var ln=d({...Y.shape,...Z(C(a(),N()),"OBJECT").shape});var ta=d({...Y.shape,...Z(a(),"COLOR").shape});var dn=j([be,Ce,lr,Me,Te,Ue,Xr,Ot,Yr,Le,Dt,ln,Nt,wt,Rt,ta]),_={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 we=d({displayName:a(),description:h(a()),hasConnectionIdentifier:h(X())});var ra=d({username:a(),password:a()}),mn=d({...we.shape,username:d({displayName:a(),description:h(a())}),password:d({displayName:a(),description:h(a())}),...Z(ra,"BASIC_AUTH").shape});var cl=C(a(),j([be,Ce,Le,Me,Te])),fn=d({...we.shape,props:cl,...Z(N(),"CUSTOM_AUTH").shape});var rt=d({...we.shape,...Z(d({auth:a()}),"SECRET_TEXT").shape});var pl=C(a(),j([be,Ce,rt,Le,Me,Te,Ue,lr])),na=d({...we.shape,props:pl,...Z(N(),"OIDC").shape});var gn=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(gn||{}),oa=j([be,rt,Te]),ia=C(a(),oa),ll=d({props:h(C(a(),oa)),authUrl:a(),tokenUrl:a(),scope:L(a()),prompt:h(j([O("none"),O("consent"),O("login"),O("omit")])),pkce:h(X()),pkceMethod:h(j([O("plain"),O("S256")])),authorizationMethod:h(H(gn)),grantType:h(j([H(Mt),O(en)])),extra:h(C(a(),a()))}),aa=d({access_token:a(),props:h(ia),data:C(a(),$t())}),yn=d({...we.shape,...ll.shape,...Z(aa,"OAUTH2").shape});var lt=j([mn,fn,na,yn,rt]),Vt="Connection",hn={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Vt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Vt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Vt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Vt}},None(){}};var vA={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 dl=d({...Y.shape,...Z(N(),"CUSTOM").shape,code:a()});var ml=j([dn,lt]),vn=C(a(),ml),MA=C(a(),dn);var sa=j([d({strategy:O("CRON"),cronExpression:a()}),d({strategy:O("NONE")})]),dt=class{constructor(t,r,n,o,s,u,c,l,g,x,E,P,p,m,y,f,v,b,B){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=u;this.handshakeConfiguration=c;this.onHandshake=l;this.renewConfiguration=g;this.onRenew=x;this.onEnable=E;this.onDisable=P;this.onStart=p;this.run=m;this.test=y;this.sampleData=f;this.testStrategy=v;this.outputSchema=b;this.aiMetadata=B}static{i(this,"ITrigger")}},De=i(e=>{switch(e.type){case"WEBHOOK":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,le(e.sampleData)&&le(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var ua="2",yr="0.82.0";var xn=class{constructor(t,r,n,o,s,u,c,l,g=yr,x,E="",P){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=c;this.auth=l;this.minimumSupportedRelease=g;this.maximumSupportedRelease=x;this.description=E;this.deprecated=P;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:ua}),"getContextInfo");(!gl(g)||yl(g,yr))&&(this.minimumSupportedRelease=yr),s.forEach(p=>this._actions[p.name]=p),u.forEach(p=>this._triggers[p.name]=p)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:fl(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}},pa=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new xn(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 fl(e){if(e!==void 0)return Array.isArray(e)?e.map(ca):ca(e)}i(fl,"withConnectionIdentifierFlag");function ca(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}i(ca,"flagConnectionIdentifier");function gl(e){return/^\d+\.\d+\.\d+$/.test(e)}i(gl,"isValidSimpleSemver");function yl(e,t){let[r,n,o]=e.split(".").map(Number),[s,u,c]=t.split(".").map(Number);return r!==s?r<s:n!==u?n<u:o<c}i(yl,"isSemverLessThan");var hl=h(C(a(),C(a(),a()))),la=d({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:L(a()),platformId:h(a()),directoryPath:h(a()),auth:h(j([lt,L(lt)])),version:a(),categories:h(L(H(Ut))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(X()),i18n:hl}),vl=H(["human","ai","both"]),da=d({description:h(a()),idempotent:h(X())}),ma=d({name:a(),displayName:a(),description:a(),props:vn,requireAuth:X(),errorHandlingOptions:h(Qr),outputSchema:h(cr()),audience:h(vl),aiMetadata:h(da)}),fa=d({name:a(),displayName:a(),description:a(),props:vn,errorHandlingOptions:h(Qr),type:H(Ee),sampleData:N(),handshakeConfiguration:h(cr()),renewConfiguration:h(sa),testStrategy:H(jt),outputSchema:h(cr()),aiMetadata:h(da)}),xl=d({...la.shape,actions:C(a(),ma),triggers:C(a(),fa)}),Pl=d({...la.shape,actions:xe(),triggers:xe(),suggestedActions:h(L(ma)),suggestedTriggers:h(L(fa))}),ga=d({projectUsage:xe(),pieceType:H(ut),packageType:H(Ct),platformId:h(a()),archiveId:h(a())}),MS=d({...xl.shape,...ga.shape}),LS=d({...Pl.shape,...ga.shape}),jS=d({name:a(),version:a()});var _l=Se(require("path")),bl=Se(require("fs/promises"));var mt=require("node:stream");var hr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,u)=>{o.append(u,s)}),{urlWithoutQueryParams:n,queryParams:o}}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 vr=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Pn,r=new _n){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Pn=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},_n=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Zt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function ya({error:e,requestBody:t}){return e instanceof Zt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(ya,"toFailsafeOutput");var ge=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(ge||{});var xr=class extends hr{static{i(this,"FetchHttpClient")}constructor(t="",r=new vr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),u=t.queryParams??{};for(let[B,ce]of Object.entries(u))o.append(B,ce);let c=o.toString(),l=c?`${n}?${c}`:n,g=t.responseType??"json",x=t.followRedirects??!0,E=t.retries??0,{body:P,extraHeaders:p,isStream:m}=Tl(t.method)?Il(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},y=Al({...s,...p}),f=await El(async()=>{let B=new AbortController,ce=t.timeout&&t.timeout>0?setTimeout(()=>B.abort(),t.timeout):void 0;try{let ve={method:t.method.toString(),headers:y,body:P,redirect:x?"follow":"manual",signal:B.signal};return m&&(ve.duplex="half"),r?.dispatcher!==void 0&&(ve.dispatcher=r.dispatcher),await fetch(l,ve)}finally{ce!==void 0&&clearTimeout(ce)}},m?0:E),v=x?300:400;if(f.status<200||f.status>=v){let B=await ha(f,g==="stream"?"text":g),ce=new Zt(t.body,{status:f.status,responseBody:B});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ce),ce}let b=await ha(f,g);return{status:f.status,headers:Sl(f.headers),body:b}}};function Tl(e){return e!=="GET"&&e!=="HEAD"}i(Tl,"acceptsRequestBody");function Il(e,t){if(xa(e))return{body:void 0,extraHeaders:{},isStream:!1};if($l(e)){let n=new mt.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof mt.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(Il,"serializeBody");async function ha(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return xa(e.body)?mt.Readable.from([]):mt.Readable.fromWeb(e.body);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}}}}i(ha,"parseResponseBody");async function El(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await va(n);continue}return o}catch(o){if(r=o,n<t){await va(n);continue}throw o}throw r}i(El,"sendWithRetries");function va(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(va,"backoff");function Al(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}i(Al,"normalizeHeaders");function Sl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Sl,"toHttpHeaders");function $l(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i($l,"isNodeFormData");function xa(e){return e==null}i(xa,"isNil");var W=new xr;var gm=Se(require("fs")),Eu=Se(Iu());var ym={"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 hm(e){let t=e.split(";")[0].trim().toLowerCase();return ym[t]??""}i(hm,"contentTypeToExtension");var vm=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),xm=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Au({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:u,extraProps:c,authLocation:l="headers"}){return ae({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:_.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:g})=>({url:_.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${xm(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...u?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ge).map(g=>({label:g,value:g}))},...u?.method??{}}),headers:_.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...u?.headers??{}}),queryParams:_.Object({displayName:"Query Parameters",required:!0,...u?.queryParams??{}}),body_type:_.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:_.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:g})=>{if(!g)return{};let x=g,E={};switch(x){case"none":break;case"json":E.data=_.Json({displayName:"JSON Body",required:!0,...u?.body??{}});break;case"raw":E.data=_.LongText({displayName:"Raw Body",required:!0});break;case"form_data":E.data=_.Array({displayName:"Form Data",required:!0,properties:{fieldName:_.ShortText({displayName:"Field Name",required:!0}),fieldType:_.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:_.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:_.File({displayName:"File Field Value",required:!1})}});break}return E},"props")}),response_is_binary:_.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:_.Checkbox({displayName:"No Error on Failure",required:!1,...u?.failsafe??{}}),timeout:_.Number({displayName:"Timeout (in seconds)",required:!1,...u?.timeout??{}}),followRedirects:_.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...c},run:i(async g=>{let{method:x,url:E,headers:P,queryParams:p,body:m,body_type:y,failsafe:f,timeout:v,response_is_binary:b,followRedirects:B}=g.propsValue;mr(x,"Method"),mr(E,"URL");let ce=le(r)?{}:await r(g.auth,g.propsValue),ve=E.url,ze=ve.startsWith("http://")||ve.startsWith("https://")?ve:vm({baseUrl:t(g.auth),relativePath:ve}),ee={method:x,url:ze,headers:{...P??{},...l==="headers"||!le(l)?ce:{}},queryParams:{...l==="queryParams"?ce:{},...p??{}},timeout:v?v*1e3:0,followRedirects:B};if(b&&(ee.responseType="arraybuffer"),m)if(y&&y!=="none"){let q=m.data;if(y==="form_data"){let ot=q,Xe=new Eu.default;for(let{fieldName:M,fieldType:I,textFieldValue:T,fileFieldValue:$}of ot)I==="text"&&!Bt(T)?Xe.append(M,T):I==="file"&&!Bt($)&&Xe.append(M,$.data,{filename:$?.filename});ee.body=Xe,ee.headers={...ee.headers,...Xe.getHeaders()}}else ee.body=q}else y||(ee.body=m);try{let q=await W.sendRequest(ee);return await Pm(g.files,q.body,q.status,q.headers,b)}catch(q){if(f)return ya({error:q,requestBody:ee.body});throw q}},"run")})}i(Au,"createCustomApiCallAction");var Pm=i(async(e,t,r,n,o)=>{let s;if(o&&_m(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],c=hm(u??"")||"txt",l;t instanceof ArrayBuffer?l=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?l=t:l=Buffer.from(t),s=await e.write({fileName:`output.${c}`,data:l})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),_m=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var re={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:u}){switch(e.strategy){case 0:{let c=await t.get("lastPoll");if(le(c))throw new Error("lastPoll doesn't exist in the store.");let l=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:c,server:u}),g=l.reduce((x,E)=>Math.max(x,E.epochMilliSeconds),c);return await t.put("lastPoll",g),l.filter(x=>x.epochMilliSeconds>c).map(x=>x.data)}case 1:{let c=await t.get("lastItem"),l=await e.items({store:t,auth:r,propsValue:n,lastItemId:c,files:s,server:u}),g=l.findIndex(P=>P.id===c),x=[];le(c)||g==-1?x=l??[]:x=l?.slice(0,g)??[],le(o)||(x=x.slice(-o));let E=x?.[0]?.id;return le(E)||await t.put("lastItem",E),x.map(P=>P.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o,isRepublish:s}){switch(e.strategy){case 0:{if(s&&!le(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(s&&!le(await t.get("lastItem")))break;let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;le(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:s}){let u=[];switch(e.strategy){case 0:{u=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{u=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:s});break}}return bm(u.map(c=>c.data))}};function bm(e){return e.length<=5?e:e.slice(0,5)}i(bm,"getFirstFiveOrAll");var G=hn.OAuth2({description:"You can find Company ID under **settings->Additional Info**.",required:!0,props:{companyId:_.ShortText({displayName:"Company ID",required:!0})},authUrl:"https://appcenter.intuit.com/connect/oauth2",tokenUrl:"https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer",scope:["com.intuit.quickbooks.accounting"]});var Tm="https://quickbooks.api.intuit.com/v3/company",J={getApiUrl:i(e=>`${Tm}/${e}`,"getApiUrl")};var Su=ae({auth:G,name:"find_invoice",displayName:"Find Invoice",description:"Search for an invoice by its number in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks invoice by its document number (DocNumber), returning the first match. Use to resolve an invoice reference to its full record before reading or acting on it; the document number is required. Read-only and idempotent.",idempotent:!0},props:{invoice_number:_.ShortText({displayName:"Invoice Number",description:"The document number (DocNumber) of the invoice to search for.",required:!0})},async run(e){let{invoice_number:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=J.getApiUrl(r),o=`SELECT * FROM Invoice WHERE DocNumber = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,s=await W.sendRequest({method:"GET",url:`${n}/query`,queryParams:{query:o,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});return s.body?.QueryResponse?.Invoice&&s.body.QueryResponse.Invoice.length>0?{found:!0,result:s.body.QueryResponse.Invoice[0]}:{found:!1,result:{}}}});var $u=ae({auth:G,name:"find_customer",displayName:"Find Customer",description:"Search for a customer by display name in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks customer by exact display name, returning the first match. Use to resolve a customer name to its full record (including its Id) before referencing it elsewhere; the match is exact, not fuzzy. Read-only and idempotent.",idempotent:!0},props:{search_term:_.ShortText({displayName:"Customer Name",description:"The display name of the customer to search for.",required:!0})},async run(e){let{search_term:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=J.getApiUrl(r),o=`SELECT * FROM Customer WHERE DisplayName = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,s=await W.sendRequest({method:"GET",url:`${n}/query`,queryParams:{query:o,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});return s.body?.QueryResponse?.Customer&&s.body.QueryResponse.Customer.length>0?{found:!0,result:s.body.QueryResponse.Customer[0]}:{found:!1,result:{}}}});var ku=ae({auth:G,name:"find_payment",displayName:"Find Payment",description:"Finds an existing payment in QuickBooks.",audience:"both",aiMetadata:{description:"List all QuickBooks payments belonging to a given customer, identified by the customer Id (not name). Use to retrieve a customer's payment history or to check whether they have any payments on record. Read-only and idempotent.",idempotent:!0},props:{customerId:_.ShortText({displayName:"Customer ID",description:"The ID of the customer to find payments for.",required:!0})},async run(e){let{customerId:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect.");let n=J.getApiUrl(r),o=`SELECT * FROM Payment WHERE CustomerRef = '${t}'`,s=await W.sendRequest({method:"GET",url:`${n}/query?query=${encodeURIComponent(o)}&minorversion=70`,headers:{Authorization:`Bearer ${e.auth.access_token}`,Accept:"application/json"}});return s.body.QueryResponse?.Payment&&s.body.QueryResponse?.Payment.length>0?{found:!0,result:s.body.QueryResponse?.Payment}:{found:!1,result:[]}}});var zu=ae({auth:G,name:"create_invoice",displayName:"Create Invoice",description:"Creates an invoice in QuickBooks.",audience:"both",aiMetadata:{description:'Create a new QuickBooks invoice for a customer with one or more line items (each line needs an amount and an Item/product Id). Optionally set due date, transaction date, invoice number, memos, and email status; setting email status to "Needs To Be Sent" requires a billing email. Not idempotent: each call creates a new invoice, so guard against duplicates.',idempotent:!1},props:{customerRef:_.Dropdown({auth:G,displayName:"Customer",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Customer STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Customer??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),lineItems:_.Array({displayName:"Line Items",description:"Line items for the invoice",required:!0,properties:{description:_.ShortText({displayName:"Description",required:!1}),amount:_.Number({displayName:"Amount",description:"Total amount for this line (Exclusive of tax). Required.",required:!0}),detailType:_.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Sales Item Line Detail",value:"SalesItemLineDetail"}]},defaultValue:"SalesItemLineDetail"}),itemId:_.ShortText({displayName:"Item ID (Product/Service)",description:"Enter the ID of the Item (Product/Service). Required for SalesItemLineDetail.",required:!0}),quantity:_.Number({displayName:"Quantity",required:!1}),unitPrice:_.Number({displayName:"Unit Price",description:"If specified, Amount will be Qty * UnitPrice. If Amount is also specified, Amount overrides calculation.",required:!1})}}),emailStatus:_.StaticDropdown({displayName:"Email Status",description:"Specify whether the invoice should be emailed after creation.",required:!1,options:{options:[{label:"Not Set (Default - No Email)",value:"NotSet"},{label:"Needs To Be Sent",value:"NeedToSend"}]},defaultValue:"NotSet"}),billEmail:_.ShortText({displayName:"Billing Email Address",description:'Email address to send the invoice to. Required if Email Status is "Needs To Be Sent". Overrides customer default.',required:!1}),dueDate:_.DateTime({displayName:"Due Date",description:"The date when the payment for the invoice is due. If not provided, default term from customer or company is used.",required:!1}),docNumber:_.ShortText({displayName:"Invoice Number",description:"Optional reference number for the invoice. If not provided, QuickBooks assigns the next sequential number.",required:!1}),txnDate:_.DateTime({displayName:"Transaction Date",description:"The date entered on the transaction. Defaults to the current date if not specified.",required:!1}),privateNote:_.LongText({displayName:"Private Note (Memo)",description:"Note to self. Does not appear on the invoice sent to the customer.",required:!1}),customerMemo:_.LongText({displayName:"Customer Memo (Statement Memo)",description:"Memo to be displayed on the invoice sent to the customer (appears on statement).",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=J.getApiUrl(r),o=e.propsValue;if(o.emailStatus==="NeedToSend"&&!o.billEmail)throw new Error('Billing Email Address is required when Email Status is "Needs To Be Sent".');let s=o.lineItems.map(l=>{if(l.detailType==="SalesItemLineDetail"){if(!l.itemId)throw new Error("Item ID is required for Sales Item Line Detail.");return{Amount:l.amount,DetailType:l.detailType,Description:l.description,SalesItemLineDetail:{ItemRef:{value:l.itemId},...l.quantity!=null&&{Qty:l.quantity},...l.unitPrice!=null&&{UnitPrice:l.unitPrice}}}}else return{Amount:l.amount,DetailType:l.detailType,Description:l.description}});if(s.length===0)throw new Error("At least one line item is required to create an invoice.");let u={Line:s,CustomerRef:{value:o.customerRef},...o.emailStatus&&{EmailStatus:o.emailStatus},...o.billEmail&&{BillEmail:{Address:o.billEmail}},...o.dueDate&&{DueDate:o.dueDate.split("T")[0]},...o.docNumber&&{DocNumber:o.docNumber},...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.privateNote&&{PrivateNote:o.privateNote},...o.customerMemo&&{CustomerMemo:{value:o.customerMemo}}},c=await W.sendRequest({method:"POST",url:`${n}/invoice`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:u});if(c.body.Fault)throw new Error(`QuickBooks API Error: ${c.body.Fault.Error.map(l=>l.Message).join(", ")} - ${c.body.Fault.Error.map(l=>l.Detail).join(", ")}`);return c.body.Invoice}});var Ou=ae({auth:G,name:"create_expense",displayName:"Create Expense",description:"Creates an expense transaction (purchase) in QuickBooks.",audience:"both",aiMetadata:{description:"Record a new expense (purchase) paid from a chosen bank or credit-card account, with one or more account-based line items (each needs an amount and an expense account Id) and a payment type of cash, check, or credit card. Optionally attach a payee/vendor, payment date, and memo. Not idempotent: each call creates a new purchase, so guard against duplicates.",idempotent:!1},props:{accountRef:_.Dropdown({auth:G,displayName:"Bank/Credit Card Account",description:"The account from which the expense was paid.",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect account",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, Name, AccountType FROM Account STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error fetching accounts: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Account??[]).map(l=>({label:`${l.Name} (${l.AccountType})`,value:l.Id}))}},"options")}),paymentType:_.StaticDropdown({displayName:"Payment Type",required:!0,options:{options:[{label:"Cash",value:"Cash"},{label:"Check",value:"Check"},{label:"Credit Card",value:"CreditCard"}]},defaultValue:"Cash"}),entityRef:_.Dropdown({auth:G,displayName:"Payee (Vendor)",description:"Optional - The vendor the expense was paid to.",required:!1,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect account",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Vendor STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error fetching vendors: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Vendor??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),txnDate:_.DateTime({displayName:"Payment Date",description:"The date the expense occurred.",required:!1}),lineItems:_.Array({displayName:"Line Items",description:"Details of the expense (e.g., categories or items purchased). At least one line is required.",required:!0,properties:{amount:_.Number({displayName:"Amount",required:!0}),description:_.ShortText({displayName:"Description",required:!1}),detailType:_.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Account Based Expense Line Detail",value:"AccountBasedExpenseLineDetail"}]},defaultValue:"AccountBasedExpenseLineDetail"}),expenseAccountId:_.ShortText({displayName:"Expense Category/Account ID",description:'The Id of the expense account. Use the "Find Account" action (filter by type Expense) to look this up.',required:!0})}}),privateNote:_.LongText({displayName:"Memo (Private Note)",description:"Internal note about the expense.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=J.getApiUrl(r),o=e.propsValue,s=o.lineItems.map(g=>{let x={Amount:g.amount,Description:g.description,DetailType:g.detailType};if(g.detailType==="AccountBasedExpenseLineDetail"){if(!g.expenseAccountId)throw new Error("Expense Category/Account ID is required for Account Based Expense Line Detail.");x.AccountBasedExpenseLineDetail={AccountRef:{value:g.expenseAccountId}}}return x});if(s.length===0)throw new Error("At least one line item is required.");let u={AccountRef:{value:o.accountRef},PaymentType:o.paymentType,Line:s,...o.entityRef&&{EntityRef:{value:o.entityRef}},...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.privateNote&&{PrivateNote:o.privateNote}},l=await W.sendRequest({method:"POST",url:`${n}/purchase`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:u});if(l.body.Fault)throw new Error(`QuickBooks API Error creating expense: ${l.body.Fault.Error.map(g=>g.Message).join(", ")} - Detail: ${l.body.Fault.Error.map(g=>g.Detail).join(", ")}`);return l.body.Purchase}});var Ru=ae({auth:G,name:"create_bill",displayName:"Create Bill",description:"Creates a bill (accounts payable) in QuickBooks.",audience:"both",aiMetadata:{description:"Record a new bill owed to a vendor, with one or more account-based line items (each needs an amount and an expense account Id). Optionally set the bill date, due date, bill number, and memo. Not idempotent: each call creates a new bill, so guard against duplicates.",idempotent:!1},props:{vendorRef:_.Dropdown({auth:G,displayName:"Vendor",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Vendor STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error fetching vendors: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Vendor??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),lineItems:_.Array({displayName:"Line Items",description:"Details of the bill (expense categories). At least one line is required.",required:!0,properties:{amount:_.Number({displayName:"Amount",required:!0}),description:_.ShortText({displayName:"Description",required:!1}),detailType:_.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Account Based Expense Line Detail",value:"AccountBasedExpenseLineDetail"}]},defaultValue:"AccountBasedExpenseLineDetail"}),expenseAccountId:_.ShortText({displayName:"Expense Category/Account ID",description:'The Id of the expense account. Use the "Find Account" action (filter by type Expense) to look this up.',required:!0})}}),txnDate:_.DateTime({displayName:"Bill Date",description:"The date of the bill. Defaults to today if empty.",required:!1}),dueDate:_.DateTime({displayName:"Due Date",description:"The date the payment is due. If empty, the vendor/company term is used.",required:!1}),docNumber:_.ShortText({displayName:"Bill Number",description:"Reference number for the bill.",required:!1}),privateNote:_.LongText({displayName:"Memo (Private Note)",description:"Internal note about the bill.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=J.getApiUrl(r),o=e.propsValue,s=o.lineItems.map(l=>{if(!l.expenseAccountId)throw new Error("Expense Category/Account ID is required for each line.");return{Amount:l.amount,Description:l.description,DetailType:l.detailType,AccountBasedExpenseLineDetail:{AccountRef:{value:l.expenseAccountId}}}});if(s.length===0)throw new Error("At least one line item is required.");let u={VendorRef:{value:o.vendorRef},Line:s,...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.dueDate&&{DueDate:o.dueDate.split("T")[0]},...o.docNumber&&{DocNumber:o.docNumber},...o.privateNote&&{PrivateNote:o.privateNote}},c=await W.sendRequest({method:"POST",url:`${n}/bill`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:u});if(c.body.Fault)throw new Error(`QuickBooks API Error creating bill: ${c.body.Fault.Error.map(l=>l.Message).join(", ")} - Detail: ${c.body.Fault.Error.map(l=>l.Detail).join(", ")}`);return c.body.Bill}});var wu=ae({auth:G,name:"find_vendor",displayName:"Find Vendor",description:"Search for a vendor by display name in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks vendor by exact display name, returning the first match. Use to resolve a vendor name to its full record (including its Id) before referencing it elsewhere; the match is exact, not fuzzy. Read-only and idempotent.",idempotent:!0},props:{search_term:_.ShortText({displayName:"Vendor Name",description:"The display name of the vendor to search for.",required:!0})},async run(e){let{search_term:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=J.getApiUrl(r),o=`SELECT * FROM Vendor WHERE DisplayName = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,s=await W.sendRequest({method:"GET",url:`${n}/query`,queryParams:{query:o,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});return s.body?.QueryResponse?.Vendor&&s.body.QueryResponse.Vendor.length>0?{found:!0,result:s.body.QueryResponse.Vendor[0]}:{found:!1,result:{}}}});var Du=ae({auth:G,name:"find_account",displayName:"Find Account",description:"List or search the chart of accounts to get an account Id (e.g. an expense account for a bill).",audience:"both",aiMetadata:{description:"List QuickBooks chart-of-accounts entries to resolve an account name to its Id. Optionally filter by a name substring and/or account type (e.g. Expense, Bank, Accounts Payable). Use this to find the expense-account Id required by Create Bill / Create Expense line items. Read-only and idempotent.",idempotent:!0},props:{search_term:_.ShortText({displayName:"Account Name Contains",description:"Optional. Filter accounts whose name contains this text.",required:!1}),accountType:_.StaticDropdown({displayName:"Account Type",description:"Optional. Filter by account type.",required:!1,options:{options:[{label:"Bank",value:"Bank"},{label:"Accounts Receivable",value:"Accounts Receivable"},{label:"Other Current Asset",value:"Other Current Asset"},{label:"Fixed Asset",value:"Fixed Asset"},{label:"Other Asset",value:"Other Asset"},{label:"Accounts Payable",value:"Accounts Payable"},{label:"Credit Card",value:"Credit Card"},{label:"Other Current Liability",value:"Other Current Liability"},{label:"Long Term Liability",value:"Long Term Liability"},{label:"Equity",value:"Equity"},{label:"Income",value:"Income"},{label:"Cost of Goods Sold",value:"Cost of Goods Sold"},{label:"Expense",value:"Expense"},{label:"Other Income",value:"Other Income"},{label:"Other Expense",value:"Other Expense"}]}})},async run(e){let{search_term:t,accountType:r}=e.propsValue,n=e.auth.props?.companyId;if(!n)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let o=J.getApiUrl(n),s=["Active = true"];t&&s.push(`Name LIKE '%${t.replace(/'/g,"\\'")}%'`),r&&s.push(`AccountType = '${r}'`);let u=`SELECT * FROM Account WHERE ${s.join(" AND ")} MAXRESULTS 1000`,l=(await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:u,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}})).body?.QueryResponse?.Account??[];return{found:l.length>0,result:l}}});var Nu=ae({auth:G,name:"record_payment",displayName:"Record Payment",description:"Records a customer payment in QuickBooks, optionally applying it to invoices.",audience:"both",aiMetadata:{description:"Record a payment received from a customer for a given total amount. Optionally apply the payment to one or more specific invoices by their transaction Id, set the deposit-to account, payment date, and reference number. If no invoices are specified, QuickBooks leaves the amount unapplied. Not idempotent: each call creates a new payment, so guard against duplicates.",idempotent:!1},props:{customerRef:_.Dropdown({auth:G,displayName:"Customer",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Customer STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Customer??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),totalAmount:_.Number({displayName:"Total Amount",description:"The total amount of the payment received.",required:!0}),lineItems:_.Array({displayName:"Apply to Invoices",description:"Optional. Apply this payment to specific invoices. Leave empty to keep the amount unapplied.",required:!1,properties:{invoiceId:_.ShortText({displayName:"Invoice ID",description:"The transaction Id of the invoice to apply the payment to.",required:!0}),amount:_.Number({displayName:"Amount Applied",description:"The amount of this payment to apply to the invoice.",required:!0})}}),depositToAccountId:_.ShortText({displayName:"Deposit To Account ID",description:"Optional. The account to deposit the payment into. Defaults to Undeposited Funds if empty.",required:!1}),txnDate:_.DateTime({displayName:"Payment Date",description:"The date the payment was received. Defaults to today if empty.",required:!1}),paymentRefNum:_.ShortText({displayName:"Reference Number",description:"Optional reference number for the payment (e.g. check number).",required:!1}),privateNote:_.LongText({displayName:"Memo (Private Note)",description:"Internal note about the payment.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=J.getApiUrl(r),o=e.propsValue,s=(o.lineItems??[]).map(l=>({Amount:l.amount,LinkedTxn:[{TxnId:l.invoiceId,TxnType:"Invoice"}]})),u={CustomerRef:{value:o.customerRef},TotalAmt:o.totalAmount,...s.length>0&&{Line:s},...o.depositToAccountId&&{DepositToAccountRef:{value:o.depositToAccountId}},...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.paymentRefNum&&{PaymentRefNum:o.paymentRefNum},...o.privateNote&&{PrivateNote:o.privateNote}},c=await W.sendRequest({method:"POST",url:`${n}/payment`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:u});if(c.body.Fault)throw new Error(`QuickBooks API Error recording payment: ${c.body.Fault.Error.map(l=>l.Message).join(", ")} - Detail: ${c.body.Fault.Error.map(l=>l.Detail).join(", ")}`);return c.body.Payment}});var Cu=ae({auth:G,name:"read_aging_report",displayName:"Read AR/AP Aging",description:"Reads an accounts receivable or accounts payable aging report from QuickBooks.",audience:"both",aiMetadata:{description:"Fetch an aging report showing outstanding receivables (money owed to the company) or payables (money the company owes), bucketed by how overdue they are. Choose the report type, optionally set the as-of date, the number of days per aging bucket, and the number of buckets. Read-only and idempotent.",idempotent:!0},props:{reportType:_.StaticDropdown({displayName:"Report",required:!0,options:{options:[{label:"A/R Aging Summary",value:"AgedReceivables"},{label:"A/R Aging Detail",value:"AgedReceivableDetail"},{label:"A/P Aging Summary",value:"AgedPayables"},{label:"A/P Aging Detail",value:"AgedPayableDetail"}]},defaultValue:"AgedReceivables"}),reportDate:_.DateTime({displayName:"As Of Date",description:"The date to age balances against. Defaults to today if empty.",required:!1}),agingPeriod:_.Number({displayName:"Days Per Period",description:"Number of days in each aging bucket (e.g. 30).",required:!1}),numPeriods:_.Number({displayName:"Number of Periods",description:"How many aging buckets to include.",required:!1})},async run(e){let{reportType:t,reportDate:r,agingPeriod:n,numPeriods:o}=e.propsValue,s=e.auth.props?.companyId;if(!s)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let u=J.getApiUrl(s),c=await W.sendRequest({method:"GET",url:`${u}/reports/${t}`,queryParams:{minorversion:"70",...r&&{report_date:r.split("T")[0]},...n!=null&&{aging_period:String(n)},...o!=null&&{num_periods:String(o)}},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});if(c.body.Fault)throw new Error(`QuickBooks API Error fetching report: ${c.body.Fault.Error.map(l=>l.Message).join(", ")}`);return c.body}});var Zn=Se(xt()),zr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Invoice ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Invoice WHERE Metadata.CreateTime >= '${(0,Zn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Invoice??[]).map(l=>({epochMilliSeconds:(0,Zn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Uu=De({auth:G,name:"new_invoice",displayName:"New Invoice",description:"Triggers when an invoice is created .",aiMetadata:{description:"Fires when a new invoice is created in the connected QuickBooks company, emitting the newly created invoice record. Use to react to billing being issued to a customer."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(zr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(zr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(zr,e)},async run(e){return await re.poll(zr,e)},sampleData:void 0});var qn=Se(xt()),Rr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Purchase ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Purchase WHERE Metadata.CreateTime >= '${(0,qn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Purchase??[]).map(l=>({epochMilliSeconds:(0,qn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Mu=De({auth:G,name:"new_expense",displayName:"New Expense (Purchase)",description:"Triggers when an Expense (Purchase) is created.",aiMetadata:{description:"Fires when a new expense (purchase transaction) is created in the connected QuickBooks company, emitting the newly created purchase record. Use to react to money being spent or a bill being recorded."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(Rr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(Rr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(Rr,e)},async run(e){return await re.poll(Rr,e)},sampleData:void 0});var Hn=Se(xt()),wr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Customer ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Customer WHERE Metadata.CreateTime >= '${(0,Hn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Customer??[]).map(l=>({epochMilliSeconds:(0,Hn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Lu=De({auth:G,name:"new_customer",displayName:"New Customer",description:"Triggers when a new customer is created.",aiMetadata:{description:"Fires when a new customer is created in the connected QuickBooks company, emitting the newly created customer record. Use to react to a new customer being added to the books."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(wr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(wr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(wr,e)},async run(e){return await re.poll(wr,e)},sampleData:void 0});var Gn=Se(xt()),Dr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Deposit ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Deposit WHERE Metadata.CreateTime >= '${(0,Gn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Deposit??[]).map(l=>({epochMilliSeconds:(0,Gn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},ju=De({auth:G,name:"new_deposit",displayName:"New Deposit",description:"Triggers when a Deposit is created.",aiMetadata:{description:"Fires when a new deposit is created in the connected QuickBooks company, emitting the newly created deposit record. Use to react to funds being deposited into an account."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(Dr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(Dr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(Dr,e)},async run(e){return await re.poll(Dr,e)},sampleData:void 0});var Wn=Se(xt());var Nr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Transfer ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Transfer WHERE Metadata.CreateTime >= '${(0,Wn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Transfer??[]).map(l=>({epochMilliSeconds:(0,Wn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Bu=De({auth:G,name:"new_transfer",displayName:"New Transfer",description:"Triggers when a Transfer is created.",aiMetadata:{description:"Fires when a new transfer is created in the connected QuickBooks company, emitting the newly created transfer record. Use to react to funds being moved between two accounts."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(Nr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(Nr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(Nr,e)},async run(e){return await re.poll(Nr,e)},sampleData:void 0});var Im=pa({displayName:"Quickbooks Online",auth:G,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/quickbooks.png",authors:["onyedikachi-david","sanket-a11y"],actions:[Su,$u,ku,zu,Ou,Ru,wu,Du,Nu,Cu,Au({auth:G,baseUrl:i(e=>{let r=e.props?.companyId;return J.getApiUrl(r)},"baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[Uu,Mu,Lu,ju,Bu]});0&&(module.exports={quickbooks});
|
|
1
|
+
"use strict";var ec=Object.create;var Tt=Object.defineProperty;var tc=Object.getOwnPropertyDescriptor;var rc=Object.getOwnPropertyNames;var nc=Object.getPrototypeOf,oc=Object.prototype.hasOwnProperty;var i=(e,t)=>Tt(e,"name",{value:t,configurable:!0});var z=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},ro=(e,t)=>{for(var r in t)Tt(e,r,{get:t[r],enumerable:!0})},no=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rc(t))!oc.call(e,o)&&o!==r&&Tt(e,o,{get:()=>t[o],enumerable:!(n=tc(t,o))||n.enumerable});return e};var Ae=(e,t,r)=>(r=e!=null?ec(nc(e)):{},no(t||!e||!e.__esModule?Tt(r,"default",{value:e,enumerable:!0}):r,e)),ic=e=>no(Tt({},"__esModule",{value:!0}),e);var Si=z((Ai,yr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",a={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 m(l,d){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let y=0,g=-1,P=(l.match(a.zoneIndex)||[])[0],_,F;for(P&&(P=P.substring(1),l=l.replace(/%.+$/,""));(g=l.indexOf(":",g+1))>=0;)y++;if(l.substr(0,2)==="::"&&y--,l.substr(-2,2)==="::"&&y--,y>d)return null;for(F=d-y,_=":";F--;)_+="0:";return l=l.replace("::",_),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),d=(function(){let ue=l.split(":"),ve=[];for(let ze=0;ze<ue.length;ze++)ve.push(parseInt(ue[ze],16));return ve})(),{parts:d,zoneId:P}}i(m,"expandIPv6");function f(l,d,y,g){if(l.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let P=0,_;for(;g>0;){if(_=y-g,_<0&&(_=0),l[P]>>_!==d[P]>>_)return!1;g-=y,P+=1}return!0}i(f,"matchCIDR");function x(l){if(o.test(l))return parseInt(l,16);if(l[0]==="0"&&!isNaN(parseInt(l[1],10))){if(n.test(l))return parseInt(l,8);throw new Error(`ipaddr: cannot parse ${l} as octal`)}return parseInt(l,10)}i(x,"parseIntAuto");function T(l,d){for(;l.length<d;)l=`0${l}`;return l}i(T,"padPart");let b={};b.IPv4=(function(){function l(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,g;for(y=0;y<d.length;y++)if(g=d[y],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(l,"IPv4"),l.prototype.SpecialRanges={unspecified:[[new l([0,0,0,0]),8]],broadcast:[[new l([255,255,255,255]),32]],multicast:[[new l([224,0,0,0]),4]],linkLocal:[[new l([169,254,0,0]),16]],loopback:[[new l([127,0,0,0]),8]],carrierGradeNat:[[new l([100,64,0,0]),10]],private:[[new l([10,0,0,0]),8],[new l([172,16,0,0]),12],[new l([192,168,0,0]),16]],reserved:[[new l([192,0,0,0]),24],[new l([192,0,2,0]),24],[new l([192,88,99,0]),24],[new l([198,18,0,0]),15],[new l([198,51,100,0]),24],[new l([203,0,113,0]),24],[new l([240,0,0,0]),4]],as112:[[new l([192,175,48,0]),24],[new l([192,31,196,0]),24]],amt:[[new l([192,52,193,0]),24]]},l.prototype.kind=function(){return"ipv4"},l.prototype.match=function(d,y){let g;if(y===void 0&&(g=d,d=g[0],y=g[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return f(this.octets,d.octets,8,y)},l.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},P,_,F;for(P=3;P>=0;P-=1)if(_=this.octets[P],_ in g){if(F=g[_],y&&F!==0)return null;F!==8&&(y=!0),d+=F}else return null;return 32-d},l.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return b.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l})(),b.IPv4.broadcastAddressFromCIDR=function(l){try{let d=this.parseCIDR(l),y=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),P=[],_=0;for(;_<4;)P.push(parseInt(y[_],10)|parseInt(g[_],10)^255),_++;return new this(P)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.IPv4.isIPv4=function(l){return this.parser(l)!==null},b.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},b.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},b.IPv4.isValidFourPartDecimal=function(l){return!!(b.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},b.IPv4.isValidCIDRFourPartDecimal=function(l){let d=l.match(/^(.+)\/(\d+)$/);return!b.IPv4.isValidCIDR(l)||!d?!1:b.IPv4.isValidFourPartDecimal(d[1])},b.IPv4.networkAddressFromCIDR=function(l){let d,y,g,P,_;try{for(d=this.parseCIDR(l),g=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),P=[],y=0;y<4;)P.push(parseInt(g[y],10)&parseInt(_[y],10)),y++;return new this(P)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.IPv4.parse=function(l){let d=this.parser(l);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},b.IPv4.parseCIDR=function(l){let d;if(d=l.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let g=[this.parse(d[1]),y];return Object.defineProperty(g,"toString",{value:i(function(){return this.join("/")},"value")}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},b.IPv4.parser=function(l){let d,y,g;if(d=l.match(r.fourOctet))return(function(){let P=d.slice(1,6),_=[];for(let F=0;F<P.length;F++)y=P[F],_.push(x(y));return _})();if(d=l.match(r.longValue)){if(g=x(d[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return(function(){let P=[],_;for(_=0;_<=24;_+=8)P.push(g>>_&255);return P})().reverse()}else return(d=l.match(r.twoOctet))?(function(){let P=d.slice(1,4),_=[];if(g=x(P[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return _.push(x(P[0])),_.push(g>>16&255),_.push(g>>8&255),_.push(g&255),_})():(d=l.match(r.threeOctet))?(function(){let P=d.slice(1,5),_=[];if(g=x(P[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return _.push(x(P[0])),_.push(x(P[1])),_.push(g>>8&255),_.push(g&255),_})():null},b.IPv4.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,g=Math.floor(l/8);for(;y<g;)d[y]=255,y++;return g<4&&(d[g]=Math.pow(2,l%8)-1<<8-l%8),new this(d)},b.IPv6=(function(){function l(d,y){let g,P;if(d.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(d[g]<<8|d[g+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(P=this.parts[g],!(0<=P&&P<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(d,y){let g;if(y===void 0&&(g=d,d=g[0],y=g[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return f(this.parts,d.parts,16,y)},l.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,g={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},P,_;for(let F=7;F>=0;F-=1)if(P=this.parts[F],P in g){if(_=g[P],y&&_!==0)return null;_!==16&&(y=!0),d+=_}else return null;return 128-d},l.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let d,y=[],g=this.parts;for(let P=0;P<g.length;P++)d=g[P],y.push(d>>8),y.push(d&255);return y},l.prototype.toFixedLengthString=function(){let d=(function(){let g=[];for(let P=0;P<this.parts.length;P++)g.push(T(this.parts[P].toString(16),4));return g}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},l.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],g=d[1];return new b.IPv4([y>>8,y&255,g>>8,g&255])},l.prototype.toNormalizedString=function(){let d=(function(){let g=[];for(let P=0;P<this.parts.length;P++)g.push(this.parts[P].toString(16));return g}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},l.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),g=0,P=-1,_;for(;_=d.exec(y);)_[0].length>P&&(g=_.index,P=_[0].length);return P<0?y:`${y.substring(0,g)}::${y.substring(g+P)}`},l.prototype.toString=function(){return this.toRFC5952String()},l})(),b.IPv6.broadcastAddressFromCIDR=function(l){try{let d=this.parseCIDR(l),y=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),P=[],_=0;for(;_<16;)P.push(parseInt(y[_],10)|parseInt(g[_],10)^255),_++;return new this(P)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},b.IPv6.isIPv6=function(l){return this.parser(l)!==null},b.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let d=this.parser(l);return new this(d.parts,d.zoneId),!0}catch{return!1}},b.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},b.IPv6.networkAddressFromCIDR=function(l){let d,y,g,P,_;try{for(d=this.parseCIDR(l),g=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),P=[],y=0;y<16;)P.push(parseInt(g[y],10)&parseInt(_[y],10)),y++;return new this(P)}catch(F){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${F})`)}},b.IPv6.parse=function(l){let d=this.parser(l);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},b.IPv6.parseCIDR=function(l){let d,y,g;if((y=l.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return g=[this.parse(y[1]),d],Object.defineProperty(g,"toString",{value:i(function(){return this.join("/")},"value")}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},b.IPv6.parser=function(l){let d,y,g,P,_,F;if(g=l.match(a.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(a.native.test(l))return m(l,8);if((g=l.match(a.transitional))&&(F=g[6]||"",d=g[1],g[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+F,6),d.parts)){for(_=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],y=0;y<_.length;y++)if(P=_[y],!(0<=P&&P<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},b.IPv6.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,g=Math.floor(l/8);for(;y<g;)d[y]=255,y++;return g<16&&(d[g]=Math.pow(2,l%8)-1<<8-l%8),new this(d)},b.fromByteArray=function(l){let d=l.length;if(d===4)return new b.IPv4(l);if(d===16)return new b.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},b.isValid=function(l){return b.IPv6.isValid(l)||b.IPv4.isValid(l)},b.isValidCIDR=function(l){return b.IPv6.isValidCIDR(l)||b.IPv4.isValidCIDR(l)},b.parse=function(l){if(b.IPv6.isValid(l))return b.IPv6.parse(l);if(b.IPv4.isValid(l))return b.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},b.parseCIDR=function(l){try{return b.IPv6.parseCIDR(l)}catch{try{return b.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},b.process=function(l){let d=this.parse(l);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},b.subnetMatch=function(l,d,y){let g,P,_,F;y==null&&(y="unicast");for(P in d)if(Object.prototype.hasOwnProperty.call(d,P)){for(_=d[P],_[0]&&!(_[0]instanceof Array)&&(_=[_]),g=0;g<_.length;g++)if(F=_[g],l.kind()===F[0].kind()&&l.match.apply(l,F))return P}return y},typeof yr<"u"&&yr.exports?yr.exports=b:e.ipaddr=b})(Ai)});var $a=z((R$,ka)=>{var Sa=require("stream").Stream,Bp=require("util");ka.exports=$e;function $e(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i($e,"DelayedStream");Bp.inherits($e,Sa);$e.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty($e.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});$e.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};$e.prototype.resume=function(){this._released||this.release(),this.source.resume()};$e.prototype.pause=function(){this.source.pause()};$e.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};$e.prototype.pipe=function(){var e=Sa.prototype.pipe.apply(this,arguments);return this.resume(),e};$e.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)};$e.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 Oa=z((D$,Ra)=>{var Fp=require("util"),wa=require("stream").Stream,za=$a();Ra.exports=se;function se(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(se,"CombinedStream");Fp.inherits(se,wa);se.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};se.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};se.prototype.append=function(e){var t=se.isStreamLike(e);if(t){if(!(e instanceof za)){var r=za.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};se.prototype.pipe=function(e,t){return wa.prototype.pipe.call(this,e,t),this.resume(),e};se.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}};se.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=se.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};se.prototype._pipeNext=function(e){this._currentStream=e;var t=se.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()};se.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};se.prototype.write=function(e){this.emit("data",e)};se.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};se.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")};se.prototype.end=function(){this._reset(),this.emit("end")};se.prototype.destroy=function(){this._reset(),this.emit("close")};se.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};se.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};se.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)};se.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Na=z((C$,Da)=>{"use strict";Da.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 Ua=z(_e=>{"use strict";var Tr=Na(),Vp=require("path").extname,Ca=/^\s*([^;\s]*)(?:;|\s|$)/,Zp=/^text\//i;_e.charset=Ma;_e.charsets={lookup:Ma};_e.contentType=qp;_e.extension=Hp;_e.extensions=Object.create(null);_e.lookup=Wp;_e.types=Object.create(null);Gp(_e.extensions,_e.types);function Ma(e){if(!e||typeof e!="string")return!1;var t=Ca.exec(e),r=t&&Tr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Zp.test(t[1])?"UTF-8":!1}i(Ma,"charset");function qp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?_e.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=_e.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(qp,"contentType");function Hp(e){if(!e||typeof e!="string")return!1;var t=Ca.exec(e),r=t&&_e.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Hp,"extension");function Wp(e){if(!e||typeof e!="string")return!1;var t=Vp("x."+e).toLowerCase().substr(1);return t&&_e.types[t]||!1}i(Wp,"lookup");function Gp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Tr).forEach(i(function(o){var u=Tr[o],c=u.extensions;if(!(!c||!c.length)){e[o]=c;for(var a=0;a<c.length;a++){var m=c[a];if(t[m]){var f=r.indexOf(Tr[t[m]].source),x=r.indexOf(u.source);if(t[m]!=="application/octet-stream"&&(f>x||f===x&&t[m].substr(0,12)==="application/"))continue}t[m]=o}}},"forEachMimeType"))}i(Gp,"populateMaps")});var ja=z((L$,La)=>{La.exports=Qp;function Qp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(Qp,"defer")});var kn=z((B$,Fa)=>{var Ba=ja();Fa.exports=Kp;function Kp(e){var t=!1;return Ba(function(){t=!0}),i(function(n,o){t?e(n,o):Ba(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Kp,"async")});var $n=z((V$,Va)=>{Va.exports=Jp;function Jp(e){Object.keys(e.jobs).forEach(Xp.bind(e)),e.jobs={}}i(Jp,"abort");function Xp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Xp,"clean")});var zn=z((q$,qa)=>{var Za=kn(),Yp=$n();qa.exports=ed;function ed(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=td(t,o,e[o],function(u,c){o in r.jobs&&(delete r.jobs[o],u?Yp(r):r.results[o]=c,n(u,r.results))})}i(ed,"iterate");function td(e,t,r,n){var o;return e.length==2?o=e(r,Za(n)):o=e(r,t,Za(n)),o}i(td,"runJob")});var wn=z((W$,Ha)=>{Ha.exports=rd;function rd(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,u){return t(e[o],e[u])}),n}i(rd,"state")});var Rn=z((Q$,Wa)=>{var nd=$n(),od=kn();Wa.exports=id;function id(e){Object.keys(this.jobs).length&&(this.index=this.size,nd(this),od(e)(null,this.results))}i(id,"terminator")});var Qa=z((J$,Ga)=>{var ad=zn(),sd=wn(),ud=Rn();Ga.exports=cd;function cd(e,t,r){for(var n=sd(e);n.index<(n.keyedList||e).length;)ad(e,t,n,function(o,u){if(o){r(o,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return ud.bind(n,r)}i(cd,"parallel")});var On=z((Y$,Ir)=>{var Ka=zn(),ld=wn(),pd=Rn();Ir.exports=dd;Ir.exports.ascending=Ja;Ir.exports.descending=md;function dd(e,t,r,n){var o=ld(e,r);return Ka(e,t,o,i(function u(c,a){if(c){n(c,a);return}if(o.index++,o.index<(o.keyedList||e).length){Ka(e,t,o,u);return}n(null,o.results)},"iteratorHandler")),pd.bind(o,n)}i(dd,"serialOrdered");function Ja(e,t){return e<t?-1:e>t?1:0}i(Ja,"ascending");function md(e,t){return-1*Ja(e,t)}i(md,"descending")});var Ya=z((tz,Xa)=>{var fd=On();Xa.exports=gd;function gd(e,t,r){return fd(e,t,null,r)}i(gd,"serial")});var ts=z((nz,es)=>{es.exports={parallel:Qa(),serial:Ya(),serialOrdered:On()}});var Dn=z((oz,rs)=>{"use strict";rs.exports=Object});var os=z((iz,ns)=>{"use strict";ns.exports=Error});var as=z((az,is)=>{"use strict";is.exports=EvalError});var us=z((sz,ss)=>{"use strict";ss.exports=RangeError});var ls=z((uz,cs)=>{"use strict";cs.exports=ReferenceError});var ds=z((cz,ps)=>{"use strict";ps.exports=SyntaxError});var Er=z((lz,ms)=>{"use strict";ms.exports=TypeError});var gs=z((pz,fs)=>{"use strict";fs.exports=URIError});var hs=z((dz,ys)=>{"use strict";ys.exports=Math.abs});var xs=z((mz,vs)=>{"use strict";vs.exports=Math.floor});var bs=z((fz,Ps)=>{"use strict";Ps.exports=Math.max});var Ts=z((gz,_s)=>{"use strict";_s.exports=Math.min});var Es=z((yz,Is)=>{"use strict";Is.exports=Math.pow});var Ss=z((hz,As)=>{"use strict";As.exports=Math.round});var $s=z((vz,ks)=>{"use strict";ks.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var ws=z((Pz,zs)=>{"use strict";var yd=$s();zs.exports=i(function(t){return yd(t)||t===0?t:t<0?-1:1},"sign")});var Os=z((_z,Rs)=>{"use strict";Rs.exports=Object.getOwnPropertyDescriptor});var Nn=z((Tz,Ds)=>{"use strict";var Ar=Os();if(Ar)try{Ar([],"length")}catch{Ar=null}Ds.exports=Ar});var Cs=z((Iz,Ns)=>{"use strict";var Sr=Object.defineProperty||!1;if(Sr)try{Sr({},"a",{value:1})}catch{Sr=!1}Ns.exports=Sr});var Cn=z((Ez,Ms)=>{"use strict";Ms.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var 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 a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==o||a.enumerable!==!0)return!1}return!0},"hasSymbols")});var js=z((Sz,Ls)=>{"use strict";var Us=typeof Symbol<"u"&&Symbol,hd=Cn();Ls.exports=i(function(){return typeof Us!="function"||typeof Symbol!="function"||typeof Us("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hd()},"hasNativeSymbols")});var Mn=z(($z,Bs)=>{"use strict";Bs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Un=z((zz,Fs)=>{"use strict";var vd=Dn();Fs.exports=vd.getPrototypeOf||null});var qs=z((wz,Zs)=>{"use strict";var xd="Function.prototype.bind called on incompatible ",Pd=Object.prototype.toString,bd=Math.max,_d="[object Function]",Vs=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Td=i(function(t,r){for(var n=[],o=r||0,u=0;o<t.length;o+=1,u+=1)n[u]=t[o];return n},"slicy"),Id=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Zs.exports=i(function(t){var r=this;if(typeof r!="function"||Pd.apply(r)!==_d)throw new TypeError(xd+r);for(var n=Td(arguments,1),o,u=i(function(){if(this instanceof o){var x=r.apply(this,Vs(n,arguments));return Object(x)===x?x:this}return r.apply(t,Vs(n,arguments))},"binder"),c=bd(0,r.length-n.length),a=[],m=0;m<c;m++)a[m]="$"+m;if(o=Function("binder","return function ("+Id(a,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var f=i(function(){},"Empty");f.prototype=r.prototype,o.prototype=new f,f.prototype=null}return o},"bind")});var ft=z((Oz,Hs)=>{"use strict";var Ed=qs();Hs.exports=Function.prototype.bind||Ed});var kr=z((Dz,Ws)=>{"use strict";Ws.exports=Function.prototype.call});var Ln=z((Nz,Gs)=>{"use strict";Gs.exports=Function.prototype.apply});var Ks=z((Cz,Qs)=>{"use strict";Qs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Xs=z((Mz,Js)=>{"use strict";var Ad=ft(),Sd=Ln(),kd=kr(),$d=Ks();Js.exports=$d||Ad.call(kd,Sd)});var eu=z((Uz,Ys)=>{"use strict";var zd=ft(),wd=Er(),Rd=kr(),Od=Xs();Ys.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new wd("a function is required");return Od(zd,Rd,t)},"callBindBasic")});var au=z((jz,iu)=>{"use strict";var Dd=eu(),tu=Nn(),nu;try{nu=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var jn=!!nu&&tu&&tu(Object.prototype,"__proto__"),ou=Object,ru=ou.getPrototypeOf;iu.exports=jn&&typeof jn.get=="function"?Dd([jn.get]):typeof ru=="function"?i(function(t){return ru(t==null?t:ou(t))},"getDunder"):!1});var pu=z((Fz,lu)=>{"use strict";var su=Mn(),uu=Un(),cu=au();lu.exports=su?i(function(t){return su(t)},"getProto"):uu?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return uu(t)},"getProto"):cu?i(function(t){return cu(t)},"getProto"):null});var Bn=z((Zz,du)=>{"use strict";var Nd=Function.prototype.call,Cd=Object.prototype.hasOwnProperty,Md=ft();du.exports=Md.call(Nd,Cd)});var xu=z((qz,vu)=>{"use strict";var K,Ud=Dn(),Ld=os(),jd=as(),Bd=us(),Fd=ls(),vt=ds(),ht=Er(),Vd=gs(),Zd=hs(),qd=xs(),Hd=bs(),Wd=Ts(),Gd=Es(),Qd=Ss(),Kd=ws(),yu=Function,Fn=i(function(e){try{return yu('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Ht=Nn(),Jd=Cs(),Vn=i(function(){throw new ht},"throwTypeError"),Xd=Ht?(function(){try{return arguments.callee,Vn}catch{try{return Ht(arguments,"callee").get}catch{return Vn}}})():Vn,gt=js()(),fe=pu(),Yd=Un(),em=Mn(),hu=Ln(),Wt=kr(),yt={},tm=typeof Uint8Array>"u"||!fe?K:fe(Uint8Array),rt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":gt&&fe?fe([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":yt,"%AsyncGenerator%":yt,"%AsyncGeneratorFunction%":yt,"%AsyncIteratorPrototype%":yt,"%Atomics%":typeof Atomics>"u"?K:Atomics,"%BigInt%":typeof BigInt>"u"?K:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?K:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?K:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?K:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ld,"%eval%":eval,"%EvalError%":jd,"%Float16Array%":typeof Float16Array>"u"?K:Float16Array,"%Float32Array%":typeof Float32Array>"u"?K:Float32Array,"%Float64Array%":typeof Float64Array>"u"?K:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?K:FinalizationRegistry,"%Function%":yu,"%GeneratorFunction%":yt,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":gt&&fe?fe(fe([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!gt||!fe?K:fe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ud,"%Object.getOwnPropertyDescriptor%":Ht,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":Bd,"%ReferenceError%":Fd,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!gt||!fe?K:fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":gt&&fe?fe(""[Symbol.iterator]()):K,"%Symbol%":gt?Symbol:K,"%SyntaxError%":vt,"%ThrowTypeError%":Xd,"%TypedArray%":tm,"%TypeError%":ht,"%Uint8Array%":typeof Uint8Array>"u"?K:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?K:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?K:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?K:Uint32Array,"%URIError%":Vd,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":Wt,"%Function.prototype.apply%":hu,"%Object.defineProperty%":Jd,"%Object.getPrototypeOf%":Yd,"%Math.abs%":Zd,"%Math.floor%":qd,"%Math.max%":Hd,"%Math.min%":Wd,"%Math.pow%":Gd,"%Math.round%":Qd,"%Math.sign%":Kd,"%Reflect.getPrototypeOf%":em};if(fe)try{null.error}catch(e){mu=fe(fe(e)),rt["%Error.prototype%"]=mu}var mu,rm=i(function e(t){var r;if(t==="%AsyncFunction%")r=Fn("async function () {}");else if(t==="%GeneratorFunction%")r=Fn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Fn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&fe&&(r=fe(o.prototype))}return rt[t]=r,r},"doEval"),fu={__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"]},Gt=ft(),$r=Bn(),nm=Gt.call(Wt,Array.prototype.concat),om=Gt.call(hu,Array.prototype.splice),gu=Gt.call(Wt,String.prototype.replace),zr=Gt.call(Wt,String.prototype.slice),im=Gt.call(Wt,RegExp.prototype.exec),am=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sm=/\\(\\)?/g,um=i(function(t){var r=zr(t,0,1),n=zr(t,-1);if(r==="%"&&n!=="%")throw new vt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new vt("invalid intrinsic syntax, expected opening `%`");var o=[];return gu(t,am,function(u,c,a,m){o[o.length]=a?gu(m,sm,"$1"):c||u}),o},"stringToPath"),cm=i(function(t,r){var n=t,o;if($r(fu,n)&&(o=fu[n],n="%"+o[0]+"%"),$r(rt,n)){var u=rt[n];if(u===yt&&(u=rm(n)),typeof u>"u"&&!r)throw new ht("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:u}}throw new vt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");vu.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new ht("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ht('"allowMissing" argument must be a boolean');if(im(/^%?[^%]*%?$/,t)===null)throw new vt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=um(t),o=n.length>0?n[0]:"",u=cm("%"+o+"%",r),c=u.name,a=u.value,m=!1,f=u.alias;f&&(o=f[0],om(n,nm([0,1],f)));for(var x=1,T=!0;x<n.length;x+=1){var b=n[x],l=zr(b,0,1),d=zr(b,-1);if((l==='"'||l==="'"||l==="`"||d==='"'||d==="'"||d==="`")&&l!==d)throw new vt("property names with quotes must have matching quotes");if((b==="constructor"||!T)&&(m=!0),o+="."+b,c="%"+o+"%",$r(rt,c))a=rt[c];else if(a!=null){if(!(b in a)){if(!r)throw new ht("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ht&&x+1>=n.length){var y=Ht(a,b);T=!!y,T&&"get"in y&&!("originalValue"in y.get)?a=y.get:a=a[b]}else T=$r(a,b),a=a[b];T&&!m&&(rt[c]=a)}}return a},"GetIntrinsic")});var bu=z((Wz,Pu)=>{"use strict";var lm=Cn();Pu.exports=i(function(){return lm()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Iu=z((Qz,Tu)=>{"use strict";var pm=xu(),_u=pm("%Object.defineProperty%",!0),dm=bu()(),mm=Bn(),fm=Er(),wr=dm?Symbol.toStringTag:null;Tu.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new fm("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");wr&&(n||!mm(t,wr))&&(_u?_u(t,wr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[wr]=r)},"setToStringTag")});var Au=z((Jz,Eu)=>{"use strict";var gm=Function.prototype.call,ym=Object.prototype.hasOwnProperty,hm=ft();Eu.exports=hm.call(gm,ym)});var ku=z((Xz,Su)=>{"use strict";Su.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var wu=z((Yz,zu)=>{"use strict";var Wn=Oa(),vm=require("util"),Zn=require("path"),xm=require("http"),Pm=require("https"),bm=require("url").parse,_m=require("fs"),Tm=require("stream").Stream,Im=require("crypto"),qn=Ua(),Em=ts(),Am=Iu(),Ke=Au(),Hn=ku();function $u(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i($u,"escapeHeaderParam");function J(e){if(!(this instanceof J))return new J(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Wn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(J,"FormData");vm.inherits(J,Wn);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=Wn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(o),n(t),n(u),this._trackLength(o,t,r)};J.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+J.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ke(t,"httpVersion"))&&!(t instanceof Tm))&&(r.knownLength||this._valuesToMeasure.push(t))};J.prototype._lengthRetriever=function(e,t){Ke(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):_m.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):Ke(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ke(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};J.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+$u(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Hn(c,r.header);var a;for(var m in c)if(Ke(c,m)){if(a=c[m],a==null)continue;Array.isArray(a)||(a=[a]),a.length&&(u+=m+": "+a.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=Zn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Zn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ke(e,"httpVersion")&&(r=Zn.basename(e.client._httpMessage.path||"")),r)return'filename="'+$u(r)+'"'};J.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=qn.lookup(e.name)),!r&&e&&e.path&&(r=qn.lookup(e.path)),!r&&e&&e.readable&&Ke(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=qn.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)Ke(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="--------------------------"+Im.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}Em.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};J.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=bm(e),n=Hn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=Hn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Pm.request(n):r=xm.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 a,m=i(function(f,x){return r.removeListener("error",m),r.removeListener("response",a),t.call(this,f,x)},"callback");a=m.bind(this,null),r.on("error",m),r.on("response",a)}}.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]"};Am(J.prototype,"FormData");zu.exports=J});var nt=z((Gn,Qn)=>{(function(e,t){typeof Gn=="object"&&typeof Qn<"u"?Qn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Gn,(function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",u="minute",c="hour",a="day",m="week",f="month",x="quarter",T="year",b="date",l="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:i(function(L){var E=["th","st","nd","rd"],I=L%100;return"["+L+(E[(I-20)%10]||E[I]||E[0])+"]"},"ordinal")},P=i(function(L,E,I){var k=String(L);return!k||k.length>=E?L:""+Array(E+1-k.length).join(I)+L},"m"),_={s:P,z:i(function(L){var E=-L.utcOffset(),I=Math.abs(E),k=Math.floor(I/60),A=I%60;return(E<=0?"+":"-")+P(k,2,"0")+":"+P(A,2,"0")},"z"),m:i(function L(E,I){if(E.date()<I.date())return-L(I,E);var k=12*(I.year()-E.year())+(I.month()-E.month()),A=E.clone().add(k,f),V=I-A<0,Z=E.clone().add(k+(V?-1:1),f);return+(-(k+(I-A)/(V?A-Z:Z-A))||0)},"t"),a:i(function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},"a"),p:i(function(L){return{M:f,y:T,w:m,d:a,D:b,h:c,m:u,s:o,ms:n,Q:x}[L]||String(L||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(L){return L===void 0},"u")},F="en",ue={};ue[F]=g;var ve=i(function(L){return L instanceof ot},"p"),ze=i(function L(E,I,k){var A;if(!E)return F;if(typeof E=="string"){var V=E.toLowerCase();ue[V]&&(A=V),I&&(ue[V]=I,A=V);var Z=E.split("-");if(!A&&Z.length>1)return L(Z[0])}else{var te=E.name;ue[te]=E,A=te}return!k&&A&&(F=A),A||!k&&F},"t"),ee=i(function(L,E){if(ve(L))return L.clone();var I=typeof E=="object"?E:{};return I.date=L,I.args=arguments,new ot(I)},"w"),G=_;G.l=ze,G.i=ve,G.w=function(L,E){return ee(L,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var ot=(function(){function L(I){this.$L=ze(I.locale,null,!0),this.parse(I)}i(L,"M");var E=L.prototype;return E.parse=function(I){this.$d=(function(k){var A=k.date,V=k.utc;if(A===null)return new Date(NaN);if(G.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var Z=A.match(d);if(Z){var te=Z[2]-1||0,ce=(Z[7]||"0").substring(0,3);return V?new Date(Date.UTC(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,ce)):new Date(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,ce)}}return new Date(A)})(I),this.$x=I.x||{},this.init()},E.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},E.$utils=function(){return G},E.isValid=function(){return this.$d.toString()!==l},E.isSame=function(I,k){var A=ee(I);return this.startOf(k)<=A&&A<=this.endOf(k)},E.isAfter=function(I,k){return ee(I)<this.startOf(k)},E.isBefore=function(I,k){return this.endOf(k)<ee(I)},E.$g=function(I,k,A){return G.u(I)?this[k]:this.set(A,I)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(I,k){var A=this,V=!!G.u(k)||k,Z=G.p(I),te=i(function(Ye,be){var je=G.w(A.$u?Date.UTC(A.$y,be,Ye):new Date(A.$y,be,Ye),A);return V?je:je.endOf(a)},"l"),ce=i(function(Ye,be){return G.w(A.toDate()[Ye].apply(A.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(be)),A)},"$"),me=this.$W,ye=this.$M,Ee=this.$D,it="set"+(this.$u?"UTC":"");switch(Z){case T:return V?te(1,0):te(31,11);case f:return V?te(1,ye):te(0,ye+1);case m:var Xe=this.$locale().weekStart||0,bt=(me<Xe?me+7:me)-Xe;return te(V?Ee-bt:Ee+(6-bt),ye);case a:case b:return ce(it+"Hours",0);case c:return ce(it+"Minutes",1);case u:return ce(it+"Seconds",2);case o:return ce(it+"Milliseconds",3);default:return this.clone()}},E.endOf=function(I){return this.startOf(I,!1)},E.$set=function(I,k){var A,V=G.p(I),Z="set"+(this.$u?"UTC":""),te=(A={},A[a]=Z+"Date",A[b]=Z+"Date",A[f]=Z+"Month",A[T]=Z+"FullYear",A[c]=Z+"Hours",A[u]=Z+"Minutes",A[o]=Z+"Seconds",A[n]=Z+"Milliseconds",A)[V],ce=V===a?this.$D+(k-this.$W):k;if(V===f||V===T){var me=this.clone().set(b,1);me.$d[te](ce),me.init(),this.$d=me.set(b,Math.min(this.$D,me.daysInMonth())).$d}else te&&this.$d[te](ce);return this.init(),this},E.set=function(I,k){return this.clone().$set(I,k)},E.get=function(I){return this[G.p(I)]()},E.add=function(I,k){var A,V=this;I=Number(I);var Z=G.p(k),te=i(function(ye){var Ee=ee(V);return G.w(Ee.date(Ee.date()+Math.round(ye*I)),V)},"y");if(Z===f)return this.set(f,this.$M+I);if(Z===T)return this.set(T,this.$y+I);if(Z===a)return te(1);if(Z===m)return te(7);var ce=(A={},A[u]=t,A[c]=r,A[o]=e,A)[Z]||1,me=this.$d.getTime()+I*ce;return G.w(me,this)},E.subtract=function(I,k){return this.add(-1*I,k)},E.format=function(I){var k=this,A=this.$locale();if(!this.isValid())return A.invalidDate||l;var V=I||"YYYY-MM-DDTHH:mm:ssZ",Z=G.z(this),te=this.$H,ce=this.$m,me=this.$M,ye=A.weekdays,Ee=A.months,it=A.meridiem,Xe=i(function(be,je,_t,Qt){return be&&(be[je]||be(k,V))||_t[je].slice(0,Qt)},"h"),bt=i(function(be){return G.s(te%12||12,be,"0")},"d"),Ye=it||function(be,je,_t){var Qt=be<12?"AM":"PM";return _t?Qt.toLowerCase():Qt};return V.replace(y,(function(be,je){return je||(function(_t){switch(_t){case"YY":return String(k.$y).slice(-2);case"YYYY":return G.s(k.$y,4,"0");case"M":return me+1;case"MM":return G.s(me+1,2,"0");case"MMM":return Xe(A.monthsShort,me,Ee,3);case"MMMM":return Xe(Ee,me);case"D":return k.$D;case"DD":return G.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return Xe(A.weekdaysMin,k.$W,ye,2);case"ddd":return Xe(A.weekdaysShort,k.$W,ye,3);case"dddd":return ye[k.$W];case"H":return String(te);case"HH":return G.s(te,2,"0");case"h":return bt(1);case"hh":return bt(2);case"a":return Ye(te,ce,!0);case"A":return Ye(te,ce,!1);case"m":return String(ce);case"mm":return G.s(ce,2,"0");case"s":return String(k.$s);case"ss":return G.s(k.$s,2,"0");case"SSS":return G.s(k.$ms,3,"0");case"Z":return Z}return null})(be)||Z.replace(":","")}))},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(I,k,A){var V,Z=this,te=G.p(k),ce=ee(I),me=(ce.utcOffset()-this.utcOffset())*t,ye=this-ce,Ee=i(function(){return G.m(Z,ce)},"D");switch(te){case T:V=Ee()/12;break;case f:V=Ee();break;case x:V=Ee()/3;break;case m:V=(ye-me)/6048e5;break;case a:V=(ye-me)/864e5;break;case c:V=ye/r;break;case u:V=ye/t;break;case o:V=ye/e;break;default:V=ye}return A?V:G.a(V)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return ue[this.$L]},E.locale=function(I,k){if(!I)return this.$L;var A=this.clone(),V=ze(I,k,!0);return V&&(A.$L=V),A},E.clone=function(){return G.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},L})(),Je=ot.prototype;return ee.prototype=Je,[["$ms",n],["$s",o],["$m",u],["$H",c],["$W",a],["$M",f],["$y",T],["$D",b]].forEach((function(L){Je[L[1]]=function(E){return this.$g(E,L[0],L[1])}})),ee.extend=function(L,E){return L.$i||(L(E,ot,ee),L.$i=!0),ee},ee.locale=ze,ee.isDayjs=ve,ee.unix=function(L){return ee(1e3*L)},ee.en=ue[F],ee.Ls=ue,ee.p={},ee}))});var Wm={};ro(Wm,{quickbooks:()=>Hm});module.exports=ic(Wm);var ac=Object.freeze({status:"aborted"});function S(e,t,r){function n(a,m){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,m);let f=c.prototype,x=Object.keys(f);for(let T=0;T<x.length;T++){let b=x[T];b in a||(a[b]=f[b].bind(a))}}i(n,"init");let o=r?.Parent??Object;class u extends o{static{i(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(a){var m;let f=r?.Parent?new u:this;n(f,a),(m=f._zod).deferred??(m.deferred=[]);for(let x of f._zod.deferred)x();return f}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(S,"$constructor");var we=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Kt=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Fr={};function De(e){return e&&Object.assign(Fr,e),Fr}i(De,"config");function Zr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(Zr,"getEnumValues");function io(e,t){return typeof t=="bigint"?t.toString():t}i(io,"jsonStringifyReplacer");function Xt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Xt,"cached");function ao(e){return e==null}i(ao,"nullish");function Yt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Yt,"cleanRegex");var oo=Symbol("evaluating");function pe(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==oo)return n===void 0&&(n=oo,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(pe,"defineLazy");var qr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function It(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(It,"isObject");var sc=Xt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function so(e){if(It(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(It(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(so,"isPlainObject");var uo=new Set(["string","number","symbol"]);function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(at,"escapeRegex");function er(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(er,"clone");function ne(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(ne,"normalizeParams");function co(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(co,"optionalKeys");var lo={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 st(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(st,"aborted");function Be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Be,"prefixIssues");function Jt(e){return typeof e=="string"?e:e?.message}i(Jt,"unwrapMessage");function Fe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Jt(e.inst?._zod.def?.error?.(e))??Jt(t?.error?.(e))??Jt(r.customError?.(e))??Jt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Fe,"finalizeIssue");function po(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(po,"getLengthableOrigin");function Hr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(Hr,"issue");var mo=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,io,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),fo=S("$ZodError",mo),Et=S("$ZodError",mo,{Parent:Error});var cc=i(e=>(t,r,n,o)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new we;if(c.issues.length){let a=new(o?.Err??e)(c.issues.map(m=>Fe(m,u,De())));throw qr(a,o?.callee),a}return c.value},"_parse"),tr=cc(Et),lc=i(e=>async(t,r,n,o)=>{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 a=new(o?.Err??e)(c.issues.map(m=>Fe(m,u,De())));throw qr(a,o?.callee),a}return c.value},"_parseAsync"),rr=lc(Et),pc=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new we;return u.issues.length?{success:!1,error:new(e??fo)(u.issues.map(c=>Fe(c,o,De())))}:{success:!0,data:u.value}},"_safeParse"),At=pc(Et),dc=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Fe(c,o,De())))}:{success:!0,data:u.value}},"_safeParseAsync"),St=dc(Et);var mc="(?:(?:\\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])))",fc=new RegExp(`^${mc}$`);var go=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),yo=/^-?\d+n?$/,ho=/^-?\d+$/,Wr=/^-?\d+(?:\.\d+)?$/,vo=/^(?:true|false)$/i;var Ve=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),gc={number:"number",bigint:"bigint",object:"date"};var xo=S("$ZodCheckGreaterThan",(e,t)=>{Ve.init(e,t);let r=gc[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,u=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?o.minimum=t.value:o.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 Po=S("$ZodCheckNumberFormat",(e,t)=>{Ve.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,u]=lo[t.format];e._zod.onattach.push(c=>{let a=c._zod.bag;a.format=t.format,a.minimum=o,a.maximum=u,r&&(a.pattern=ho)}),e._zod.check=c=>{let a=c.value;if(r){if(!Number.isInteger(a)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?c.issues.push({input:a,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:a,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}}a<o&&c.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>u&&c.issues.push({origin:"number",input:a,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var bo=S("$ZodCheckMinLength",(e,t)=>{var r;Ve.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ao(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=po(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Gr=S("$ZodCheckStringFormat",(e,t)=>{var r,n;Ve.init(e,t),e._zod.onattach.push(o=>{let u=o._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=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),_o=S("$ZodCheckRegex",(e,t)=>{Gr.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 Io={major:4,minor:3,patch:6};var ie=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Io;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let u of o._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 o=i((c,a,m)=>{let f=st(c),x;for(let T of a){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(f)continue;let b=c.issues.length,l=T._zod.check(c);if(l instanceof Promise&&m?.async===!1)throw new we;if(x||l instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await l,c.issues.length!==b&&(f||(f=st(c,b)))});else{if(c.issues.length===b)continue;f||(f=st(c,b))}}return x?x.then(()=>c):c},"runChecks"),u=i((c,a,m)=>{if(st(c))return c.aborted=!0,c;let f=o(a,n,m);if(f instanceof Promise){if(m.async===!1)throw new we;return f.then(x=>e._zod.parse(x,m))}return e._zod.parse(f,m)},"handleCanaryResult");e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let f=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});return f instanceof Promise?f.then(x=>u(x,c,a)):u(f,c,a)}let m=e._zod.parse(c,a);if(m instanceof Promise){if(a.async===!1)throw new we;return m.then(f=>o(f,n,a))}return o(m,n,a)}}pe(e,"~standard",()=>({validate:i(o=>{try{let u=At(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return St(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),ir=S("$ZodString",(e,t)=>{ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??go(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}}),Qr=S("$ZodStringFormat",(e,t)=>{Gr.init(e,t),ir.init(e,t)});var $o=S("$ZodURL",(e,t)=>{Qr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Kr=S("$ZodNumber",(e,t)=>{ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let u=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...u?{received:u}:{}}),r}}),zo=S("$ZodNumberFormat",(e,t)=>{Po.init(e,t),Kr.init(e,t)}),Jr=S("$ZodBoolean",(e,t)=>{ie.init(e,t),e._zod.pattern=vo,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),wo=S("$ZodBigInt",(e,t)=>{ie.init(e,t),e._zod.pattern=yo,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 Ro=S("$ZodAny",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r}),Oo=S("$ZodUnknown",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r});var Do=S("$ZodVoid",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),No=S("$ZodDate",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,u=o instanceof Date;return u&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Eo(e,t,r){e.issues.length&&t.issues.push(...Be(r,e.issues)),t.value[r]=e.value}i(Eo,"handleArrayResult");var Co=S("$ZodArray",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let u=[];for(let c=0;c<o.length;c++){let a=o[c],m=t.element._zod.run({value:a,issues:[]},n);m instanceof Promise?u.push(m.then(f=>Eo(f,r,c))):Eo(m,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function or(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(or,"handlePropertyResult");function yc(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=co(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(yc,"normalizeDef");function hc(e,t,r,n,o,u){let c=[],a=o.keySet,m=o.catchall._zod,f=m.def.type,x=m.optout==="optional";for(let T in t){if(a.has(T))continue;if(f==="never"){c.push(T);continue}let b=m.run({value:t[T],issues:[]},n);b instanceof Promise?e.push(b.then(l=>or(l,r,T,t,x))):or(b,r,T,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}i(hc,"handleCatchall");var Mo=S("$ZodObject",(e,t)=>{if(ie.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let m={...a};return Object.defineProperty(t,"shape",{value:m}),m},"get")})}let n=Xt(()=>yc(t));pe(e._zod,"propValues",()=>{let a=t.shape,m={};for(let f in a){let x=a[f]._zod;if(x.values){m[f]??(m[f]=new Set);for(let T of x.values)m[f].add(T)}}return m});let o=It,u=t.catchall,c;e._zod.parse=(a,m)=>{c??(c=n.value);let f=a.value;if(!o(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value={};let x=[],T=c.shape;for(let b of c.keys){let l=T[b],d=l._zod.optout==="optional",y=l._zod.run({value:f[b],issues:[]},m);y instanceof Promise?x.push(y.then(g=>or(g,a,b,f,d))):or(y,a,b,f,d)}return u?hc(x,f,a,m,n.value,e):x.length?Promise.all(x).then(()=>a):a}});function Ao(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let o=e.filter(u=>!st(u));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Fe(c,n,De())))}),t)}i(Ao,"handleUnionResults");var Xr=S("$ZodUnion",(e,t)=>{ie.init(e,t),pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),pe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>Yt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,u)=>{if(r)return n(o,u);let c=!1,a=[];for(let m of t.options){let f=m._zod.run({value:o.value,issues:[]},u);if(f instanceof Promise)a.push(f),c=!0;else{if(f.issues.length===0)return f;a.push(f)}}return c?Promise.all(a).then(m=>Ao(m,o,e,u)):Ao(a,o,e,u)}});var Uo=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Xr.init(e,t);let r=e._zod.parse;pe(e._zod,"propValues",()=>{let o={};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[a,m]of Object.entries(c)){o[a]||(o[a]=new Set);for(let f of m)o[a].add(f)}}return o});let n=Xt(()=>{let o=t.options,u=new Map;for(let c of o){let a=c._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let m of a){if(u.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);u.set(m,c)}}return u});e._zod.parse=(o,u)=>{let c=o.value;if(!It(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let a=n.value.get(c?.[t.discriminator]);return a?a._zod.run(o,u):t.unionFallback?r(o,u):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var Lo=S("$ZodRecord",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!so(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let a=new Set;for(let f of c)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){a.add(typeof f=="number"?f.toString():f);let x=t.valueType._zod.run({value:o[f],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...Be(f,T.issues)),r.value[f]=T.value})):(x.issues.length&&r.issues.push(...Be(f,x.issues)),r.value[f]=x.value)}let m;for(let f in o)a.has(f)||(m=m??[],m.push(f));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:m})}else{r.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let m=t.keyType._zod.run({value:a,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Wr.test(a)&&m.issues.length){let T=t.keyType._zod.run({value:Number(a),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(m=T)}if(m.issues.length){t.mode==="loose"?r.value[a]=o[a]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(T=>Fe(T,n,De())),input:a,path:[a],inst:e});continue}let x=t.valueType._zod.run({value:o[a],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...Be(a,T.issues)),r.value[m.value]=T.value})):(x.issues.length&&r.issues.push(...Be(a,x.issues)),r.value[m.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var jo=S("$ZodEnum",(e,t)=>{ie.init(e,t);let r=Zr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>uo.has(typeof o)).map(o=>typeof o=="string"?at(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Bo=S("$ZodLiteral",(e,t)=>{if(ie.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"?at(n):n?at(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Fo=S("$ZodTransform",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Kt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new we;return r.value=o,r}});function So(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(So,"handleOptionalResult");var Vo=S("$ZodOptional",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Yt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(u=>So(u,r.value)):So(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Zo=S("$ZodNullable",(e,t)=>{ie.init(e,t),pe(e._zod,"optin",()=>t.innerType._zod.optin),pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Yt(r.source)}|null)$`):void 0}),pe(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 qo=S("$ZodPipe",(e,t)=>{ie.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(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=>nr(c,t.in,n)):nr(u,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(u=>nr(u,t.out,n)):nr(o,t.out,n)}});function nr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(nr,"handlePipeResult");var Ho=S("$ZodCustom",(e,t)=>{Ve.init(e,t),ie.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(u=>ko(u,r,n,e));ko(o,r,n,e)}});function ko(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Hr(o))}}i(ko,"handleRefineResult");var Go;var Yr=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Qo(){return new Yr}i(Qo,"registry");(Go=globalThis).__zod_globalRegistry??(Go.__zod_globalRegistry=Qo());var en=globalThis.__zod_globalRegistry;function Ko(e,t){return new e({type:"string",...ne(t)})}i(Ko,"_string");function Jo(e,t){return new e({type:"string",coerce:!0,...ne(t)})}i(Jo,"_coercedString");function Xo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}i(Xo,"_url");function Yo(e,t){return new e({type:"number",checks:[],...ne(t)})}i(Yo,"_number");function ei(e,t){return new e({type:"number",coerce:!0,checks:[],...ne(t)})}i(ei,"_coercedNumber");function ti(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}i(ti,"_int");function ri(e,t){return new e({type:"boolean",...ne(t)})}i(ri,"_boolean");function ni(e,t){return new e({type:"boolean",coerce:!0,...ne(t)})}i(ni,"_coercedBoolean");function oi(e,t){return new e({type:"bigint",coerce:!0,...ne(t)})}i(oi,"_coercedBigint");function ii(e){return new e({type:"any"})}i(ii,"_any");function ai(e){return new e({type:"unknown"})}i(ai,"_unknown");function si(e,t){return new e({type:"void",...ne(t)})}i(si,"_void");function ui(e,t){return new e({type:"date",coerce:!0,...ne(t)})}i(ui,"_coercedDate");function ar(e,t){return new xo({check:"greater_than",...ne(t),value:e,inclusive:!0})}i(ar,"_gte");function ke(e,t){return new bo({check:"min_length",...ne(t),minimum:e})}i(ke,"_minLength");function Ze(e,t){return new _o({check:"string_format",format:"regex",...ne(t),pattern:e})}i(Ze,"_regex");function ci(e,t,r){let n=ne(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(ci,"_custom");var de=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ie.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>tr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>At(e,r,n),e.parseAsync=async(r,n)=>rr(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>St(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)=>er(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),ur=S("ZodMiniString",(e,t)=>{ir.init(e,t),de.init(e,t)});function s(e){return Ko(ur,e)}i(s,"string");var li=S("ZodMiniStringFormat",(e,t)=>{Qr.init(e,t),ur.init(e,t)});var zc=S("ZodMiniURL",(e,t)=>{$o.init(e,t),li.init(e,t)});function pi(e){return Xo(zc,e)}i(pi,"url");var cr=S("ZodMiniNumber",(e,t)=>{Kr.init(e,t),de.init(e,t)});function xe(e){return Yo(cr,e)}i(xe,"number");var wc=S("ZodMiniNumberFormat",(e,t)=>{zo.init(e,t),cr.init(e,t)});function di(e){return ti(wc,e)}i(di,"int");var tn=S("ZodMiniBoolean",(e,t)=>{Jr.init(e,t),de.init(e,t)});function X(e){return ri(tn,e)}i(X,"boolean");var mi=S("ZodMiniBigInt",(e,t)=>{wo.init(e,t),de.init(e,t)});var Rc=S("ZodMiniAny",(e,t)=>{Ro.init(e,t),de.init(e,t)});function $t(){return ii(Rc)}i($t,"any");var Oc=S("ZodMiniUnknown",(e,t)=>{Oo.init(e,t),de.init(e,t)});function C(){return ai(Oc)}i(C,"unknown");var Dc=S("ZodMiniVoid",(e,t)=>{Do.init(e,t),de.init(e,t)});function fi(e){return si(Dc,e)}i(fi,"_void");var gi=S("ZodMiniDate",(e,t)=>{No.init(e,t),de.init(e,t)});var Nc=S("ZodMiniArray",(e,t)=>{Co.init(e,t),de.init(e,t)});function j(e,t){return new Nc({type:"array",element:e,...ne(t)})}i(j,"array");var Cc=S("ZodMiniObject",(e,t)=>{Mo.init(e,t),de.init(e,t),pe(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...ne(t)};return new Cc(r)}i(p,"object");var Mc=S("ZodMiniUnion",(e,t)=>{Xr.init(e,t),de.init(e,t)});function B(e,t){return new Mc({type:"union",options:e,...ne(t)})}i(B,"union");var Uc=S("ZodMiniDiscriminatedUnion",(e,t)=>{Uo.init(e,t),de.init(e,t)});function qe(e,t,r){return new Uc({type:"union",options:t,discriminator:e,...ne(r)})}i(qe,"discriminatedUnion");var Lc=S("ZodMiniRecord",(e,t)=>{Lo.init(e,t),de.init(e,t)});function M(e,t,r){return new Lc({type:"record",keyType:e,valueType:t,...ne(r)})}i(M,"record");var jc=S("ZodMiniEnum",(e,t)=>{jo.init(e,t),de.init(e,t),e.options=Object.values(t.entries)});function Q(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new jc({type:"enum",entries:r,...ne(t)})}i(Q,"_enum");var Bc=S("ZodMiniLiteral",(e,t)=>{Bo.init(e,t),de.init(e,t)});function w(e,t){return new Bc({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}i(w,"literal");var Fc=S("ZodMiniTransform",(e,t)=>{Fo.init(e,t),de.init(e,t)});function He(e){return new Fc({type:"transform",transform:e})}i(He,"transform");var Vc=S("ZodMiniOptional",(e,t)=>{Vo.init(e,t),de.init(e,t)});function v(e){return new Vc({type:"optional",innerType:e})}i(v,"optional");var Zc=S("ZodMiniNullable",(e,t)=>{Zo.init(e,t),de.init(e,t)});function zt(e){return new Zc({type:"nullable",innerType:e})}i(zt,"nullable");var qc=S("ZodMiniPipe",(e,t)=>{qo.init(e,t),de.init(e,t)});function We(e,t){return new qc({type:"pipe",in:e,out:t})}i(We,"pipe");var Hc=S("ZodMiniCustom",(e,t)=>{Ho.init(e,t),de.init(e,t)});function lr(e,t){return ci(Hc,e??(()=>!0),t)}i(lr,"custom");var wt={};ro(wt,{bigint:()=>Xc,boolean:()=>Jc,date:()=>Yc,number:()=>Kc,string:()=>Qc});function Qc(e){return Jo(ur,e)}i(Qc,"string");function Kc(e){return ei(cr,e)}i(Kc,"number");function Jc(e){return ni(tn,e)}i(Jc,"boolean");function Xc(e){return oi(mi,e)}i(Xc,"bigint");function Yc(e){return ui(gi,e)}i(Yc,"date");var nn=p({retryOnFailure:p({defaultValue:v(X()),hide:v(X())}),continueOnFailure:p({defaultValue:v(X()),hide:v(X())})}),rn=class{constructor(t,r,n,o,u,c,a,m,f,x,T){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=u;this.test=c;this.requireAuth=a;this.errorHandlingOptions=m;this.outputSchema=f;this.audience=x;this.aiMetadata=T}static{i(this,"IAction")}},re=i(e=>new rn(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 Y=p({displayName:s(),description:v(s())}),q=i((e,t)=>p({type:w(t),required:X(),defaultValue:v($t())}),"TPropertyValue");var Te=p({...Y.shape,...q(s(),"SHORT_TEXT").shape}),Ne=p({...Y.shape,...q(s(),"LONG_TEXT").shape});var hi=p({label:s(),value:C()}),pr=p({disabled:v(X()),placeholder:v(s()),options:j(hi)});var Ie=p({...Y.shape,options:pr,...q(C(),"STATIC_DROPDOWN").shape}),Ce=p({...Y.shape,options:pr,...q(j(C()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var on=p({...Y.shape,...q(C(),"DROPDOWN").shape,refreshers:j(s())}),Rt=p({...Y.shape,...q(j(C()),"MULTI_SELECT_DROPDOWN").shape,refreshers:j(s())});var Me=p({...Y.shape,...q(X(),"CHECKBOX").shape});var Ue=p({...Y.shape,...q(xe(),"NUMBER").shape});var Ot=p({...Y.shape,streaming:v(X()),...q(C(),"FILE").shape});var Dt=p({...Y.shape,...q(s(),"DATE_TIME").shape});var vi=M(s(),B([Te,Ne,Ie,Rt,Ce,Me,Ue,Ot,Dt])),Nt=p({...Y.shape,properties:vi,...q(j(C()),"ARRAY").shape});var Ct=p({...Y.shape,...q(B([M(s(),C())]),"JSON").shape});var xi=B([Te,Ie,Ct,Nt,Ce]),tl=M(s(),xi),an=p({refreshers:j(s()),...Y.shape,...q(C(),"DYNAMIC").shape});var dr=p({...Y.shape,...q(fi(),"MARKDOWN").shape});var Mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Mt||{}),ut=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ut||{}),Ut=(P=>(P.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",P.COMMUNICATION="COMMUNICATION",P.COMMERCE="COMMERCE",P.CORE="CORE",P.UNIVERSAL_AI="UNIVERSAL_AI",P.FLOW_CONTROL="FLOW_CONTROL",P.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",P.ACCOUNTING="ACCOUNTING",P.PRODUCTIVITY="PRODUCTIVITY",P.CONTENT_AND_FILES="CONTENT_AND_FILES",P.DEVELOPER_TOOLS="DEVELOPER_TOOLS",P.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",P.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",P.HUMAN_RESOURCES="HUMAN_RESOURCES",P.PAYMENT_PROCESSING="PAYMENT_PROCESSING",P.MARKETING="MARKETING",P.SALES_AND_CRM="SALES_AND_CRM",P))(Ut||{});var Lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Lt||{}),sn="both_client_credentials_and_authorization_code";var Pe=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Pe||{}),jt=(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))(jt||{}),rl=p({strategy:Q(jt),paramName:v(s())}),Bt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Bt||{});var mr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(mr||{}),Pi=p({status:v(xe()),body:v(C()),headers:v(M(s(),s()))}),bi=p({type:w("DELAY"),resumeDateTime:s(),requestIdToReply:v(s()),handlerId:v(s()),streamStepProgress:v(Q(mr))}),_i=p({type:w("WEBHOOK"),requestId:s(),requestIdToReply:v(s()),response:Pi,handlerId:v(s()),streamStepProgress:v(Q(mr))}),nl=B([bi,_i]);var ol=p({body:C(),rawBody:v(C()),headers:M(s(),s()),queryParams:M(s(),s())});function le(e){return e==null}i(le,"isNil");function Ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(Ft,"isEmpty");function fr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(fr,"assertNotNullOrUndefined");var un=Ae(require("crypto"),1);var il=128,Ge,ct,al=i(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!Ge||Ge.length<e?(Ge=Buffer.allocUnsafe(e*il),un.default.randomFillSync(Ge),ct=0):ct+e>Ge.length&&(un.default.randomFillSync(Ge),ct=0)}catch(t){throw Ge=void 0,t}ct+=e},"fillPool"),sl=i(e=>(al(e|=0),Ge.subarray(ct-e,ct)),"random"),ul=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(u=t)=>{if(u<=0)return"";let c="";for(;;){let a=r(o),m=o;for(;m--;)if(c+=e[a[m]&n]||"",c.length===u)return c}}},"customRandom"),Ii=i((e,t=21)=>ul(e,t,sl),"customAlphabet");var cl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ei=21,kT=s().check(Ze(new RegExp(`^[0-9a-zA-Z]{${Ei}}$`))),ll=Ii(cl,Ei);var Qe=We(He(e=>e instanceof Date?e.toISOString():e),s()),Se={id:s(),created:Qe,updated:Qe},oe=i(e=>v(zt(e)),"Nullable");function cn(e){return v(zt(Q(e)))}i(cn,"NullableEnum");var wT=We(He(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(X())),gr=i(e=>We(He(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(j(e))),"OptionalArrayFromQuery");var DT=M(s(),C());var Vt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(Vt||{});var HT=s().check(Ze(/^#[0-9A-Fa-f]{6}$/));var GT=p({filename:s(),data:C(),type:w("file"),mimetype:v(s())});var pl=Ae(Si());var tI=p({...Se,name:s(),permissions:j(s()),platformId:oe(s()),type:s(),userCount:v(xe())});var ki=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ki||{}),ln=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(ln||{}),pn=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(pn||{});var dn=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(dn||{});var mn=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(mn||{});var dl=p({mode:Q(ki),value:C()}),ml=p({auth:v(s()),fields:M(s(),dl)}),fl=p({pieceName:s(),pieceVersion:s(),actionName:s(),predefinedInput:v(ml)}),gl=p({type:w("PIECE"),toolName:s().check(ke(1)),pieceMetadata:fl}),yl=p({type:w("none")}),hl=p({type:w("access_token"),accessToken:s()}),vl=p({type:w("api_key"),apiKey:s(),apiKeyHeader:s()}),xl=p({type:w("headers"),headers:M(s(),s())}),Pl=qe("type",[yl,hl,vl,xl]),$i=p({type:w("FLOW"),toolName:s().check(ke(1)),externalFlowId:s(),flowDisplayName:v(s())}),zi=p({type:w("MCP"),toolName:s().check(ke(1)),serverUrl:pi(),protocol:Q(pn),auth:Pl}),wi=p({type:w("KNOWLEDGE_BASE"),toolName:s().check(ke(1)),sourceType:Q(ln),sourceId:s(),sourceName:s()}),bl=qe("type",[gl,$i,zi,wi]),_l=p({displayName:s(),description:v(s()),type:Q(dn)}),Ri=p({type:w("MARKDOWN"),markdown:s()}),lt={type:w("TOOL_CALL"),input:oe(M(s(),C())),output:v(C()),toolName:s(),status:Q(mn),toolCallId:s(),startTime:s(),endTime:v(s())},RI=p(lt),Oi=qe("toolCallType",[p({...lt,toolCallType:w("PIECE"),pieceName:s(),pieceVersion:s(),actionName:s()}),p({...lt,toolCallType:w("FLOW"),displayName:s(),externalFlowId:s()}),p({...lt,toolCallType:w("MCP"),displayName:s(),serverUrl:s()}),p({...lt,toolCallType:w("KNOWLEDGE_BASE"),displayName:s(),sourceType:s()}),p({...lt,toolCallType:w("UNKNOWN"),displayName:s()})]),Tl=B([Ri,Oi]);var fn=(r=>(r.IMAGE="image",r.TEXT="text",r))(fn||{}),Le=p({apiKey:s()}),Il=Le,El=p({apiKey:s(),apiKeyHash:s()}),Al=Le,Sl=Le,kl=Le,$l=Le,zl=Le,wl=Le,Rl=Le,Ui=p({accessKeyId:s().check(ke(1)),secretAccessKey:s().check(ke(1))}),Ol=p({}),Dl=p({}),Nl=p({}),Cl=p({}),Ml=p({}),Ul=p({}),Li=p({modelId:s(),modelName:s(),modelType:Q(fn)}),ji=p({apiKeyHeader:s(),baseUrl:s(),models:j(Li),defaultHeaders:v(M(s(),s()))}),Bi=p({accountId:s(),gatewayId:s(),models:j(Li),vertexProject:v(s()),vertexRegion:v(s())}),Fi=p({resourceName:s(),apiVersion:We(He(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(s()))}),Vi=p({region:s().check(ke(1))}),Ll=B([Il,kl,$l,zl,wl,Sl,Al,El,Ui,Rl]),Zi=B([ji,Bi,Fi,Vi,Ol,Nl,Cl,Ml,Dl,Ul]),jl=p({id:s(),name:s(),type:Q(fn)}),Bl=p({id:s(),name:s(),provider:Q(Vt),config:Zi,enabledForChat:X()}),Fl=p({provider:Q(Vt),config:Zi,auth:Ll,platformId:s()});var CI={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"],Vl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Zl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Ni=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],ql=["grok-4.20","grok-4.1-fast"],Hl={openai:Di,anthropic:Vl,google:Ni,activepieces:[...Zl.map(e=>`anthropic/${e}`),...Di.map(e=>`openai/${e}`),...Ni.map(e=>`google/${e}`),...ql.map(e=>`x-ai/${e}`)]};var Ci=128e3,Wl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Gl({provider:e}){return e?Wl[e]??Ci:Ci}i(Gl,"getMaxContextTokens");var Mi={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"},Ql={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Kl=new Set(["anthropic","mistral"]);function Re(e){return{chatModels:Hl[e],maxContextTokens:Gl({provider:e}),defaultEmbeddingModel:Mi[e],supportsEmbedding:Mi[e]!==void 0,supportsImageGeneration:!Kl.has(e),webSearch:Ql[e]}}i(Re,"buildProviderCapabilities");var Jl={openai:Re("openai"),anthropic:Re("anthropic"),openrouter:Re("openrouter"),azure:Re("azure"),google:Re("google"),"cloudflare-gateway":Re("cloudflare-gateway"),custom:Re("custom"),bedrock:Re("bedrock"),mistral:Re("mistral"),activepieces:Re("activepieces")};var Xl=p({base64Url:s(),fileName:s(),extension:v(s())}),Yl=p({mimeType:s(),url:s(),fileName:v(s())}),gn=B([Xl,Yl]);var ep=B([p({type:w("file"),value:gn}),p({type:w("markdown"),value:s(),files:v(j(gn))})]),tp=p({sessionId:s(),message:s(),files:v(j(s()))});var Hi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Hi||{}),Wi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Wi||{}),yn=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(yn||{});var rp=B([p({...Se,name:s(),externalId:s(),type:w("STATIC_DROPDOWN"),tableId:s(),projectId:s(),data:p({options:j(p({value:s()}))})}),p({...Se,name:s(),externalId:s(),type:B([w("TEXT"),w("NUMBER"),w("DATE"),w("DATETIME")]),tableId:s(),projectId:s()})]),np=p({...Se,name:s(),folderId:oe(s()),projectId:s(),externalId:s(),status:cn(Wi),trigger:cn(Hi)}),op=p({...Se,tableId:s(),projectId:s(),cells:M(s(),p({updated:s(),created:s(),value:C(),fieldName:s()}))}),ip=p({events:j(Q(yn)),webhookUrl:s(),flowId:s()}),ap=p({fields:j(p({id:s(),name:s()})),rows:j(M(s(),s())),name:s()}),sp=p({projectId:s(),limit:v(wt.number()),cursor:v(s()),name:v(s()),externalIds:gr(s()),folderId:v(s()),folderIds:gr(s())}),up=p({records:j(j(p({fieldId:s(),value:Qi()}))),tableId:s()}),cp=p({cells:v(j(p({fieldId:s(),value:Qi()}))),tableId:s(),agentUpdate:v(X())}),Gi=qe("operator",[et("eq"),et("neq"),et("gt"),et("gte"),et("lt"),et("lte"),et("co"),qi("exists"),qi("not_exists")]),lp=p({tableId:s(),limit:v(wt.number()),cursor:v(s()),filters:gr(Gi)});function Qi(){return We(He(e=>e==null?e:String(e)),zt(s()))}i(Qi,"coerceToString");function et(e){return p({fieldId:s(),operator:w(e),value:s()})}i(et,"valueFilter");function qi(e){return p({fieldId:s(),operator:w(e)})}i(qi,"existenceFilter");var pp=p({status:v(xe()),body:v(C()),headers:v(M(s(),s()))}),dp=p({...Se,deleted:oe(Qe),ownerId:s(),displayName:s(),platformId:s(),externalId:oe(s())});var Ki=p({name:s(),description:v(s()),type:s(),required:X()}),mp=p({pieceName:s(),triggerName:s(),input:p({toolName:s(),toolDescription:s(),inputSchema:j(Ki),returnsResponse:X()})});var Ji="^[0-9]+\\.[0-9]+\\.[0-9]+$",tE=new RegExp(Ji),gp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",rE=s().check(Ze(new RegExp(Ji))),nE=s().check(Ze(new RegExp(gp))),yp=p({packageType:w("ARCHIVE"),pieceType:Q(ut),pieceName:s(),pieceVersion:s(),archiveId:s(),platformId:s()}),Xi=p({packageType:w("REGISTRY"),pieceType:w("OFFICIAL"),pieceName:s(),pieceVersion:s()}),Yi=p({packageType:w("REGISTRY"),pieceType:w("CUSTOM"),pieceName:s(),pieceVersion:s(),platformId:s()}),oE=B([Xi,Yi]),iE=B([yp,Xi,Yi]);var hp=qe("type",[p({type:w("CRON_EXPRESSION"),cronExpression:s(),timezone:s()}),p({type:w("INTERVAL"),intervalMs:di().check(ar(6e4))})]),aE=p({...Se,type:Q(Pe),projectId:s(),flowId:s(),triggerName:s(),schedule:oe(hp),flowVersionId:s(),pieceName:s(),pieceVersion:s(),deleted:oe(s()),simulate:X()}),ea=(g=>(g.UNKNOWN="UNKNOWN",g.FLOW_RUN_LOG="FLOW_RUN_LOG",g.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",g.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",g.FLOW_STEP_FILE="FLOW_STEP_FILE",g.SAMPLE_DATA="SAMPLE_DATA",g.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",g.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",g.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",g.PROJECT_RELEASE="PROJECT_RELEASE",g.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",g.PLATFORM_ASSET="PLATFORM_ASSET",g.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",g.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",g.KNOWLEDGE_BASE="KNOWLEDGE_BASE",g.FLOW_BUNDLE="FLOW_BUNDLE",g))(ea||{}),ta=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ta||{}),ra=(r=>(r.S3="S3",r.DB="DB",r))(ra||{}),sE=p({...Se,projectId:oe(s()),platformId:oe(s()),type:Q(ea),compression:Q(ta),data:v(C()),location:Q(ra),size:oe(xe()),fileName:oe(s()),s3Key:oe(s()),metadata:oe(M(s(),s()))}),na=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(na||{}),oa=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(oa||{}),uE=p({id:s(),email:s(),firstName:s(),status:Q(oa),externalId:oe(s()),platformId:oe(s()),platformRole:Q(na),lastName:s(),created:Qe,updated:Qe,lastActiveDate:oe(Qe),imageUrl:oe(s())});var hn=p({...Y.shape,...q(M(s(),C()),"OBJECT").shape});var ua=p({...Y.shape,...q(s(),"COLOR").shape});var vn=B([Te,Ne,dr,Me,Ie,Ce,on,Rt,an,Ue,Nt,hn,Ct,Dt,Ot,ua]),h={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 Oe=p({displayName:s(),description:v(s()),hasConnectionIdentifier:v(X())});var ca=p({username:s(),password:s()}),xn=p({...Oe.shape,username:p({displayName:s(),description:v(s())}),password:p({displayName:s(),description:v(s())}),...q(ca,"BASIC_AUTH").shape});var bp=M(s(),B([Te,Ne,Ue,Me,Ie])),Pn=p({...Oe.shape,props:bp,...q(C(),"CUSTOM_AUTH").shape});var tt=p({...Oe.shape,...q(p({auth:s()}),"SECRET_TEXT").shape});var _p=M(s(),B([Te,Ne,tt,Ue,Me,Ie,Ce,dr])),la=p({...Oe.shape,props:_p,...q(C(),"OIDC").shape});var bn=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(bn||{}),pa=B([Te,tt,Ie]),da=M(s(),pa),Tp=p({props:v(M(s(),pa)),authUrl:s(),tokenUrl:s(),scope:j(s()),prompt:v(B([w("none"),w("consent"),w("login"),w("omit")])),pkce:v(X()),pkceMethod:v(B([w("plain"),w("S256")])),authorizationMethod:v(Q(bn)),grantType:v(B([Q(Lt),w(sn)])),extra:v(M(s(),s()))}),ma=p({access_token:s(),props:v(da),data:M(s(),$t())}),_n=p({...Oe.shape,...Tp.shape,...q(ma,"OAUTH2").shape});var pt=B([xn,Pn,la,_n,tt]),Zt="Connection",Tn={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Zt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Zt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Zt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Zt}},None(){}};var jA={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 Ip=p({...Y.shape,...q(C(),"CUSTOM").shape,code:s()});var Ep=B([vn,pt]),In=M(s(),Ep),aS=M(s(),vn);var fa=B([p({strategy:w("CRON"),cronExpression:s()}),p({strategy:w("NONE")})]),dt=class{constructor(t,r,n,o,u,c,a,m,f,x,T,b,l,d,y,g,P,_,F){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=u;this.type=c;this.handshakeConfiguration=a;this.onHandshake=m;this.renewConfiguration=f;this.onRenew=x;this.onEnable=T;this.onDisable=b;this.onStart=l;this.run=d;this.test=y;this.sampleData=g;this.testStrategy=P;this.outputSchema=_;this.aiMetadata=F}static{i(this,"ITrigger")}},he=i(e=>{switch(e.type){case"WEBHOOK":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,le(e.sampleData)&&le(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var ga="2",hr="0.82.0";var En=class{constructor(t,r,n,o,u,c,a,m,f=hr,x,T="",b){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=a;this.auth=m;this.minimumSupportedRelease=f;this.maximumSupportedRelease=x;this.description=T;this.deprecated=b;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:ga}),"getContextInfo");(!Sp(f)||kp(f,hr))&&(this.minimumSupportedRelease=hr),u.forEach(l=>this._actions[l.name]=l),c.forEach(l=>this._triggers[l.name]=l)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:Ap(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}},ha=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new En(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 Ap(e){if(e!==void 0)return Array.isArray(e)?e.map(ya):ya(e)}i(Ap,"withConnectionIdentifierFlag");function ya(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}i(ya,"flagConnectionIdentifier");function Sp(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Sp,"isValidSimpleSemver");function kp(e,t){let[r,n,o]=e.split(".").map(Number),[u,c,a]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:o<a}i(kp,"isSemverLessThan");var $p=v(M(s(),M(s(),s()))),va=p({id:v(s()),name:s(),displayName:s(),logoUrl:s(),description:s(),authors:j(s()),platformId:v(s()),directoryPath:v(s()),auth:v(B([pt,j(pt)])),version:s(),categories:v(j(Q(Ut))),minimumSupportedRelease:v(s()),maximumSupportedRelease:v(s()),deprecated:v(X()),i18n:$p}),zp=Q(["human","ai","both"]),xa=p({description:v(s()),idempotent:v(X())}),Pa=p({name:s(),displayName:s(),description:s(),props:In,requireAuth:X(),errorHandlingOptions:v(nn),outputSchema:v(lr()),audience:v(zp),aiMetadata:v(xa)}),ba=p({name:s(),displayName:s(),description:s(),props:In,errorHandlingOptions:v(nn),type:Q(Pe),sampleData:C(),handshakeConfiguration:v(lr()),renewConfiguration:v(fa),testStrategy:Q(Bt),outputSchema:v(lr()),aiMetadata:v(xa)}),wp=p({...va.shape,actions:M(s(),Pa),triggers:M(s(),ba)}),Rp=p({...va.shape,actions:xe(),triggers:xe(),suggestedActions:v(j(Pa)),suggestedTriggers:v(j(ba))}),_a=p({projectUsage:xe(),pieceType:Q(ut),packageType:Q(Mt),platformId:v(s()),archiveId:v(s())}),ak=p({...wp.shape,..._a.shape}),sk=p({...Rp.shape,..._a.shape}),uk=p({name:s(),version:s()});var Op=Ae(require("path")),Dp=Ae(require("fs/promises"));var R=Tn.OAuth2({description:"You can find Company ID under **settings->Additional Info**.",required:!0,props:{companyId:h.ShortText({displayName:"Company ID",required:!0})},authUrl:"https://appcenter.intuit.com/connect/oauth2",tokenUrl:"https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer",scope:["com.intuit.quickbooks.accounting"]});var mt=require("node:stream");var vr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((u,c)=>{o.append(c,u)}),{urlWithoutQueryParams:n,queryParams:o}}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 xr=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new An,r=new Sn){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},An=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Sn=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var qt=class extends Error{constructor(r,n){let o=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:u},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=u}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Ta({error:e,requestBody:t}){return e instanceof qt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(Ta,"toFailsafeOutput");var Pr=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Pr||{});var br=class extends vr{static{i(this,"FetchHttpClient")}constructor(t="",r=new xr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[F,ue]of Object.entries(c))o.append(F,ue);let a=o.toString(),m=a?`${n}?${a}`:n,f=t.responseType??"json",x=t.followRedirects??!0,T=t.retries??0,{body:b,extraHeaders:l,isStream:d}=Np(t.method)?Cp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=Up({...u,...l}),g=await Mp(async()=>{let F=new AbortController,ue=t.timeout&&t.timeout>0?setTimeout(()=>F.abort(),t.timeout):void 0;try{let ve={method:t.method.toString(),headers:y,body:b,redirect:x?"follow":"manual",signal:F.signal};return d&&(ve.duplex="half"),r?.dispatcher!==void 0&&(ve.dispatcher=r.dispatcher),await fetch(m,ve)}finally{ue!==void 0&&clearTimeout(ue)}},d?0:T),P=x?300:400;if(g.status<200||g.status>=P){let F=await Ia(g,f==="stream"?"text":f),ue=new qt(t.body,{status:g.status,responseBody:F});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ue),ue}let _=await Ia(g,f);return{status:g.status,headers:Lp(g.headers),body:_}}};function Np(e){return e!=="GET"&&e!=="HEAD"}i(Np,"acceptsRequestBody");function Cp(e,t){if(Aa(e))return{body:void 0,extraHeaders:{},isStream:!1};if(jp(e)){let n=new mt.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof mt.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(Cp,"serializeBody");async function Ia(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Aa(e.body)?mt.Readable.from([]):mt.Readable.fromWeb(e.body);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}}}}i(Ia,"parseResponseBody");async function Mp(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Ea(n);continue}return o}catch(o){if(r=o,n<t){await Ea(n);continue}throw o}throw r}i(Mp,"sendWithRetries");function Ea(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Ea,"backoff");function Up(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}i(Up,"normalizeHeaders");function Lp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Lp,"toHttpHeaders");function jp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(jp,"isNodeFormData");function Aa(e){return e==null}i(Aa,"isNil");var _r=new br;var Sm=Ae(require("fs")),Ru=Ae(wu());var km={"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 $m(e){let t=e.split(";")[0].trim().toLowerCase();return km[t]??""}i($m,"contentTypeToExtension");var zm=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),wm=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Ou({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:u,props:c,extraProps:a,authLocation:m="headers"}){return re({audience:"human",name:u||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:h.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:f})=>({url:h.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${wm(t,f)}/resource or /resource`,required:!0,defaultValue:f?t(f):"",...c?.url??{}})}),"props")}),method:h.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Pr).map(f=>({label:f,value:f}))},...c?.method??{}}),headers:h.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:h.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:h.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:h.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:f})=>{if(!f)return{};let x=f,T={};switch(x){case"none":break;case"json":T.data=h.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":T.data=h.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=h.Array({displayName:"Form Data",required:!0,properties:{fieldName:h.ShortText({displayName:"Field Name",required:!0}),fieldType:h.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:h.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:h.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:h.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:h.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:h.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:h.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...a},run:i(async f=>{let{method:x,url:T,headers:b,queryParams:l,body:d,body_type:y,failsafe:g,timeout:P,response_is_binary:_,followRedirects:F}=f.propsValue;fr(x,"Method"),fr(T,"URL");let ue=le(r)?{}:await r(f.auth,f.propsValue),ve=T.url,ze=ve.startsWith("http://")||ve.startsWith("https://")?ve:zm({baseUrl:t(f.auth),relativePath:ve}),ee={method:x,url:ze,headers:{...b??{},...m==="headers"||!le(m)?ue:{}},queryParams:{...m==="queryParams"?ue:{},...l??{}},timeout:P?P*1e3:0,followRedirects:F};if(_&&(ee.responseType="arraybuffer"),d)if(y&&y!=="none"){let G=d.data;if(y==="form_data"){let ot=G,Je=new Ru.default;for(let{fieldName:L,fieldType:E,textFieldValue:I,fileFieldValue:k}of ot)E==="text"&&!Ft(I)?Je.append(L,I):E==="file"&&!Ft(k)&&Je.append(L,k.data,{filename:k?.filename});ee.body=Je,ee.headers={...ee.headers,...Je.getHeaders()}}else ee.body=G}else y||(ee.body=d);try{let G=await _r.sendRequest(ee);return await Rm(f.files,G.body,G.status,G.headers,_)}catch(G){if(g)return Ta({error:G,requestBody:ee.body});throw G}},"run")})}i(Ou,"createCustomApiCallAction");var Rm=i(async(e,t,r,n,o)=>{let u;if(o&&Om(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],a=$m(c??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),u=await e.write({fileName:`output.${a}`,data:m})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Om=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var H={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:u,server:c}){switch(e.strategy){case 0:{let a=await t.get("lastPoll");if(le(a))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:a,server:c}),f=m.reduce((x,T)=>Math.max(x,T.epochMilliSeconds),a);return await t.put("lastPoll",f),m.filter(x=>x.epochMilliSeconds>a).map(x=>x.data)}case 1:{let a=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:a,files:u,server:c}),f=m.findIndex(b=>b.id===a),x=[];le(a)||f==-1?x=m??[]:x=m?.slice(0,f)??[],le(o)||(x=x.slice(-o));let T=x?.[0]?.id;return le(T)||await t.put("lastItem",T),x.map(b=>b.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o,isRepublish:u}){switch(e.strategy){case 0:{if(u&&!le(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(u&&!le(await t.get("lastItem")))break;let a=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;le(a)?await t.delete("lastItem"):await t.put("lastItem",a);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:u}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:u});break}}return Dm(c.map(a=>a.data))}};function Dm(e){return e.length<=5?e:e.slice(0,5)}i(Dm,"getFirstFiveOrAll");var Nm="https://quickbooks.api.intuit.com/v3/company",Rr={minorVersion:"75",getApiUrl:i(e=>`${Nm}/${e}`,"getApiUrl")};async function ge({accessToken:e,companyId:t,method:r,resourceUri:n,query:o,body:u}){let c=Rr.getApiUrl(t),a={minorversion:Rr.minorVersion};for(let[f,x]of Object.entries(o??{}))x!==void 0&&(a[f]=String(x));return(await _r.sendRequest({method:r,url:`${c}${n}`,queryParams:a,authentication:{type:"BEARER_TOKEN",token:e},headers:{Accept:"application/json",...u!==void 0&&{"Content-Type":"application/json"}},body:u})).body}i(ge,"quickbooksApiCall");async function W({accessToken:e,companyId:t,query:r}){return ge({accessToken:e,companyId:t,method:"GET",resourceUri:"/query",query:{query:r}})}i(W,"quickbooksQuery");var Du=re({auth:R,name:"find_invoice",displayName:"Find Invoice",description:"Search for an invoice by its number in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks invoice by its document number (DocNumber), returning the first match. Use to resolve an invoice reference to its full record before reading or acting on it; the document number is required. Read-only and idempotent.",idempotent:!0},props:{invoice_number:h.ShortText({displayName:"Invoice Number",description:"The document number (DocNumber) of the invoice to search for.",required:!0})},async run(e){let{invoice_number:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=`SELECT * FROM Invoice WHERE DocNumber = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,o=await W({accessToken:e.auth.access_token,companyId:r,query:n});return o?.QueryResponse?.Invoice&&o.QueryResponse.Invoice.length>0?{found:!0,result:o.QueryResponse.Invoice[0]}:{found:!1,result:{}}}});var Nu=re({auth:R,name:"find_customer",displayName:"Find Customer",description:"Search for a customer by display name in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks customer by exact display name, returning the first match. Use to resolve a customer name to its full record (including its Id) before referencing it elsewhere; the match is exact, not fuzzy. Read-only and idempotent.",idempotent:!0},props:{search_term:h.ShortText({displayName:"Customer Name",description:"The display name of the customer to search for.",required:!0})},async run(e){let{search_term:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=`SELECT * FROM Customer WHERE DisplayName = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,o=await W({accessToken:e.auth.access_token,companyId:r,query:n});return o?.QueryResponse?.Customer&&o.QueryResponse.Customer.length>0?{found:!0,result:o.QueryResponse.Customer[0]}:{found:!1,result:{}}}});var Cu=re({auth:R,name:"find_payment",displayName:"Find Payment",description:"Finds an existing payment in QuickBooks.",audience:"both",aiMetadata:{description:"List all QuickBooks payments belonging to a given customer, identified by the customer Id (not name). Use to retrieve a customer's payment history or to check whether they have any payments on record. Read-only and idempotent.",idempotent:!0},props:{customerId:h.ShortText({displayName:"Customer ID",description:"The ID of the customer to find payments for.",required:!0})},async run(e){let{customerId:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect.");let n=`SELECT * FROM Payment WHERE CustomerRef = '${t}'`,o=await W({accessToken:e.auth.access_token,companyId:r,query:n});return o.QueryResponse?.Payment&&o.QueryResponse?.Payment.length>0?{found:!0,result:o.QueryResponse?.Payment}:{found:!1,result:[]}}});var Mu=re({auth:R,name:"create_invoice",displayName:"Create Invoice",description:"Creates an invoice in QuickBooks.",audience:"both",aiMetadata:{description:'Create a new QuickBooks invoice for a customer with one or more line items (each line needs an amount and an Item/product Id). Optionally set due date, transaction date, invoice number, memos, and email status; setting email status to "Needs To Be Sent" requires a billing email. Not idempotent: each call creates a new invoice, so guard against duplicates.',idempotent:!1},props:{customerRef:h.Dropdown({auth:R,displayName:"Customer",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,u=await W({accessToken:t,companyId:n,query:"SELECT Id, DisplayName FROM Customer STARTPOSITION 1 MAXRESULTS 1000"});if(u.Fault)throw new Error(`QuickBooks API Error: ${u.Fault.Error.map(a=>a.Message).join(", ")}`);return{disabled:!1,options:(u.QueryResponse?.Customer??[]).map(a=>({label:a.DisplayName,value:a.Id}))}},"options")}),lineItems:h.Array({displayName:"Line Items",description:"Line items for the invoice",required:!0,properties:{description:h.ShortText({displayName:"Description",required:!1}),amount:h.Number({displayName:"Amount",description:"Total amount for this line (Exclusive of tax). Required.",required:!0}),detailType:h.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Sales Item Line Detail",value:"SalesItemLineDetail"}]},defaultValue:"SalesItemLineDetail"}),itemId:h.ShortText({displayName:"Item ID (Product/Service)",description:"Enter the ID of the Item (Product/Service). Required for SalesItemLineDetail.",required:!0}),quantity:h.Number({displayName:"Quantity",required:!1}),unitPrice:h.Number({displayName:"Unit Price",description:"If specified, Amount will be Qty * UnitPrice. If Amount is also specified, Amount overrides calculation.",required:!1})}}),emailStatus:h.StaticDropdown({displayName:"Email Status",description:"Specify whether the invoice should be emailed after creation.",required:!1,options:{options:[{label:"Not Set (Default - No Email)",value:"NotSet"},{label:"Needs To Be Sent",value:"NeedToSend"}]},defaultValue:"NotSet"}),billEmail:h.ShortText({displayName:"Billing Email Address",description:'Email address to send the invoice to. Required if Email Status is "Needs To Be Sent". Overrides customer default.',required:!1}),dueDate:h.DateTime({displayName:"Due Date",description:"The date when the payment for the invoice is due. If not provided, default term from customer or company is used.",required:!1}),docNumber:h.ShortText({displayName:"Invoice Number",description:"Optional reference number for the invoice. If not provided, QuickBooks assigns the next sequential number.",required:!1}),txnDate:h.DateTime({displayName:"Transaction Date",description:"The date entered on the transaction. Defaults to the current date if not specified.",required:!1}),privateNote:h.LongText({displayName:"Private Note (Memo)",description:"Note to self. Does not appear on the invoice sent to the customer.",required:!1}),customerMemo:h.LongText({displayName:"Customer Memo (Statement Memo)",description:"Memo to be displayed on the invoice sent to the customer (appears on statement).",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=e.propsValue;if(n.emailStatus==="NeedToSend"&&!n.billEmail)throw new Error('Billing Email Address is required when Email Status is "Needs To Be Sent".');let o=n.lineItems.map(a=>{if(a.detailType==="SalesItemLineDetail"){if(!a.itemId)throw new Error("Item ID is required for Sales Item Line Detail.");return{Amount:a.amount,DetailType:a.detailType,Description:a.description,SalesItemLineDetail:{ItemRef:{value:a.itemId},...a.quantity!=null&&{Qty:a.quantity},...a.unitPrice!=null&&{UnitPrice:a.unitPrice}}}}else return{Amount:a.amount,DetailType:a.detailType,Description:a.description}});if(o.length===0)throw new Error("At least one line item is required to create an invoice.");let u={Line:o,CustomerRef:{value:n.customerRef},...n.emailStatus&&{EmailStatus:n.emailStatus},...n.billEmail&&{BillEmail:{Address:n.billEmail}},...n.dueDate&&{DueDate:n.dueDate.split("T")[0]},...n.docNumber&&{DocNumber:n.docNumber},...n.txnDate&&{TxnDate:n.txnDate.split("T")[0]},...n.privateNote&&{PrivateNote:n.privateNote},...n.customerMemo&&{CustomerMemo:{value:n.customerMemo}}},c=await ge({accessToken:t,companyId:r,method:"POST",resourceUri:"/invoice",body:u});if(c.Fault)throw new Error(`QuickBooks API Error: ${c.Fault.Error.map(a=>a.Message).join(", ")} - ${c.Fault.Error.map(a=>a.Detail).join(", ")}`);return c.Invoice}});var Uu=re({auth:R,name:"create_expense",displayName:"Create Expense",description:"Creates an expense transaction (purchase) in QuickBooks.",audience:"both",aiMetadata:{description:"Record a new expense (purchase) paid from a chosen bank or credit-card account, with one or more account-based line items (each needs an amount and an expense account Id) and a payment type of cash, check, or credit card. Optionally attach a payee/vendor, payment date, and memo. Not idempotent: each call creates a new purchase, so guard against duplicates.",idempotent:!1},props:{accountRef:h.Dropdown({auth:R,displayName:"Bank/Credit Card Account",description:"The account from which the expense was paid.",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect account",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,u=await W({accessToken:t,companyId:n,query:"SELECT Id, Name, AccountType FROM Account STARTPOSITION 1 MAXRESULTS 1000"});if(u.Fault)throw new Error(`QuickBooks API Error fetching accounts: ${u.Fault.Error.map(a=>a.Message).join(", ")}`);return{disabled:!1,options:(u.QueryResponse?.Account??[]).map(a=>({label:`${a.Name} (${a.AccountType})`,value:a.Id}))}},"options")}),paymentType:h.StaticDropdown({displayName:"Payment Type",required:!0,options:{options:[{label:"Cash",value:"Cash"},{label:"Check",value:"Check"},{label:"Credit Card",value:"CreditCard"}]},defaultValue:"Cash"}),entityRef:h.Dropdown({auth:R,displayName:"Payee (Vendor)",description:"Optional - The vendor the expense was paid to.",required:!1,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect account",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,u=await W({accessToken:t,companyId:n,query:"SELECT Id, DisplayName FROM Vendor STARTPOSITION 1 MAXRESULTS 1000"});if(u.Fault)throw new Error(`QuickBooks API Error fetching vendors: ${u.Fault.Error.map(a=>a.Message).join(", ")}`);return{disabled:!1,options:(u.QueryResponse?.Vendor??[]).map(a=>({label:a.DisplayName,value:a.Id}))}},"options")}),txnDate:h.DateTime({displayName:"Payment Date",description:"The date the expense occurred.",required:!1}),lineItems:h.Array({displayName:"Line Items",description:"Details of the expense (e.g., categories or items purchased). At least one line is required.",required:!0,properties:{amount:h.Number({displayName:"Amount",required:!0}),description:h.ShortText({displayName:"Description",required:!1}),detailType:h.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Account Based Expense Line Detail",value:"AccountBasedExpenseLineDetail"}]},defaultValue:"AccountBasedExpenseLineDetail"}),expenseAccountId:h.ShortText({displayName:"Expense Category/Account ID",description:'The Id of the expense account. Use the "Find Account" action (filter by type Expense) to look this up.',required:!0})}}),privateNote:h.LongText({displayName:"Memo (Private Note)",description:"Internal note about the expense.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=e.propsValue,o=n.lineItems.map(a=>{let m={Amount:a.amount,Description:a.description,DetailType:a.detailType};if(a.detailType==="AccountBasedExpenseLineDetail"){if(!a.expenseAccountId)throw new Error("Expense Category/Account ID is required for Account Based Expense Line Detail.");m.AccountBasedExpenseLineDetail={AccountRef:{value:a.expenseAccountId}}}return m});if(o.length===0)throw new Error("At least one line item is required.");let u={AccountRef:{value:n.accountRef},PaymentType:n.paymentType,Line:o,...n.entityRef&&{EntityRef:{value:n.entityRef}},...n.txnDate&&{TxnDate:n.txnDate.split("T")[0]},...n.privateNote&&{PrivateNote:n.privateNote}},c=await ge({accessToken:t,companyId:r,method:"POST",resourceUri:"/purchase",body:u});if(c.Fault)throw new Error(`QuickBooks API Error creating expense: ${c.Fault.Error.map(a=>a.Message).join(", ")} - Detail: ${c.Fault.Error.map(a=>a.Detail).join(", ")}`);return c.Purchase}});var Lu=re({auth:R,name:"create_bill",displayName:"Create Bill",description:"Creates a bill (accounts payable) in QuickBooks.",audience:"both",aiMetadata:{description:"Record a new bill owed to a vendor, with one or more account-based line items (each needs an amount and an expense account Id, and optionally a Class Id on QuickBooks Plus/Advanced). Optionally set the bill date, due date, bill number, and memo. Not idempotent: each call creates a new bill, so guard against duplicates.",idempotent:!1},props:{vendorRef:h.Dropdown({auth:R,displayName:"Vendor",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,u=await W({accessToken:t,companyId:n,query:"SELECT Id, DisplayName FROM Vendor STARTPOSITION 1 MAXRESULTS 1000"});if(u.Fault)throw new Error(`QuickBooks API Error fetching vendors: ${u.Fault.Error.map(a=>a.Message).join(", ")}`);return{disabled:!1,options:(u.QueryResponse?.Vendor??[]).map(a=>({label:a.DisplayName,value:a.Id}))}},"options")}),lineItems:h.Array({displayName:"Line Items",description:"Details of the bill (expense categories). At least one line is required.",required:!0,properties:{amount:h.Number({displayName:"Amount",required:!0}),description:h.ShortText({displayName:"Description",required:!1}),detailType:h.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Account Based Expense Line Detail",value:"AccountBasedExpenseLineDetail"}]},defaultValue:"AccountBasedExpenseLineDetail"}),expenseAccountId:h.ShortText({displayName:"Expense Category/Account ID",description:'The Id of the expense account. Use the "Find Account" action (filter by type Expense) to look this up.',required:!0}),classId:h.ShortText({displayName:"Class ID",description:"Optional. The Id of the class to tag this line with. Only available on QuickBooks Plus and Advanced plans with class tracking enabled for per-line transactions; on other plans this is ignored.",required:!1})}}),txnDate:h.DateTime({displayName:"Bill Date",description:"The date of the bill. Defaults to today if empty.",required:!1}),dueDate:h.DateTime({displayName:"Due Date",description:"The date the payment is due. If empty, the vendor/company term is used.",required:!1}),docNumber:h.ShortText({displayName:"Bill Number",description:"Reference number for the bill.",required:!1}),privateNote:h.LongText({displayName:"Memo (Private Note)",description:"Internal note about the bill.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=e.propsValue,o=await Cm({accessToken:t,companyId:r}),u=n.lineItems.map(m=>{if(!m.expenseAccountId)throw new Error("Expense Category/Account ID is required for each line.");return{Amount:m.amount,Description:m.description,DetailType:m.detailType,AccountBasedExpenseLineDetail:{AccountRef:{value:m.expenseAccountId},...o&&m.classId&&{ClassRef:{value:m.classId}}}}});if(u.length===0)throw new Error("At least one line item is required.");let c={VendorRef:{value:n.vendorRef},Line:u,...n.txnDate&&{TxnDate:n.txnDate.split("T")[0]},...n.dueDate&&{DueDate:n.dueDate.split("T")[0]},...n.docNumber&&{DocNumber:n.docNumber},...n.privateNote&&{PrivateNote:n.privateNote}},a=await ge({accessToken:t,companyId:r,method:"POST",resourceUri:"/bill",body:c});if(a.Fault)throw new Error(`QuickBooks API Error creating bill: ${a.Fault.Error.map(m=>m.Message).join(", ")} - Detail: ${a.Fault.Error.map(m=>m.Detail).join(", ")}`);return a.Bill}});async function Cm({accessToken:e,companyId:t}){try{return!!(await ge({accessToken:e,companyId:t,method:"GET",resourceUri:"/preferences"})).Preferences?.AccountingInfoPrefs?.ClassTrackingPerTxnLine}catch{return!1}}i(Cm,"isClassTrackingPerLineEnabled");var ju=re({auth:R,name:"create_vendor",displayName:"Create Vendor",description:"Creates a vendor in QuickBooks.",audience:"both",aiMetadata:{description:"Create a new QuickBooks vendor with a display name and optional company name, email, phone, billing address, 1099 tracking flag, tax identifier, account number, and payment term. Not idempotent: each call creates a new vendor, so guard against duplicates (e.g. with Find Vendor first).",idempotent:!1},props:{displayName:h.ShortText({displayName:"Vendor Display Name",description:"The name QuickBooks will show for this vendor. Must be unique across all vendors, customers, and employees.",required:!0}),companyName:h.ShortText({displayName:"Company Name",required:!1}),email:h.ShortText({displayName:"Email Address",required:!1}),phone:h.ShortText({displayName:"Phone Number",required:!1}),billAddrLine1:h.ShortText({displayName:"Billing Address Line 1",required:!1}),billAddrCity:h.ShortText({displayName:"Billing Address City",required:!1}),billAddrState:h.ShortText({displayName:"Billing Address State",description:"State or province code, e.g. CA.",required:!1}),billAddrPostalCode:h.ShortText({displayName:"Billing Address Postal Code",required:!1}),vendor1099:h.Checkbox({displayName:"Track for 1099",description:"Whether this vendor should be tracked for 1099 reporting.",required:!1,defaultValue:!1}),taxIdentifier:h.ShortText({displayName:"Tax ID (SSN or EIN)",required:!1}),acctNum:h.ShortText({displayName:"Account Number",description:"Your own reference/account number for this vendor (external ID). Shown on checks.",required:!1}),termRef:h.Dropdown({auth:R,displayName:"Payment Term",description:"Optional. The default payment term for bills from this vendor.",required:!1,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,u=await W({accessToken:t,companyId:n,query:"SELECT Id, Name FROM Term MAXRESULTS 1000"});return u.Fault?{disabled:!0,placeholder:"Unable to load payment terms",options:[]}:{disabled:!1,options:(u.QueryResponse?.Term??[]).map(a=>({label:a.Name,value:a.Id}))}},"options")})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=e.propsValue,o=n.billAddrLine1||n.billAddrCity||n.billAddrState||n.billAddrPostalCode?{...n.billAddrLine1&&{Line1:n.billAddrLine1},...n.billAddrCity&&{City:n.billAddrCity},...n.billAddrState&&{CountrySubDivisionCode:n.billAddrState},...n.billAddrPostalCode&&{PostalCode:n.billAddrPostalCode}}:void 0,u={DisplayName:n.displayName,...n.companyName&&{CompanyName:n.companyName},...n.email&&{PrimaryEmailAddr:{Address:n.email}},...n.phone&&{PrimaryPhone:{FreeFormNumber:n.phone}},...o&&{BillAddr:o},...n.vendor1099!==void 0&&{Vendor1099:n.vendor1099},...n.taxIdentifier&&{TaxIdentifier:n.taxIdentifier},...n.acctNum&&{AcctNum:n.acctNum},...n.termRef&&{TermRef:{value:n.termRef}}},c=await ge({accessToken:t,companyId:r,method:"POST",resourceUri:"/vendor",body:u});if(c.Fault)throw new Error(`QuickBooks API Error creating vendor: ${c.Fault.Error.map(a=>a.Message).join(", ")} - Detail: ${c.Fault.Error.map(a=>a.Detail).join(", ")}`);return c.Vendor}});var Bu=re({auth:R,name:"find_vendor",displayName:"Find Vendor",description:"Search for a vendor in QuickBooks by display name, email address, or account number.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks vendor by exact display name, email address, or account number (external ID), returning the first match. Use to resolve a vendor to its full record (including its Id) before referencing it elsewhere; the match is exact, not fuzzy. Read-only and idempotent.",idempotent:!0},props:{searchBy:h.StaticDropdown({displayName:"Search By",required:!1,defaultValue:"DisplayName",options:{options:[{label:"Vendor Name",value:"DisplayName"},{label:"Email Address",value:"Email"},{label:"Account Number",value:"AcctNum"}]}}),search_term:h.ShortText({displayName:"Search Value",description:"The exact vendor display name, email address, or account number to search for, depending on Search By.",required:!0})},async run(e){let{searchBy:t,search_term:r}=e.propsValue,n=e.auth.props?.companyId;if(!n)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let o=e.auth.access_token,u=t==="Email"?await Um({accessToken:o,companyId:n,email:r}):await Mm({accessToken:o,companyId:n,field:t==="AcctNum"?"AcctNum":"DisplayName",value:r});return u?{found:!0,result:u}:{found:!1,result:{}}}});async function Mm({accessToken:e,companyId:t,field:r,value:n}){let o=`SELECT * FROM Vendor WHERE ${r} = '${n.replace(/'/g,"\\'")}' MAXRESULTS 1`;return(await W({accessToken:e,companyId:t,query:o})).QueryResponse?.Vendor?.[0]}i(Mm,"findVendorByField");async function Um({accessToken:e,companyId:t,email:r}){try{let u=r.replace(/'/g,"\\'"),c=await W({accessToken:e,companyId:t,query:`SELECT * FROM Vendor WHERE PrimaryEmailAddr = '${u}' MAXRESULTS 1`});if(!c.Fault){let a=c.QueryResponse?.Vendor?.[0];if(a)return a}}catch{}return((await W({accessToken:e,companyId:t,query:"SELECT * FROM Vendor WHERE Active = true MAXRESULTS 1000"})).QueryResponse?.Vendor??[]).find(u=>u.PrimaryEmailAddr?.Address?.toLowerCase()===r.toLowerCase())}i(Um,"findVendorByEmail");var Fu=re({auth:R,name:"find_account",displayName:"Find Account",description:"List or search the chart of accounts to get an account Id (e.g. an expense account for a bill).",audience:"both",aiMetadata:{description:"List QuickBooks chart-of-accounts entries to resolve an account name to its Id. Optionally filter by a name substring and/or account type (e.g. Expense, Bank, Accounts Payable). Use this to find the expense-account Id required by Create Bill / Create Expense line items. Read-only and idempotent.",idempotent:!0},props:{search_term:h.ShortText({displayName:"Account Name Contains",description:"Optional. Filter accounts whose name contains this text.",required:!1}),accountType:h.StaticDropdown({displayName:"Account Type",description:"Optional. Filter by account type.",required:!1,options:{options:[{label:"Bank",value:"Bank"},{label:"Accounts Receivable",value:"Accounts Receivable"},{label:"Other Current Asset",value:"Other Current Asset"},{label:"Fixed Asset",value:"Fixed Asset"},{label:"Other Asset",value:"Other Asset"},{label:"Accounts Payable",value:"Accounts Payable"},{label:"Credit Card",value:"Credit Card"},{label:"Other Current Liability",value:"Other Current Liability"},{label:"Long Term Liability",value:"Long Term Liability"},{label:"Equity",value:"Equity"},{label:"Income",value:"Income"},{label:"Cost of Goods Sold",value:"Cost of Goods Sold"},{label:"Expense",value:"Expense"},{label:"Other Income",value:"Other Income"},{label:"Other Expense",value:"Other Expense"}]}})},async run(e){let{search_term:t,accountType:r}=e.propsValue,n=e.auth.props?.companyId;if(!n)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let o=["Active = true"];t&&o.push(`Name LIKE '%${t.replace(/'/g,"\\'")}%'`),r&&o.push(`AccountType = '${r}'`);let u=`SELECT * FROM Account WHERE ${o.join(" AND ")} MAXRESULTS 1000`,a=(await W({accessToken:e.auth.access_token,companyId:n,query:u}))?.QueryResponse?.Account??[];return{found:a.length>0,result:a}}});var Vu=re({auth:R,name:"record_payment",displayName:"Record Payment",description:"Records a customer payment in QuickBooks, optionally applying it to invoices.",audience:"both",aiMetadata:{description:"Record a payment received from a customer for a given total amount. Optionally apply the payment to one or more specific invoices by their transaction Id, set the deposit-to account, payment date, and reference number. If no invoices are specified, QuickBooks leaves the amount unapplied. Not idempotent: each call creates a new payment, so guard against duplicates.",idempotent:!1},props:{customerRef:h.Dropdown({auth:R,displayName:"Customer",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,u=await W({accessToken:t,companyId:n,query:"SELECT Id, DisplayName FROM Customer STARTPOSITION 1 MAXRESULTS 1000"});if(u.Fault)throw new Error(`QuickBooks API Error: ${u.Fault.Error.map(a=>a.Message).join(", ")}`);return{disabled:!1,options:(u.QueryResponse?.Customer??[]).map(a=>({label:a.DisplayName,value:a.Id}))}},"options")}),totalAmount:h.Number({displayName:"Total Amount",description:"The total amount of the payment received.",required:!0}),lineItems:h.Array({displayName:"Apply to Invoices",description:"Optional. Apply this payment to specific invoices. Leave empty to keep the amount unapplied.",required:!1,properties:{invoiceId:h.ShortText({displayName:"Invoice ID",description:"The transaction Id of the invoice to apply the payment to.",required:!0}),amount:h.Number({displayName:"Amount Applied",description:"The amount of this payment to apply to the invoice.",required:!0})}}),depositToAccountId:h.ShortText({displayName:"Deposit To Account ID",description:"Optional. The account to deposit the payment into. Defaults to Undeposited Funds if empty.",required:!1}),txnDate:h.DateTime({displayName:"Payment Date",description:"The date the payment was received. Defaults to today if empty.",required:!1}),paymentRefNum:h.ShortText({displayName:"Reference Number",description:"Optional reference number for the payment (e.g. check number).",required:!1}),privateNote:h.LongText({displayName:"Memo (Private Note)",description:"Internal note about the payment.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=e.propsValue,o=(n.lineItems??[]).map(a=>({Amount:a.amount,LinkedTxn:[{TxnId:a.invoiceId,TxnType:"Invoice"}]})),u={CustomerRef:{value:n.customerRef},TotalAmt:n.totalAmount,...o.length>0&&{Line:o},...n.depositToAccountId&&{DepositToAccountRef:{value:n.depositToAccountId}},...n.txnDate&&{TxnDate:n.txnDate.split("T")[0]},...n.paymentRefNum&&{PaymentRefNum:n.paymentRefNum},...n.privateNote&&{PrivateNote:n.privateNote}},c=await ge({accessToken:t,companyId:r,method:"POST",resourceUri:"/payment",body:u});if(c.Fault)throw new Error(`QuickBooks API Error recording payment: ${c.Fault.Error.map(a=>a.Message).join(", ")} - Detail: ${c.Fault.Error.map(a=>a.Detail).join(", ")}`);return c.Payment}});var Zu=re({auth:R,name:"record_bill_payment",displayName:"Record Bill Payment (AP)",description:"Pays one or more vendor bills in QuickBooks, in full or in part, by check or credit card.",audience:"both",aiMetadata:{description:"Record a payment made to a vendor to settle one or more outstanding bills, by check or credit card. Each bill line takes the amount applied so partial payments and paying several bills in a single payment are both supported. Not idempotent: each call creates a new bill payment, so guard against duplicates.",idempotent:!1},props:{vendorRef:h.Dropdown({auth:R,displayName:"Vendor",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,u=await W({accessToken:t,companyId:n,query:"SELECT Id, DisplayName FROM Vendor STARTPOSITION 1 MAXRESULTS 1000"});return u.Fault?{disabled:!0,placeholder:"Unable to load vendors",options:[]}:{disabled:!1,options:(u.QueryResponse?.Vendor??[]).map(a=>({label:a.DisplayName,value:a.Id}))}},"options")}),payType:h.StaticDropdown({displayName:"Pay With",required:!0,options:{options:[{label:"Check",value:"Check"},{label:"Credit Card",value:"CreditCard"}]},defaultValue:"Check"}),payFromAccountRef:h.Dropdown({auth:R,displayName:"Pay From Account",description:"The checking/savings account (for Check) or credit card account (for Credit Card) the payment is made from.",required:!0,refreshers:["payType"],options:i(async({auth:e,payType:t})=>{if(!e||!t)return{disabled:!0,placeholder:"Select a pay-with method first",options:[]};let{access_token:r,props:n}=e,o=n?.companyId,a=await W({accessToken:r,companyId:o,query:`SELECT Id, Name, AccountType FROM Account WHERE AccountType = '${t==="CreditCard"?"Credit Card":"Bank"}' AND Active = true MAXRESULTS 1000`});return a.Fault?{disabled:!0,placeholder:"Unable to load accounts",options:[]}:{disabled:!1,options:(a.QueryResponse?.Account??[]).map(f=>({label:f.Name,value:f.Id}))}},"options")}),billLines:h.Array({displayName:"Bills To Pay",description:"One or more bills this payment applies to. Amounts can be less than the bill balance for a partial payment.",required:!0,properties:{billId:h.ShortText({displayName:"Bill ID",description:"The transaction Id of the bill being paid. Use the bill Id returned by Create Bill or a QuickBooks report.",required:!0}),amount:h.Number({displayName:"Amount To Apply",required:!0})}}),txnDate:h.DateTime({displayName:"Payment Date",description:"Defaults to today if empty.",required:!1}),docNumber:h.ShortText({displayName:"Reference / Check Number",required:!1}),privateNote:h.LongText({displayName:"Memo (Private Note)",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=e.propsValue,o=n.billLines;if(o.length===0)throw new Error("At least one bill is required.");let u=o.map(T=>({Amount:T.amount,LinkedTxn:[{TxnId:T.billId,TxnType:"Bill"}]})),c=u.reduce((T,b)=>T+b.Amount,0),a=n.payType,m={value:n.payFromAccountRef},f={VendorRef:{value:n.vendorRef},PayType:a,TotalAmt:c,Line:u,...a==="Check"&&{CheckPayment:{BankAccountRef:m}},...a==="CreditCard"&&{CreditCardPayment:{CCAccountRef:m}},...n.txnDate&&{TxnDate:n.txnDate.split("T")[0]},...n.docNumber&&{DocNumber:n.docNumber},...n.privateNote&&{PrivateNote:n.privateNote}},x=await ge({accessToken:t,companyId:r,method:"POST",resourceUri:"/billpayment",body:f});if(x.Fault)throw new Error(`QuickBooks API Error recording bill payment: ${x.Fault.Error.map(T=>T.Message).join(", ")} - Detail: ${x.Fault.Error.map(T=>T.Detail).join(", ")}`);return x.BillPayment}});var qu=re({auth:R,name:"read_aging_report",displayName:"Read AR/AP Aging",description:"Reads an accounts receivable or accounts payable aging report from QuickBooks.",audience:"both",aiMetadata:{description:'Fetch an aging report showing outstanding receivables (money owed to the company) or payables (money the company owes), bucketed by how overdue they are. Choose the report type, optionally set the as-of date, the number of days per aging bucket, the number of buckets, the aging method, and a minimum past-due days filter. Returns both the raw QuickBooks report and a flattened "rows" array (one object per report line, columns as keys) ready for reconciliation or spreadsheet export. Read-only and idempotent.',idempotent:!0},props:{reportType:h.StaticDropdown({displayName:"Report",required:!0,options:{options:[{label:"A/R Aging Summary",value:"AgedReceivables"},{label:"A/R Aging Detail",value:"AgedReceivableDetail"},{label:"A/P Aging Summary",value:"AgedPayables"},{label:"A/P Aging Detail",value:"AgedPayableDetail"}]},defaultValue:"AgedReceivables"}),reportDate:h.DateTime({displayName:"As Of Date",description:"The date to age balances against. Defaults to today if empty.",required:!1}),agingPeriod:h.Number({displayName:"Days Per Period",description:"Number of days in each aging bucket (e.g. 30).",required:!1}),numPeriods:h.Number({displayName:"Number of Periods",description:"How many aging buckets to include.",required:!1}),agingMethod:h.StaticDropdown({displayName:"Aging Method",description:"Whether buckets are calculated from the report date or from each transaction's due date.",required:!1,options:{options:[{label:"Report Date",value:"Report_Date"},{label:"Current",value:"Current"}]}}),pastDue:h.Number({displayName:"Minimum Days Past Due",description:"Only include transactions overdue by at least this many days.",required:!1})},async run(e){let{reportType:t,reportDate:r,agingPeriod:n,numPeriods:o,agingMethod:u,pastDue:c}=e.propsValue,a=e.auth.props?.companyId;if(!a)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let m=await ge({accessToken:e.auth.access_token,companyId:a,method:"GET",resourceUri:`/reports/${t}`,query:{...r&&{report_date:r.split("T")[0]},...n!=null&&{aging_period:String(n)},...o!=null&&{num_periods:String(o)},...u&&{aging_method:u},...c!=null&&{past_due:String(c)}}});if(m.Fault)throw new Error(`QuickBooks API Error fetching report: ${m.Fault.Error.map(f=>f.Message).join(", ")}`);return{...m,rows:jm(m)}}});function Lm(e,t){return e?e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||`column_${t}`:`column_${t}`}i(Lm,"toColumnKey");function jm(e){let r=(e.Columns?.Column??[]).map((c,a)=>Lm(c.ColTitle??c.ColType,a)),n=[],o=i((c,a)=>{if(!c||c.length===0)return;let m={row_type:a};c.forEach((f,x)=>{let T=r[x]??`column_${x}`;m[T]=f.value??"",f.id&&(m[`${T}_id`]=f.id)}),n.push(m)},"pushColData"),u=i(c=>{if(c)for(let a of c)o(a.ColData,"Data"),u(a.Rows?.Row),o(a.Summary?.ColData,"Summary")},"walk");return u(e.Rows?.Row),n}i(jm,"flattenAgingReportRows");var Kn=Ae(nt()),Or={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=t===0?"SELECT * FROM Invoice ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Invoice WHERE Metadata.CreateTime >= '${(0,Kn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W({accessToken:r,companyId:n,query:o})).QueryResponse?.Invoice??[]).map(a=>({epochMilliSeconds:(0,Kn.default)(a.MetaData?.CreateTime).valueOf(),data:a}))}},Hu=he({auth:R,name:"new_invoice",displayName:"New Invoice",description:"Triggers when an invoice is created .",aiMetadata:{description:"Fires when a new invoice is created in the connected QuickBooks company, emitting the newly created invoice record. Use to react to billing being issued to a customer."},props:{},type:"POLLING",async onEnable(e){await H.onEnable(Or,e)},async onDisable(e){await H.onDisable(Or,e)},async test(e){return await H.test(Or,e)},async run(e){return await H.poll(Or,e)},sampleData:void 0});var Jn=Ae(nt()),Nr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=t===0?"SELECT * FROM Purchase ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Purchase WHERE Metadata.CreateTime >= '${(0,Jn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W({accessToken:r,companyId:n,query:o})).QueryResponse?.Purchase??[]).map(a=>({epochMilliSeconds:(0,Jn.default)(a.MetaData?.CreateTime).valueOf(),data:a}))}},Wu=he({auth:R,name:"new_expense",displayName:"New Expense (Purchase)",description:"Triggers when an Expense (Purchase) is created.",aiMetadata:{description:"Fires when a new expense (purchase transaction) is created in the connected QuickBooks company, emitting the newly created purchase record. Use to react to money being spent or a bill being recorded."},props:{},type:"POLLING",async onEnable(e){await H.onEnable(Nr,e)},async onDisable(e){await H.onDisable(Nr,e)},async test(e){return await H.test(Nr,e)},async run(e){return await H.poll(Nr,e)},sampleData:void 0});var Xn=Ae(nt()),Cr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=t===0?"SELECT * FROM Customer ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Customer WHERE Metadata.CreateTime >= '${(0,Xn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W({accessToken:r,companyId:n,query:o})).QueryResponse?.Customer??[]).map(a=>({epochMilliSeconds:(0,Xn.default)(a.MetaData?.CreateTime).valueOf(),data:a}))}},Gu=he({auth:R,name:"new_customer",displayName:"New Customer",description:"Triggers when a new customer is created.",aiMetadata:{description:"Fires when a new customer is created in the connected QuickBooks company, emitting the newly created customer record. Use to react to a new customer being added to the books."},props:{},type:"POLLING",async onEnable(e){await H.onEnable(Cr,e)},async onDisable(e){await H.onDisable(Cr,e)},async test(e){return await H.test(Cr,e)},async run(e){return await H.poll(Cr,e)},sampleData:void 0});var Yn=Ae(nt()),Mr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=t===0?"SELECT * FROM Deposit ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Deposit WHERE Metadata.CreateTime >= '${(0,Yn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W({accessToken:r,companyId:n,query:o})).QueryResponse?.Deposit??[]).map(a=>({epochMilliSeconds:(0,Yn.default)(a.MetaData?.CreateTime).valueOf(),data:a}))}},Qu=he({auth:R,name:"new_deposit",displayName:"New Deposit",description:"Triggers when a Deposit is created.",aiMetadata:{description:"Fires when a new deposit is created in the connected QuickBooks company, emitting the newly created deposit record. Use to react to funds being deposited into an account."},props:{},type:"POLLING",async onEnable(e){await H.onEnable(Mr,e)},async onDisable(e){await H.onDisable(Mr,e)},async test(e){return await H.test(Mr,e)},async run(e){return await H.poll(Mr,e)},sampleData:void 0});var eo=Ae(nt());var Ur={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=t===0?"SELECT * FROM Transfer ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Transfer WHERE Metadata.CreateTime >= '${(0,eo.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W({accessToken:r,companyId:n,query:o})).QueryResponse?.Transfer??[]).map(a=>({epochMilliSeconds:(0,eo.default)(a.MetaData?.CreateTime).valueOf(),data:a}))}},Ku=he({auth:R,name:"new_transfer",displayName:"New Transfer",description:"Triggers when a Transfer is created.",aiMetadata:{description:"Fires when a new transfer is created in the connected QuickBooks company, emitting the newly created transfer record. Use to react to funds being moved between two accounts."},props:{},type:"POLLING",async onEnable(e){await H.onEnable(Ur,e)},async onDisable(e){await H.onDisable(Ur,e)},async test(e){return await H.test(Ur,e)},async run(e){return await H.poll(Ur,e)},sampleData:void 0});var xt=Ae(nt());function Pt({entity:e,newOnly:t}){return{strategy:0,async items({auth:r,lastFetchEpochMS:n}){let{access_token:o}=r,u=r.props?.companyId;return(await Fm({accessToken:o,companyId:u,entity:e,lastFetchEpochMS:n,newOnly:t})).map(a=>({epochMilliSeconds:(0,xt.default)(a.MetaData?.LastUpdatedTime??a.MetaData?.CreateTime).valueOf(),data:a}))}}}i(Pt,"createQuickbooksCdcPolling");var Bm=720*60*60*1e3;async function Fm({accessToken:e,companyId:t,entity:r,lastFetchEpochMS:n,newOnly:o}){let a=(n!==0&&Date.now()-n<=Bm?await Vm({accessToken:e,companyId:t,entity:r,lastFetchEpochMS:n}):await qm({accessToken:e,companyId:t,entity:r,lastFetchEpochMS:n,isInitialFetch:n===0})).filter(f=>f.status!=="Deleted");if(!o)return a;let m=(0,xt.default)(n);return a.filter(f=>f.MetaData?.CreateTime&&(0,xt.default)(f.MetaData.CreateTime).isAfter(m))}i(Fm,"fetchQuickbooksChanges");async function Vm({accessToken:e,companyId:t,entity:r,lastFetchEpochMS:n}){return((await ge({accessToken:e,companyId:t,method:"GET",resourceUri:"/cdc",query:{entities:r,changedSince:(0,xt.default)(n).toISOString()}})).CDCResponse?.[0]?.QueryResponse??[]).flatMap(c=>c[r]??[])}i(Vm,"fetchViaCdc");var to=1e3,Zm=50;async function qm({accessToken:e,companyId:t,entity:r,lastFetchEpochMS:n,isInitialFetch:o}){if(o)return(await W({accessToken:e,companyId:t,query:`SELECT * FROM ${r} ORDERBY Metadata.LastUpdatedTime DESC MAXRESULTS 10`})).QueryResponse?.[r]??[];let u=[];for(let c=0;c<Zm;c++){let a=c*to+1,f=(await W({accessToken:e,companyId:t,query:`SELECT * FROM ${r} WHERE Metadata.LastUpdatedTime >= '${(0,xt.default)(n).toISOString()}' ORDERBY Metadata.LastUpdatedTime ASC STARTPOSITION ${a} MAXRESULTS ${to}`})).QueryResponse?.[r]??[];if(u.push(...f),f.length<to)break}return u}i(qm,"fetchViaFullSelect");var Lr=Pt({entity:"Invoice",newOnly:!1}),Ju=he({auth:R,name:"new_or_updated_invoice",displayName:"New or Updated Invoice",description:"Triggers when an invoice is created or updated in QuickBooks.",aiMetadata:{description:"Fires when an invoice is created or changed (e.g. line items, balance, or status updated) in the connected QuickBooks company, emitting the invoice record. Use to keep an external system in sync with invoice changes, not just creation."},props:{},type:"POLLING",async onEnable(e){await H.onEnable(Lr,e)},async onDisable(e){await H.onDisable(Lr,e)},async test(e){return await H.test(Lr,e)},async run(e){return await H.poll(Lr,e)},sampleData:void 0});var jr=Pt({entity:"Payment",newOnly:!0}),Xu=he({auth:R,name:"payment_received",displayName:"Payment Received",description:"Triggers when a new customer payment is recorded in QuickBooks.",aiMetadata:{description:"Fires when a new payment from a customer is recorded in the connected QuickBooks company, emitting the payment record. Use to react to money coming in, e.g. to send a receipt or update a CRM."},props:{},type:"POLLING",async onEnable(e){await H.onEnable(jr,e)},async onDisable(e){await H.onDisable(jr,e)},async test(e){return await H.test(jr,e)},async run(e){return await H.poll(jr,e)},sampleData:void 0});var Br=Pt({entity:"Bill",newOnly:!0}),Yu=he({auth:R,name:"new_bill",displayName:"New Bill",description:"Triggers when a new bill (accounts payable) is created in QuickBooks.",aiMetadata:{description:"Fires when a new vendor bill is created in the connected QuickBooks company, emitting the bill record. Use to react to new accounts-payable obligations, e.g. to route bills for approval."},props:{},type:"POLLING",async onEnable(e){await H.onEnable(Br,e)},async onDisable(e){await H.onDisable(Br,e)},async test(e){return await H.test(Br,e)},async run(e){return await H.poll(Br,e)},sampleData:void 0});var Hm=ha({displayName:"Quickbooks Online",auth:R,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/quickbooks.png",authors:["onyedikachi-david","sanket-a11y"],actions:[Du,Nu,Cu,Mu,Uu,Lu,ju,Bu,Fu,Vu,Zu,qu,Ou({auth:R,baseUrl:i(e=>{let r=e.props?.companyId;return Rr.getApiUrl(r)},"baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[Hu,Wu,Gu,Qu,Ku,Ju,Xu,Yu]});0&&(module.exports={quickbooks});
|
|
4
4
|
/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
mime-types/index.js:
|