@activepieces/piece-microsoft-outlook 0.5.0 → 0.5.1
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 +2 -4
- package/src/i18n/translation.json +10 -1
- package/src/index.js +6 -6
package/src/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var qp=Object.create;var Zt=Object.defineProperty;var Gp=Object.getOwnPropertyDescriptor;var Wp=Object.getOwnPropertyNames;var Kp=Object.getPrototypeOf,Jp=Object.prototype.hasOwnProperty;var a=(e,t)=>Zt(e,"name",{value:t,configurable:!0});var Xp=(e,t)=>()=>(e&&(t=e(e=0)),t);var b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),io=(e,t)=>{for(var r in t)Zt(e,r,{get:t[r],enumerable:!0})},Vi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wp(t))!Jp.call(e,o)&&o!==r&&Zt(e,o,{get:()=>t[o],enumerable:!(n=Gp(t,o))||n.enumerable});return e};var ze=(e,t,r)=>(r=e!=null?qp(Kp(e)):{},Vi(t||!e||!e.__esModule?Zt(r,"default",{value:e,enumerable:!0}):r,e)),oe=e=>Vi(Zt({},"__esModule",{value:!0}),e);var as=b((is,Fr)=>{(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"),i="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${i})?$`,"i")};function p(l,m){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let _=0,h=-1,x=(l.match(u.zoneIndex)||[])[0],T,V;for(x&&(x=x.substring(1),l=l.replace(/%.+$/,""));(h=l.indexOf(":",h+1))>=0;)_++;if(l.substr(0,2)==="::"&&_--,l.substr(-2,2)==="::"&&_--,_>m)return null;for(V=m-_,T=":";V--;)T+="0:";return l=l.replace("::",T),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),m=function(){let de=l.split(":"),xe=[];for(let De=0;De<de.length;De++)xe.push(parseInt(de[De],16));return xe}(),{parts:m,zoneId:x}}a(p,"expandIPv6");function d(l,m,_,h){if(l.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,T;for(;h>0;){if(T=_-h,T<0&&(T=0),l[x]>>T!==m[x]>>T)return!1;h-=_,x+=1}return!0}a(d,"matchCIDR");function f(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)}a(f,"parseIntAuto");function v(l,m){for(;l.length<m;)l=`0${l}`;return l}a(v,"padPart");let y={};y.IPv4=function(){function l(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let _,h;for(_=0;_<m.length;_++)if(h=m[_],!(0<=h&&h<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return a(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(m,_){let h;if(_===void 0&&(h=m,m=h[0],_=h[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return d(this.octets,m.octets,8,_)},l.prototype.prefixLengthFromSubnetMask=function(){let m=0,_=!1,h={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,T,V;for(x=3;x>=0;x-=1)if(T=this.octets[x],T in h){if(V=h[T],_&&V!==0)return null;V!==8&&(_=!0),m+=V}else return null;return 32-m},l.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l}(),y.IPv4.broadcastAddressFromCIDR=function(l){try{let m=this.parseCIDR(l),_=m[0].toByteArray(),h=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],T=0;for(;T<4;)x.push(parseInt(_[T],10)|parseInt(h[T],10)^255),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(l){return this.parser(l)!==null},y.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(l){return!!(y.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(l){let m=l.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(l)||!m?!1:y.IPv4.isValidFourPartDecimal(m[1])},y.IPv4.networkAddressFromCIDR=function(l){let m,_,h,x,T;try{for(m=this.parseCIDR(l),h=m[0].toByteArray(),T=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],_=0;_<4;)x.push(parseInt(h[_],10)&parseInt(T[_],10)),_++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(l){let m=this.parser(l);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},y.IPv4.parseCIDR=function(l){let m;if(m=l.match(/^(.+)\/(\d+)$/)){let _=parseInt(m[2]);if(_>=0&&_<=32){let h=[this.parse(m[1]),_];return Object.defineProperty(h,"toString",{value:a(function(){return this.join("/")},"value")}),h}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},y.IPv4.parser=function(l){let m,_,h;if(m=l.match(r.fourOctet))return function(){let x=m.slice(1,6),T=[];for(let V=0;V<x.length;V++)_=x[V],T.push(f(_));return T}();if(m=l.match(r.longValue)){if(h=f(m[1]),h>4294967295||h<0)throw new Error("ipaddr: address outside defined range");return function(){let x=[],T;for(T=0;T<=24;T+=8)x.push(h>>T&255);return x}().reverse()}else return(m=l.match(r.twoOctet))?function(){let x=m.slice(1,4),T=[];if(h=f(x[1]),h>16777215||h<0)throw new Error("ipaddr: address outside defined range");return T.push(f(x[0])),T.push(h>>16&255),T.push(h>>8&255),T.push(h&255),T}():(m=l.match(r.threeOctet))?function(){let x=m.slice(1,5),T=[];if(h=f(x[2]),h>65535||h<0)throw new Error("ipaddr: address outside defined range");return T.push(f(x[0])),T.push(f(x[1])),T.push(h>>8&255),T.push(h&255),T}():null},y.IPv4.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let m=[0,0,0,0],_=0,h=Math.floor(l/8);for(;_<h;)m[_]=255,_++;return h<4&&(m[h]=Math.pow(2,l%8)-1<<8-l%8),new this(m)},y.IPv6=function(){function l(m,_){let h,x;if(m.length===16)for(this.parts=[],h=0;h<=14;h+=2)this.parts.push(m[h]<<8|m[h+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(h=0;h<this.parts.length;h++)if(x=this.parts[h],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");_&&(this.zoneId=_)}return a(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(m,_){let h;if(_===void 0&&(h=m,m=h[0],_=h[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return d(this.parts,m.parts,16,_)},l.prototype.prefixLengthFromSubnetMask=function(){let m=0,_=!1,h={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,T;for(let V=7;V>=0;V-=1)if(x=this.parts[V],x in h){if(T=h[x],_&&T!==0)return null;T!==16&&(_=!0),m+=T}else return null;return 128-m},l.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let m,_=[],h=this.parts;for(let x=0;x<h.length;x++)m=h[x],_.push(m>>8),_.push(m&255);return _},l.prototype.toFixedLengthString=function(){let m=function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(v(this.parts[x].toString(16),4));return h}.call(this).join(":"),_="";return this.zoneId&&(_=`%${this.zoneId}`),m+_},l.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),_=m[0],h=m[1];return new y.IPv4([_>>8,_&255,h>>8,h&255])},l.prototype.toNormalizedString=function(){let m=function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(this.parts[x].toString(16));return h}.call(this).join(":"),_="";return this.zoneId&&(_=`%${this.zoneId}`),m+_},l.prototype.toRFC5952String=function(){let m=/((^|:)(0(:|$)){2,})/g,_=this.toNormalizedString(),h=0,x=-1,T;for(;T=m.exec(_);)T[0].length>x&&(h=T.index,x=T[0].length);return x<0?_:`${_.substring(0,h)}::${_.substring(h+x)}`},l.prototype.toString=function(){return this.toRFC5952String()},l}(),y.IPv6.broadcastAddressFromCIDR=function(l){try{let m=this.parseCIDR(l),_=m[0].toByteArray(),h=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],T=0;for(;T<16;)x.push(parseInt(_[T],10)|parseInt(h[T],10)^255),T++;return new this(x)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},y.IPv6.isIPv6=function(l){return this.parser(l)!==null},y.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let m=this.parser(l);return new this(m.parts,m.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(l){let m,_,h,x,T;try{for(m=this.parseCIDR(l),h=m[0].toByteArray(),T=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],_=0;_<16;)x.push(parseInt(h[_],10)&parseInt(T[_],10)),_++;return new this(x)}catch(V){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${V})`)}},y.IPv6.parse=function(l){let m=this.parser(l);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},y.IPv6.parseCIDR=function(l){let m,_,h;if((_=l.match(/^(.+)\/(\d+)$/))&&(m=parseInt(_[2]),m>=0&&m<=128))return h=[this.parse(_[1]),m],Object.defineProperty(h,"toString",{value:a(function(){return this.join("/")},"value")}),h;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},y.IPv6.parser=function(l){let m,_,h,x,T,V;if(h=l.match(u.deprecatedTransitional))return this.parser(`::ffff:${h[1]}`);if(u.native.test(l))return p(l,8);if((h=l.match(u.transitional))&&(V=h[6]||"",m=h[1],h[1].endsWith("::")||(m=m.slice(0,-1)),m=p(m+V,6),m.parts)){for(T=[parseInt(h[2]),parseInt(h[3]),parseInt(h[4]),parseInt(h[5])],_=0;_<T.length;_++)if(x=T[_],!(0<=x&&x<=255))return null;return m.parts.push(T[0]<<8|T[1]),m.parts.push(T[2]<<8|T[3]),{parts:m.parts,zoneId:m.zoneId}}return null},y.IPv6.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>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],_=0,h=Math.floor(l/8);for(;_<h;)m[_]=255,_++;return h<16&&(m[h]=Math.pow(2,l%8)-1<<8-l%8),new this(m)},y.fromByteArray=function(l){let m=l.length;if(m===4)return new y.IPv4(l);if(m===16)return new y.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(l){return y.IPv6.isValid(l)||y.IPv4.isValid(l)},y.isValidCIDR=function(l){return y.IPv6.isValidCIDR(l)||y.IPv4.isValidCIDR(l)},y.parse=function(l){if(y.IPv6.isValid(l))return y.IPv6.parse(l);if(y.IPv4.isValid(l))return y.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(l){try{return y.IPv6.parseCIDR(l)}catch{try{return y.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(l){let m=this.parse(l);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},y.subnetMatch=function(l,m,_){let h,x,T,V;_==null&&(_="unicast");for(x in m)if(Object.prototype.hasOwnProperty.call(m,x)){for(T=m[x],T[0]&&!(T[0]instanceof Array)&&(T=[T]),h=0;h<T.length;h++)if(V=T[h],l.kind()===V[0].kind()&&l.match.apply(l,V))return x}return _},typeof Fr<"u"&&Fr.exports?Fr.exports=y:e.ipaddr=y})(is)});var ru=b((ED,tu)=>{var eu=require("stream").Stream,Sm=require("util");tu.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=[]}a(ke,"DelayedStream");Sm.inherits(ke,eu);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:a(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=eu.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 au=b((AD,iu)=>{var $m=require("util"),ou=require("stream").Stream,nu=ru();iu.exports=pe;function pe(){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}a(pe,"CombinedStream");$m.inherits(pe,ou);pe.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};pe.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};pe.prototype.append=function(e){var t=pe.isStreamLike(e);if(t){if(!(e instanceof nu)){var r=nu.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};pe.prototype.pipe=function(e,t){return ou.prototype.pipe.call(this,e,t),this.resume(),e};pe.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}};pe.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=pe.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};pe.prototype._pipeNext=function(e){this._currentStream=e;var t=pe.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()};pe.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};pe.prototype.write=function(e){this.emit("data",e)};pe.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};pe.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")};pe.prototype.end=function(){this._reset(),this.emit("end")};pe.prototype.destroy=function(){this._reset(),this.emit("close")};pe.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};pe.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};pe.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)};pe.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var uu=b(($D,su)=>{"use strict";su.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 pu=b(Te=>{"use strict";var Gr=uu(),wm=require("path").extname,cu=/^\s*([^;\s]*)(?:;|\s|$)/,Om=/^text\//i;Te.charset=lu;Te.charsets={lookup:lu};Te.contentType=zm;Te.extension=Rm;Te.extensions=Object.create(null);Te.lookup=km;Te.types=Object.create(null);Dm(Te.extensions,Te.types);function lu(e){if(!e||typeof e!="string")return!1;var t=cu.exec(e),r=t&&Gr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Om.test(t[1])?"UTF-8":!1}a(lu,"charset");function zm(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}a(zm,"contentType");function Rm(e){if(!e||typeof e!="string")return!1;var t=cu.exec(e),r=t&&Te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(Rm,"extension");function km(e){if(!e||typeof e!="string")return!1;var t=wm("x."+e).toLowerCase().substr(1);return t&&Te.types[t]||!1}a(km,"lookup");function Dm(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Gr).forEach(a(function(o){var i=Gr[o],s=i.extensions;if(!(!s||!s.length)){e[o]=s;for(var u=0;u<s.length;u++){var p=s[u];if(t[p]){var d=r.indexOf(Gr[t[p]].source),f=r.indexOf(i.source);if(t[p]!=="application/octet-stream"&&(d>f||d===f&&t[p].substr(0,12)==="application/"))continue}t[p]=o}}},"forEachMimeType"))}a(Dm,"populateMaps")});var fu=b((zD,du)=>{du.exports=Cm;function Cm(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(Cm,"defer")});var Wo=b((kD,gu)=>{var mu=fu();gu.exports=Nm;function Nm(e){var t=!1;return mu(function(){t=!0}),a(function(n,o){t?e(n,o):mu(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(Nm,"async")});var Ko=b((CD,hu)=>{hu.exports=Mm;function Mm(e){Object.keys(e.jobs).forEach(Um.bind(e)),e.jobs={}}a(Mm,"abort");function Um(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(Um,"clean")});var Jo=b((MD,vu)=>{var yu=Wo(),Lm=Ko();vu.exports=jm;function jm(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Fm(t,o,e[o],function(i,s){o in r.jobs&&(delete r.jobs[o],i?Lm(r):r.results[o]=s,n(i,r.results))})}a(jm,"iterate");function Fm(e,t,r,n){var o;return e.length==2?o=e(r,yu(n)):o=e(r,t,yu(n)),o}a(Fm,"runJob")});var Xo=b((LD,_u)=>{_u.exports=Bm;function Bm(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,i){return t(e[o],e[i])}),n}a(Bm,"state")});var Yo=b((FD,xu)=>{var Vm=Ko(),Hm=Wo();xu.exports=Zm;function Zm(e){Object.keys(this.jobs).length&&(this.index=this.size,Vm(this),Hm(e)(null,this.results))}a(Zm,"terminator")});var bu=b((VD,Pu)=>{var qm=Jo(),Gm=Xo(),Wm=Yo();Pu.exports=Km;function Km(e,t,r){for(var n=Gm(e);n.index<(n.keyedList||e).length;)qm(e,t,n,function(o,i){if(o){r(o,i);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Wm.bind(n,r)}a(Km,"parallel")});var Qo=b((ZD,Wr)=>{var Tu=Jo(),Jm=Xo(),Xm=Yo();Wr.exports=Ym;Wr.exports.ascending=Eu;Wr.exports.descending=Qm;function Ym(e,t,r,n){var o=Jm(e,r);return Tu(e,t,o,a(function i(s,u){if(s){n(s,u);return}if(o.index++,o.index<(o.keyedList||e).length){Tu(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),Xm.bind(o,n)}a(Ym,"serialOrdered");function Eu(e,t){return e<t?-1:e>t?1:0}a(Eu,"ascending");function Qm(e,t){return-1*Eu(e,t)}a(Qm,"descending")});var Au=b((GD,Iu)=>{var eg=Qo();Iu.exports=tg;function tg(e,t,r){return eg(e,t,null,r)}a(tg,"serial")});var $u=b((KD,Su)=>{Su.exports={parallel:bu(),serial:Au(),serialOrdered:Qo()}});var ei=b((JD,wu)=>{"use strict";wu.exports=Object});var zu=b((XD,Ou)=>{"use strict";Ou.exports=Error});var ku=b((YD,Ru)=>{"use strict";Ru.exports=EvalError});var Cu=b((QD,Du)=>{"use strict";Du.exports=RangeError});var Mu=b((eC,Nu)=>{"use strict";Nu.exports=ReferenceError});var Lu=b((tC,Uu)=>{"use strict";Uu.exports=SyntaxError});var Kr=b((rC,ju)=>{"use strict";ju.exports=TypeError});var Bu=b((nC,Fu)=>{"use strict";Fu.exports=URIError});var Hu=b((oC,Vu)=>{"use strict";Vu.exports=Math.abs});var qu=b((iC,Zu)=>{"use strict";Zu.exports=Math.floor});var Wu=b((aC,Gu)=>{"use strict";Gu.exports=Math.max});var Ju=b((sC,Ku)=>{"use strict";Ku.exports=Math.min});var Yu=b((uC,Xu)=>{"use strict";Xu.exports=Math.pow});var ec=b((cC,Qu)=>{"use strict";Qu.exports=Math.round});var rc=b((lC,tc)=>{"use strict";tc.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var oc=b((dC,nc)=>{"use strict";var rg=rc();nc.exports=a(function(t){return rg(t)||t===0?t:t<0?-1:1},"sign")});var ac=b((mC,ic)=>{"use strict";ic.exports=Object.getOwnPropertyDescriptor});var ti=b((gC,sc)=>{"use strict";var Jr=ac();if(Jr)try{Jr([],"length")}catch{Jr=null}sc.exports=Jr});var cc=b((hC,uc)=>{"use strict";var Xr=Object.defineProperty||!1;if(Xr)try{Xr({},"a",{value:1})}catch{Xr=!1}uc.exports=Xr});var ri=b((yC,lc)=>{"use strict";lc.exports=a(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 i 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 s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(t,r);if(u.value!==o||u.enumerable!==!0)return!1}return!0},"hasSymbols")});var fc=b((_C,dc)=>{"use strict";var pc=typeof Symbol<"u"&&Symbol,ng=ri();dc.exports=a(function(){return typeof pc!="function"||typeof Symbol!="function"||typeof pc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ng()},"hasNativeSymbols")});var ni=b((PC,mc)=>{"use strict";mc.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var oi=b((bC,gc)=>{"use strict";var og=ei();gc.exports=og.getPrototypeOf||null});var vc=b((TC,yc)=>{"use strict";var ig="Function.prototype.bind called on incompatible ",ag=Object.prototype.toString,sg=Math.max,ug="[object Function]",hc=a(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},"concatty"),cg=a(function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},"slicy"),lg=a(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");yc.exports=a(function(t){var r=this;if(typeof r!="function"||ag.apply(r)!==ug)throw new TypeError(ig+r);for(var n=cg(arguments,1),o,i=a(function(){if(this instanceof o){var f=r.apply(this,hc(n,arguments));return Object(f)===f?f:this}return r.apply(t,hc(n,arguments))},"binder"),s=sg(0,r.length-n.length),u=[],p=0;p<s;p++)u[p]="$"+p;if(o=Function("binder","return function ("+lg(u,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var d=a(function(){},"Empty");d.prototype=r.prototype,o.prototype=new d,d.prototype=null}return o},"bind")});var $t=b((IC,_c)=>{"use strict";var pg=vc();_c.exports=Function.prototype.bind||pg});var Yr=b((AC,xc)=>{"use strict";xc.exports=Function.prototype.call});var ii=b((SC,Pc)=>{"use strict";Pc.exports=Function.prototype.apply});var Tc=b(($C,bc)=>{"use strict";bc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ic=b((wC,Ec)=>{"use strict";var dg=$t(),fg=ii(),mg=Yr(),gg=Tc();Ec.exports=gg||dg.call(mg,fg)});var Sc=b((OC,Ac)=>{"use strict";var hg=$t(),yg=Kr(),vg=Yr(),_g=Ic();Ac.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new yg("a function is required");return _g(hg,vg,t)},"callBindBasic")});var kc=b((RC,Rc)=>{"use strict";var xg=Sc(),$c=ti(),Oc;try{Oc=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var ai=!!Oc&&$c&&$c(Object.prototype,"__proto__"),zc=Object,wc=zc.getPrototypeOf;Rc.exports=ai&&typeof ai.get=="function"?xg([ai.get]):typeof wc=="function"?a(function(t){return wc(t==null?t:zc(t))},"getDunder"):!1});var Uc=b((DC,Mc)=>{"use strict";var Dc=ni(),Cc=oi(),Nc=kc();Mc.exports=Dc?a(function(t){return Dc(t)},"getProto"):Cc?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Cc(t)},"getProto"):Nc?a(function(t){return Nc(t)},"getProto"):null});var si=b((NC,Lc)=>{"use strict";var Pg=Function.prototype.call,bg=Object.prototype.hasOwnProperty,Tg=$t();Lc.exports=Tg.call(Pg,bg)});var qc=b((MC,Zc)=>{"use strict";var K,Eg=ei(),Ig=zu(),Ag=ku(),Sg=Cu(),$g=Mu(),Rt=Lu(),zt=Kr(),wg=Bu(),Og=Hu(),zg=qu(),Rg=Wu(),kg=Ju(),Dg=Yu(),Cg=ec(),Ng=oc(),Vc=Function,ui=a(function(e){try{return Vc('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),dr=ti(),Mg=cc(),ci=a(function(){throw new zt},"throwTypeError"),Ug=dr?function(){try{return arguments.callee,ci}catch{try{return dr(arguments,"callee").get}catch{return ci}}}():ci,wt=fc()(),ve=Uc(),Lg=oi(),jg=ni(),Hc=ii(),fr=Yr(),Ot={},Fg=typeof Uint8Array>"u"||!ve?K:ve(Uint8Array),dt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":wt&&ve?ve([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":Ot,"%AsyncGenerator%":Ot,"%AsyncGeneratorFunction%":Ot,"%AsyncIteratorPrototype%":Ot,"%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%":Ig,"%eval%":eval,"%EvalError%":Ag,"%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%":Vc,"%GeneratorFunction%":Ot,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":wt&&ve?ve(ve([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!wt||!ve?K:ve(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Eg,"%Object.getOwnPropertyDescriptor%":dr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":Sg,"%ReferenceError%":$g,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!wt||!ve?K:ve(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":wt&&ve?ve(""[Symbol.iterator]()):K,"%Symbol%":wt?Symbol:K,"%SyntaxError%":Rt,"%ThrowTypeError%":Ug,"%TypedArray%":Fg,"%TypeError%":zt,"%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%":wg,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":fr,"%Function.prototype.apply%":Hc,"%Object.defineProperty%":Mg,"%Object.getPrototypeOf%":Lg,"%Math.abs%":Og,"%Math.floor%":zg,"%Math.max%":Rg,"%Math.min%":kg,"%Math.pow%":Dg,"%Math.round%":Cg,"%Math.sign%":Ng,"%Reflect.getPrototypeOf%":jg};if(ve)try{null.error}catch(e){jc=ve(ve(e)),dt["%Error.prototype%"]=jc}var jc,Bg=a(function e(t){var r;if(t==="%AsyncFunction%")r=ui("async function () {}");else if(t==="%GeneratorFunction%")r=ui("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ui("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ve&&(r=ve(o.prototype))}return dt[t]=r,r},"doEval"),Fc={__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"]},mr=$t(),Qr=si(),Vg=mr.call(fr,Array.prototype.concat),Hg=mr.call(Hc,Array.prototype.splice),Bc=mr.call(fr,String.prototype.replace),en=mr.call(fr,String.prototype.slice),Zg=mr.call(fr,RegExp.prototype.exec),qg=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Gg=/\\(\\)?/g,Wg=a(function(t){var r=en(t,0,1),n=en(t,-1);if(r==="%"&&n!=="%")throw new Rt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Rt("invalid intrinsic syntax, expected opening `%`");var o=[];return Bc(t,qg,function(i,s,u,p){o[o.length]=u?Bc(p,Gg,"$1"):s||i}),o},"stringToPath"),Kg=a(function(t,r){var n=t,o;if(Qr(Fc,n)&&(o=Fc[n],n="%"+o[0]+"%"),Qr(dt,n)){var i=dt[n];if(i===Ot&&(i=Bg(n)),typeof i>"u"&&!r)throw new zt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Rt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Zc.exports=a(function(t,r){if(typeof t!="string"||t.length===0)throw new zt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new zt('"allowMissing" argument must be a boolean');if(Zg(/^%?[^%]*%?$/,t)===null)throw new Rt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Wg(t),o=n.length>0?n[0]:"",i=Kg("%"+o+"%",r),s=i.name,u=i.value,p=!1,d=i.alias;d&&(o=d[0],Hg(n,Vg([0,1],d)));for(var f=1,v=!0;f<n.length;f+=1){var y=n[f],l=en(y,0,1),m=en(y,-1);if((l==='"'||l==="'"||l==="`"||m==='"'||m==="'"||m==="`")&&l!==m)throw new Rt("property names with quotes must have matching quotes");if((y==="constructor"||!v)&&(p=!0),o+="."+y,s="%"+o+"%",Qr(dt,s))u=dt[s];else if(u!=null){if(!(y in u)){if(!r)throw new zt("base intrinsic for "+t+" exists, but the property is not available.");return}if(dr&&f+1>=n.length){var _=dr(u,y);v=!!_,v&&"get"in _&&!("originalValue"in _.get)?u=_.get:u=u[y]}else v=Qr(u,y),u=u[y];v&&!p&&(dt[s]=u)}}return u},"GetIntrinsic")});var Wc=b((LC,Gc)=>{"use strict";var Jg=ri();Gc.exports=a(function(){return Jg()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Xc=b((FC,Jc)=>{"use strict";var Xg=qc(),Kc=Xg("%Object.defineProperty%",!0),Yg=Wc()(),Qg=si(),eh=Kr(),tn=Yg?Symbol.toStringTag:null;Jc.exports=a(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 eh("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");tn&&(n||!Qg(t,tn))&&(Kc?Kc(t,tn,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[tn]=r)},"setToStringTag")});var Qc=b((VC,Yc)=>{"use strict";var th=Function.prototype.call,rh=Object.prototype.hasOwnProperty,nh=$t();Yc.exports=nh.call(th,rh)});var tl=b((HC,el)=>{"use strict";el.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var ol=b((ZC,nl)=>{"use strict";var fi=au(),oh=require("util"),li=require("path"),ih=require("http"),ah=require("https"),sh=require("url").parse,uh=require("fs"),ch=require("stream").Stream,lh=require("crypto"),pi=pu(),ph=$u(),dh=Xc(),tt=Qc(),di=tl();function rl(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(rl,"escapeHeaderParam");function X(e){if(!(this instanceof X))return new X(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fi.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(X,"FormData");oh.inherits(X,fi);X.LINE_BREAK=`\r
|
|
2
|
-
`;X.DEFAULT_CONTENT_TYPE="application/octet-stream";X.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=fi.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),i=this._multiPartFooter();n(o),n(t),n(i),this._trackLength(o,t,r)};X.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)+X.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&tt(t,"httpVersion"))&&!(t instanceof ch))&&(r.knownLength||this._valuesToMeasure.push(t))};X.prototype._lengthRetriever=function(e,t){tt(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):uh.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):tt(e,"httpVersion")?t(null,Number(e.headers["content-length"])):tt(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};X.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),i="",s={"Content-Disposition":["form-data",'name="'+rl(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&di(s,r.header);var u;for(var p in s)if(tt(s,p)){if(u=s[p],u==null)continue;Array.isArray(u)||(u=[u]),u.length&&(i+=p+": "+u.join("; ")+X.LINE_BREAK)}return"--"+this.getBoundary()+X.LINE_BREAK+i+X.LINE_BREAK};X.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=li.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=li.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&tt(e,"httpVersion")&&(r=li.basename(e.client._httpMessage.path||"")),r)return'filename="'+rl(r)+'"'};X.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=pi.lookup(e.name)),!r&&e&&e.path&&(r=pi.lookup(e.path)),!r&&e&&e.readable&&tt(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=pi.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=X.DEFAULT_CONTENT_TYPE),r};X.prototype._multiPartFooter=function(){return function(e){var t=X.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};X.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+X.LINE_BREAK};X.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)tt(e,t)&&(r[t.toLowerCase()]=e[t]);return r};X.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};X.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};X.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(X.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};X.prototype._generateBoundary=function(){this._boundary="--------------------------"+lh.randomBytes(12).toString("hex")};X.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};X.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};X.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}ph.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};X.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=sh(e),n=di({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=di(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=ah.request(n):r=ih.request(n),this.getLength(function(i,s){if(i&&i!=="Unknown stream"){this._error(i);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),t){var u,p=a(function(d,f){return r.removeListener("error",p),r.removeListener("response",u),t.call(this,d,f)},"callback");u=p.bind(this,null),r.on("error",p),r.on("response",u)}}.bind(this)),r};X.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};X.prototype.toString=function(){return"[object FormData]"};dh(X.prototype,"FormData");nl.exports=X});var ae={};io(ae,{__addDisposableResource:()=>Ul,__assign:()=>nn,__asyncDelegator:()=>Ol,__asyncGenerator:()=>wl,__asyncValues:()=>zl,__await:()=>kt,__awaiter:()=>Tl,__classPrivateFieldGet:()=>Cl,__classPrivateFieldIn:()=>Ml,__classPrivateFieldSet:()=>Nl,__createBinding:()=>an,__decorate:()=>hl,__disposeResources:()=>Ll,__esDecorate:()=>vl,__exportStar:()=>Il,__extends:()=>ml,__generator:()=>El,__importDefault:()=>Dl,__importStar:()=>kl,__makeTemplateObject:()=>Rl,__metadata:()=>bl,__param:()=>yl,__propKey:()=>xl,__read:()=>hi,__rest:()=>gl,__rewriteRelativeImportExtension:()=>jl,__runInitializers:()=>_l,__setFunctionName:()=>Pl,__spread:()=>Al,__spreadArray:()=>$l,__spreadArrays:()=>Sl,__values:()=>on,default:()=>Ih});function ml(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mi(e,t);function r(){this.constructor=e}a(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function gl(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function hl(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(s=e[u])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function yl(e,t){return function(r,n){t(r,n,e)}}function vl(e,t,r,n,o,i){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}a(s,"accept");for(var u=n.kind,p=u==="getter"?"get":u==="setter"?"set":"value",d=!t&&e?n.static?e:e.prototype:null,f=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),v,y=!1,l=r.length-1;l>=0;l--){var m={};for(var _ in n)m[_]=_==="access"?{}:n[_];for(var _ in n.access)m.access[_]=n.access[_];m.addInitializer=function(x){if(y)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(x||null))};var h=(0,r[l])(u==="accessor"?{get:f.get,set:f.set}:f[p],m);if(u==="accessor"){if(h===void 0)continue;if(h===null||typeof h!="object")throw new TypeError("Object expected");(v=s(h.get))&&(f.get=v),(v=s(h.set))&&(f.set=v),(v=s(h.init))&&o.unshift(v)}else(v=s(h))&&(u==="field"?o.unshift(v):f[p]=v)}d&&Object.defineProperty(d,n.name,f),y=!0}function _l(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function xl(e){return typeof e=="symbol"?e:"".concat(e)}function Pl(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function bl(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Tl(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return a(o,"adopt"),new(r||(r=Promise))(function(i,s){function u(f){try{d(n.next(f))}catch(v){s(v)}}a(u,"fulfilled");function p(f){try{d(n.throw(f))}catch(v){s(v)}}a(p,"rejected");function d(f){f.done?i(f.value):o(f.value).then(u,p)}a(d,"step"),d((n=n.apply(e,t||[])).next())})}function El(e,t){var r={label:0,sent:a(function(){if(i[0]&1)throw i[1];return i[1]},"sent"),trys:[],ops:[]},n,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(d){return function(f){return p([d,f])}}function p(d){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(i=d[0]&2?o.return:d[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,d[1])).done)return i;switch(o=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){r.label=d[1];break}if(d[0]===6&&r.label<i[1]){r.label=i[1],i=d;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(d);break}i[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(f){d=[6,f],o=0}finally{n=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Il(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&an(t,e,r)}function on(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:a(function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}},"next")};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i}function Al(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(hi(arguments[t]));return e}function Sl(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],s=0,u=i.length;s<u;s++,o++)n[o]=i[s];return n}function $l(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function kt(e){return this instanceof kt?(this.v=e,this):new kt(e)}function wl(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(l){return function(m){return Promise.resolve(m).then(l,v)}}function u(l,m){n[l]&&(o[l]=function(_){return new Promise(function(h,x){i.push([l,_,h,x])>1||p(l,_)})},m&&(o[l]=m(o[l])))}function p(l,m){try{d(n[l](m))}catch(_){y(i[0][3],_)}}function d(l){l.value instanceof kt?Promise.resolve(l.value.v).then(f,v):y(i[0][2],l)}function f(l){p("next",l)}function v(l){p("throw",l)}function y(l,m){l(m),i.shift(),i.length&&p(i[0][0],i[0][1])}}function Ol(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(s){return(r=!r)?{value:kt(e[o](s)),done:!1}:i?i(s):s}:i}}function zl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof on=="function"?on(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(s){return new Promise(function(u,p){s=e[i](s),o(u,p,s.done,s.value)})}}function o(i,s,u,p){Promise.resolve(p).then(function(d){i({value:d,done:u})},s)}}function Rl(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function kl(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=gi(e),n=0;n<r.length;n++)r[n]!=="default"&&an(t,e,r[n]);return Th(t,e),t}function Dl(e){return e&&e.__esModule?e:{default:e}}function Cl(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Nl(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function Ml(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Ul(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=a(function(){try{o.call(this)}catch(i){return Promise.reject(i)}},"dispose")),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function Ll(e){function t(i){e.error=e.hasError?new Eh(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}a(t,"fail");var r,n=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(s){return t(s),o()})}else n|=1}catch(s){t(s)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return a(o,"next"),o()}function jl(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,s){return n?t?".jsx":".js":o&&(!i||!s)?r:o+i+"."+s.toLowerCase()+"js"}):e}var mi,nn,an,Th,gi,Eh,Ih,se=Xp(()=>{mi=a(function(e,t){return mi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},mi(e,t)},"extendStatics");a(ml,"__extends");nn=a(function(){return nn=Object.assign||a(function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},"__assign"),nn.apply(this,arguments)},"__assign");a(gl,"__rest");a(hl,"__decorate");a(yl,"__param");a(vl,"__esDecorate");a(_l,"__runInitializers");a(xl,"__propKey");a(Pl,"__setFunctionName");a(bl,"__metadata");a(Tl,"__awaiter");a(El,"__generator");an=Object.create?function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return t[r]},"get")}),Object.defineProperty(e,n,o)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};a(Il,"__exportStar");a(on,"__values");a(hi,"__read");a(Al,"__spread");a(Sl,"__spreadArrays");a($l,"__spreadArray");a(kt,"__await");a(wl,"__asyncGenerator");a(Ol,"__asyncDelegator");a(zl,"__asyncValues");a(Rl,"__makeTemplateObject");Th=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},gi=a(function(e){return gi=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},gi(e)},"ownKeys");a(kl,"__importStar");a(Dl,"__importDefault");a(Cl,"__classPrivateFieldGet");a(Nl,"__classPrivateFieldSet");a(Ml,"__classPrivateFieldIn");a(Ul,"__addDisposableResource");Eh=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};a(Ll,"__disposeResources");a(jl,"__rewriteRelativeImportExtension");Ih={__extends:ml,__assign:nn,__rest:gl,__decorate:hl,__param:yl,__esDecorate:vl,__runInitializers:_l,__propKey:xl,__setFunctionName:Pl,__metadata:bl,__awaiter:Tl,__generator:El,__createBinding:an,__exportStar:Il,__values:on,__read:hi,__spread:Al,__spreadArrays:Sl,__spreadArray:$l,__await:kt,__asyncGenerator:wl,__asyncDelegator:Ol,__asyncValues:zl,__makeTemplateObject:Rl,__importStar:kl,__importDefault:Dl,__classPrivateFieldGet:Cl,__classPrivateFieldSet:Nl,__classPrivateFieldIn:Ml,__addDisposableResource:Ul,__disposeResources:Ll,__rewriteRelativeImportExtension:jl}});var hr=b(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.RequestMethod=void 0;var Fl;(function(e){e.GET="GET",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"})(Fl||(sn.RequestMethod=Fl={}))});var Bl=b(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.BatchRequestContent=void 0;var Dt=(se(),oe(ae)),yi=hr(),Ah=function(){function e(t){if(this.requests=new Map,typeof t<"u"){var r=e.requestLimit;if(t.length>r){var n=new Error("Maximum requests limit exceeded, Max allowed number of requests are ".concat(r));throw n.name="Limit Exceeded Error",n}for(var o=0,i=t;o<i.length;o++){var s=i[o];this.addRequest(s)}}}return a(e,"BatchRequestContent"),e.validateDependencies=function(t){var r=a(function(s){for(var u=s.entries(),p=u.next();!p.done;){var d=p.value[1];if(d.dependsOn!==void 0&&d.dependsOn.length>0)return!1;p=u.next()}return!0},"isParallel"),n=a(function(s){var u=s.entries(),p=u.next(),d=p.value[1];if(d.dependsOn!==void 0&&d.dependsOn.length>0)return!1;var f=p;for(p=u.next();!p.done;){var v=p.value[1];if(v.dependsOn===void 0||v.dependsOn.length!==1||v.dependsOn[0]!==f.value[1].id)return!1;f=p,p=u.next()}return!0},"isSerial"),o=a(function(s){var u=s.entries(),p=u.next(),d=p.value[1],f;if(d.dependsOn===void 0||d.dependsOn.length===0)f=d.id;else if(d.dependsOn.length===1){var v=d.dependsOn[0];if(v!==d.id&&s.has(v))f=v;else return!1}else return!1;for(p=u.next();!p.done;){var y=p.value[1];if((y.dependsOn===void 0||y.dependsOn.length===0)&&f!==y.id||y.dependsOn!==void 0&&y.dependsOn.length!==0&&(y.dependsOn.length===1&&(y.id===f||y.dependsOn[0]!==f)||y.dependsOn.length>1))return!1;p=u.next()}return!0},"isSame");if(t.size===0){var i=new Error("Empty requests map, Please provide at least one request.");throw i.name="Empty Requests Error",i}return r(t)||n(t)||o(t)},e.getRequestData=function(t){return Dt.__awaiter(this,void 0,void 0,function(){var r,n,o,i;return Dt.__generator(this,function(s){switch(s.label){case 0:return r={url:""},n=new RegExp("^https?://"),r.url=n.test(t.url)?"/"+t.url.split(/.*?\/\/.*?\//)[1]:t.url,r.method=t.method,o={},t.headers.forEach(function(u,p){o[p]=u}),Object.keys(o).length&&(r.headers=o),t.method===yi.RequestMethod.PATCH||t.method===yi.RequestMethod.POST||t.method===yi.RequestMethod.PUT?(i=r,[4,e.getRequestBody(t)]):[3,2];case 1:i.body=s.sent(),s.label=2;case 2:return[2,r]}})})},e.getRequestBody=function(t){return Dt.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,p,d;return Dt.__generator(this,function(f){switch(f.label){case 0:r=!1,f.label=1;case 1:return f.trys.push([1,3,,4]),o=t.clone(),[4,o.json()];case 2:return n=f.sent(),r=!0,[3,4];case 3:return i=f.sent(),[3,4];case 4:if(r)return[3,12];f.label=5;case 5:return f.trys.push([5,11,,12]),typeof Blob<"u"?[4,t.blob()]:[3,8];case 6:return s=f.sent(),u=new FileReader,[4,new Promise(function(v){u.addEventListener("load",function(){var y=u.result,l=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$"),m=l.exec(y);v(m[4])},!1),u.readAsDataURL(s)})];case 7:return n=f.sent(),[3,10];case 8:return typeof Buffer<"u"?[4,t.buffer()]:[3,10];case 9:p=f.sent(),n=p.toString("base64"),f.label=10;case 10:return r=!0,[3,12];case 11:return d=f.sent(),[3,12];case 12:return[2,n]}})})},e.prototype.addRequest=function(t){var r=e.requestLimit;if(t.id===""){var n=new Error("Id for a request is empty, Please provide an unique id");throw n.name="Empty Id For Request",n}if(this.requests.size===r){var n=new Error("Maximum requests limit exceeded, Max allowed number of requests are ".concat(r));throw n.name="Limit Exceeded Error",n}if(this.requests.has(t.id)){var n=new Error("Adding request with duplicate id ".concat(t.id,", Make the id of the requests unique"));throw n.name="Duplicate RequestId Error",n}return this.requests.set(t.id,t),t.id},e.prototype.removeRequest=function(t){for(var r=this.requests.delete(t),n=this.requests.entries(),o=n.next();!o.done;){var i=o.value[1].dependsOn;if(typeof i<"u"){var s=i.indexOf(t);s!==-1&&i.splice(s,1),i.length===0&&delete o.value[1].dependsOn}o=n.next()}return r},e.prototype.getContent=function(){return Dt.__awaiter(this,void 0,void 0,function(){var t,r,n,o,u,u,i,s,u;return Dt.__generator(this,function(p){switch(p.label){case 0:if(t=[],r={requests:t},n=this.requests.entries(),o=n.next(),o.done)throw u=new Error("No requests added yet, Please add at least one request."),u.name="Empty Payload",u;if(!e.validateDependencies(this.requests))throw u=new Error(`Invalid dependency found, Dependency should be:
|
|
1
|
+
"use strict";var ad=Object.create;var qt=Object.defineProperty;var sd=Object.getOwnPropertyDescriptor;var ud=Object.getOwnPropertyNames;var cd=Object.getPrototypeOf,ld=Object.prototype.hasOwnProperty;var a=(e,t)=>qt(e,"name",{value:t,configurable:!0});var pd=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var b=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},uo=(e,t)=>{for(var r in t)qt(e,r,{get:t[r],enumerable:!0})},qi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ud(t))!ld.call(e,o)&&o!==r&&qt(e,o,{get:()=>t[o],enumerable:!(n=sd(t,o))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?ad(cd(e)):{},qi(t||!e||!e.__esModule?qt(r,"default",{value:e,enumerable:!0}):r,e)),ie=e=>qi(qt({},"__esModule",{value:!0}),e);var gs=b((fs,Zr)=>{(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"),i="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${i})?$`,"i")};function p(l,f){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let _=0,h=-1,P=(l.match(u.zoneIndex)||[])[0],E,V;for(P&&(P=P.substring(1),l=l.replace(/%.+$/,""));(h=l.indexOf(":",h+1))>=0;)_++;if(l.substr(0,2)==="::"&&_--,l.substr(-2,2)==="::"&&_--,_>f)return null;for(V=f-_,E=":";V--;)E+="0:";return l=l.replace("::",E),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),f=(function(){let de=l.split(":"),Pe=[];for(let Ce=0;Ce<de.length;Ce++)Pe.push(parseInt(de[Ce],16));return Pe})(),{parts:f,zoneId:P}}a(p,"expandIPv6");function d(l,f,_,h){if(l.length!==f.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let P=0,E;for(;h>0;){if(E=_-h,E<0&&(E=0),l[P]>>E!==f[P]>>E)return!1;h-=_,P+=1}return!0}a(d,"matchCIDR");function m(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)}a(m,"parseIntAuto");function y(l,f){for(;l.length<f;)l=`0${l}`;return l}a(y,"padPart");let v={};v.IPv4=(function(){function l(f){if(f.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let _,h;for(_=0;_<f.length;_++)if(h=f[_],!(0<=h&&h<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=f}return a(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(f,_){let h;if(_===void 0&&(h=f,f=h[0],_=h[1]),f.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return d(this.octets,f.octets,8,_)},l.prototype.prefixLengthFromSubnetMask=function(){let f=0,_=!1,h={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},P,E,V;for(P=3;P>=0;P-=1)if(E=this.octets[P],E in h){if(V=h[E],_&&V!==0)return null;V!==8&&(_=!0),f+=V}else return null;return 32-f},l.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return v.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l})(),v.IPv4.broadcastAddressFromCIDR=function(l){try{let f=this.parseCIDR(l),_=f[0].toByteArray(),h=this.subnetMaskFromPrefixLength(f[1]).toByteArray(),P=[],E=0;for(;E<4;)P.push(parseInt(_[E],10)|parseInt(h[E],10)^255),E++;return new this(P)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.isIPv4=function(l){return this.parser(l)!==null},v.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},v.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},v.IPv4.isValidFourPartDecimal=function(l){return!!(v.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},v.IPv4.isValidCIDRFourPartDecimal=function(l){let f=l.match(/^(.+)\/(\d+)$/);return!v.IPv4.isValidCIDR(l)||!f?!1:v.IPv4.isValidFourPartDecimal(f[1])},v.IPv4.networkAddressFromCIDR=function(l){let f,_,h,P,E;try{for(f=this.parseCIDR(l),h=f[0].toByteArray(),E=this.subnetMaskFromPrefixLength(f[1]).toByteArray(),P=[],_=0;_<4;)P.push(parseInt(h[_],10)&parseInt(E[_],10)),_++;return new this(P)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.parse=function(l){let f=this.parser(l);if(f===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(f)},v.IPv4.parseCIDR=function(l){let f;if(f=l.match(/^(.+)\/(\d+)$/)){let _=parseInt(f[2]);if(_>=0&&_<=32){let h=[this.parse(f[1]),_];return Object.defineProperty(h,"toString",{value:a(function(){return this.join("/")},"value")}),h}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},v.IPv4.parser=function(l){let f,_,h;if(f=l.match(r.fourOctet))return(function(){let P=f.slice(1,6),E=[];for(let V=0;V<P.length;V++)_=P[V],E.push(m(_));return E})();if(f=l.match(r.longValue)){if(h=m(f[1]),h>4294967295||h<0)throw new Error("ipaddr: address outside defined range");return(function(){let P=[],E;for(E=0;E<=24;E+=8)P.push(h>>E&255);return P})().reverse()}else return(f=l.match(r.twoOctet))?(function(){let P=f.slice(1,4),E=[];if(h=m(P[1]),h>16777215||h<0)throw new Error("ipaddr: address outside defined range");return E.push(m(P[0])),E.push(h>>16&255),E.push(h>>8&255),E.push(h&255),E})():(f=l.match(r.threeOctet))?(function(){let P=f.slice(1,5),E=[];if(h=m(P[2]),h>65535||h<0)throw new Error("ipaddr: address outside defined range");return E.push(m(P[0])),E.push(m(P[1])),E.push(h>>8&255),E.push(h&255),E})():null},v.IPv4.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let f=[0,0,0,0],_=0,h=Math.floor(l/8);for(;_<h;)f[_]=255,_++;return h<4&&(f[h]=Math.pow(2,l%8)-1<<8-l%8),new this(f)},v.IPv6=(function(){function l(f,_){let h,P;if(f.length===16)for(this.parts=[],h=0;h<=14;h+=2)this.parts.push(f[h]<<8|f[h+1]);else if(f.length===8)this.parts=f;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(h=0;h<this.parts.length;h++)if(P=this.parts[h],!(0<=P&&P<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");_&&(this.zoneId=_)}return a(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(f,_){let h;if(_===void 0&&(h=f,f=h[0],_=h[1]),f.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return d(this.parts,f.parts,16,_)},l.prototype.prefixLengthFromSubnetMask=function(){let f=0,_=!1,h={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,E;for(let V=7;V>=0;V-=1)if(P=this.parts[V],P in h){if(E=h[P],_&&E!==0)return null;E!==16&&(_=!0),f+=E}else return null;return 128-f},l.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let f,_=[],h=this.parts;for(let P=0;P<h.length;P++)f=h[P],_.push(f>>8),_.push(f&255);return _},l.prototype.toFixedLengthString=function(){let f=(function(){let h=[];for(let P=0;P<this.parts.length;P++)h.push(y(this.parts[P].toString(16),4));return h}).call(this).join(":"),_="";return this.zoneId&&(_=`%${this.zoneId}`),f+_},l.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let f=this.parts.slice(-2),_=f[0],h=f[1];return new v.IPv4([_>>8,_&255,h>>8,h&255])},l.prototype.toNormalizedString=function(){let f=(function(){let h=[];for(let P=0;P<this.parts.length;P++)h.push(this.parts[P].toString(16));return h}).call(this).join(":"),_="";return this.zoneId&&(_=`%${this.zoneId}`),f+_},l.prototype.toRFC5952String=function(){let f=/((^|:)(0(:|$)){2,})/g,_=this.toNormalizedString(),h=0,P=-1,E;for(;E=f.exec(_);)E[0].length>P&&(h=E.index,P=E[0].length);return P<0?_:`${_.substring(0,h)}::${_.substring(h+P)}`},l.prototype.toString=function(){return this.toRFC5952String()},l})(),v.IPv6.broadcastAddressFromCIDR=function(l){try{let f=this.parseCIDR(l),_=f[0].toByteArray(),h=this.subnetMaskFromPrefixLength(f[1]).toByteArray(),P=[],E=0;for(;E<16;)P.push(parseInt(_[E],10)|parseInt(h[E],10)^255),E++;return new this(P)}catch(f){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${f})`)}},v.IPv6.isIPv6=function(l){return this.parser(l)!==null},v.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let f=this.parser(l);return new this(f.parts,f.zoneId),!0}catch{return!1}},v.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},v.IPv6.networkAddressFromCIDR=function(l){let f,_,h,P,E;try{for(f=this.parseCIDR(l),h=f[0].toByteArray(),E=this.subnetMaskFromPrefixLength(f[1]).toByteArray(),P=[],_=0;_<16;)P.push(parseInt(h[_],10)&parseInt(E[_],10)),_++;return new this(P)}catch(V){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${V})`)}},v.IPv6.parse=function(l){let f=this.parser(l);if(f.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(f.parts,f.zoneId)},v.IPv6.parseCIDR=function(l){let f,_,h;if((_=l.match(/^(.+)\/(\d+)$/))&&(f=parseInt(_[2]),f>=0&&f<=128))return h=[this.parse(_[1]),f],Object.defineProperty(h,"toString",{value:a(function(){return this.join("/")},"value")}),h;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},v.IPv6.parser=function(l){let f,_,h,P,E,V;if(h=l.match(u.deprecatedTransitional))return this.parser(`::ffff:${h[1]}`);if(u.native.test(l))return p(l,8);if((h=l.match(u.transitional))&&(V=h[6]||"",f=h[1],h[1].endsWith("::")||(f=f.slice(0,-1)),f=p(f+V,6),f.parts)){for(E=[parseInt(h[2]),parseInt(h[3]),parseInt(h[4]),parseInt(h[5])],_=0;_<E.length;_++)if(P=E[_],!(0<=P&&P<=255))return null;return f.parts.push(E[0]<<8|E[1]),f.parts.push(E[2]<<8|E[3]),{parts:f.parts,zoneId:f.zoneId}}return null},v.IPv6.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>128)throw new Error("ipaddr: invalid IPv6 prefix length");let f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0,h=Math.floor(l/8);for(;_<h;)f[_]=255,_++;return h<16&&(f[h]=Math.pow(2,l%8)-1<<8-l%8),new this(f)},v.fromByteArray=function(l){let f=l.length;if(f===4)return new v.IPv4(l);if(f===16)return new v.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},v.isValid=function(l){return v.IPv6.isValid(l)||v.IPv4.isValid(l)},v.isValidCIDR=function(l){return v.IPv6.isValidCIDR(l)||v.IPv4.isValidCIDR(l)},v.parse=function(l){if(v.IPv6.isValid(l))return v.IPv6.parse(l);if(v.IPv4.isValid(l))return v.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},v.parseCIDR=function(l){try{return v.IPv6.parseCIDR(l)}catch{try{return v.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},v.process=function(l){let f=this.parse(l);return f.kind()==="ipv6"&&f.isIPv4MappedAddress()?f.toIPv4Address():f},v.subnetMatch=function(l,f,_){let h,P,E,V;_==null&&(_="unicast");for(P in f)if(Object.prototype.hasOwnProperty.call(f,P)){for(E=f[P],E[0]&&!(E[0]instanceof Array)&&(E=[E]),h=0;h<E.length;h++)if(V=E[h],l.kind()===V[0].kind()&&l.match.apply(l,V))return P}return _},typeof Zr<"u"&&Zr.exports?Zr.exports=v:e.ipaddr=v})(fs)});var hu=b((KC,gu)=>{var fu=require("stream").Stream,Wf=require("util");gu.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=[]}a(ke,"DelayedStream");Wf.inherits(ke,fu);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:a(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=fu.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 Pu=b((XC,_u)=>{var Kf=require("util"),vu=require("stream").Stream,yu=hu();_u.exports=pe;function pe(){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}a(pe,"CombinedStream");Kf.inherits(pe,vu);pe.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};pe.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};pe.prototype.append=function(e){var t=pe.isStreamLike(e);if(t){if(!(e instanceof yu)){var r=yu.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};pe.prototype.pipe=function(e,t){return vu.prototype.pipe.call(this,e,t),this.resume(),e};pe.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}};pe.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=pe.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};pe.prototype._pipeNext=function(e){this._currentStream=e;var t=pe.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()};pe.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};pe.prototype.write=function(e){this.emit("data",e)};pe.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};pe.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")};pe.prototype.end=function(){this._reset(),this.emit("end")};pe.prototype.destroy=function(){this._reset(),this.emit("close")};pe.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};pe.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};pe.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)};pe.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var bu=b((QC,xu)=>{"use strict";xu.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 Iu=b(Ee=>{"use strict";var Jr=bu(),Jf=require("path").extname,Eu=/^\s*([^;\s]*)(?:;|\s|$)/,Xf=/^text\//i;Ee.charset=Tu;Ee.charsets={lookup:Tu};Ee.contentType=Yf;Ee.extension=Qf;Ee.extensions=Object.create(null);Ee.lookup=eg;Ee.types=Object.create(null);tg(Ee.extensions,Ee.types);function Tu(e){if(!e||typeof e!="string")return!1;var t=Eu.exec(e),r=t&&Jr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Xf.test(t[1])?"UTF-8":!1}a(Tu,"charset");function Yf(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Ee.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Ee.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}a(Yf,"contentType");function Qf(e){if(!e||typeof e!="string")return!1;var t=Eu.exec(e),r=t&&Ee.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(Qf,"extension");function eg(e){if(!e||typeof e!="string")return!1;var t=Jf("x."+e).toLowerCase().substr(1);return t&&Ee.types[t]||!1}a(eg,"lookup");function tg(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Jr).forEach(a(function(o){var i=Jr[o],s=i.extensions;if(!(!s||!s.length)){e[o]=s;for(var u=0;u<s.length;u++){var p=s[u];if(t[p]){var d=r.indexOf(Jr[t[p]].source),m=r.indexOf(i.source);if(t[p]!=="application/octet-stream"&&(d>m||d===m&&t[p].substr(0,12)==="application/"))continue}t[p]=o}}},"forEachMimeType"))}a(tg,"populateMaps")});var Su=b((rD,Au)=>{Au.exports=rg;function rg(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(rg,"defer")});var Xo=b((oD,wu)=>{var $u=Su();wu.exports=ng;function ng(e){var t=!1;return $u(function(){t=!0}),a(function(n,o){t?e(n,o):$u(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(ng,"async")});var Yo=b((aD,Ou)=>{Ou.exports=og;function og(e){Object.keys(e.jobs).forEach(ig.bind(e)),e.jobs={}}a(og,"abort");function ig(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(ig,"clean")});var Qo=b((uD,zu)=>{var Ru=Xo(),ag=Yo();zu.exports=sg;function sg(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=ug(t,o,e[o],function(i,s){o in r.jobs&&(delete r.jobs[o],i?ag(r):r.results[o]=s,n(i,r.results))})}a(sg,"iterate");function ug(e,t,r,n){var o;return e.length==2?o=e(r,Ru(n)):o=e(r,t,Ru(n)),o}a(ug,"runJob")});var ei=b((lD,ku)=>{ku.exports=cg;function cg(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,i){return t(e[o],e[i])}),n}a(cg,"state")});var ti=b((dD,Cu)=>{var lg=Yo(),pg=Xo();Cu.exports=dg;function dg(e){Object.keys(this.jobs).length&&(this.index=this.size,lg(this),pg(e)(null,this.results))}a(dg,"terminator")});var Nu=b((fD,Du)=>{var mg=Qo(),fg=ei(),gg=ti();Du.exports=hg;function hg(e,t,r){for(var n=fg(e);n.index<(n.keyedList||e).length;)mg(e,t,n,function(o,i){if(o){r(o,i);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return gg.bind(n,r)}a(hg,"parallel")});var ri=b((hD,Xr)=>{var Mu=Qo(),yg=ei(),vg=ti();Xr.exports=_g;Xr.exports.ascending=Uu;Xr.exports.descending=Pg;function _g(e,t,r,n){var o=yg(e,r);return Mu(e,t,o,a(function i(s,u){if(s){n(s,u);return}if(o.index++,o.index<(o.keyedList||e).length){Mu(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),vg.bind(o,n)}a(_g,"serialOrdered");function Uu(e,t){return e<t?-1:e>t?1:0}a(Uu,"ascending");function Pg(e,t){return-1*Uu(e,t)}a(Pg,"descending")});var ju=b((vD,Lu)=>{var xg=ri();Lu.exports=bg;function bg(e,t,r){return xg(e,t,null,r)}a(bg,"serial")});var Bu=b((PD,Fu)=>{Fu.exports={parallel:Nu(),serial:ju(),serialOrdered:ri()}});var ni=b((xD,Vu)=>{"use strict";Vu.exports=Object});var Zu=b((bD,Hu)=>{"use strict";Hu.exports=Error});var Gu=b((ED,qu)=>{"use strict";qu.exports=EvalError});var Ku=b((TD,Wu)=>{"use strict";Wu.exports=RangeError});var Xu=b((ID,Ju)=>{"use strict";Ju.exports=ReferenceError});var Qu=b((AD,Yu)=>{"use strict";Yu.exports=SyntaxError});var Yr=b((SD,ec)=>{"use strict";ec.exports=TypeError});var rc=b(($D,tc)=>{"use strict";tc.exports=URIError});var oc=b((wD,nc)=>{"use strict";nc.exports=Math.abs});var ac=b((OD,ic)=>{"use strict";ic.exports=Math.floor});var uc=b((RD,sc)=>{"use strict";sc.exports=Math.max});var lc=b((zD,cc)=>{"use strict";cc.exports=Math.min});var dc=b((kD,pc)=>{"use strict";pc.exports=Math.pow});var fc=b((CD,mc)=>{"use strict";mc.exports=Math.round});var hc=b((DD,gc)=>{"use strict";gc.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var vc=b((MD,yc)=>{"use strict";var Eg=hc();yc.exports=a(function(t){return Eg(t)||t===0?t:t<0?-1:1},"sign")});var Pc=b((LD,_c)=>{"use strict";_c.exports=Object.getOwnPropertyDescriptor});var oi=b((jD,xc)=>{"use strict";var Qr=Pc();if(Qr)try{Qr([],"length")}catch{Qr=null}xc.exports=Qr});var Ec=b((FD,bc)=>{"use strict";var en=Object.defineProperty||!1;if(en)try{en({},"a",{value:1})}catch{en=!1}bc.exports=en});var ii=b((BD,Tc)=>{"use strict";Tc.exports=a(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 i 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 s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(t,r);if(u.value!==o||u.enumerable!==!0)return!1}return!0},"hasSymbols")});var Sc=b((HD,Ac)=>{"use strict";var Ic=typeof Symbol<"u"&&Symbol,Tg=ii();Ac.exports=a(function(){return typeof Ic!="function"||typeof Symbol!="function"||typeof Ic("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Tg()},"hasNativeSymbols")});var ai=b((qD,$c)=>{"use strict";$c.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var si=b((GD,wc)=>{"use strict";var Ig=ni();wc.exports=Ig.getPrototypeOf||null});var zc=b((WD,Rc)=>{"use strict";var Ag="Function.prototype.bind called on incompatible ",Sg=Object.prototype.toString,$g=Math.max,wg="[object Function]",Oc=a(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},"concatty"),Og=a(function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},"slicy"),Rg=a(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");Rc.exports=a(function(t){var r=this;if(typeof r!="function"||Sg.apply(r)!==wg)throw new TypeError(Ag+r);for(var n=Og(arguments,1),o,i=a(function(){if(this instanceof o){var m=r.apply(this,Oc(n,arguments));return Object(m)===m?m:this}return r.apply(t,Oc(n,arguments))},"binder"),s=$g(0,r.length-n.length),u=[],p=0;p<s;p++)u[p]="$"+p;if(o=Function("binder","return function ("+Rg(u,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var d=a(function(){},"Empty");d.prototype=r.prototype,o.prototype=new d,d.prototype=null}return o},"bind")});var wt=b((JD,kc)=>{"use strict";var zg=zc();kc.exports=Function.prototype.bind||zg});var tn=b((XD,Cc)=>{"use strict";Cc.exports=Function.prototype.call});var ui=b((YD,Dc)=>{"use strict";Dc.exports=Function.prototype.apply});var Mc=b((QD,Nc)=>{"use strict";Nc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Lc=b((eN,Uc)=>{"use strict";var kg=wt(),Cg=ui(),Dg=tn(),Ng=Mc();Uc.exports=Ng||kg.call(Dg,Cg)});var Fc=b((tN,jc)=>{"use strict";var Mg=wt(),Ug=Yr(),Lg=tn(),jg=Lc();jc.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new Ug("a function is required");return jg(Mg,Lg,t)},"callBindBasic")});var Gc=b((nN,qc)=>{"use strict";var Fg=Fc(),Bc=oi(),Hc;try{Hc=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var ci=!!Hc&&Bc&&Bc(Object.prototype,"__proto__"),Zc=Object,Vc=Zc.getPrototypeOf;qc.exports=ci&&typeof ci.get=="function"?Fg([ci.get]):typeof Vc=="function"?a(function(t){return Vc(t==null?t:Zc(t))},"getDunder"):!1});var Yc=b((iN,Xc)=>{"use strict";var Wc=ai(),Kc=si(),Jc=Gc();Xc.exports=Wc?a(function(t){return Wc(t)},"getProto"):Kc?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Kc(t)},"getProto"):Jc?a(function(t){return Jc(t)},"getProto"):null});var li=b((sN,Qc)=>{"use strict";var Bg=Function.prototype.call,Vg=Object.prototype.hasOwnProperty,Hg=wt();Qc.exports=Hg.call(Bg,Vg)});var al=b((uN,il)=>{"use strict";var K,Zg=ni(),qg=Zu(),Gg=Gu(),Wg=Ku(),Kg=Xu(),kt=Qu(),zt=Yr(),Jg=rc(),Xg=oc(),Yg=ac(),Qg=uc(),eh=lc(),th=dc(),rh=fc(),nh=vc(),nl=Function,pi=a(function(e){try{return nl('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),fr=oi(),oh=Ec(),di=a(function(){throw new zt},"throwTypeError"),ih=fr?(function(){try{return arguments.callee,di}catch{try{return fr(arguments,"callee").get}catch{return di}}})():di,Ot=Sc()(),ve=Yc(),ah=si(),sh=ai(),ol=ui(),gr=tn(),Rt={},uh=typeof Uint8Array>"u"||!ve?K:ve(Uint8Array),gt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":Ot&&ve?ve([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":Rt,"%AsyncGenerator%":Rt,"%AsyncGeneratorFunction%":Rt,"%AsyncIteratorPrototype%":Rt,"%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%":qg,"%eval%":eval,"%EvalError%":Gg,"%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%":nl,"%GeneratorFunction%":Rt,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ot&&ve?ve(ve([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ot||!ve?K:ve(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Zg,"%Object.getOwnPropertyDescriptor%":fr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":Wg,"%ReferenceError%":Kg,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ot||!ve?K:ve(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ot&&ve?ve(""[Symbol.iterator]()):K,"%Symbol%":Ot?Symbol:K,"%SyntaxError%":kt,"%ThrowTypeError%":ih,"%TypedArray%":uh,"%TypeError%":zt,"%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%":Jg,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":gr,"%Function.prototype.apply%":ol,"%Object.defineProperty%":oh,"%Object.getPrototypeOf%":ah,"%Math.abs%":Xg,"%Math.floor%":Yg,"%Math.max%":Qg,"%Math.min%":eh,"%Math.pow%":th,"%Math.round%":rh,"%Math.sign%":nh,"%Reflect.getPrototypeOf%":sh};if(ve)try{null.error}catch(e){el=ve(ve(e)),gt["%Error.prototype%"]=el}var el,ch=a(function e(t){var r;if(t==="%AsyncFunction%")r=pi("async function () {}");else if(t==="%GeneratorFunction%")r=pi("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=pi("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ve&&(r=ve(o.prototype))}return gt[t]=r,r},"doEval"),tl={__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"]},hr=wt(),rn=li(),lh=hr.call(gr,Array.prototype.concat),ph=hr.call(ol,Array.prototype.splice),rl=hr.call(gr,String.prototype.replace),nn=hr.call(gr,String.prototype.slice),dh=hr.call(gr,RegExp.prototype.exec),mh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fh=/\\(\\)?/g,gh=a(function(t){var r=nn(t,0,1),n=nn(t,-1);if(r==="%"&&n!=="%")throw new kt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new kt("invalid intrinsic syntax, expected opening `%`");var o=[];return rl(t,mh,function(i,s,u,p){o[o.length]=u?rl(p,fh,"$1"):s||i}),o},"stringToPath"),hh=a(function(t,r){var n=t,o;if(rn(tl,n)&&(o=tl[n],n="%"+o[0]+"%"),rn(gt,n)){var i=gt[n];if(i===Rt&&(i=ch(n)),typeof i>"u"&&!r)throw new zt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new kt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");il.exports=a(function(t,r){if(typeof t!="string"||t.length===0)throw new zt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new zt('"allowMissing" argument must be a boolean');if(dh(/^%?[^%]*%?$/,t)===null)throw new kt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=gh(t),o=n.length>0?n[0]:"",i=hh("%"+o+"%",r),s=i.name,u=i.value,p=!1,d=i.alias;d&&(o=d[0],ph(n,lh([0,1],d)));for(var m=1,y=!0;m<n.length;m+=1){var v=n[m],l=nn(v,0,1),f=nn(v,-1);if((l==='"'||l==="'"||l==="`"||f==='"'||f==="'"||f==="`")&&l!==f)throw new kt("property names with quotes must have matching quotes");if((v==="constructor"||!y)&&(p=!0),o+="."+v,s="%"+o+"%",rn(gt,s))u=gt[s];else if(u!=null){if(!(v in u)){if(!r)throw new zt("base intrinsic for "+t+" exists, but the property is not available.");return}if(fr&&m+1>=n.length){var _=fr(u,v);y=!!_,y&&"get"in _&&!("originalValue"in _.get)?u=_.get:u=u[v]}else y=rn(u,v),u=u[v];y&&!p&&(gt[s]=u)}}return u},"GetIntrinsic")});var ul=b((lN,sl)=>{"use strict";var yh=ii();sl.exports=a(function(){return yh()&&!!Symbol.toStringTag},"hasToStringTagShams")});var pl=b((dN,ll)=>{"use strict";var vh=al(),cl=vh("%Object.defineProperty%",!0),_h=ul()(),Ph=li(),xh=Yr(),on=_h?Symbol.toStringTag:null;ll.exports=a(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 xh("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");on&&(n||!Ph(t,on))&&(cl?cl(t,on,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[on]=r)},"setToStringTag")});var ml=b((fN,dl)=>{"use strict";var bh=Function.prototype.call,Eh=Object.prototype.hasOwnProperty,Th=wt();dl.exports=Th.call(bh,Eh)});var gl=b((gN,fl)=>{"use strict";fl.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var vl=b((hN,yl)=>{"use strict";var hi=Pu(),Ih=require("util"),mi=require("path"),Ah=require("http"),Sh=require("https"),$h=require("url").parse,wh=require("fs"),Oh=require("stream").Stream,Rh=require("crypto"),fi=Iu(),zh=Bu(),kh=pl(),ot=ml(),gi=gl();function hl(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(hl,"escapeHeaderParam");function X(e){if(!(this instanceof X))return new X(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],hi.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(X,"FormData");Ih.inherits(X,hi);X.LINE_BREAK=`\r
|
|
2
|
+
`;X.DEFAULT_CONTENT_TYPE="application/octet-stream";X.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=hi.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),i=this._multiPartFooter();n(o),n(t),n(i),this._trackLength(o,t,r)};X.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)+X.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ot(t,"httpVersion"))&&!(t instanceof Oh))&&(r.knownLength||this._valuesToMeasure.push(t))};X.prototype._lengthRetriever=function(e,t){ot(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):wh.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):ot(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ot(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};X.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),i="",s={"Content-Disposition":["form-data",'name="'+hl(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&gi(s,r.header);var u;for(var p in s)if(ot(s,p)){if(u=s[p],u==null)continue;Array.isArray(u)||(u=[u]),u.length&&(i+=p+": "+u.join("; ")+X.LINE_BREAK)}return"--"+this.getBoundary()+X.LINE_BREAK+i+X.LINE_BREAK};X.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=mi.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=mi.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ot(e,"httpVersion")&&(r=mi.basename(e.client._httpMessage.path||"")),r)return'filename="'+hl(r)+'"'};X.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=fi.lookup(e.name)),!r&&e&&e.path&&(r=fi.lookup(e.path)),!r&&e&&e.readable&&ot(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=fi.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=X.DEFAULT_CONTENT_TYPE),r};X.prototype._multiPartFooter=function(){return function(e){var t=X.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};X.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+X.LINE_BREAK};X.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ot(e,t)&&(r[t.toLowerCase()]=e[t]);return r};X.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};X.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};X.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(X.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};X.prototype._generateBoundary=function(){this._boundary="--------------------------"+Rh.randomBytes(12).toString("hex")};X.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};X.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};X.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}zh.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};X.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=$h(e),n=gi({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=gi(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Sh.request(n):r=Ah.request(n),this.getLength(function(i,s){if(i&&i!=="Unknown stream"){this._error(i);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),t){var u,p=a(function(d,m){return r.removeListener("error",p),r.removeListener("response",u),t.call(this,d,m)},"callback");u=p.bind(this,null),r.on("error",p),r.on("response",u)}}.bind(this)),r};X.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};X.prototype.toString=function(){return"[object FormData]"};kh(X.prototype,"FormData");yl.exports=X});var se={};uo(se,{__addDisposableResource:()=>Yl,__assign:()=>sn,__asyncDelegator:()=>Hl,__asyncGenerator:()=>Vl,__asyncValues:()=>Zl,__await:()=>Ct,__awaiter:()=>Ml,__classPrivateFieldGet:()=>Kl,__classPrivateFieldIn:()=>Xl,__classPrivateFieldSet:()=>Jl,__createBinding:()=>cn,__decorate:()=>Ol,__disposeResources:()=>Ql,__esDecorate:()=>zl,__exportStar:()=>Ll,__extends:()=>$l,__generator:()=>Ul,__importDefault:()=>Wl,__importStar:()=>Gl,__makeTemplateObject:()=>ql,__metadata:()=>Nl,__param:()=>Rl,__propKey:()=>Cl,__read:()=>_i,__rest:()=>wl,__rewriteRelativeImportExtension:()=>ep,__runInitializers:()=>kl,__setFunctionName:()=>Dl,__spread:()=>jl,__spreadArray:()=>Bl,__spreadArrays:()=>Fl,__values:()=>un,default:()=>qh});function $l(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yi(e,t);function r(){this.constructor=e}a(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function wl(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Ol(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(s=e[u])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function Rl(e,t){return function(r,n){t(r,n,e)}}function zl(e,t,r,n,o,i){function s(P){if(P!==void 0&&typeof P!="function")throw new TypeError("Function expected");return P}a(s,"accept");for(var u=n.kind,p=u==="getter"?"get":u==="setter"?"set":"value",d=!t&&e?n.static?e:e.prototype:null,m=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),y,v=!1,l=r.length-1;l>=0;l--){var f={};for(var _ in n)f[_]=_==="access"?{}:n[_];for(var _ in n.access)f.access[_]=n.access[_];f.addInitializer=function(P){if(v)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(P||null))};var h=(0,r[l])(u==="accessor"?{get:m.get,set:m.set}:m[p],f);if(u==="accessor"){if(h===void 0)continue;if(h===null||typeof h!="object")throw new TypeError("Object expected");(y=s(h.get))&&(m.get=y),(y=s(h.set))&&(m.set=y),(y=s(h.init))&&o.unshift(y)}else(y=s(h))&&(u==="field"?o.unshift(y):m[p]=y)}d&&Object.defineProperty(d,n.name,m),v=!0}function kl(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function Cl(e){return typeof e=="symbol"?e:"".concat(e)}function Dl(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function Nl(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Ml(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return a(o,"adopt"),new(r||(r=Promise))(function(i,s){function u(m){try{d(n.next(m))}catch(y){s(y)}}a(u,"fulfilled");function p(m){try{d(n.throw(m))}catch(y){s(y)}}a(p,"rejected");function d(m){m.done?i(m.value):o(m.value).then(u,p)}a(d,"step"),d((n=n.apply(e,t||[])).next())})}function Ul(e,t){var r={label:0,sent:a(function(){if(i[0]&1)throw i[1];return i[1]},"sent"),trys:[],ops:[]},n,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(d){return function(m){return p([d,m])}}function p(d){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(i=d[0]&2?o.return:d[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,d[1])).done)return i;switch(o=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){r.label=d[1];break}if(d[0]===6&&r.label<i[1]){r.label=i[1],i=d;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(d);break}i[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(m){d=[6,m],o=0}finally{n=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Ll(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&cn(t,e,r)}function un(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:a(function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}},"next")};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _i(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i}function jl(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_i(arguments[t]));return e}function Fl(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],s=0,u=i.length;s<u;s++,o++)n[o]=i[s];return n}function Bl(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Ct(e){return this instanceof Ct?(this.v=e,this):new Ct(e)}function Vl(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(l){return function(f){return Promise.resolve(f).then(l,y)}}function u(l,f){n[l]&&(o[l]=function(_){return new Promise(function(h,P){i.push([l,_,h,P])>1||p(l,_)})},f&&(o[l]=f(o[l])))}function p(l,f){try{d(n[l](f))}catch(_){v(i[0][3],_)}}function d(l){l.value instanceof Ct?Promise.resolve(l.value.v).then(m,y):v(i[0][2],l)}function m(l){p("next",l)}function y(l){p("throw",l)}function v(l,f){l(f),i.shift(),i.length&&p(i[0][0],i[0][1])}}function Hl(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(s){return(r=!r)?{value:Ct(e[o](s)),done:!1}:i?i(s):s}:i}}function Zl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof un=="function"?un(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(s){return new Promise(function(u,p){s=e[i](s),o(u,p,s.done,s.value)})}}function o(i,s,u,p){Promise.resolve(p).then(function(d){i({value:d,done:u})},s)}}function ql(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Gl(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=vi(e),n=0;n<r.length;n++)r[n]!=="default"&&cn(t,e,r[n]);return Hh(t,e),t}function Wl(e){return e&&e.__esModule?e:{default:e}}function Kl(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Jl(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function Xl(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Yl(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=a(function(){try{o.call(this)}catch(i){return Promise.reject(i)}},"dispose")),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function Ql(e){function t(i){e.error=e.hasError?new Zh(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}a(t,"fail");var r,n=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(s){return t(s),o()})}else n|=1}catch(s){t(s)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return a(o,"next"),o()}function ep(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,s){return n?t?".jsx":".js":o&&(!i||!s)?r:o+i+"."+s.toLowerCase()+"js"}):e}var yi,sn,cn,Hh,vi,Zh,qh,ue=pd(()=>{yi=a(function(e,t){return yi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},yi(e,t)},"extendStatics");a($l,"__extends");sn=a(function(){return sn=Object.assign||a(function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},"__assign"),sn.apply(this,arguments)},"__assign");a(wl,"__rest");a(Ol,"__decorate");a(Rl,"__param");a(zl,"__esDecorate");a(kl,"__runInitializers");a(Cl,"__propKey");a(Dl,"__setFunctionName");a(Nl,"__metadata");a(Ml,"__awaiter");a(Ul,"__generator");cn=Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return t[r]},"get")}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]});a(Ll,"__exportStar");a(un,"__values");a(_i,"__read");a(jl,"__spread");a(Fl,"__spreadArrays");a(Bl,"__spreadArray");a(Ct,"__await");a(Vl,"__asyncGenerator");a(Hl,"__asyncDelegator");a(Zl,"__asyncValues");a(ql,"__makeTemplateObject");Hh=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},vi=a(function(e){return vi=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},vi(e)},"ownKeys");a(Gl,"__importStar");a(Wl,"__importDefault");a(Kl,"__classPrivateFieldGet");a(Jl,"__classPrivateFieldSet");a(Xl,"__classPrivateFieldIn");a(Yl,"__addDisposableResource");Zh=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};a(Ql,"__disposeResources");a(ep,"__rewriteRelativeImportExtension");qh={__extends:$l,__assign:sn,__rest:wl,__decorate:Ol,__param:Rl,__esDecorate:zl,__runInitializers:kl,__propKey:Cl,__setFunctionName:Dl,__metadata:Nl,__awaiter:Ml,__generator:Ul,__createBinding:cn,__exportStar:Ll,__values:un,__read:_i,__spread:jl,__spreadArrays:Fl,__spreadArray:Bl,__await:Ct,__asyncGenerator:Vl,__asyncDelegator:Hl,__asyncValues:Zl,__makeTemplateObject:ql,__importStar:Gl,__importDefault:Wl,__classPrivateFieldGet:Kl,__classPrivateFieldSet:Jl,__classPrivateFieldIn:Xl,__addDisposableResource:Yl,__disposeResources:Ql,__rewriteRelativeImportExtension:ep}});var vr=b(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.RequestMethod=void 0;var tp;(function(e){e.GET="GET",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"})(tp||(ln.RequestMethod=tp={}))});var rp=b(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.BatchRequestContent=void 0;var Dt=(ue(),ie(se)),Pi=vr(),Gh=(function(){function e(t){if(this.requests=new Map,typeof t<"u"){var r=e.requestLimit;if(t.length>r){var n=new Error("Maximum requests limit exceeded, Max allowed number of requests are ".concat(r));throw n.name="Limit Exceeded Error",n}for(var o=0,i=t;o<i.length;o++){var s=i[o];this.addRequest(s)}}}return a(e,"BatchRequestContent"),e.validateDependencies=function(t){var r=a(function(s){for(var u=s.entries(),p=u.next();!p.done;){var d=p.value[1];if(d.dependsOn!==void 0&&d.dependsOn.length>0)return!1;p=u.next()}return!0},"isParallel"),n=a(function(s){var u=s.entries(),p=u.next(),d=p.value[1];if(d.dependsOn!==void 0&&d.dependsOn.length>0)return!1;var m=p;for(p=u.next();!p.done;){var y=p.value[1];if(y.dependsOn===void 0||y.dependsOn.length!==1||y.dependsOn[0]!==m.value[1].id)return!1;m=p,p=u.next()}return!0},"isSerial"),o=a(function(s){var u=s.entries(),p=u.next(),d=p.value[1],m;if(d.dependsOn===void 0||d.dependsOn.length===0)m=d.id;else if(d.dependsOn.length===1){var y=d.dependsOn[0];if(y!==d.id&&s.has(y))m=y;else return!1}else return!1;for(p=u.next();!p.done;){var v=p.value[1];if((v.dependsOn===void 0||v.dependsOn.length===0)&&m!==v.id||v.dependsOn!==void 0&&v.dependsOn.length!==0&&(v.dependsOn.length===1&&(v.id===m||v.dependsOn[0]!==m)||v.dependsOn.length>1))return!1;p=u.next()}return!0},"isSame");if(t.size===0){var i=new Error("Empty requests map, Please provide at least one request.");throw i.name="Empty Requests Error",i}return r(t)||n(t)||o(t)},e.getRequestData=function(t){return Dt.__awaiter(this,void 0,void 0,function(){var r,n,o,i;return Dt.__generator(this,function(s){switch(s.label){case 0:return r={url:""},n=new RegExp("^https?://"),r.url=n.test(t.url)?"/"+t.url.split(/.*?\/\/.*?\//)[1]:t.url,r.method=t.method,o={},t.headers.forEach(function(u,p){o[p]=u}),Object.keys(o).length&&(r.headers=o),t.method===Pi.RequestMethod.PATCH||t.method===Pi.RequestMethod.POST||t.method===Pi.RequestMethod.PUT?(i=r,[4,e.getRequestBody(t)]):[3,2];case 1:i.body=s.sent(),s.label=2;case 2:return[2,r]}})})},e.getRequestBody=function(t){return Dt.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,p,d;return Dt.__generator(this,function(m){switch(m.label){case 0:r=!1,m.label=1;case 1:return m.trys.push([1,3,,4]),o=t.clone(),[4,o.json()];case 2:return n=m.sent(),r=!0,[3,4];case 3:return i=m.sent(),[3,4];case 4:if(r)return[3,12];m.label=5;case 5:return m.trys.push([5,11,,12]),typeof Blob<"u"?[4,t.blob()]:[3,8];case 6:return s=m.sent(),u=new FileReader,[4,new Promise(function(y){u.addEventListener("load",function(){var v=u.result,l=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$"),f=l.exec(v);y(f[4])},!1),u.readAsDataURL(s)})];case 7:return n=m.sent(),[3,10];case 8:return typeof Buffer<"u"?[4,t.buffer()]:[3,10];case 9:p=m.sent(),n=p.toString("base64"),m.label=10;case 10:return r=!0,[3,12];case 11:return d=m.sent(),[3,12];case 12:return[2,n]}})})},e.prototype.addRequest=function(t){var r=e.requestLimit;if(t.id===""){var n=new Error("Id for a request is empty, Please provide an unique id");throw n.name="Empty Id For Request",n}if(this.requests.size===r){var n=new Error("Maximum requests limit exceeded, Max allowed number of requests are ".concat(r));throw n.name="Limit Exceeded Error",n}if(this.requests.has(t.id)){var n=new Error("Adding request with duplicate id ".concat(t.id,", Make the id of the requests unique"));throw n.name="Duplicate RequestId Error",n}return this.requests.set(t.id,t),t.id},e.prototype.removeRequest=function(t){for(var r=this.requests.delete(t),n=this.requests.entries(),o=n.next();!o.done;){var i=o.value[1].dependsOn;if(typeof i<"u"){var s=i.indexOf(t);s!==-1&&i.splice(s,1),i.length===0&&delete o.value[1].dependsOn}o=n.next()}return r},e.prototype.getContent=function(){return Dt.__awaiter(this,void 0,void 0,function(){var t,r,n,o,u,u,i,s,u;return Dt.__generator(this,function(p){switch(p.label){case 0:if(t=[],r={requests:t},n=this.requests.entries(),o=n.next(),o.done)throw u=new Error("No requests added yet, Please add at least one request."),u.name="Empty Payload",u;if(!e.validateDependencies(this.requests))throw u=new Error(`Invalid dependency found, Dependency should be:
|
|
3
3
|
1. Parallel - no individual request states a dependency in the dependsOn property.
|
|
4
4
|
2. Serial - all individual requests depend on the previous individual request.
|
|
5
|
-
3. Same - all individual requests that state a dependency in the dependsOn property, state the same dependency.`),u.name="Invalid Dependency",u;p.label=1;case 1:return o.done?[3,3]:(i=o.value[1],[4,e.getRequestData(i.request)]);case 2:if(s=p.sent(),s.body!==void 0&&(s.headers===void 0||s.headers["content-type"]===void 0))throw u=new Error("Content-type header is not mentioned for request #".concat(i.id,", For request having body, Content-type header should be mentioned")),u.name="Invalid Content-type header",u;return s.id=i.id,i.dependsOn!==void 0&&i.dependsOn.length>0&&(s.dependsOn=i.dependsOn),t.push(s),o=n.next(),[3,1];case 3:return r.requests=t,[2,r]}})})},e.prototype.addDependency=function(t,r){if(!this.requests.has(t)){var n=new Error("Dependent ".concat(t," does not exists, Please check the id"));throw n.name="Invalid Dependent",n}if(typeof r<"u"&&!this.requests.has(r)){var n=new Error("Dependency ".concat(r," does not exists, Please check the id"));throw n.name="Invalid Dependency",n}if(typeof r<"u"){var o=this.requests.get(t);if(o.dependsOn===void 0&&(o.dependsOn=[]),o.dependsOn.indexOf(r)!==-1){var n=new Error("Dependency ".concat(r," is already added for the request ").concat(t));throw n.name="Duplicate Dependency",n}o.dependsOn.push(r)}else{for(var i=this.requests.entries(),s=void 0,u=i.next();!u.done&&u.value[1].id!==t;)s=u,u=i.next();if(typeof s<"u"){var p=s.value[0];if(u.value[1].dependsOn===void 0&&(u.value[1].dependsOn=[]),u.value[1].dependsOn.indexOf(p)!==-1){var n=new Error("Dependency ".concat(p," is already added for the request ").concat(t));throw n.name="Duplicate Dependency",n}u.value[1].dependsOn.push(p)}else{var n=new Error("Can't add dependency ".concat(r,", There is only a dependent request in the batch"));throw n.name="Invalid Dependency Addition",n}}},e.prototype.removeDependency=function(t,r){var n=this.requests.get(t);if(typeof n>"u"||n.dependsOn===void 0||n.dependsOn.length===0)return!1;if(typeof r<"u"){var o=n.dependsOn.indexOf(r);return o===-1?!1:(n.dependsOn.splice(o,1),!0)}else return delete n.dependsOn,!0},e.requestLimit=20,e}();un.BatchRequestContent=Ah});var Vl=b(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.BatchResponseContent=void 0;var Sh=(se(),oe(ae)),$h=function(){function e(t){this.responses=new Map,this.update(t)}return a(e,"BatchResponseContent"),e.prototype.createResponseObject=function(t){var r=t.body,n={};if(n.status=t.status,t.statusText!==void 0&&(n.statusText=t.statusText),n.headers=t.headers,n.headers!==void 0&&n.headers["Content-Type"]!==void 0&&n.headers["Content-Type"].split(";")[0]==="application/json"){var o=JSON.stringify(r);return new Response(o,n)}return new Response(r,n)},e.prototype.update=function(t){this.nextLink=t["@odata.nextLink"];for(var r=t.responses,n=0,o=r.length;n<o;n++)this.responses.set(r[n].id,this.createResponseObject(r[n]))},e.prototype.getResponseById=function(t){return this.responses.get(t)},e.prototype.getResponses=function(){return this.responses},e.prototype.getResponsesIterator=function(){var t,r;return Sh.__generator(this,function(n){switch(n.label){case 0:t=this.responses.entries(),r=t.next(),n.label=1;case 1:return r.done?[3,3]:[4,r.value];case 2:return n.sent(),r=t.next(),[3,1];case 3:return[2]}})},e}();cn.BatchResponseContent=$h});var vi=b(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.GRAPH_URLS=rt.GRAPH_BASE_URL=rt.GRAPH_API_VERSION=void 0;rt.GRAPH_API_VERSION="v1.0";rt.GRAPH_BASE_URL="https://graph.microsoft.com/";rt.GRAPH_URLS=new Set(["graph.microsoft.com","graph.microsoft.us","dod-graph.microsoft.us","graph.microsoft.de","microsoftgraph.chinacloudapi.cn","canary.graph.microsoft.com"])});var qe=b(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.GraphClientError=void 0;var wh=(se(),oe(ae)),Oh=function(e){wh.__extends(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return a(t,"GraphClientError"),t.setGraphClientError=function(r){var n;return r instanceof Error?n=r:(n=new t,n.customError=r),n},t}(Error);ln.GraphClientError=Oh});var pn=b(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.isCustomHost=we.isGraphURL=we.serializeContent=we.urlJoin=we.oDataQueryNames=void 0;var zh=vi(),Rh=qe();we.oDataQueryNames=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"];var kh=a(function(e){var t=a(function(i){return i.replace(/\/+$/,"")},"removePostSlash"),r=a(function(i){return i.replace(/^\/+/,"")},"removePreSlash"),n=a(function(i,s){return[t(i),r(s)].join("/")},"joiner"),o=Array.prototype.slice.call(e);return o.reduce(n)},"urlJoin");we.urlJoin=kh;var Dh=a(function(e){var t=e&&e.constructor&&e.constructor.name;if(t==="Buffer"||t==="Blob"||t==="File"||t==="FormData"||typeof e=="string")return e;if(t==="ArrayBuffer")e=Buffer.from(e);else if(t==="Int8Array"||t==="Int16Array"||t==="Int32Array"||t==="Uint8Array"||t==="Uint16Array"||t==="Uint32Array"||t==="Uint8ClampedArray"||t==="Float32Array"||t==="Float64Array"||t==="DataView")e=Buffer.from(e.buffer);else try{e=JSON.stringify(e)}catch{throw new Error("Unable to stringify the content")}return e},"serializeContent");we.serializeContent=Dh;var Ch=a(function(e){return Hl(e)},"isGraphURL");we.isGraphURL=Ch;var Nh=a(function(e,t){return t.forEach(function(r){return Mh(r)}),Hl(e,t)},"isCustomHost");we.isCustomHost=Nh;var Hl=a(function(e,t){if(t===void 0&&(t=zh.GRAPH_URLS),e=e.toLowerCase(),e.indexOf("https://")!==-1){e=e.replace("https://","");var r=e.indexOf(":"),n=e.indexOf("/"),o="";if(n!==-1)return r!==-1&&r<n?(o=e.substring(0,r),t.has(o)):(o=e.substring(0,n),t.has(o))}return!1},"isValidEndpoint"),Mh=a(function(e){if(e.indexOf("/")!==-1)throw new Rh.GraphClientError("Please add only hosts or hostnames to the CustomHosts config. If the url is `http://example.com:3000/`, host is `example:3000`")},"isCustomHostValid")});var nt=b(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.MiddlewareControl=void 0;var Uh=function(){function e(t){t===void 0&&(t=[]),this.middlewareOptions=new Map;for(var r=0,n=t;r<n.length;r++){var o=n[r],i=o.constructor;this.middlewareOptions.set(i,o)}}return a(e,"MiddlewareControl"),e.prototype.getMiddlewareOptions=function(t){return this.middlewareOptions.get(t)},e.prototype.setMiddlewareOptions=function(t,r){this.middlewareOptions.set(t,r)},e}();dn.MiddlewareControl=Uh});var Ct=b(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.cloneRequestWithNewUrl=Oe.appendRequestHeader=Oe.setRequestHeader=Oe.getRequestHeader=Oe.generateUUID=void 0;var Zl=(se(),oe(ae)),Lh=a(function(){for(var e="",t=0;t<32;t++)(t===8||t===12||t===16||t===20)&&(e+="-"),e+=Math.floor(Math.random()*16).toString(16);return e},"generateUUID");Oe.generateUUID=Lh;var jh=a(function(e,t,r){var n=null;if(typeof Request<"u"&&e instanceof Request)n=e.headers.get(r);else if(typeof t<"u"&&t.headers!==void 0)if(typeof Headers<"u"&&t.headers instanceof Headers)n=t.headers.get(r);else if(t.headers instanceof Array){for(var o=t.headers,i=0,s=o.length;i<s;i++)if(o[i][0]===r){n=o[i][1];break}}else t.headers[r]!==void 0&&(n=t.headers[r]);return n},"getRequestHeader");Oe.getRequestHeader=jh;var Fh=a(function(e,t,r,n){var o,i;if(typeof Request<"u"&&e instanceof Request)e.headers.set(r,n);else if(typeof t<"u")if(t.headers===void 0)t.headers=new Headers((o={},o[r]=n,o));else if(typeof Headers<"u"&&t.headers instanceof Headers)t.headers.set(r,n);else if(t.headers instanceof Array){for(var s=0,u=t.headers.length;s<u;s++){var p=t.headers[s];if(p[0]===r){p[1]=n;break}}s===u&&t.headers.push([r,n])}else Object.assign(t.headers,(i={},i[r]=n,i))},"setRequestHeader");Oe.setRequestHeader=Fh;var Bh=a(function(e,t,r,n){var o,i;typeof Request<"u"&&e instanceof Request?e.headers.append(r,n):typeof t<"u"&&(t.headers===void 0?t.headers=new Headers((o={},o[r]=n,o)):typeof Headers<"u"&&t.headers instanceof Headers?t.headers.append(r,n):t.headers instanceof Array?t.headers.push([r,n]):t.headers===void 0?t.headers=(i={},i[r]=n,i):t.headers[r]===void 0?t.headers[r]=n:t.headers[r]+=", ".concat(n))},"appendRequestHeader");Oe.appendRequestHeader=Bh;var Vh=a(function(e,t){return Zl.__awaiter(void 0,void 0,void 0,function(){var r,n,o,i,s,u,p,d,f,v,y,l,m;return Zl.__generator(this,function(_){switch(_.label){case 0:return t.headers.get("Content-Type")?[4,t.blob()]:[3,2];case 1:return n=_.sent(),[3,4];case 2:return[4,Promise.resolve(void 0)];case 3:n=_.sent(),_.label=4;case 4:return r=n,o=t.method,i=t.headers,s=t.referrer,u=t.referrerPolicy,p=t.mode,d=t.credentials,f=t.cache,v=t.redirect,y=t.integrity,l=t.keepalive,m=t.signal,[2,new Request(e,{method:o,headers:i,body:r,referrer:s,referrerPolicy:u,mode:p,credentials:d,cache:f,redirect:v,integrity:y,keepalive:l,signal:m})]}})})},"cloneRequestWithNewUrl");Oe.cloneRequestWithNewUrl=Vh});var _i=b(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.AuthenticationHandlerOptions=void 0;var Hh=function(){function e(t,r){this.authenticationProvider=t,this.authenticationProviderOptions=r}return a(e,"AuthenticationHandlerOptions"),e}();fn.AuthenticationHandlerOptions=Hh});var Mt=b(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.TelemetryHandlerOptions=Nt.FeatureUsageFlag=void 0;var ql=nt(),xi;(function(e){e[e.NONE=0]="NONE",e[e.REDIRECT_HANDLER_ENABLED=1]="REDIRECT_HANDLER_ENABLED",e[e.RETRY_HANDLER_ENABLED=2]="RETRY_HANDLER_ENABLED",e[e.AUTHENTICATION_HANDLER_ENABLED=4]="AUTHENTICATION_HANDLER_ENABLED"})(xi||(Nt.FeatureUsageFlag=xi={}));var Zh=function(){function e(){this.featureUsage=xi.NONE}return a(e,"TelemetryHandlerOptions"),e.updateFeatureUsageFlag=function(t,r){var n;t.middlewareControl instanceof ql.MiddlewareControl?n=t.middlewareControl.getMiddlewareOptions(e):t.middlewareControl=new ql.MiddlewareControl,typeof n>"u"&&(n=new e,t.middlewareControl.setMiddlewareOptions(e,n)),n.setFeatureUsage(r)},e.prototype.setFeatureUsage=function(t){this.featureUsage=this.featureUsage|t},e.prototype.getFeatureUsage=function(){return this.featureUsage.toString(16)},e}();Nt.TelemetryHandlerOptions=Zh});var gn=b(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.AuthenticationHandler=void 0;var Gl=(se(),oe(ae)),Wl=pn(),qh=nt(),Gh=Ct(),Wh=_i(),Kl=Mt(),Kh=function(){function e(t){this.authenticationProvider=t}return a(e,"AuthenticationHandler"),e.prototype.execute=function(t){return Gl.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u;return Gl.__generator(this,function(p){switch(p.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,Wl.isGraphURL)(r)||t.customHosts&&(0,Wl.isCustomHost)(r,t.customHosts)?(n=void 0,t.middlewareControl instanceof qh.MiddlewareControl&&(n=t.middlewareControl.getMiddlewareOptions(Wh.AuthenticationHandlerOptions)),o=void 0,i=void 0,n&&(o=n.authenticationProvider,i=n.authenticationProviderOptions),o||(o=this.authenticationProvider),[4,o.getAccessToken(i)]):[3,2];case 1:return s=p.sent(),u="Bearer ".concat(s),(0,Gh.appendRequestHeader)(t.request,t.options,e.AUTHORIZATION_HEADER,u),Kl.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Kl.FeatureUsageFlag.AUTHENTICATION_HANDLER_ENABLED),[3,3];case 2:t.options.headers&&delete t.options.headers[e.AUTHORIZATION_HEADER],p.label=3;case 3:return[4,this.nextMiddleware.execute(t)];case 4:return[2,p.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.AUTHORIZATION_HEADER="Authorization",e}();mn.AuthenticationHandler=Kh});var yn=b(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.HTTPMessageHandler=void 0;var Jl=(se(),oe(ae)),Jh=function(){function e(){}return a(e,"HTTPMessageHandler"),e.prototype.execute=function(t){return Jl.__awaiter(this,void 0,void 0,function(){var r;return Jl.__generator(this,function(n){switch(n.label){case 0:return r=t,[4,fetch(t.request,t.options)];case 1:return r.response=n.sent(),[2]}})})},e}();hn.HTTPMessageHandler=Jh});var yr=b(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.RetryHandlerOptions=void 0;var Xh=function(){function e(t,r,n){if(t===void 0&&(t=e.DEFAULT_DELAY),r===void 0&&(r=e.DEFAULT_MAX_RETRIES),n===void 0&&(n=e.defaultShouldRetry),t>e.MAX_DELAY&&r>e.MAX_MAX_RETRIES){var o=new Error("Delay and MaxRetries should not be more than ".concat(e.MAX_DELAY," and ").concat(e.MAX_MAX_RETRIES));throw o.name="MaxLimitExceeded",o}else if(t>e.MAX_DELAY){var o=new Error("Delay should not be more than ".concat(e.MAX_DELAY));throw o.name="MaxLimitExceeded",o}else if(r>e.MAX_MAX_RETRIES){var o=new Error("MaxRetries should not be more than ".concat(e.MAX_MAX_RETRIES));throw o.name="MaxLimitExceeded",o}else if(t<0&&r<0){var o=new Error("Delay and MaxRetries should not be negative");throw o.name="MinExpectationNotMet",o}else if(t<0){var o=new Error("Delay should not be negative");throw o.name="MinExpectationNotMet",o}else if(r<0){var o=new Error("MaxRetries should not be negative");throw o.name="MinExpectationNotMet",o}this.delay=Math.min(t,e.MAX_DELAY),this.maxRetries=Math.min(r,e.MAX_MAX_RETRIES),this.shouldRetry=n}return a(e,"RetryHandlerOptions"),e.prototype.getMaxDelay=function(){return e.MAX_DELAY},e.DEFAULT_DELAY=3,e.DEFAULT_MAX_RETRIES=3,e.MAX_DELAY=180,e.MAX_MAX_RETRIES=10,e.defaultShouldRetry=function(){return!0},e}();vn.RetryHandlerOptions=Xh});var xn=b(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.RetryHandler=void 0;var Ut=(se(),oe(ae)),Pi=hr(),Yh=nt(),Xl=Ct(),Yl=yr(),Ql=Mt(),Qh=function(){function e(t){t===void 0&&(t=new Yl.RetryHandlerOptions),this.options=t}return a(e,"RetryHandler"),e.prototype.isRetry=function(t){return e.RETRY_STATUS_CODES.indexOf(t.status)!==-1},e.prototype.isBuffered=function(t,r){var n=typeof t=="string"?r.method:t.method,o=n===Pi.RequestMethod.PUT||n===Pi.RequestMethod.PATCH||n===Pi.RequestMethod.POST;if(o){var i=(0,Xl.getRequestHeader)(t,r,"Content-Type")==="application/octet-stream";if(i)return!1}return!0},e.prototype.getDelay=function(t,r,n){var o=a(function(){return Number(Math.random().toFixed(3))},"getRandomness"),i=t.headers!==void 0?t.headers.get(e.RETRY_AFTER_HEADER):null,s;return i!==null?Number.isNaN(Number(i))?s=Math.round((new Date(i).getTime()-Date.now())/1e3):s=Number(i):s=r>=2?this.getExponentialBackOffTime(r)+n+o():n+o(),Math.min(s,this.options.getMaxDelay()+o())},e.prototype.getExponentialBackOffTime=function(t){return Math.round(1/2*(Math.pow(2,t)-1))},e.prototype.sleep=function(t){return Ut.__awaiter(this,void 0,void 0,function(){var r;return Ut.__generator(this,function(n){return r=t*1e3,[2,new Promise(function(o){return setTimeout(o,r)})]})})},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof Yh.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof r>"u"&&(r=Object.assign(new Yl.RetryHandlerOptions,this.options)),r},e.prototype.executeWithRetry=function(t,r,n){return Ut.__awaiter(this,void 0,void 0,function(){var o;return Ut.__generator(this,function(i){switch(i.label){case 0:return[4,this.nextMiddleware.execute(t)];case 1:return i.sent(),r<n.maxRetries&&this.isRetry(t.response)&&this.isBuffered(t.request,t.options)&&n.shouldRetry(n.delay,r,t.request,t.options,t.response)?(++r,(0,Xl.setRequestHeader)(t.request,t.options,e.RETRY_ATTEMPT_HEADER,r.toString()),o=this.getDelay(t.response,r,n.delay),[4,this.sleep(o)]):[3,4];case 2:return i.sent(),[4,this.executeWithRetry(t,r,n)];case 3:return[2,i.sent()];case 4:return[2]}})})},e.prototype.execute=function(t){return Ut.__awaiter(this,void 0,void 0,function(){var r,n;return Ut.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),Ql.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Ql.FeatureUsageFlag.RETRY_HANDLER_ENABLED),[4,this.executeWithRetry(t,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.RETRY_STATUS_CODES=[429,503,504],e.RETRY_ATTEMPT_HEADER="Retry-Attempt",e.RETRY_AFTER_HEADER="Retry-After",e}();_n.RetryHandler=Qh});var vr=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.RedirectHandlerOptions=void 0;var ey=function(){function e(t,r){if(t===void 0&&(t=e.DEFAULT_MAX_REDIRECTS),r===void 0&&(r=e.defaultShouldRedirect),t>e.MAX_MAX_REDIRECTS){var n=new Error("MaxRedirects should not be more than ".concat(e.MAX_MAX_REDIRECTS));throw n.name="MaxLimitExceeded",n}if(t<0){var n=new Error("MaxRedirects should not be negative");throw n.name="MinExpectationNotMet",n}this.maxRedirects=t,this.shouldRedirect=r}return a(e,"RedirectHandlerOptions"),e.DEFAULT_MAX_REDIRECTS=5,e.MAX_MAX_REDIRECTS=20,e.defaultShouldRedirect=function(){return!0},e}();Pn.RedirectHandlerOptions=ey});var Tn=b(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.RedirectHandler=void 0;var Lt=(se(),oe(ae)),ty=hr(),ry=nt(),ny=Ct(),bi=vr(),ep=Mt(),oy=function(){function e(t){t===void 0&&(t=new bi.RedirectHandlerOptions),this.options=t}return a(e,"RedirectHandler"),e.prototype.isRedirect=function(t){return e.REDIRECT_STATUS_CODES.indexOf(t.status)!==-1},e.prototype.hasLocationHeader=function(t){return t.headers.has(e.LOCATION_HEADER)},e.prototype.getLocationHeader=function(t){return t.headers.get(e.LOCATION_HEADER)},e.prototype.isRelativeURL=function(t){return t.indexOf("://")===-1},e.prototype.shouldDropAuthorizationHeader=function(t,r){var n=/^[A-Za-z].+?:\/\/.+?(?=\/|$)/,o=n.exec(t),i,s;o!==null&&(i=o[0]);var u=n.exec(r);return u!==null&&(s=u[0]),typeof i<"u"&&typeof s<"u"&&i!==s},e.prototype.updateRequestUrl=function(t,r){return Lt.__awaiter(this,void 0,void 0,function(){var n,o;return Lt.__generator(this,function(i){switch(i.label){case 0:return n=r,typeof r.request!="string"?[3,1]:(o=t,[3,3]);case 1:return[4,(0,ny.cloneRequestWithNewUrl)(t,r.request)];case 2:o=i.sent(),i.label=3;case 3:return n.request=o,[2]}})})},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof ry.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(bi.RedirectHandlerOptions)),typeof r>"u"&&(r=Object.assign(new bi.RedirectHandlerOptions,this.options)),r},e.prototype.executeWithRedirect=function(t,r,n){return Lt.__awaiter(this,void 0,void 0,function(){var o,i;return Lt.__generator(this,function(s){switch(s.label){case 0:return[4,this.nextMiddleware.execute(t)];case 1:return s.sent(),o=t.response,r<n.maxRedirects&&this.isRedirect(o)&&this.hasLocationHeader(o)&&n.shouldRedirect(o)?(++r,o.status!==e.STATUS_CODE_SEE_OTHER?[3,2]:(t.options.method=ty.RequestMethod.GET,delete t.options.body,[3,4])):[3,6];case 2:return i=this.getLocationHeader(o),!this.isRelativeURL(i)&&this.shouldDropAuthorizationHeader(o.url,i)&&delete t.options.headers[e.AUTHORIZATION_HEADER],[4,this.updateRequestUrl(i,t)];case 3:s.sent(),s.label=4;case 4:return[4,this.executeWithRedirect(t,r,n)];case 5:return s.sent(),[3,7];case 6:return[2];case 7:return[2]}})})},e.prototype.execute=function(t){return Lt.__awaiter(this,void 0,void 0,function(){var r,n;return Lt.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),t.options.redirect=e.MANUAL_REDIRECT,ep.TelemetryHandlerOptions.updateFeatureUsageFlag(t,ep.FeatureUsageFlag.REDIRECT_HANDLER_ENABLED),[4,this.executeWithRedirect(t,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.REDIRECT_STATUS_CODES=[301,302,303,307,308],e.STATUS_CODE_SEE_OTHER=303,e.LOCATION_HEADER="Location",e.AUTHORIZATION_HEADER="Authorization",e.MANUAL_REDIRECT="manual",e}();bn.RedirectHandler=oy});var tp=b(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.PACKAGE_VERSION=void 0;En.PACKAGE_VERSION="3.0.7"});var Sn=b(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.TelemetryHandler=void 0;var rp=(se(),oe(ae)),np=pn(),iy=tp(),ay=nt(),In=Ct(),sy=Mt(),uy=function(){function e(){}return a(e,"TelemetryHandler"),e.prototype.execute=function(t){return rp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s;return rp.__generator(this,function(u){switch(u.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,np.isGraphURL)(r)||t.customHosts&&(0,np.isCustomHost)(r,t.customHosts)?(n=(0,In.getRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER),n||(n=(0,In.generateUUID)(),(0,In.setRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER,n)),o="".concat(e.PRODUCT_NAME,"/").concat(iy.PACKAGE_VERSION),i=void 0,t.middlewareControl instanceof ay.MiddlewareControl&&(i=t.middlewareControl.getMiddlewareOptions(sy.TelemetryHandlerOptions)),i&&(s=i.getFeatureUsage(),o+=" (".concat(e.FEATURE_USAGE_STRING,"=").concat(s,")")),(0,In.appendRequestHeader)(t.request,t.options,e.SDK_VERSION_HEADER,o)):(delete t.options.headers[e.CLIENT_REQUEST_ID_HEADER],delete t.options.headers[e.SDK_VERSION_HEADER]),[4,this.nextMiddleware.execute(t)];case 1:return[2,u.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.CLIENT_REQUEST_ID_HEADER="client-request-id",e.SDK_VERSION_HEADER="SdkVersion",e.PRODUCT_NAME="graph-js",e.FEATURE_USAGE_STRING="featureUsage",e}();An.TelemetryHandler=uy});var op=b($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.MiddlewareFactory=void 0;var cy=gn(),ly=yn(),py=vr(),dy=yr(),fy=Tn(),my=xn(),gy=Sn(),hy=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),yy=function(){function e(){}return a(e,"MiddlewareFactory"),e.getDefaultMiddlewareChain=function(t){var r=[],n=new cy.AuthenticationHandler(t),o=new my.RetryHandler(new dy.RetryHandlerOptions),i=new gy.TelemetryHandler,s=new ly.HTTPMessageHandler;if(r.push(n),r.push(o),hy()){var u=new fy.RedirectHandler(new py.RedirectHandlerOptions);r.push(u)}return r.push(i),r.push(s),r},e}();$n.MiddlewareFactory=yy});var On=b(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.ChaosStrategy=void 0;var ip;(function(e){e[e.MANUAL=0]="MANUAL",e[e.RANDOM=1]="RANDOM"})(ip||(wn.ChaosStrategy=ip={}))});var Ti=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.ChaosHandlerOptions=void 0;var vy=On(),_y=function(){function e(t,r,n,o,i,s){if(t===void 0&&(t=vy.ChaosStrategy.RANDOM),r===void 0&&(r="Some error Happened"),this.chaosStrategy=t,this.statusCode=n,this.statusMessage=r,this.chaosPercentage=o!==void 0?o:10,this.responseBody=i,this.headers=s,this.chaosPercentage>100)throw new Error("Error Pecentage can not be more than 100")}return a(e,"ChaosHandlerOptions"),e}();zn.ChaosHandlerOptions=_y});var ap=b(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.httpStatusCode=jt.methodStatusCode=void 0;jt.methodStatusCode={GET:[429,500,502,503,504],POST:[429,500,502,503,504,507],PUT:[429,500,502,503,504,507],PATCH:[429,500,502,503,504],DELETE:[429,500,502,503,504,507]};jt.httpStatusCode={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"}});var cp=b(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ChaosHandler=void 0;var Rn=(se(),oe(ae)),xy=nt(),Py=Ct(),sp=ap(),Ei=Ti(),up=On(),by=function(){function e(t,r){t===void 0&&(t=new Ei.ChaosHandlerOptions),this.options=t,this.manualMap=r}return a(e,"ChaosHandler"),e.prototype.createResponseHeaders=function(t,r,n){var o=t.headers?new Headers(t.headers):new Headers;return o.append("Cache-Control","no-store"),o.append("request-id",r),o.append("client-request-id",r),o.append("x-ms-ags-diagnostic",""),o.append("Date",n),o.append("Strict-Transport-Security",""),t.statusCode===429&&o.append("retry-after","3"),o},e.prototype.createResponseBody=function(t,r,n){if(t.responseBody)return t.responseBody;var o;if(t.statusCode>=400){var i=sp.httpStatusCode[t.statusCode],s=t.statusMessage;o={error:{code:i,message:s,innerError:{"request-id":r,date:n}}}}else o={};return o},e.prototype.createResponse=function(t,r){var n=r.request,o=(0,Py.generateUUID)(),i=new Date,s=this.createResponseHeaders(t,o,i.toString()),u=this.createResponseBody(t,o,i.toString()),p={url:n,status:t.statusCode,statusText:t.statusMessage,headers:s};r.response=new Response(typeof u=="string"?u:JSON.stringify(u),p)},e.prototype.sendRequest=function(t,r){return Rn.__awaiter(this,void 0,void 0,function(){return Rn.__generator(this,function(n){switch(n.label){case 0:return this.setStatusCode(t,r.request,r.options.method),t.chaosStrategy===up.ChaosStrategy.MANUAL&&!this.nextMiddleware||Math.floor(Math.random()*100)<t.chaosPercentage?(this.createResponse(t,r),[3,3]):[3,1];case 1:return this.nextMiddleware?[4,this.nextMiddleware.execute(r)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.getRandomStatusCode=function(t){var r=sp.methodStatusCode[t];return r[Math.floor(Math.random()*r.length)]},e.prototype.getRelativeURL=function(t){var r=/https?:\/\/graph\.microsoft\.com\/[^/]+(.+?)(\?|$)/,n;return r.exec(t)!==null&&(n=r.exec(t)[1]),n},e.prototype.setStatusCode=function(t,r,n){var o=this;if(t.chaosStrategy===up.ChaosStrategy.MANUAL){if(t.statusCode===void 0){var i=this.getRelativeURL(r);this.manualMap.get(i)!==void 0?this.manualMap.get(i).get(n)!==void 0&&(t.statusCode=this.manualMap.get(i).get(n)):this.manualMap.forEach(function(s,u){var p=new RegExp(u+"$");p.test(i)&&o.manualMap.get(u).get(n)!==void 0&&(t.statusCode=o.manualMap.get(u).get(n))})}}else t.statusCode=this.getRandomStatusCode(n)},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof xy.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Ei.ChaosHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Ei.ChaosHandlerOptions,this.options)),r},e.prototype.execute=function(t){return Rn.__awaiter(this,void 0,void 0,function(){var r;return Rn.__generator(this,function(n){switch(n.label){case 0:return r=this.getOptions(t),[4,this.sendRequest(r,t)];case 1:return[2,n.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e}();kn.ChaosHandler=by});var _r=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ResponseType=void 0;var lp;(function(e){e.ARRAYBUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.RAW="raw",e.STREAM="stream",e.TEXT="text"})(lp||(Dn.ResponseType=lp={}))});var Ai=b(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.GraphResponseHandler=Ft.DocumentType=void 0;var Cn=(se(),oe(ae)),ft=_r(),Ii;(function(e){e.TEXT_HTML="text/html",e.TEXT_XML="text/xml",e.APPLICATION_XML="application/xml",e.APPLICATION_XHTML="application/xhtml+xml"})(Ii||(Ft.DocumentType=Ii={}));var Nn;(function(e){e.TEXT_PLAIN="text/plain",e.APPLICATION_JSON="application/json"})(Nn||(Nn={}));var Mn;(function(e){e.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",e.IMAGE="^image\\/.+"})(Mn||(Mn={}));var Ty=function(){function e(){}return a(e,"GraphResponseHandler"),e.parseDocumentResponse=function(t,r){return typeof DOMParser<"u"?new Promise(function(n,o){t.text().then(function(i){try{var s=new DOMParser,u=s.parseFromString(i,r);n(u)}catch(p){o(p)}})}):Promise.resolve(t.body)},e.convertResponse=function(t,r){return Cn.__awaiter(this,void 0,void 0,function(){var n,o,i,s;return Cn.__generator(this,function(u){switch(u.label){case 0:if(t.status===204)return[2,Promise.resolve()];switch(o=t.headers.get("Content-type"),i=r,i){case ft.ResponseType.ARRAYBUFFER:return[3,1];case ft.ResponseType.BLOB:return[3,3];case ft.ResponseType.DOCUMENT:return[3,5];case ft.ResponseType.JSON:return[3,7];case ft.ResponseType.STREAM:return[3,9];case ft.ResponseType.TEXT:return[3,11]}return[3,13];case 1:return[4,t.arrayBuffer()];case 2:return n=u.sent(),[3,24];case 3:return[4,t.blob()];case 4:return n=u.sent(),[3,24];case 5:return[4,e.parseDocumentResponse(t,Ii.TEXT_XML)];case 6:return n=u.sent(),[3,24];case 7:return[4,t.json()];case 8:return n=u.sent(),[3,24];case 9:return[4,Promise.resolve(t.body)];case 10:return n=u.sent(),[3,24];case 11:return[4,t.text()];case 12:return n=u.sent(),[3,24];case 13:return o===null?[3,22]:(s=o.split(";")[0],new RegExp(Mn.DOCUMENT).test(s)?[4,e.parseDocumentResponse(t,s)]:[3,15]);case 14:return n=u.sent(),[3,21];case 15:return new RegExp(Mn.IMAGE).test(s)?(n=t.blob(),[3,21]):[3,16];case 16:return s!==Nn.TEXT_PLAIN?[3,18]:[4,t.text()];case 17:return n=u.sent(),[3,21];case 18:return s!==Nn.APPLICATION_JSON?[3,20]:[4,t.json()];case 19:return n=u.sent(),[3,21];case 20:n=Promise.resolve(t.body),u.label=21;case 21:return[3,23];case 22:n=Promise.resolve(t.body),u.label=23;case 23:return[3,24];case 24:return[2,n]}})})},e.getResponse=function(t,r,n){return Cn.__awaiter(this,void 0,void 0,function(){var o;return Cn.__generator(this,function(i){switch(i.label){case 0:return r!==ft.ResponseType.RAW?[3,1]:[2,Promise.resolve(t)];case 1:return[4,e.convertResponse(t,r)];case 2:if(o=i.sent(),t.ok)if(typeof n=="function")n(null,o);else return[2,o];else throw o;i.label=3;case 3:return[2]}})})},e}();Ft.GraphResponseHandler=Ty});var Si=b(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.Range=void 0;var Ey=function(){function e(t,r){t===void 0&&(t=-1),r===void 0&&(r=-1),this.minValue=t,this.maxValue=r}return a(e,"Range"),e}();Un.Range=Ey});var $i=b(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.UploadResult=void 0;var Iy=function(){function e(t,r){this._location=r,this._responseBody=t}return a(e,"UploadResult"),Object.defineProperty(e.prototype,"location",{get:a(function(){return this._location},"get"),set:a(function(t){this._location=t},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseBody",{get:a(function(){return this._responseBody},"get"),set:a(function(t){this._responseBody=t},"set"),enumerable:!1,configurable:!0}),e.CreateUploadResult=function(t,r){return new e(t,r.get("location"))},e}();Ln.UploadResult=Iy});var Oi=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.LargeFileUploadTask=void 0;var Ee=(se(),oe(ae)),wi=qe(),Ay=Ai(),pp=_r(),jn=Si(),Sy=$i(),$y=function(){function e(t,r,n,o){if(o===void 0&&(o={}),this.DEFAULT_FILE_SIZE=5*1024*1024,this.client=t,r.sliceFile)this.file=r;else throw new wi.GraphClientError("Please pass the FileUpload object, StreamUpload object or any custom implementation of the FileObject interface");this.file=r,o.rangeSize||(o.rangeSize=this.DEFAULT_FILE_SIZE),this.options=o,this.uploadSession=n,this.nextRange=new jn.Range(0,this.options.rangeSize-1)}return a(e,"LargeFileUploadTask"),e.createUploadSession=function(t,r,n,o){return o===void 0&&(o={}),Ee.__awaiter(this,void 0,void 0,function(){var i,s;return Ee.__generator(this,function(u){switch(u.label){case 0:return[4,t.api(r).headers(o).post(n)];case 1:return i=u.sent(),s={url:i.uploadUrl,expiry:new Date(i.expirationDateTime),isCancelled:!1},[2,s]}})})},e.prototype.parseRange=function(t){var r=t[0];if(typeof r>"u"||r==="")return new jn.Range;var n=r.split("-"),o=parseInt(n[0],10),i=parseInt(n[1],10);return Number.isNaN(i)&&(i=this.file.size-1),new jn.Range(o,i)},e.prototype.updateTaskStatus=function(t){this.uploadSession.expiry=new Date(t.expirationDateTime),this.nextRange=this.parseRange(t.nextExpectedRanges)},e.prototype.getNextRange=function(){if(this.nextRange.minValue===-1)return this.nextRange;var t=this.nextRange.minValue,r=t+this.options.rangeSize-1;return r>=this.file.size&&(r=this.file.size-1),new jn.Range(t,r)},e.prototype.sliceFile=function(t){if(console.warn("The LargeFileUploadTask.sliceFile() function has been deprecated and moved into the FileObject interface."),this.file.content instanceof ArrayBuffer||this.file.content instanceof Blob||this.file.content instanceof Uint8Array)return this.file.content.slice(t.minValue,t.maxValue+1);throw new wi.GraphClientError("The LargeFileUploadTask.sliceFile() function expects only Blob, ArrayBuffer or Uint8Array file content. Please note that the sliceFile() function is deprecated.")},e.prototype.upload=function(){return Ee.__awaiter(this,void 0,void 0,function(){var t,r,n,o,i,s,u;return Ee.__generator(this,function(p){switch(p.label){case 0:t=this.options&&this.options.uploadEventHandlers,p.label=1;case 1:if(this.uploadSession.isCancelled)return[3,5];if(r=this.getNextRange(),r.maxValue===-1)throw n=new Error("Task with which you are trying to upload is already completed, Please check for your uploaded file"),n.name="Invalid Session",n;return[4,this.file.sliceFile(r)];case 2:return o=p.sent(),[4,this.uploadSliceGetRawResponse(o,r,this.file.size)];case 3:if(i=p.sent(),!i)throw new wi.GraphClientError("Something went wrong! Large file upload slice response is null.");return[4,Ay.GraphResponseHandler.getResponse(i)];case 4:return s=p.sent(),i.status===201||i.status===200&&s.id?(this.reportProgress(t,r),[2,Sy.UploadResult.CreateUploadResult(s,i.headers)]):(u={expirationDateTime:s.expirationDateTime||s.ExpirationDateTime,nextExpectedRanges:s.NextExpectedRanges||s.nextExpectedRanges},this.updateTaskStatus(u),this.reportProgress(t,r),[3,1]);case 5:return[2]}})})},e.prototype.reportProgress=function(t,r){t&&t.progress&&t.progress(r,t.extraCallbackParam)},e.prototype.uploadSlice=function(t,r,n){return Ee.__awaiter(this,void 0,void 0,function(){return Ee.__generator(this,function(o){switch(o.label){case 0:return[4,this.client.api(this.uploadSession.url).headers({"Content-Length":"".concat(r.maxValue-r.minValue+1),"Content-Range":"bytes ".concat(r.minValue,"-").concat(r.maxValue,"/").concat(n),"Content-Type":"application/octet-stream"}).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.uploadSliceGetRawResponse=function(t,r,n){return Ee.__awaiter(this,void 0,void 0,function(){return Ee.__generator(this,function(o){switch(o.label){case 0:return[4,this.client.api(this.uploadSession.url).headers({"Content-Length":"".concat(r.maxValue-r.minValue+1),"Content-Range":"bytes ".concat(r.minValue,"-").concat(r.maxValue,"/").concat(n),"Content-Type":"application/octet-stream"}).responseType(pp.ResponseType.RAW).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.cancel=function(){return Ee.__awaiter(this,void 0,void 0,function(){var t;return Ee.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).responseType(pp.ResponseType.RAW).delete()];case 1:return t=r.sent(),t.status===204&&(this.uploadSession.isCancelled=!0),[2,t]}})})},e.prototype.getStatus=function(){return Ee.__awaiter(this,void 0,void 0,function(){var t;return Ee.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).get()];case 1:return t=r.sent(),this.updateTaskStatus(t),[2,t]}})})},e.prototype.resume=function(){return Ee.__awaiter(this,void 0,void 0,function(){return Ee.__generator(this,function(t){switch(t.label){case 0:return[4,this.getStatus()];case 1:return t.sent(),[4,this.upload()];case 2:return[2,t.sent()]}})})},e.prototype.getUploadSession=function(){return this.uploadSession},e}();Fn.LargeFileUploadTask=$y});var zi=b(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.FileUpload=void 0;var wy=qe(),Oy=function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new wy.GraphClientError("Please provide the upload content, name of the file and size of the file")}return a(e,"FileUpload"),e.prototype.sliceFile=function(t){return this.content.slice(t.minValue,t.maxValue+1)},e}();Bn.FileUpload=Oy});var Ri=b(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.getValidRangeSize=void 0;var zy=5*1024*1024,Ry=a(function(e){return e>320*1024&&(e=Math.floor(e/(320*1024))*320*1024),e},"roundTo320KB"),ky=a(function(e){e===void 0&&(e=zy);var t=60*1024*1024;return e>t&&(e=t),Ry(e)},"getValidRangeSize");Vn.getValidRangeSize=ky});var fp=b(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.OneDriveLargeFileUploadTask=void 0;var Ge=(se(),oe(ae)),dp=qe(),Dy=zi(),Cy=Oi(),Ny=Ri(),My=function(e){Ge.__extends(t,e);function t(r,n,o,i){return e.call(this,r,n,o,i)||this}return a(t,"OneDriveLargeFileUploadTask"),t.constructCreateSessionUrl=function(r,n){return n===void 0&&(n=t.DEFAULT_UPLOAD_PATH),r=r.trim(),n=n.trim(),n===""&&(n="/"),n[0]!=="/"&&(n="/".concat(n)),n[n.length-1]!=="/"&&(n="".concat(n,"/")),"/me/drive/root:".concat(n.split("/").map(function(o){return encodeURIComponent(o)}).join("/")).concat(encodeURIComponent(r),":/createUploadSession")},t.getFileInfo=function(r,n){var o,i;if(typeof Blob<"u"&&r instanceof Blob)o=new File([r],n),i=o.size;else if(typeof File<"u"&&r instanceof File)o=r,i=o.size;else if(typeof Uint8Array<"u"&&r instanceof Uint8Array){var s=r;i=s.byteLength,o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}return{content:o,size:i}},t.create=function(r,n,o){return Ge.__awaiter(this,void 0,void 0,function(){var i,s,u;return Ge.__generator(this,function(p){if(!r||!n||!o)throw new dp.GraphClientError("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");return i=o.fileName,s=t.getFileInfo(n,i),u=new Dy.FileUpload(s.content,i,s.size),[2,this.createTaskWithFileObject(r,u,o)]})})},t.createTaskWithFileObject=function(r,n,o){return Ge.__awaiter(this,void 0,void 0,function(){var i,s,u,p;return Ge.__generator(this,function(d){switch(d.label){case 0:if(!r||!n||!o)throw new dp.GraphClientError("Please provide the Graph client instance, FileObject interface implementation and OneDriveLargeFileUploadOptions value");return i=o.uploadSessionURL?o.uploadSessionURL:t.constructCreateSessionUrl(o.fileName,o.path),s={fileName:o.fileName,fileDescription:o.fileDescription,conflictBehavior:o.conflictBehavior},[4,t.createUploadSession(r,i,s)];case 1:return u=d.sent(),p=(0,Ny.getValidRangeSize)(o.rangeSize),[2,new t(r,n,u,{rangeSize:p,uploadEventHandlers:o.uploadEventHandlers})]}})})},t.createUploadSession=function(r,n,o){return Ge.__awaiter(this,void 0,void 0,function(){var i;return Ge.__generator(this,function(s){return i={item:{"@microsoft.graph.conflictBehavior":o?.conflictBehavior||"rename",name:o?.fileName,description:o?.fileDescription}},[2,e.createUploadSession.call(this,r,n,i)]})})},t.prototype.commit=function(r,n){return n===void 0&&(n="rename"),Ge.__awaiter(this,void 0,void 0,function(){var o;return Ge.__generator(this,function(i){switch(i.label){case 0:return o={name:this.file.name,"@microsoft.graph.conflictBehavior":n,"@microsoft.graph.sourceUrl":this.uploadSession.url},[4,this.client.api(r).put(o)];case 1:return[2,i.sent()]}})})},t.DEFAULT_UPLOAD_PATH="/",t}(Cy.LargeFileUploadTask);Hn.OneDriveLargeFileUploadTask=My});var gp=b(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.StreamUpload=void 0;var mp=(se(),oe(ae)),xr=qe(),Uy=function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new xr.GraphClientError("Please provide the Readable Stream content, name of the file and size of the file")}return a(e,"StreamUpload"),e.prototype.sliceFile=function(t){return mp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,p;return mp.__generator(this,function(d){switch(d.label){case 0:if(r=t.maxValue-t.minValue+1,n=[],this.previousSlice){if(t.minValue<this.previousSlice.range.minValue)throw new xr.GraphClientError("An error occurred while uploading the stream. Please restart the stream upload from the first byte of the file.");if(t.minValue<this.previousSlice.range.maxValue){if(o=this.previousSlice.range.minValue,i=this.previousSlice.range.maxValue,t.minValue===o&&t.maxValue===i)return[2,this.previousSlice.fileSlice];if(t.maxValue===i)return[2,this.previousSlice.fileSlice.slice(t.minValue,t.maxValue+1)];n.push(this.previousSlice.fileSlice.slice(t.minValue,i+1)),r=t.maxValue-i}}return this.content&&this.content.readable?this.content.readableLength>=r?(n.push(this.content.read(r)),[3,3]):[3,1]:[3,4];case 1:return u=(s=n).push,[4,this.readNBytesFromStream(r)];case 2:u.apply(s,[d.sent()]),d.label=3;case 3:return[3,5];case 4:throw new xr.GraphClientError("Stream is not readable.");case 5:return p=Buffer.concat(n),this.previousSlice={fileSlice:p,range:t},[2,p]}})})},e.prototype.readNBytesFromStream=function(t){var r=this;return new Promise(function(n,o){var i=[],s=t,u=0;r.content.on("end",function(){if(s>0)return o(new xr.GraphClientError("Stream ended before reading required range size"))}),r.content.on("readable",function(){for(var p;u<t&&(p=r.content.read(s))!==null;)u+=p.length,i.push(p),s>0&&(s=t-u);if(u===t)return n(Buffer.concat(i));if(!r.content||!r.content.readable)return o(new xr.GraphClientError("Error encountered while reading the stream during the upload"))})})},e}();Zn.StreamUpload=Uy});var hp=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.PageIterator=void 0;var Bt=(se(),oe(ae)),Ly=function(){function e(t,r,n,o){this.client=t,this.collection=r.value,this.nextLink=r["@odata.nextLink"],this.deltaLink=r["@odata.deltaLink"],this.callback=n,this.cursor=0,this.complete=!1,this.requestOptions=o}return a(e,"PageIterator"),e.prototype.iterationHelper=function(){if(this.collection===void 0)return!1;for(var t=!0;t&&this.cursor<this.collection.length;){var r=this.collection[this.cursor];t=this.callback(r),this.cursor++}return t},e.prototype.fetchAndUpdateNextPageData=function(){return Bt.__awaiter(this,void 0,void 0,function(){var t,r;return Bt.__generator(this,function(n){switch(n.label){case 0:return t=this.client.api(this.nextLink),this.requestOptions&&(this.requestOptions.headers&&(t=t.headers(this.requestOptions.headers)),this.requestOptions.middlewareOptions&&(t=t.middlewareOptions(this.requestOptions.middlewareOptions)),this.requestOptions.options&&(t=t.options(this.requestOptions.options))),[4,t.get()];case 1:return r=n.sent(),this.collection=r.value,this.cursor=0,this.nextLink=r["@odata.nextLink"],this.deltaLink=r["@odata.deltaLink"],[2]}})})},e.prototype.getDeltaLink=function(){return this.deltaLink},e.prototype.iterate=function(){return Bt.__awaiter(this,void 0,void 0,function(){var t;return Bt.__generator(this,function(r){switch(r.label){case 0:t=this.iterationHelper(),r.label=1;case 1:return t?this.nextLink===void 0?[3,3]:[4,this.fetchAndUpdateNextPageData()]:[3,5];case 2:return r.sent(),t=this.iterationHelper(),[3,4];case 3:t=!1,r.label=4;case 4:return[3,1];case 5:return this.nextLink===void 0&&this.cursor>=this.collection.length&&(this.complete=!0),[2]}})})},e.prototype.resume=function(){return Bt.__awaiter(this,void 0,void 0,function(){return Bt.__generator(this,function(t){return[2,this.iterate()]})})},e.prototype.isComplete=function(){return this.complete},e}();qn.PageIterator=Ly});var ki=b(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.CustomAuthenticationProvider=void 0;var Gn=(se(),oe(ae)),yp=qe(),jy=function(){function e(t){this.provider=t}return a(e,"CustomAuthenticationProvider"),e.prototype.getAccessToken=function(){return Gn.__awaiter(this,void 0,void 0,function(){var t=this;return Gn.__generator(this,function(r){return[2,new Promise(function(n,o){t.provider(function(i,s){return Gn.__awaiter(t,void 0,void 0,function(){var u,p;return Gn.__generator(this,function(d){switch(d.label){case 0:return s?(n(s),[3,3]):[3,1];case 1:return i||(u="Access token is undefined or empty. Please provide a valid token. For more help - https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/CustomAuthenticationProvider.md",i=new yp.GraphClientError(u)),[4,yp.GraphClientError.setGraphClientError(i)];case 2:p=d.sent(),o(p),d.label=3;case 3:return[2]}})})})})]})})},e}();Wn.CustomAuthenticationProvider=jy});var Di=b(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.GraphError=void 0;var Fy=(se(),oe(ae)),By=function(e){Fy.__extends(t,e);function t(r,n,o){r===void 0&&(r=-1);var i=e.call(this,n||o&&o.message)||this;return Object.setPrototypeOf(i,t.prototype),i.statusCode=r,i.code=null,i.requestId=null,i.date=new Date,i.body=null,i.stack=o?o.stack:i.stack,i}return a(t,"GraphError"),t}(Error);Kn.GraphError=By});var _p=b(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.GraphErrorHandler=void 0;var vp=(se(),oe(ae)),Ci=Di(),Vy=function(){function e(){}return a(e,"GraphErrorHandler"),e.constructError=function(t,r,n){var o=new Ci.GraphError(r,"",t);return t.name!==void 0&&(o.code=t.name),o.body=t.toString(),o.date=new Date,o.headers=n?.headers,o},e.constructErrorFromResponse=function(t,r,n){var o=t.error,i=new Ci.GraphError(r,o.message);return i.code=o.code,o.innerError!==void 0&&(i.requestId=o.innerError["request-id"],i.date=new Date(o.innerError.date)),i.body=JSON.stringify(o),i.headers=n?.headers,i},e.getError=function(t,r,n,o){return t===void 0&&(t=null),r===void 0&&(r=-1),vp.__awaiter(this,void 0,void 0,function(){var i;return vp.__generator(this,function(s){if(t&&t.error?i=e.constructErrorFromResponse(t,r,o):t instanceof Error?i=e.constructError(t,r,o):(i=new Ci.GraphError(r),i.body=t),typeof n=="function")n(i,null);else return[2,i];return[2]})})},e}();Jn.GraphErrorHandler=Vy});var Ni=b(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.GraphRequest=void 0;var re=(se(),oe(ae)),Hy=qe(),Zy=_p(),Pr=pn(),qy=Ai(),Gy=nt(),mt=hr(),Wy=_r(),Ky=function(){function e(t,r,n){var o=this;this.parsePath=function(i){if(i.indexOf("https://")!==-1){i=i.replace("https://","");var s=i.indexOf("/");s!==-1&&(o.urlComponents.host="https://"+i.substring(0,s),i=i.substring(s+1,i.length));var u=i.indexOf("/");u!==-1&&(o.urlComponents.version=i.substring(0,u),i=i.substring(u+1,i.length))}i.charAt(0)==="/"&&(i=i.substr(1));var p=i.indexOf("?");if(p===-1)o.urlComponents.path=i;else{o.urlComponents.path=i.substr(0,p);for(var d=i.substring(p+1,i.length).split("&"),f=0,v=d;f<v.length;f++){var y=v[f];o.parseQueryParameter(y)}}},this.httpClient=t,this.config=r,this.urlComponents={host:this.config.baseUrl,version:this.config.defaultVersion,oDataQueryParams:{},otherURLQueryParams:{},otherURLQueryOptions:[]},this._headers={},this._options={},this._middlewareOptions=[],this.parsePath(n)}return a(e,"GraphRequest"),e.prototype.addCsvQueryParameter=function(t,r,n){this.urlComponents.oDataQueryParams[t]=this.urlComponents.oDataQueryParams[t]?this.urlComponents.oDataQueryParams[t]+",":"";var o=[];n.length>1&&typeof r=="string"?o=Array.prototype.slice.call(n):typeof r=="string"?o.push(r):o=o.concat(r),this.urlComponents.oDataQueryParams[t]+=o.join(",")},e.prototype.buildFullUrl=function(){var t=(0,Pr.urlJoin)([this.urlComponents.host,this.urlComponents.version,this.urlComponents.path])+this.createQueryString();return this.config.debugLogging&&console.log(t),t},e.prototype.createQueryString=function(){var t=this.urlComponents,r=[];if(Object.keys(t.oDataQueryParams).length!==0)for(var n in t.oDataQueryParams)Object.prototype.hasOwnProperty.call(t.oDataQueryParams,n)&&r.push(n+"="+t.oDataQueryParams[n]);if(Object.keys(t.otherURLQueryParams).length!==0)for(var n in t.otherURLQueryParams)Object.prototype.hasOwnProperty.call(t.otherURLQueryParams,n)&&r.push(n+"="+t.otherURLQueryParams[n]);if(t.otherURLQueryOptions.length!==0)for(var o=0,i=t.otherURLQueryOptions;o<i.length;o++){var s=i[o];r.push(s)}return r.length>0?"?"+r.join("&"):""},e.prototype.parseQueryParameter=function(t){if(typeof t=="string")if(t.charAt(0)==="?"&&(t=t.substring(1)),t.indexOf("&")!==-1)for(var r=t.split("&"),n=0,o=r;n<o.length;n++){var i=o[n];this.parseQueryParamenterString(i)}else this.parseQueryParamenterString(t);else if(t.constructor===Object)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&this.setURLComponentsQueryParamater(s,t[s]);return this},e.prototype.parseQueryParamenterString=function(t){if(this.isValidQueryKeyValuePair(t)){var r=t.indexOf("="),n=t.substring(0,r),o=t.substring(r+1);this.setURLComponentsQueryParamater(n,o)}else this.urlComponents.otherURLQueryOptions.push(t)},e.prototype.setURLComponentsQueryParamater=function(t,r){if(Pr.oDataQueryNames.indexOf(t)!==-1){var n=this.urlComponents.oDataQueryParams[t],o=n&&(t==="$expand"||t==="$select"||t==="$orderby");this.urlComponents.oDataQueryParams[t]=o?n+","+r:r}else this.urlComponents.otherURLQueryParams[t]=r},e.prototype.isValidQueryKeyValuePair=function(t){var r=t.indexOf("=");if(r===-1)return!1;var n=t.indexOf("(");return!(n!==-1&&t.indexOf("(")<r)},e.prototype.updateRequestOptions=function(t){var r=re.__assign({},t.headers);if(this.config.fetchOptions!==void 0){var n=re.__assign({},this.config.fetchOptions);Object.assign(t,n),typeof this.config.fetchOptions.headers!==void 0&&(t.headers=re.__assign({},this.config.fetchOptions.headers))}Object.assign(t,this._options),t.headers!==void 0&&Object.assign(r,t.headers),Object.assign(r,this._headers),t.headers=r},e.prototype.send=function(t,r,n){var o;return re.__awaiter(this,void 0,void 0,function(){var i,s,u,p,d,f,v,y;return re.__generator(this,function(l){switch(l.label){case 0:s=new Gy.MiddlewareControl(this._middlewareOptions),this.updateRequestOptions(r),u=(o=this.config)===null||o===void 0?void 0:o.customHosts,l.label=1;case 1:return l.trys.push([1,4,,6]),[4,this.httpClient.sendRequest({request:t,options:r,middlewareControl:s,customHosts:u})];case 2:return p=l.sent(),i=p.response,[4,qy.GraphResponseHandler.getResponse(i,this._responseType,n)];case 3:return d=l.sent(),[2,d];case 4:if(f=l.sent(),f instanceof Hy.GraphClientError)throw f;return v=void 0,i&&(v=i.status),[4,Zy.GraphErrorHandler.getError(f,v,n,i)];case 5:throw y=l.sent(),y;case 6:return[2]}})})},e.prototype.setHeaderContentType=function(){if(!this._headers){this.header("Content-Type","application/json");return}for(var t=Object.keys(this._headers),r=0,n=t;r<n.length;r++){var o=n[r];if(o.toLowerCase()==="content-type")return}this.header("Content-Type","application/json")},e.prototype.header=function(t,r){return this._headers[t]=r,this},e.prototype.headers=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._headers[r]=t[r]);return this},e.prototype.option=function(t,r){return this._options[t]=r,this},e.prototype.options=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._options[r]=t[r]);return this},e.prototype.middlewareOptions=function(t){return this._middlewareOptions=t,this},e.prototype.version=function(t){return this.urlComponents.version=t,this},e.prototype.responseType=function(t){return this._responseType=t,this},e.prototype.select=function(t){return this.addCsvQueryParameter("$select",t,arguments),this},e.prototype.expand=function(t){return this.addCsvQueryParameter("$expand",t,arguments),this},e.prototype.orderby=function(t){return this.addCsvQueryParameter("$orderby",t,arguments),this},e.prototype.filter=function(t){return this.urlComponents.oDataQueryParams.$filter=t,this},e.prototype.search=function(t){return this.urlComponents.oDataQueryParams.$search=t,this},e.prototype.top=function(t){return this.urlComponents.oDataQueryParams.$top=t,this},e.prototype.skip=function(t){return this.urlComponents.oDataQueryParams.$skip=t,this},e.prototype.skipToken=function(t){return this.urlComponents.oDataQueryParams.$skipToken=t,this},e.prototype.count=function(t){return t===void 0&&(t=!0),this.urlComponents.oDataQueryParams.$count=t.toString(),this},e.prototype.query=function(t){return this.parseQueryParameter(t)},e.prototype.get=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n,o;return re.__generator(this,function(i){switch(i.label){case 0:return r=this.buildFullUrl(),n={method:mt.RequestMethod.GET},[4,this.send(r,n,t)];case 1:return o=i.sent(),[2,o]}})})},e.prototype.post=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o,i;return re.__generator(this,function(s){switch(s.label){case 0:return n=this.buildFullUrl(),o={method:mt.RequestMethod.POST,body:(0,Pr.serializeContent)(t)},i=t&&t.constructor&&t.constructor.name,i==="FormData"?o.headers={}:(this.setHeaderContentType(),o.headers=this._headers),[4,this.send(n,o,r)];case 1:return[2,s.sent()]}})})},e.prototype.create=function(t,r){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(n){switch(n.label){case 0:return[4,this.post(t,r)];case 1:return[2,n.sent()]}})})},e.prototype.put=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),this.setHeaderContentType(),o={method:mt.RequestMethod.PUT,body:(0,Pr.serializeContent)(t)},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e.prototype.patch=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),this.setHeaderContentType(),o={method:mt.RequestMethod.PATCH,body:(0,Pr.serializeContent)(t)},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e.prototype.update=function(t,r){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(n){switch(n.label){case 0:return[4,this.patch(t,r)];case 1:return[2,n.sent()]}})})},e.prototype.delete=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n;return re.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:mt.RequestMethod.DELETE},[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.del=function(t){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(r){switch(r.label){case 0:return[4,this.delete(t)];case 1:return[2,r.sent()]}})})},e.prototype.getStream=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n;return re.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:mt.RequestMethod.GET},this.responseType(Wy.ResponseType.STREAM),[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.putStream=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),o={method:mt.RequestMethod.PUT,headers:{"Content-Type":"application/octet-stream"},body:t},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e}();Xn.GraphRequest=Ky});var Mi=b(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.HTTPClient=void 0;var xp=(se(),oe(ae)),Jy=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(!t||!t.length){var n=new Error;throw n.name="InvalidMiddlewareChain",n.message="Please provide a default middleware chain or custom middleware chain",n}this.setMiddleware.apply(this,t)}return a(e,"HTTPClient"),e.prototype.setMiddleware=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.length>1?this.parseMiddleWareArray(t):this.middleware=t[0]},e.prototype.parseMiddleWareArray=function(t){t.forEach(function(r,n){n<t.length-1&&r.setNext(t[n+1])}),this.middleware=t[0]},e.prototype.sendRequest=function(t){return xp.__awaiter(this,void 0,void 0,function(){var r;return xp.__generator(this,function(n){switch(n.label){case 0:if(typeof t.request=="string"&&t.options===void 0)throw r=new Error,r.name="InvalidRequestOptions",r.message="Unable to execute the middleware, Please provide valid options for a request",r;return[4,this.middleware.execute(t)];case 1:return n.sent(),[2,t]}})})},e}();Yn.HTTPClient=Jy});var bp=b(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.HTTPClientFactory=void 0;var Xy=(se(),oe(ae)),Pp=Mi(),Yy=gn(),Qy=yn(),ev=vr(),tv=yr(),rv=Tn(),nv=xn(),ov=Sn(),iv=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),av=function(){function e(){}return a(e,"HTTPClientFactory"),e.createWithAuthenticationProvider=function(t){var r=new Yy.AuthenticationHandler(t),n=new nv.RetryHandler(new tv.RetryHandlerOptions),o=new ov.TelemetryHandler,i=new Qy.HTTPMessageHandler;if(r.setNext(n),iv()){var s=new rv.RedirectHandler(new ev.RedirectHandlerOptions);n.setNext(s),s.setNext(o)}else n.setNext(o);return o.setNext(i),e.createWithMiddleware(r)},e.createWithMiddleware=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new(Pp.HTTPClient.bind.apply(Pp.HTTPClient,Xy.__spreadArray([void 0],t,!1)))},e}();Qn.HTTPClientFactory=av});var Tp=b(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.validatePolyFilling=void 0;var sv=a(function(){if(typeof Promise>"u"&&typeof fetch>"u"){var e=new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them.");throw e.name="PolyFillNotAvailable",e}else if(typeof Promise>"u"){var e=new Error("Library cannot function without Promise. So, please provide polyfill for it.");throw e.name="PolyFillNotAvailable",e}else if(typeof fetch>"u"){var e=new Error("Library cannot function without fetch. So, please provide polyfill for it.");throw e.name="PolyFillNotAvailable",e}return!0},"validatePolyFilling");eo.validatePolyFilling=sv});var Ap=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.Client=void 0;var uv=(se(),oe(ae)),Ep=vi(),cv=ki(),lv=Ni(),Ip=Mi(),pv=bp(),dv=Tp(),fv=function(){function e(t){this.config={baseUrl:Ep.GRAPH_BASE_URL,debugLogging:!1,defaultVersion:Ep.GRAPH_API_VERSION},(0,dv.validatePolyFilling)();for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this.config[r]=t[r]);var n;if(t.authProvider!==void 0&&t.middleware!==void 0){var o=new Error;throw o.name="AmbiguityInInitialization",o.message="Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain not both",o}else if(t.authProvider!==void 0)n=pv.HTTPClientFactory.createWithAuthenticationProvider(t.authProvider);else if(t.middleware!==void 0)n=new(Ip.HTTPClient.bind.apply(Ip.HTTPClient,uv.__spreadArray([void 0],[].concat(t.middleware),!1)));else{var o=new Error;throw o.name="InvalidMiddlewareChain",o.message="Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain",o}this.httpClient=n}return a(e,"Client"),e.init=function(t){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=n==="authProvider"?new cv.CustomAuthenticationProvider(t[n]):t[n]);return e.initWithMiddleware(r)},e.initWithMiddleware=function(t){return new e(t)},e.prototype.api=function(t){return new lv.GraphRequest(this.httpClient,this.config,t)},e}();to.Client=fv});var $p=b(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.ResponseType=w.GraphRequest=w.GraphClientError=w.GraphError=w.CustomAuthenticationProvider=w.Client=w.PageIterator=w.Range=w.UploadResult=w.FileUpload=w.StreamUpload=w.getValidRangeSize=w.OneDriveLargeFileUploadTask=w.LargeFileUploadTask=w.ChaosHandler=w.ChaosStrategy=w.ChaosHandlerOptions=w.TelemetryHandlerOptions=w.FeatureUsageFlag=w.RedirectHandlerOptions=w.RetryHandlerOptions=w.AuthenticationHandlerOptions=w.MiddlewareFactory=w.TelemetryHandler=w.RedirectHandler=w.RetryHandler=w.HTTPMessageHandler=w.AuthenticationHandler=w.BatchResponseContent=w.BatchRequestContent=void 0;var mv=Bl();Object.defineProperty(w,"BatchRequestContent",{enumerable:!0,get:a(function(){return mv.BatchRequestContent},"get")});var gv=Vl();Object.defineProperty(w,"BatchResponseContent",{enumerable:!0,get:a(function(){return gv.BatchResponseContent},"get")});var hv=gn();Object.defineProperty(w,"AuthenticationHandler",{enumerable:!0,get:a(function(){return hv.AuthenticationHandler},"get")});var yv=yn();Object.defineProperty(w,"HTTPMessageHandler",{enumerable:!0,get:a(function(){return yv.HTTPMessageHandler},"get")});var vv=xn();Object.defineProperty(w,"RetryHandler",{enumerable:!0,get:a(function(){return vv.RetryHandler},"get")});var _v=Tn();Object.defineProperty(w,"RedirectHandler",{enumerable:!0,get:a(function(){return _v.RedirectHandler},"get")});var xv=Sn();Object.defineProperty(w,"TelemetryHandler",{enumerable:!0,get:a(function(){return xv.TelemetryHandler},"get")});var Pv=op();Object.defineProperty(w,"MiddlewareFactory",{enumerable:!0,get:a(function(){return Pv.MiddlewareFactory},"get")});var bv=_i();Object.defineProperty(w,"AuthenticationHandlerOptions",{enumerable:!0,get:a(function(){return bv.AuthenticationHandlerOptions},"get")});var Tv=yr();Object.defineProperty(w,"RetryHandlerOptions",{enumerable:!0,get:a(function(){return Tv.RetryHandlerOptions},"get")});var Ev=vr();Object.defineProperty(w,"RedirectHandlerOptions",{enumerable:!0,get:a(function(){return Ev.RedirectHandlerOptions},"get")});var Sp=Mt();Object.defineProperty(w,"FeatureUsageFlag",{enumerable:!0,get:a(function(){return Sp.FeatureUsageFlag},"get")});Object.defineProperty(w,"TelemetryHandlerOptions",{enumerable:!0,get:a(function(){return Sp.TelemetryHandlerOptions},"get")});var Iv=Ti();Object.defineProperty(w,"ChaosHandlerOptions",{enumerable:!0,get:a(function(){return Iv.ChaosHandlerOptions},"get")});var Av=On();Object.defineProperty(w,"ChaosStrategy",{enumerable:!0,get:a(function(){return Av.ChaosStrategy},"get")});var Sv=cp();Object.defineProperty(w,"ChaosHandler",{enumerable:!0,get:a(function(){return Sv.ChaosHandler},"get")});var $v=Oi();Object.defineProperty(w,"LargeFileUploadTask",{enumerable:!0,get:a(function(){return $v.LargeFileUploadTask},"get")});var wv=fp();Object.defineProperty(w,"OneDriveLargeFileUploadTask",{enumerable:!0,get:a(function(){return wv.OneDriveLargeFileUploadTask},"get")});var Ov=Ri();Object.defineProperty(w,"getValidRangeSize",{enumerable:!0,get:a(function(){return Ov.getValidRangeSize},"get")});var zv=gp();Object.defineProperty(w,"StreamUpload",{enumerable:!0,get:a(function(){return zv.StreamUpload},"get")});var Rv=zi();Object.defineProperty(w,"FileUpload",{enumerable:!0,get:a(function(){return Rv.FileUpload},"get")});var kv=$i();Object.defineProperty(w,"UploadResult",{enumerable:!0,get:a(function(){return kv.UploadResult},"get")});var Dv=Si();Object.defineProperty(w,"Range",{enumerable:!0,get:a(function(){return Dv.Range},"get")});var Cv=hp();Object.defineProperty(w,"PageIterator",{enumerable:!0,get:a(function(){return Cv.PageIterator},"get")});var Nv=Ap();Object.defineProperty(w,"Client",{enumerable:!0,get:a(function(){return Nv.Client},"get")});var Mv=ki();Object.defineProperty(w,"CustomAuthenticationProvider",{enumerable:!0,get:a(function(){return Mv.CustomAuthenticationProvider},"get")});var Uv=Di();Object.defineProperty(w,"GraphError",{enumerable:!0,get:a(function(){return Uv.GraphError},"get")});var Lv=qe();Object.defineProperty(w,"GraphClientError",{enumerable:!0,get:a(function(){return Lv.GraphClientError},"get")});var jv=Ni();Object.defineProperty(w,"GraphRequest",{enumerable:!0,get:a(function(){return jv.GraphRequest},"get")});var Fv=_r();Object.defineProperty(w,"ResponseType",{enumerable:!0,get:a(function(){return Fv.ResponseType},"get")})});var br=b((Ui,Li)=>{(function(e,t){typeof Ui=="object"&&typeof Li<"u"?Li.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Ui,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",s="hour",u="day",p="week",d="month",f="quarter",v="year",y="date",l="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|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,h={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:a(function(j){var A=["th","st","nd","rd"],I=j%100;return"["+j+(A[(I-20)%10]||A[I]||A[0])+"]"},"ordinal")},x=a(function(j,A,I){var O=String(j);return!O||O.length>=A?j:""+Array(A+1-O.length).join(I)+j},"m"),T={s:x,z:a(function(j){var A=-j.utcOffset(),I=Math.abs(A),O=Math.floor(I/60),S=I%60;return(A<=0?"+":"-")+x(O,2,"0")+":"+x(S,2,"0")},"z"),m:a(function j(A,I){if(A.date()<I.date())return-j(I,A);var O=12*(I.year()-A.year())+(I.month()-A.month()),S=A.clone().add(O,d),H=I-S<0,Z=A.clone().add(O+(H?-1:1),d);return+(-(O+(I-S)/(H?S-Z:Z-S))||0)},"t"),a:a(function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},"a"),p:a(function(j){return{M:d,y:v,w:p,d:u,D:y,h:s,m:i,s:o,ms:n,Q:f}[j]||String(j||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(j){return j===void 0},"u")},V="en",de={};de[V]=h;var xe=a(function(j){return j instanceof gt},"p"),De=a(function j(A,I,O){var S;if(!A)return V;if(typeof A=="string"){var H=A.toLowerCase();de[H]&&(S=H),I&&(de[H]=I,S=H);var Z=A.split("-");if(!S&&Z.length>1)return j(Z[0])}else{var te=A.name;de[te]=A,S=te}return!O&&S&&(V=S),S||!O&&V},"t"),ee=a(function(j,A){if(xe(j))return j.clone();var I=typeof A=="object"?A:{};return I.date=j,I.args=arguments,new gt(I)},"w"),W=T;W.l=De,W.i=xe,W.w=function(j,A){return ee(j,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var gt=function(){function j(I){this.$L=De(I.locale,null,!0),this.parse(I)}a(j,"M");var A=j.prototype;return A.parse=function(I){this.$d=function(O){var S=O.date,H=O.utc;if(S===null)return new Date(NaN);if(W.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var Z=S.match(m);if(Z){var te=Z[2]-1||0,fe=(Z[7]||"0").substring(0,3);return H?new Date(Date.UTC(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,fe)):new Date(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,fe)}}return new Date(S)}(I),this.$x=I.x||{},this.init()},A.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()},A.$utils=function(){return W},A.isValid=function(){return this.$d.toString()!==l},A.isSame=function(I,O){var S=ee(I);return this.startOf(O)<=S&&S<=this.endOf(O)},A.isAfter=function(I,O){return ee(I)<this.startOf(O)},A.isBefore=function(I,O){return this.endOf(O)<ee(I)},A.$g=function(I,O,S){return W.u(I)?this[O]:this.set(S,I)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(I,O){var S=this,H=!!W.u(O)||O,Z=W.p(I),te=a(function(ut,be){var We=W.w(S.$u?Date.UTC(S.$y,be,ut):new Date(S.$y,be,ut),S);return H?We:We.endOf(u)},"l"),fe=a(function(ut,be){return W.w(S.toDate()[ut].apply(S.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(be)),S)},"$"),ye=this.$W,_e=this.$M,Se=this.$D,ht="set"+(this.$u?"UTC":"");switch(Z){case v:return H?te(1,0):te(31,11);case d:return H?te(1,_e):te(0,_e+1);case p:var st=this.$locale().weekStart||0,Vt=(ye<st?ye+7:ye)-st;return te(H?Se-Vt:Se+(6-Vt),_e);case u:case y:return fe(ht+"Hours",0);case s:return fe(ht+"Minutes",1);case i:return fe(ht+"Seconds",2);case o:return fe(ht+"Milliseconds",3);default:return this.clone()}},A.endOf=function(I){return this.startOf(I,!1)},A.$set=function(I,O){var S,H=W.p(I),Z="set"+(this.$u?"UTC":""),te=(S={},S[u]=Z+"Date",S[y]=Z+"Date",S[d]=Z+"Month",S[v]=Z+"FullYear",S[s]=Z+"Hours",S[i]=Z+"Minutes",S[o]=Z+"Seconds",S[n]=Z+"Milliseconds",S)[H],fe=H===u?this.$D+(O-this.$W):O;if(H===d||H===v){var ye=this.clone().set(y,1);ye.$d[te](fe),ye.init(),this.$d=ye.set(y,Math.min(this.$D,ye.daysInMonth())).$d}else te&&this.$d[te](fe);return this.init(),this},A.set=function(I,O){return this.clone().$set(I,O)},A.get=function(I){return this[W.p(I)]()},A.add=function(I,O){var S,H=this;I=Number(I);var Z=W.p(O),te=a(function(_e){var Se=ee(H);return W.w(Se.date(Se.date()+Math.round(_e*I)),H)},"y");if(Z===d)return this.set(d,this.$M+I);if(Z===v)return this.set(v,this.$y+I);if(Z===u)return te(1);if(Z===p)return te(7);var fe=(S={},S[i]=t,S[s]=r,S[o]=e,S)[Z]||1,ye=this.$d.getTime()+I*fe;return W.w(ye,this)},A.subtract=function(I,O){return this.add(-1*I,O)},A.format=function(I){var O=this,S=this.$locale();if(!this.isValid())return S.invalidDate||l;var H=I||"YYYY-MM-DDTHH:mm:ssZ",Z=W.z(this),te=this.$H,fe=this.$m,ye=this.$M,_e=S.weekdays,Se=S.months,ht=S.meridiem,st=a(function(be,We,Ht,Tr){return be&&(be[We]||be(O,H))||Ht[We].slice(0,Tr)},"h"),Vt=a(function(be){return W.s(te%12||12,be,"0")},"d"),ut=ht||function(be,We,Ht){var Tr=be<12?"AM":"PM";return Ht?Tr.toLowerCase():Tr};return H.replace(_,function(be,We){return We||function(Ht){switch(Ht){case"YY":return String(O.$y).slice(-2);case"YYYY":return W.s(O.$y,4,"0");case"M":return ye+1;case"MM":return W.s(ye+1,2,"0");case"MMM":return st(S.monthsShort,ye,Se,3);case"MMMM":return st(Se,ye);case"D":return O.$D;case"DD":return W.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return st(S.weekdaysMin,O.$W,_e,2);case"ddd":return st(S.weekdaysShort,O.$W,_e,3);case"dddd":return _e[O.$W];case"H":return String(te);case"HH":return W.s(te,2,"0");case"h":return Vt(1);case"hh":return Vt(2);case"a":return ut(te,fe,!0);case"A":return ut(te,fe,!1);case"m":return String(fe);case"mm":return W.s(fe,2,"0");case"s":return String(O.$s);case"ss":return W.s(O.$s,2,"0");case"SSS":return W.s(O.$ms,3,"0");case"Z":return Z}return null}(be)||Z.replace(":","")})},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(I,O,S){var H,Z=this,te=W.p(O),fe=ee(I),ye=(fe.utcOffset()-this.utcOffset())*t,_e=this-fe,Se=a(function(){return W.m(Z,fe)},"D");switch(te){case v:H=Se()/12;break;case d:H=Se();break;case f:H=Se()/3;break;case p:H=(_e-ye)/6048e5;break;case u:H=(_e-ye)/864e5;break;case s:H=_e/r;break;case i:H=_e/t;break;case o:H=_e/e;break;default:H=_e}return S?H:W.a(H)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return de[this.$L]},A.locale=function(I,O){if(!I)return this.$L;var S=this.clone(),H=De(I,O,!0);return H&&(S.$L=H),S},A.clone=function(){return W.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},j}(),at=gt.prototype;return ee.prototype=at,[["$ms",n],["$s",o],["$m",i],["$H",s],["$W",u],["$M",d],["$y",v],["$D",y]].forEach(function(j){at[j[1]]=function(A){return this.$g(A,j[0],j[1])}}),ee.extend=function(j,A){return j.$i||(j(A,gt,ee),j.$i=!0),ee},ee.locale=De,ee.isDayjs=xe,ee.unix=function(j){return ee(1e3*j)},ee.en=de[V],ee.Ls=de,ee.p={},ee})});var Wv={};io(Wv,{microsoftOutlook:()=>Gv});module.exports=oe(Wv);var Yp=Object.freeze({status:"aborted"});function z(e,t,r){function n(u,p){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:p,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,p);let d=s.prototype,f=Object.keys(d);for(let v=0;v<f.length;v++){let y=f[v];y in u||(u[y]=d[y].bind(u))}}a(n,"init");let o=r?.Parent??Object;class i extends o{static{a(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function s(u){var p;let d=r?.Parent?new i:this;n(d,u),(p=d._zod).deferred??(p.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a(u=>r?.Parent&&u instanceof r.Parent?!0:u?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a(z,"$constructor");var Qp=Symbol("zod_brand"),Ce=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Er=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ao={};function Le(e){return e&&Object.assign(ao,e),ao}a(Le,"config");function uo(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)}a(uo,"getEnumValues");function Zi(e,t){return typeof t=="bigint"?t.toString():t}a(Zi,"jsonStringifyReplacer");function Ar(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Ar,"cached");function qi(e){return e==null}a(qi,"nullish");function Sr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(Sr,"cleanRegex");var Hi=Symbol("evaluating");function me(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Hi)return n===void 0&&(n=Hi,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(me,"defineLazy");var co="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(qt,"isObject");var ed=Ar(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Gi(e){if(qt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(qt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Gi,"isPlainObject");var Wi=new Set(["string","number","symbol"]);function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(yt,"escapeRegex");function $r(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a($r,"clone");function ue(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>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:a(()=>t.error,"error")}:t}a(ue,"normalizeParams");function Ki(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(Ki,"optionalKeys");var td={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 vt(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}a(vt,"aborted");function Ke(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}a(Ke,"prefixIssues");function Ir(e){return typeof e=="string"?e:e?.message}a(Ir,"unwrapMessage");function Je(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Ir(e.inst?._zod.def?.error?.(e))??Ir(t?.error?.(e))??Ir(r.customError?.(e))??Ir(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}a(Je,"finalizeIssue");function Ji(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(Ji,"getLengthableOrigin");function lo(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(lo,"issue");var Xi=a((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,Zi,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),Yi=z("$ZodError",Xi),Gt=z("$ZodError",Xi,{Parent:Error});var nd=a(e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Ce;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(p=>Je(p,i,Le())));throw co(u,o?.callee),u}return s.value},"_parse"),wr=nd(Gt),od=a(e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(o?.Err??e)(s.issues.map(p=>Je(p,i,Le())));throw co(u,o?.callee),u}return s.value},"_parseAsync"),Or=od(Gt),id=a(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Ce;return i.issues.length?{success:!1,error:new(e??Yi)(i.issues.map(s=>Je(s,o,Le())))}:{success:!0,data:i.value}},"_safeParse"),Wt=id(Gt),ad=a(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Je(s,o,Le())))}:{success:!0,data:i.value}},"_safeParseAsync"),Kt=ad(Gt);var sd="(?:(?:\\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])))",ud=new RegExp(`^${sd}$`);var Qi=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),ea=/^-?\d+n?$/;var po=/^-?\d+(?:\.\d+)?$/,ta=/^(?:true|false)$/i;var _t=z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ra=z("$ZodCheckMinLength",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!qi(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 s=Ji(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var fo=z("$ZodCheckStringFormat",(e,t)=>{var r,n;_t.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.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=()=>{})}),na=z("$ZodCheckRegex",(e,t)=>{fo.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 ia={major:4,minor:3,patch:6};var ce=z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ia;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=a((s,u,p)=>{let d=vt(s),f;for(let v of u){if(v._zod.def.when){if(!v._zod.def.when(s))continue}else if(d)continue;let y=s.issues.length,l=v._zod.check(s);if(l instanceof Promise&&p?.async===!1)throw new Ce;if(f||l instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await l,s.issues.length!==y&&(d||(d=vt(s,y)))});else{if(s.issues.length===y)continue;d||(d=vt(s,y))}}return f?f.then(()=>s):s},"runChecks"),i=a((s,u,p)=>{if(vt(s))return s.aborted=!0,s;let d=o(u,n,p);if(d instanceof Promise){if(p.async===!1)throw new Ce;return d.then(f=>e._zod.parse(f,p))}return e._zod.parse(d,p)},"handleCanaryResult");e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let d=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(f=>i(f,s,u)):i(d,s,u)}let p=e._zod.parse(s,u);if(p instanceof Promise){if(u.async===!1)throw new Ce;return p.then(d=>o(d,n,u))}return o(p,n,u)}}me(e,"~standard",()=>({validate:a(o=>{try{let i=Wt(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Kt(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kr=z("$ZodString",(e,t)=>{ce.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qi(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}}),mo=z("$ZodStringFormat",(e,t)=>{fo.init(e,t),kr.init(e,t)});var la=z("$ZodURL",(e,t)=>{mo.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 pa=z("$ZodNumber",(e,t)=>{ce.init(e,t),e._zod.pattern=e._zod.bag.pattern??po,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 i=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,...i?{received:i}:{}}),r}});var go=z("$ZodBoolean",(e,t)=>{ce.init(e,t),e._zod.pattern=ta,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}}),da=z("$ZodBigInt",(e,t)=>{ce.init(e,t),e._zod.pattern=ea,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 fa=z("$ZodAny",(e,t)=>{ce.init(e,t),e._zod.parse=r=>r}),ma=z("$ZodUnknown",(e,t)=>{ce.init(e,t),e._zod.parse=r=>r});var ga=z("$ZodVoid",(e,t)=>{ce.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}}),ha=z("$ZodDate",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});function aa(e,t,r){e.issues.length&&t.issues.push(...Ke(r,e.issues)),t.value[r]=e.value}a(aa,"handleArrayResult");var ya=z("$ZodArray",(e,t)=>{ce.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 i=[];for(let s=0;s<o.length;s++){let u=o[s],p=t.element._zod.run({value:u,issues:[]},n);p instanceof Promise?i.push(p.then(d=>aa(d,r,s))):aa(p,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Rr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Ke(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}a(Rr,"handlePropertyResult");function cd(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=Ki(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(cd,"normalizeDef");function ld(e,t,r,n,o,i){let s=[],u=o.keySet,p=o.catchall._zod,d=p.def.type,f=p.optout==="optional";for(let v in t){if(u.has(v))continue;if(d==="never"){s.push(v);continue}let y=p.run({value:t[v],issues:[]},n);y instanceof Promise?e.push(y.then(l=>Rr(l,r,v,t,f))):Rr(y,r,v,t,f)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}a(ld,"handleCatchall");var va=z("$ZodObject",(e,t)=>{if(ce.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let u=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let p={...u};return Object.defineProperty(t,"shape",{value:p}),p},"get")})}let n=Ar(()=>cd(t));me(e._zod,"propValues",()=>{let u=t.shape,p={};for(let d in u){let f=u[d]._zod;if(f.values){p[d]??(p[d]=new Set);for(let v of f.values)p[d].add(v)}}return p});let o=qt,i=t.catchall,s;e._zod.parse=(u,p)=>{s??(s=n.value);let d=u.value;if(!o(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value={};let f=[],v=s.shape;for(let y of s.keys){let l=v[y],m=l._zod.optout==="optional",_=l._zod.run({value:d[y],issues:[]},p);_ instanceof Promise?f.push(_.then(h=>Rr(h,u,y,d,m))):Rr(_,u,y,d,m)}return i?ld(f,d,u,p,n.value,e):f.length?Promise.all(f).then(()=>u):u}});function sa(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!vt(i));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(i=>i.issues.map(s=>Je(s,n,Le())))}),t)}a(sa,"handleUnionResults");var ho=z("$ZodUnion",(e,t)=>{ce.init(e,t),me(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),me(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),me(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),me(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Sr(i.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let s=!1,u=[];for(let p of t.options){let d=p._zod.run({value:o.value,issues:[]},i);if(d instanceof Promise)u.push(d),s=!0;else{if(d.issues.length===0)return d;u.push(d)}}return s?Promise.all(u).then(p=>sa(p,o,e,i)):sa(u,o,e,i)}});var _a=z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ho.init(e,t);let r=e._zod.parse;me(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[u,p]of Object.entries(s)){o[u]||(o[u]=new Set);for(let d of p)o[u].add(d)}}return o});let n=Ar(()=>{let o=t.options,i=new Map;for(let s of o){let u=s._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let p of u){if(i.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);i.set(p,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!qt(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let u=n.value.get(s?.[t.discriminator]);return u?u._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}});var xa=z("$ZodRecord",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Gi(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let u=new Set;for(let d of s)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){u.add(typeof d=="number"?d.toString():d);let f=t.valueType._zod.run({value:o[d],issues:[]},n);f instanceof Promise?i.push(f.then(v=>{v.issues.length&&r.issues.push(...Ke(d,v.issues)),r.value[d]=v.value})):(f.issues.length&&r.issues.push(...Ke(d,f.issues)),r.value[d]=f.value)}let p;for(let d in o)u.has(d)||(p=p??[],p.push(d));p&&p.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:p})}else{r.value={};for(let u of Reflect.ownKeys(o)){if(u==="__proto__")continue;let p=t.keyType._zod.run({value:u,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&po.test(u)&&p.issues.length){let v=t.keyType._zod.run({value:Number(u),issues:[]},n);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(p=v)}if(p.issues.length){t.mode==="loose"?r.value[u]=o[u]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(v=>Je(v,n,Le())),input:u,path:[u],inst:e});continue}let f=t.valueType._zod.run({value:o[u],issues:[]},n);f instanceof Promise?i.push(f.then(v=>{v.issues.length&&r.issues.push(...Ke(u,v.issues)),r.value[p.value]=v.value})):(f.issues.length&&r.issues.push(...Ke(u,f.issues)),r.value[p.value]=f.value)}}return i.length?Promise.all(i).then(()=>r):r}});var Pa=z("$ZodEnum",(e,t)=>{ce.init(e,t);let r=uo(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Wi.has(typeof o)).map(o=>typeof o=="string"?yt(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),ba=z("$ZodLiteral",(e,t)=>{if(ce.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"?yt(n):n?yt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var Ta=z("$ZodTransform",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Er(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new Ce;return r.value=o,r}});function ua(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(ua,"handleOptionalResult");var Ea=z("$ZodOptional",(e,t)=>{ce.init(e,t),e._zod.optin="optional",e._zod.optout="optional",me(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),me(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Sr(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(i=>ua(i,r.value)):ua(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Ia=z("$ZodNullable",(e,t)=>{ce.init(e,t),me(e._zod,"optin",()=>t.innerType._zod.optin),me(e._zod,"optout",()=>t.innerType._zod.optout),me(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Sr(r.source)}|null)$`):void 0}),me(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 Aa=z("$ZodPipe",(e,t)=>{ce.init(e,t),me(e._zod,"values",()=>t.in._zod.values),me(e._zod,"optin",()=>t.in._zod.optin),me(e._zod,"optout",()=>t.out._zod.optout),me(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>zr(s,t.in,n)):zr(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>zr(i,t.out,n)):zr(o,t.out,n)}});function zr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(zr,"handlePipeResult");var Sa=z("$ZodCustom",(e,t)=>{_t.init(e,t),ce.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(i=>ca(i,r,n,e));ca(o,r,n,e)}});function ca(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(lo(o))}}a(ca,"handleRefineResult");var wa,md=Symbol("ZodOutput"),gd=Symbol("ZodInput"),yo=class{static{a(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 Oa(){return new yo}a(Oa,"registry");(wa=globalThis).__zod_globalRegistry??(wa.__zod_globalRegistry=Oa());var vo=globalThis.__zod_globalRegistry;function za(e,t){return new e({type:"string",...ue(t)})}a(za,"_string");function Ra(e,t){return new e({type:"string",coerce:!0,...ue(t)})}a(Ra,"_coercedString");function ka(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}a(ka,"_url");function Da(e,t){return new e({type:"number",checks:[],...ue(t)})}a(Da,"_number");function Ca(e,t){return new e({type:"number",coerce:!0,checks:[],...ue(t)})}a(Ca,"_coercedNumber");function Na(e,t){return new e({type:"boolean",...ue(t)})}a(Na,"_boolean");function Ma(e,t){return new e({type:"boolean",coerce:!0,...ue(t)})}a(Ma,"_coercedBoolean");function Ua(e,t){return new e({type:"bigint",coerce:!0,...ue(t)})}a(Ua,"_coercedBigint");function La(e){return new e({type:"any"})}a(La,"_any");function ja(e){return new e({type:"unknown"})}a(ja,"_unknown");function Fa(e,t){return new e({type:"void",...ue(t)})}a(Fa,"_void");function Ba(e,t){return new e({type:"date",coerce:!0,...ue(t)})}a(Ba,"_coercedDate");function Re(e,t){return new ra({check:"min_length",...ue(t),minimum:e})}a(Re,"_minLength");function Xe(e,t){return new na({check:"string_format",format:"regex",...ue(t),pattern:e})}a(Xe,"_regex");function Va(e,t,r){let n=ue(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(Va,"_custom");var ge=z("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ce.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>wr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Wt(e,r,n),e.parseAsync=async(r,n)=>Or(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Kt(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)=>$r(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Cr=z("ZodMiniString",(e,t)=>{kr.init(e,t),ge.init(e,t)});function c(e){return za(Cr,e)}a(c,"string");var Ha=z("ZodMiniStringFormat",(e,t)=>{mo.init(e,t),Cr.init(e,t)});var Id=z("ZodMiniURL",(e,t)=>{la.init(e,t),Ha.init(e,t)});function Za(e){return ka(Id,e)}a(Za,"url");var _o=z("ZodMiniNumber",(e,t)=>{pa.init(e,t),ge.init(e,t)});function Pe(e){return Da(_o,e)}a(Pe,"number");var xo=z("ZodMiniBoolean",(e,t)=>{go.init(e,t),ge.init(e,t)});function Q(e){return Na(xo,e)}a(Q,"boolean");var qa=z("ZodMiniBigInt",(e,t)=>{da.init(e,t),ge.init(e,t)});var Ad=z("ZodMiniAny",(e,t)=>{fa.init(e,t),ge.init(e,t)});function Xt(){return La(Ad)}a(Xt,"any");var Sd=z("ZodMiniUnknown",(e,t)=>{ma.init(e,t),ge.init(e,t)});function M(){return ja(Sd)}a(M,"unknown");var $d=z("ZodMiniVoid",(e,t)=>{ga.init(e,t),ge.init(e,t)});function Ga(e){return Fa($d,e)}a(Ga,"_void");var Wa=z("ZodMiniDate",(e,t)=>{ha.init(e,t),ge.init(e,t)});var wd=z("ZodMiniArray",(e,t)=>{ya.init(e,t),ge.init(e,t)});function F(e,t){return new wd({type:"array",element:e,...ue(t)})}a(F,"array");var Od=z("ZodMiniObject",(e,t)=>{va.init(e,t),ge.init(e,t),me(e,"shape",()=>t.shape)});function g(e,t){let r={type:"object",shape:e??{},...ue(t)};return new Od(r)}a(g,"object");var zd=z("ZodMiniUnion",(e,t)=>{ho.init(e,t),ge.init(e,t)});function B(e,t){return new zd({type:"union",options:e,...ue(t)})}a(B,"union");var Rd=z("ZodMiniDiscriminatedUnion",(e,t)=>{_a.init(e,t),ge.init(e,t)});function xt(e,t,r){return new Rd({type:"union",options:t,discriminator:e,...ue(r)})}a(xt,"discriminatedUnion");var kd=z("ZodMiniRecord",(e,t)=>{xa.init(e,t),ge.init(e,t)});function U(e,t,r){return new kd({type:"record",keyType:e,valueType:t,...ue(r)})}a(U,"record");var Dd=z("ZodMiniEnum",(e,t)=>{Pa.init(e,t),ge.init(e,t),e.options=Object.values(t.entries)});function G(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Dd({type:"enum",entries:r,...ue(t)})}a(G,"_enum");var Cd=z("ZodMiniLiteral",(e,t)=>{ba.init(e,t),ge.init(e,t)});function k(e,t){return new Cd({type:"literal",values:Array.isArray(e)?e:[e],...ue(t)})}a(k,"literal");var Nd=z("ZodMiniTransform",(e,t)=>{Ta.init(e,t),ge.init(e,t)});function Ye(e){return new Nd({type:"transform",transform:e})}a(Ye,"transform");var Md=z("ZodMiniOptional",(e,t)=>{Ea.init(e,t),ge.init(e,t)});function P(e){return new Md({type:"optional",innerType:e})}a(P,"optional");var Ud=z("ZodMiniNullable",(e,t)=>{Ia.init(e,t),ge.init(e,t)});function Yt(e){return new Ud({type:"nullable",innerType:e})}a(Yt,"nullable");var Ld=z("ZodMiniPipe",(e,t)=>{Aa.init(e,t),ge.init(e,t)});function Qe(e,t){return new Ld({type:"pipe",in:e,out:t})}a(Qe,"pipe");var jd=z("ZodMiniCustom",(e,t)=>{Sa.init(e,t),ge.init(e,t)});function Nr(e,t){return Va(jd,e??(()=>!0),t)}a(Nr,"custom");var Qt={};io(Qt,{bigint:()=>Gd,boolean:()=>qd,date:()=>Wd,number:()=>Zd,string:()=>Hd});function Hd(e){return Ra(Cr,e)}a(Hd,"string");function Zd(e){return Ca(_o,e)}a(Zd,"number");function qd(e){return Ma(xo,e)}a(qd,"boolean");function Gd(e){return Ua(qa,e)}a(Gd,"bigint");function Wd(e){return Ba(Wa,e)}a(Wd,"date");var bo=g({retryOnFailure:g({defaultValue:P(Q()),hide:P(Q())}),continueOnFailure:g({defaultValue:P(Q()),hide:P(Q())})}),Po=class{constructor(t,r,n,o,i,s,u,p,d,f,v){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=i;this.test=s;this.requireAuth=u;this.errorHandlingOptions=p;this.outputSchema=d;this.audience=f;this.aiMetadata=v}static{a(this,"IAction")}},ne=a(e=>new Po(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=g({displayName:c(),description:P(c())}),q=a((e,t)=>g({type:k(t),required:Q(),defaultValue:P(Xt())}),"TPropertyValue");var Ie=g({...Y.shape,...q(c(),"SHORT_TEXT").shape}),je=g({...Y.shape,...q(c(),"LONG_TEXT").shape});var Ja=g({label:c(),value:M()}),Mr=g({disabled:P(Q()),placeholder:P(c()),options:F(Ja)});var Ae=g({...Y.shape,options:Mr,...q(M(),"STATIC_DROPDOWN").shape}),Fe=g({...Y.shape,options:Mr,...q(F(M()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var To=g({...Y.shape,...q(M(),"DROPDOWN").shape,refreshers:F(c())}),er=g({...Y.shape,...q(F(M()),"MULTI_SELECT_DROPDOWN").shape,refreshers:F(c())});var Be=g({...Y.shape,...q(Q(),"CHECKBOX").shape});var Ve=g({...Y.shape,...q(Pe(),"NUMBER").shape});var tr=g({...Y.shape,...q(M(),"FILE").shape});var rr=g({...Y.shape,...q(c(),"DATE_TIME").shape});var Xa=U(c(),B([Ie,je,Ae,er,Fe,Be,Ve,tr,rr])),nr=g({...Y.shape,properties:Xa,...q(F(M()),"ARRAY").shape});var or=g({...Y.shape,...q(B([U(c(),M())]),"JSON").shape});var Ya=B([Ie,Ae,or,nr,Fe]),Jd=U(c(),Ya),Eo=g({refreshers:F(c()),...Y.shape,...q(M(),"DYNAMIC").shape});var Ur=g({...Y.shape,...q(Ga(),"MARKDOWN").shape});var ir=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ir||{}),Pt=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Pt||{}),bt=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(bt||{});var ar=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ar||{}),Io="both_client_credentials_and_authorization_code";var Ne=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ne||{}),sr=(i=>(i.NONE="NONE",i.HEADER_PRESENT="HEADER_PRESENT",i.QUERY_PRESENT="QUERY_PRESENT",i.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",i.HEAD_REQUEST="HEAD_REQUEST",i))(sr||{}),Xd=g({strategy:G(sr),paramName:P(c())}),ur=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ur||{});var Lr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lr||{}),Qa=g({status:P(Pe()),body:P(M()),headers:P(U(c(),c()))}),es=g({type:k("DELAY"),resumeDateTime:c(),requestIdToReply:P(c()),handlerId:P(c()),streamStepProgress:P(G(Lr))}),ts=g({type:k("WEBHOOK"),requestId:c(),requestIdToReply:P(c()),response:Qa,handlerId:P(c()),streamStepProgress:P(G(Lr))}),Yd=B([es,ts]);var Qd=g({body:M(),rawBody:P(M()),headers:U(c(),c()),queryParams:U(c(),c())});function he(e){return e==null}a(he,"isNil");function cr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(cr,"isEmpty");function He(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(He,"assertNotNullOrUndefined");var Ao=ze(require("crypto"),1);var ef=128,ct,Tt,tf=a(e=>{!ct||ct.length<e?(ct=Buffer.allocUnsafe(e*ef),Ao.default.randomFillSync(ct),Tt=0):Tt+e>ct.length&&(Ao.default.randomFillSync(ct),Tt=0),Tt+=e},"fillPool"),rf=a(e=>(tf(e|=0),ct.subarray(Tt-e,Tt)),"random"),nf=a((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(i=t)=>{let s="";for(;;){let u=r(o),p=o;for(;p--;)if(s+=e[u[p]&n]||"",s.length===i)return s}}},"customRandom"),ns=a((e,t=21)=>nf(e,t,rf),"customAlphabet");var of="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",os=21,O$=c().check(Xe(new RegExp(`^[0-9a-zA-Z]{${os}}$`))),af=ns(of,os);var et=Qe(Ye(e=>e instanceof Date?e.toISOString():e),c()),$e={id:c(),created:et,updated:et},ie=a(e=>P(Yt(e)),"Nullable");function So(e){return P(Yt(G(e)))}a(So,"NullableEnum");var k$=Qe(Ye(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),P(Q())),jr=a(e=>Qe(Ye(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),P(F(e))),"OptionalArrayFromQuery");var N$=U(c(),M());var lr=(f=>(f.OPENAI="openai",f.OPENROUTER="openrouter",f.ANTHROPIC="anthropic",f.AZURE="azure",f.GOOGLE="google",f.ACTIVEPIECES="activepieces",f.CLOUDFLARE_GATEWAY="cloudflare-gateway",f.CUSTOM="custom",f.BEDROCK="bedrock",f.MISTRAL="mistral",f))(lr||{});var W$=c().check(Xe(/^#[0-9A-Fa-f]{6}$/));var J$=g({filename:c(),data:M(),type:k("file"),mimetype:P(c())});var sf=ze(as());var nw=g({...$e,name:c(),permissions:F(c()),platformId:ie(c()),type:c(),userCount:P(Pe())});var ss=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ss||{}),$o=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))($o||{}),wo=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(wo||{});var Oo=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Oo||{});var zo=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(zo||{});var uf=g({mode:G(ss),value:M()}),cf=g({auth:P(c()),fields:U(c(),uf)}),lf=g({pieceName:c(),pieceVersion:c(),actionName:c(),predefinedInput:P(cf)}),pf=g({type:k("PIECE"),toolName:c().check(Re(1)),pieceMetadata:lf}),df=g({type:k("none")}),ff=g({type:k("access_token"),accessToken:c()}),mf=g({type:k("api_key"),apiKey:c(),apiKeyHeader:c()}),gf=g({type:k("headers"),headers:U(c(),c())}),hf=xt("type",[df,ff,mf,gf]),us=g({type:k("FLOW"),toolName:c().check(Re(1)),externalFlowId:c(),flowDisplayName:P(c())}),cs=g({type:k("MCP"),toolName:c().check(Re(1)),serverUrl:Za(),protocol:G(wo),auth:hf}),ls=g({type:k("KNOWLEDGE_BASE"),toolName:c().check(Re(1)),sourceType:G($o),sourceId:c(),sourceName:c()}),yf=xt("type",[pf,us,cs,ls]),vf=g({displayName:c(),description:P(c()),type:G(Oo)}),ps=g({type:k("MARKDOWN"),markdown:c()}),Et={type:k("TOOL_CALL"),input:ie(U(c(),M())),output:P(M()),toolName:c(),status:G(zo),toolCallId:c(),startTime:c(),endTime:P(c())},Ow=g(Et),ds=xt("toolCallType",[g({...Et,toolCallType:k("PIECE"),pieceName:c(),pieceVersion:c(),actionName:c()}),g({...Et,toolCallType:k("FLOW"),displayName:c(),externalFlowId:c()}),g({...Et,toolCallType:k("MCP"),displayName:c(),serverUrl:c()}),g({...Et,toolCallType:k("KNOWLEDGE_BASE"),displayName:c(),sourceType:c()}),g({...Et,toolCallType:k("UNKNOWN"),displayName:c()})]),_f=B([ps,ds]);var Ro=(r=>(r.IMAGE="image",r.TEXT="text",r))(Ro||{}),Ze=g({apiKey:c()}),xf=Ze,Pf=g({apiKey:c(),apiKeyHash:c()}),bf=Ze,Tf=Ze,Ef=Ze,If=Ze,Af=Ze,Sf=Ze,$f=Ze,fs=g({accessKeyId:c().check(Re(1)),secretAccessKey:c().check(Re(1))}),wf=g({}),Of=g({}),zf=g({}),Rf=g({}),kf=g({}),Df=g({}),ms=g({modelId:c(),modelName:c(),modelType:G(Ro)}),gs=g({apiKeyHeader:c(),baseUrl:c(),models:F(ms),defaultHeaders:P(U(c(),c()))}),hs=g({accountId:c(),gatewayId:c(),models:F(ms),vertexProject:P(c()),vertexRegion:P(c())}),ys=g({resourceName:c(),apiVersion:Qe(Ye(e=>typeof e=="string"&&e.trim().length===0?void 0:e),P(c()))}),vs=g({region:c().check(Re(1))}),Cf=B([xf,Ef,If,Af,Sf,Tf,bf,Pf,fs,$f]),_s=B([gs,hs,ys,vs,wf,zf,Rf,kf,Of,Df]),Nf=g({id:c(),name:c(),type:G(Ro)}),Mf=g({id:c(),name:c(),provider:G(lr),config:_s,enabledForChat:Q()}),Uf=g({provider:G(lr),config:_s,auth:Cf,platformId:c()});var Dw={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Lf=g({base64Url:c(),fileName:c(),extension:P(c())}),jf=g({mimeType:c(),url:c(),fileName:P(c())}),ko=B([Lf,jf]);var Ff=B([g({type:k("file"),value:ko}),g({type:k("markdown"),value:c(),files:P(F(ko))})]),Bf=g({sessionId:c(),message:c(),files:P(F(c()))});var Ps=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ps||{}),bs=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(bs||{}),Do=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Do||{});var Vf=B([g({...$e,name:c(),externalId:c(),type:k("STATIC_DROPDOWN"),tableId:c(),projectId:c(),data:g({options:F(g({value:c()}))})}),g({...$e,name:c(),externalId:c(),type:B([k("TEXT"),k("NUMBER"),k("DATE")]),tableId:c(),projectId:c()})]),Hf=g({...$e,name:c(),folderId:ie(c()),projectId:c(),externalId:c(),status:So(bs),trigger:So(Ps)}),Zf=g({...$e,tableId:c(),projectId:c(),cells:U(c(),g({updated:c(),created:c(),value:M(),fieldName:c()}))}),qf=g({events:F(G(Do)),webhookUrl:c(),flowId:c()}),Gf=g({fields:F(g({id:c(),name:c()})),rows:F(U(c(),c())),name:c()}),Wf=g({projectId:c(),limit:P(Qt.number()),cursor:P(c()),name:P(c()),externalIds:jr(c()),folderId:P(c()),folderIds:jr(c())}),Kf=g({records:F(F(g({fieldId:c(),value:Es()}))),tableId:c()}),Jf=g({cells:P(F(g({fieldId:c(),value:Es()}))),tableId:c(),agentUpdate:P(Q())}),Ts=xt("operator",[lt("eq"),lt("neq"),lt("gt"),lt("gte"),lt("lt"),lt("lte"),lt("co"),xs("exists"),xs("not_exists")]),Xf=g({tableId:c(),limit:P(Qt.number()),cursor:P(c()),filters:jr(Ts)});function Es(){return Qe(Ye(e=>e==null?e:String(e)),Yt(c()))}a(Es,"coerceToString");function lt(e){return g({fieldId:c(),operator:k(e),value:c()})}a(lt,"valueFilter");function xs(e){return g({fieldId:c(),operator:k(e)})}a(xs,"existenceFilter");var Yf=g({status:P(Pe()),body:P(M()),headers:P(U(c(),c()))}),Qf=g({...$e,deleted:ie(et),ownerId:c(),displayName:c(),platformId:c(),externalId:ie(c())});var Is=g({name:c(),description:P(c()),type:c(),required:Q()}),em=g({pieceName:c(),triggerName:c(),input:g({toolName:c(),toolDescription:c(),inputSchema:F(Is),returnsResponse:Q()})});var As="^[0-9]+\\.[0-9]+\\.[0-9]+$",Qw=new RegExp(As),rm="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",eO=c().check(Xe(new RegExp(As))),tO=c().check(Xe(new RegExp(rm))),nm=g({packageType:k("ARCHIVE"),pieceType:G(Pt),pieceName:c(),pieceVersion:c(),archiveId:c(),platformId:c()}),Ss=g({packageType:k("REGISTRY"),pieceType:k("OFFICIAL"),pieceName:c(),pieceVersion:c()}),$s=g({packageType:k("REGISTRY"),pieceType:k("CUSTOM"),pieceName:c(),pieceVersion:c(),platformId:c()}),rO=B([Ss,$s]),nO=B([nm,Ss,$s]),ws=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ws||{}),om=g({type:G(ws),cronExpression:c(),timezone:c()}),oO=g({...$e,type:G(Ne),projectId:c(),flowId:c(),triggerName:c(),schedule:ie(om),flowVersionId:c(),pieceName:c(),pieceVersion:c(),deleted:ie(c()),simulate:Q()}),Os=(h=>(h.UNKNOWN="UNKNOWN",h.FLOW_RUN_LOG="FLOW_RUN_LOG",h.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",h.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",h.FLOW_STEP_FILE="FLOW_STEP_FILE",h.SAMPLE_DATA="SAMPLE_DATA",h.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",h.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",h.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",h.PROJECT_RELEASE="PROJECT_RELEASE",h.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",h.PLATFORM_ASSET="PLATFORM_ASSET",h.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",h.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",h.KNOWLEDGE_BASE="KNOWLEDGE_BASE",h.FLOW_BUNDLE="FLOW_BUNDLE",h))(Os||{}),zs=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(zs||{}),Rs=(r=>(r.S3="S3",r.DB="DB",r))(Rs||{}),iO=g({...$e,projectId:ie(c()),platformId:ie(c()),type:G(Os),compression:G(zs),data:P(M()),location:G(Rs),size:ie(Pe()),fileName:ie(c()),s3Key:ie(c()),metadata:ie(U(c(),c()))}),ks=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ks||{}),Ds=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ds||{}),aO=g({id:c(),email:c(),firstName:c(),status:G(Ds),externalId:ie(c()),platformId:ie(c()),platformRole:G(ks),lastName:c(),created:et,updated:et,lastActiveDate:ie(et),imageUrl:ie(c())});var No=g({...Y.shape,...q(U(c(),M()),"OBJECT").shape});var Ms=g({...Y.shape,...q(c(),"COLOR").shape});var Mo=B([Ie,je,Ur,Be,Ae,Fe,To,er,Eo,Ve,nr,No,or,rr,tr,Ms]),E={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 Me=g({displayName:c(),description:P(c())});var Us=g({username:c(),password:c()}),Uo=g({...Me.shape,username:g({displayName:c(),description:P(c())}),password:g({displayName:c(),description:P(c())}),...q(Us,"BASIC_AUTH").shape});var um=U(c(),B([Ie,je,Ve,Be,Ae])),Lo=g({...Me.shape,props:um,...q(M(),"CUSTOM_AUTH").shape});var pt=g({...Me.shape,...q(g({auth:c()}),"SECRET_TEXT").shape});var cm=U(c(),B([Ie,je,pt,Ve,Be,Ae,Fe,Ur])),Ls=g({...Me.shape,props:cm,...q(M(),"OIDC").shape});var jo=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(jo||{}),js=B([Ie,pt,Ae]),Fs=U(c(),js),lm=g({props:P(U(c(),js)),authUrl:c(),tokenUrl:c(),scope:F(c()),prompt:P(B([k("none"),k("consent"),k("login"),k("omit")])),pkce:P(Q()),pkceMethod:P(B([k("plain"),k("S256")])),authorizationMethod:P(G(jo)),grantType:P(B([G(ar),k(Io)])),extra:P(U(c(),c()))}),Bs=g({access_token:c(),props:P(Fs),data:U(c(),Xt())}),Fo=g({...Me.shape,...lm.shape,...q(Bs,"OAUTH2").shape});var It=B([Uo,Lo,Ls,Fo,pt]),pr="Connection",Bo={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||pr}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||pr,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||pr}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||pr}},None(){}};var Uz={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 pm=g({...Y.shape,...q(M(),"CUSTOM").shape,code:c()});var dm=B([Mo,It]),Vo=U(c(),dm),oR=U(c(),Mo);var Vs=B([g({strategy:k("CRON"),cronExpression:c()}),g({strategy:k("NONE")})]),At=class{constructor(t,r,n,o,i,s,u,p,d,f,v,y,l,m,_,h,x,T,V){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=i;this.type=s;this.handshakeConfiguration=u;this.onHandshake=p;this.renewConfiguration=d;this.onRenew=f;this.onEnable=v;this.onDisable=y;this.onStart=l;this.run=m;this.test=_;this.sampleData=h;this.testStrategy=x;this.outputSchema=T;this.aiMetadata=V}static{a(this,"ITrigger")}},St=a(e=>{switch(e.type){case"WEBHOOK":return new At(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 At(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 At(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 At(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,he(e.sampleData)&&he(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Hs="2",Br="0.82.0";var Ho=class{constructor(t,r,n,o,i,s,u,p,d=Br,f,v=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=u;this.auth=p;this.minimumSupportedRelease=d;this.maximumSupportedRelease=f;this.description=v;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:Hs}),"getContextInfo");(!fm(d)||mm(d,Br))&&(this.minimumSupportedRelease=Br),i.forEach(y=>this._actions[y.name]=y),s.forEach(y=>this._triggers[y.name]=y)}static{a(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Zs=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(i=>i.type===r.type)))throw new Error("Auth properties must be unique by type");return new Ho(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function fm(e){return/^\d+\.\d+\.\d+$/.test(e)}a(fm,"isValidSimpleSemver");function mm(e,t){let[r,n,o]=e.split(".").map(Number),[i,s,u]=t.split(".").map(Number);return r!==i?r<i:n!==s?n<s:o<u}a(mm,"isSemverLessThan");var gm=P(U(c(),U(c(),c()))),qs=g({id:P(c()),name:c(),displayName:c(),logoUrl:c(),description:c(),authors:F(c()),platformId:P(c()),directoryPath:P(c()),auth:P(B([It,F(It)])),version:c(),categories:P(F(G(bt))),minimumSupportedRelease:P(c()),maximumSupportedRelease:P(c()),i18n:gm}),hm=G(["human","ai","both"]),Gs=g({description:P(c()),idempotent:P(Q())}),Ws=g({name:c(),displayName:c(),description:c(),props:Vo,requireAuth:Q(),errorHandlingOptions:P(bo),outputSchema:P(Nr()),audience:P(hm),aiMetadata:P(Gs)}),Ks=g({name:c(),displayName:c(),description:c(),props:Vo,errorHandlingOptions:P(bo),type:G(Ne),sampleData:M(),handshakeConfiguration:P(Nr()),renewConfiguration:P(Vs),testStrategy:G(ur),outputSchema:P(Nr()),aiMetadata:P(Gs)}),ym=g({...qs.shape,actions:U(c(),Ws),triggers:U(c(),Ks)}),vm=g({...qs.shape,actions:Pe(),triggers:Pe(),suggestedActions:P(F(Ks)),suggestedTriggers:P(F(Ws))}),Js=g({projectUsage:Pe(),tags:P(F(c())),pieceType:G(Pt),packageType:G(ir),platformId:P(c()),archiveId:P(c())}),ok=g({...ym.shape,...Js.shape}),ik=g({...vm.shape,...Js.shape}),ak=g({name:c(),version:c()});var _m=ze(require("path")),xm=ze(require("fs/promises"));var Vr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{a(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((i,s)=>{o.append(s,i)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Hr=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new Zo,r=new qo){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Zo=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qo=class{static{a(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Zr=class extends Error{constructor(r,n){let o=n.status||500,i=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:i},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=i}static{a(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var qr=class extends Vr{static{a(this,"FetchHttpClient")}constructor(t="",r=new Hr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),i=this.getHeaders(t),s=t.queryParams??{};for(let[V,de]of Object.entries(s))o.append(V,de);let u=o.toString(),p=u?`${n}?${u}`:n,d=t.responseType??"json",f=t.followRedirects??!0,v=t.retries??0,{body:y,extraHeaders:l,isStream:m}=Pm(t.body,i),_=Tm({...i,...l}),h=await bm(async()=>{let V=new AbortController,de=t.timeout&&t.timeout>0?setTimeout(()=>V.abort(),t.timeout):void 0;try{let xe={method:t.method.toString(),headers:_,body:y,redirect:f?"follow":"manual",signal:V.signal};return m&&(xe.duplex="half"),r?.dispatcher!==void 0&&(xe.dispatcher=r.dispatcher),await fetch(p,xe)}finally{de!==void 0&&clearTimeout(de)}},v),x=f?300:400;if(h.status<200||h.status>=x){let V=await Xs(h,d),de=new Zr(t.body,{status:h.status,responseBody:V});throw console.error("[HttpClient#(sanitized error message)] Request failed:",de),de}let T=await Xs(h,d);return{status:h.status,headers:Em(h.headers),body:T}}};function Pm(e,t){return Am(e)?{body:void 0,extraHeaders:{},isStream:!1}:Im(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}a(Pm,"serializeBody");async function Xs(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}a(Xs,"parseResponseBody");async function bm(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Ys(n);continue}return o}catch(o){if(r=o,n<t){await Ys(n);continue}throw o}throw r}a(bm,"sendWithRetries");function Ys(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a(Ys,"backoff");function Tm(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}a(Tm,"normalizeHeaders");function Em(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(Em,"toHttpHeaders");function Im(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}a(Im,"isNodeFormData");function Am(e){return e==null}a(Am,"isNil");var Qs=new qr;var Go=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(Go||{});var fh=ze(require("fs")),il=ze(ol());var mh={"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 gh(e){let t=e.split(";")[0].trim().toLowerCase();return mh[t]??""}a(gh,"contentTypeToExtension");var hh=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),yh=a((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 al({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:i,props:s,extraProps:u,authLocation:p="headers"}){return ne({audience:"human",name:i||"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:E.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:a(async({auth:d})=>({url:E.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
6
|
-
i.e ${
|
|
5
|
+
3. Same - all individual requests that state a dependency in the dependsOn property, state the same dependency.`),u.name="Invalid Dependency",u;p.label=1;case 1:return o.done?[3,3]:(i=o.value[1],[4,e.getRequestData(i.request)]);case 2:if(s=p.sent(),s.body!==void 0&&(s.headers===void 0||s.headers["content-type"]===void 0))throw u=new Error("Content-type header is not mentioned for request #".concat(i.id,", For request having body, Content-type header should be mentioned")),u.name="Invalid Content-type header",u;return s.id=i.id,i.dependsOn!==void 0&&i.dependsOn.length>0&&(s.dependsOn=i.dependsOn),t.push(s),o=n.next(),[3,1];case 3:return r.requests=t,[2,r]}})})},e.prototype.addDependency=function(t,r){if(!this.requests.has(t)){var n=new Error("Dependent ".concat(t," does not exists, Please check the id"));throw n.name="Invalid Dependent",n}if(typeof r<"u"&&!this.requests.has(r)){var n=new Error("Dependency ".concat(r," does not exists, Please check the id"));throw n.name="Invalid Dependency",n}if(typeof r<"u"){var o=this.requests.get(t);if(o.dependsOn===void 0&&(o.dependsOn=[]),o.dependsOn.indexOf(r)!==-1){var n=new Error("Dependency ".concat(r," is already added for the request ").concat(t));throw n.name="Duplicate Dependency",n}o.dependsOn.push(r)}else{for(var i=this.requests.entries(),s=void 0,u=i.next();!u.done&&u.value[1].id!==t;)s=u,u=i.next();if(typeof s<"u"){var p=s.value[0];if(u.value[1].dependsOn===void 0&&(u.value[1].dependsOn=[]),u.value[1].dependsOn.indexOf(p)!==-1){var n=new Error("Dependency ".concat(p," is already added for the request ").concat(t));throw n.name="Duplicate Dependency",n}u.value[1].dependsOn.push(p)}else{var n=new Error("Can't add dependency ".concat(r,", There is only a dependent request in the batch"));throw n.name="Invalid Dependency Addition",n}}},e.prototype.removeDependency=function(t,r){var n=this.requests.get(t);if(typeof n>"u"||n.dependsOn===void 0||n.dependsOn.length===0)return!1;if(typeof r<"u"){var o=n.dependsOn.indexOf(r);return o===-1?!1:(n.dependsOn.splice(o,1),!0)}else return delete n.dependsOn,!0},e.requestLimit=20,e})();pn.BatchRequestContent=Gh});var np=b(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.BatchResponseContent=void 0;var Wh=(ue(),ie(se)),Kh=(function(){function e(t){this.responses=new Map,this.update(t)}return a(e,"BatchResponseContent"),e.prototype.createResponseObject=function(t){var r=t.body,n={};if(n.status=t.status,t.statusText!==void 0&&(n.statusText=t.statusText),n.headers=t.headers,n.headers!==void 0&&n.headers["Content-Type"]!==void 0&&n.headers["Content-Type"].split(";")[0]==="application/json"){var o=JSON.stringify(r);return new Response(o,n)}return new Response(r,n)},e.prototype.update=function(t){this.nextLink=t["@odata.nextLink"];for(var r=t.responses,n=0,o=r.length;n<o;n++)this.responses.set(r[n].id,this.createResponseObject(r[n]))},e.prototype.getResponseById=function(t){return this.responses.get(t)},e.prototype.getResponses=function(){return this.responses},e.prototype.getResponsesIterator=function(){var t,r;return Wh.__generator(this,function(n){switch(n.label){case 0:t=this.responses.entries(),r=t.next(),n.label=1;case 1:return r.done?[3,3]:[4,r.value];case 2:return n.sent(),r=t.next(),[3,1];case 3:return[2]}})},e})();dn.BatchResponseContent=Kh});var xi=b(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.GRAPH_URLS=it.GRAPH_BASE_URL=it.GRAPH_API_VERSION=void 0;it.GRAPH_API_VERSION="v1.0";it.GRAPH_BASE_URL="https://graph.microsoft.com/";it.GRAPH_URLS=new Set(["graph.microsoft.com","graph.microsoft.us","dod-graph.microsoft.us","graph.microsoft.de","microsoftgraph.chinacloudapi.cn","canary.graph.microsoft.com"])});var Ge=b(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.GraphClientError=void 0;var Jh=(ue(),ie(se)),Xh=(function(e){Jh.__extends(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return a(t,"GraphClientError"),t.setGraphClientError=function(r){var n;return r instanceof Error?n=r:(n=new t,n.customError=r),n},t})(Error);mn.GraphClientError=Xh});var fn=b(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.isCustomHost=we.isGraphURL=we.serializeContent=we.urlJoin=we.oDataQueryNames=void 0;var Yh=xi(),Qh=Ge();we.oDataQueryNames=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"];var ey=a(function(e){var t=a(function(i){return i.replace(/\/+$/,"")},"removePostSlash"),r=a(function(i){return i.replace(/^\/+/,"")},"removePreSlash"),n=a(function(i,s){return[t(i),r(s)].join("/")},"joiner"),o=Array.prototype.slice.call(e);return o.reduce(n)},"urlJoin");we.urlJoin=ey;var ty=a(function(e){var t=e&&e.constructor&&e.constructor.name;if(t==="Buffer"||t==="Blob"||t==="File"||t==="FormData"||typeof e=="string")return e;if(t==="ArrayBuffer")e=Buffer.from(e);else if(t==="Int8Array"||t==="Int16Array"||t==="Int32Array"||t==="Uint8Array"||t==="Uint16Array"||t==="Uint32Array"||t==="Uint8ClampedArray"||t==="Float32Array"||t==="Float64Array"||t==="DataView")e=Buffer.from(e.buffer);else try{e=JSON.stringify(e)}catch{throw new Error("Unable to stringify the content")}return e},"serializeContent");we.serializeContent=ty;var ry=a(function(e){return op(e)},"isGraphURL");we.isGraphURL=ry;var ny=a(function(e,t){return t.forEach(function(r){return oy(r)}),op(e,t)},"isCustomHost");we.isCustomHost=ny;var op=a(function(e,t){if(t===void 0&&(t=Yh.GRAPH_URLS),e=e.toLowerCase(),e.indexOf("https://")!==-1){e=e.replace("https://","");var r=e.indexOf(":"),n=e.indexOf("/"),o="";if(n!==-1)return r!==-1&&r<n?(o=e.substring(0,r),t.has(o)):(o=e.substring(0,n),t.has(o))}return!1},"isValidEndpoint"),oy=a(function(e){if(e.indexOf("/")!==-1)throw new Qh.GraphClientError("Please add only hosts or hostnames to the CustomHosts config. If the url is `http://example.com:3000/`, host is `example:3000`")},"isCustomHostValid")});var at=b(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.MiddlewareControl=void 0;var iy=(function(){function e(t){t===void 0&&(t=[]),this.middlewareOptions=new Map;for(var r=0,n=t;r<n.length;r++){var o=n[r],i=o.constructor;this.middlewareOptions.set(i,o)}}return a(e,"MiddlewareControl"),e.prototype.getMiddlewareOptions=function(t){return this.middlewareOptions.get(t)},e.prototype.setMiddlewareOptions=function(t,r){this.middlewareOptions.set(t,r)},e})();gn.MiddlewareControl=iy});var Nt=b(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.cloneRequestWithNewUrl=Oe.appendRequestHeader=Oe.setRequestHeader=Oe.getRequestHeader=Oe.generateUUID=void 0;var ip=(ue(),ie(se)),ay=a(function(){for(var e="",t=0;t<32;t++)(t===8||t===12||t===16||t===20)&&(e+="-"),e+=Math.floor(Math.random()*16).toString(16);return e},"generateUUID");Oe.generateUUID=ay;var sy=a(function(e,t,r){var n=null;if(typeof Request<"u"&&e instanceof Request)n=e.headers.get(r);else if(typeof t<"u"&&t.headers!==void 0)if(typeof Headers<"u"&&t.headers instanceof Headers)n=t.headers.get(r);else if(t.headers instanceof Array){for(var o=t.headers,i=0,s=o.length;i<s;i++)if(o[i][0]===r){n=o[i][1];break}}else t.headers[r]!==void 0&&(n=t.headers[r]);return n},"getRequestHeader");Oe.getRequestHeader=sy;var uy=a(function(e,t,r,n){var o,i;if(typeof Request<"u"&&e instanceof Request)e.headers.set(r,n);else if(typeof t<"u")if(t.headers===void 0)t.headers=new Headers((o={},o[r]=n,o));else if(typeof Headers<"u"&&t.headers instanceof Headers)t.headers.set(r,n);else if(t.headers instanceof Array){for(var s=0,u=t.headers.length;s<u;s++){var p=t.headers[s];if(p[0]===r){p[1]=n;break}}s===u&&t.headers.push([r,n])}else Object.assign(t.headers,(i={},i[r]=n,i))},"setRequestHeader");Oe.setRequestHeader=uy;var cy=a(function(e,t,r,n){var o,i;typeof Request<"u"&&e instanceof Request?e.headers.append(r,n):typeof t<"u"&&(t.headers===void 0?t.headers=new Headers((o={},o[r]=n,o)):typeof Headers<"u"&&t.headers instanceof Headers?t.headers.append(r,n):t.headers instanceof Array?t.headers.push([r,n]):t.headers===void 0?t.headers=(i={},i[r]=n,i):t.headers[r]===void 0?t.headers[r]=n:t.headers[r]+=", ".concat(n))},"appendRequestHeader");Oe.appendRequestHeader=cy;var ly=a(function(e,t){return ip.__awaiter(void 0,void 0,void 0,function(){var r,n,o,i,s,u,p,d,m,y,v,l,f;return ip.__generator(this,function(_){switch(_.label){case 0:return t.headers.get("Content-Type")?[4,t.blob()]:[3,2];case 1:return n=_.sent(),[3,4];case 2:return[4,Promise.resolve(void 0)];case 3:n=_.sent(),_.label=4;case 4:return r=n,o=t.method,i=t.headers,s=t.referrer,u=t.referrerPolicy,p=t.mode,d=t.credentials,m=t.cache,y=t.redirect,v=t.integrity,l=t.keepalive,f=t.signal,[2,new Request(e,{method:o,headers:i,body:r,referrer:s,referrerPolicy:u,mode:p,credentials:d,cache:m,redirect:y,integrity:v,keepalive:l,signal:f})]}})})},"cloneRequestWithNewUrl");Oe.cloneRequestWithNewUrl=ly});var bi=b(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.AuthenticationHandlerOptions=void 0;var py=(function(){function e(t,r){this.authenticationProvider=t,this.authenticationProviderOptions=r}return a(e,"AuthenticationHandlerOptions"),e})();hn.AuthenticationHandlerOptions=py});var Ut=b(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.TelemetryHandlerOptions=Mt.FeatureUsageFlag=void 0;var ap=at(),Ei;(function(e){e[e.NONE=0]="NONE",e[e.REDIRECT_HANDLER_ENABLED=1]="REDIRECT_HANDLER_ENABLED",e[e.RETRY_HANDLER_ENABLED=2]="RETRY_HANDLER_ENABLED",e[e.AUTHENTICATION_HANDLER_ENABLED=4]="AUTHENTICATION_HANDLER_ENABLED"})(Ei||(Mt.FeatureUsageFlag=Ei={}));var dy=(function(){function e(){this.featureUsage=Ei.NONE}return a(e,"TelemetryHandlerOptions"),e.updateFeatureUsageFlag=function(t,r){var n;t.middlewareControl instanceof ap.MiddlewareControl?n=t.middlewareControl.getMiddlewareOptions(e):t.middlewareControl=new ap.MiddlewareControl,typeof n>"u"&&(n=new e,t.middlewareControl.setMiddlewareOptions(e,n)),n.setFeatureUsage(r)},e.prototype.setFeatureUsage=function(t){this.featureUsage=this.featureUsage|t},e.prototype.getFeatureUsage=function(){return this.featureUsage.toString(16)},e})();Mt.TelemetryHandlerOptions=dy});var vn=b(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.AuthenticationHandler=void 0;var sp=(ue(),ie(se)),up=fn(),my=at(),fy=Nt(),gy=bi(),cp=Ut(),hy=(function(){function e(t){this.authenticationProvider=t}return a(e,"AuthenticationHandler"),e.prototype.execute=function(t){return sp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u;return sp.__generator(this,function(p){switch(p.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,up.isGraphURL)(r)||t.customHosts&&(0,up.isCustomHost)(r,t.customHosts)?(n=void 0,t.middlewareControl instanceof my.MiddlewareControl&&(n=t.middlewareControl.getMiddlewareOptions(gy.AuthenticationHandlerOptions)),o=void 0,i=void 0,n&&(o=n.authenticationProvider,i=n.authenticationProviderOptions),o||(o=this.authenticationProvider),[4,o.getAccessToken(i)]):[3,2];case 1:return s=p.sent(),u="Bearer ".concat(s),(0,fy.appendRequestHeader)(t.request,t.options,e.AUTHORIZATION_HEADER,u),cp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,cp.FeatureUsageFlag.AUTHENTICATION_HANDLER_ENABLED),[3,3];case 2:t.options.headers&&delete t.options.headers[e.AUTHORIZATION_HEADER],p.label=3;case 3:return[4,this.nextMiddleware.execute(t)];case 4:return[2,p.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.AUTHORIZATION_HEADER="Authorization",e})();yn.AuthenticationHandler=hy});var Pn=b(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.HTTPMessageHandler=void 0;var lp=(ue(),ie(se)),yy=(function(){function e(){}return a(e,"HTTPMessageHandler"),e.prototype.execute=function(t){return lp.__awaiter(this,void 0,void 0,function(){var r;return lp.__generator(this,function(n){switch(n.label){case 0:return r=t,[4,fetch(t.request,t.options)];case 1:return r.response=n.sent(),[2]}})})},e})();_n.HTTPMessageHandler=yy});var _r=b(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.RetryHandlerOptions=void 0;var vy=(function(){function e(t,r,n){if(t===void 0&&(t=e.DEFAULT_DELAY),r===void 0&&(r=e.DEFAULT_MAX_RETRIES),n===void 0&&(n=e.defaultShouldRetry),t>e.MAX_DELAY&&r>e.MAX_MAX_RETRIES){var o=new Error("Delay and MaxRetries should not be more than ".concat(e.MAX_DELAY," and ").concat(e.MAX_MAX_RETRIES));throw o.name="MaxLimitExceeded",o}else if(t>e.MAX_DELAY){var o=new Error("Delay should not be more than ".concat(e.MAX_DELAY));throw o.name="MaxLimitExceeded",o}else if(r>e.MAX_MAX_RETRIES){var o=new Error("MaxRetries should not be more than ".concat(e.MAX_MAX_RETRIES));throw o.name="MaxLimitExceeded",o}else if(t<0&&r<0){var o=new Error("Delay and MaxRetries should not be negative");throw o.name="MinExpectationNotMet",o}else if(t<0){var o=new Error("Delay should not be negative");throw o.name="MinExpectationNotMet",o}else if(r<0){var o=new Error("MaxRetries should not be negative");throw o.name="MinExpectationNotMet",o}this.delay=Math.min(t,e.MAX_DELAY),this.maxRetries=Math.min(r,e.MAX_MAX_RETRIES),this.shouldRetry=n}return a(e,"RetryHandlerOptions"),e.prototype.getMaxDelay=function(){return e.MAX_DELAY},e.DEFAULT_DELAY=3,e.DEFAULT_MAX_RETRIES=3,e.MAX_DELAY=180,e.MAX_MAX_RETRIES=10,e.defaultShouldRetry=function(){return!0},e})();xn.RetryHandlerOptions=vy});var En=b(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.RetryHandler=void 0;var Lt=(ue(),ie(se)),Ti=vr(),_y=at(),pp=Nt(),dp=_r(),mp=Ut(),Py=(function(){function e(t){t===void 0&&(t=new dp.RetryHandlerOptions),this.options=t}return a(e,"RetryHandler"),e.prototype.isRetry=function(t){return e.RETRY_STATUS_CODES.indexOf(t.status)!==-1},e.prototype.isBuffered=function(t,r){var n=typeof t=="string"?r.method:t.method,o=n===Ti.RequestMethod.PUT||n===Ti.RequestMethod.PATCH||n===Ti.RequestMethod.POST;if(o){var i=(0,pp.getRequestHeader)(t,r,"Content-Type")==="application/octet-stream";if(i)return!1}return!0},e.prototype.getDelay=function(t,r,n){var o=a(function(){return Number(Math.random().toFixed(3))},"getRandomness"),i=t.headers!==void 0?t.headers.get(e.RETRY_AFTER_HEADER):null,s;return i!==null?Number.isNaN(Number(i))?s=Math.round((new Date(i).getTime()-Date.now())/1e3):s=Number(i):s=r>=2?this.getExponentialBackOffTime(r)+n+o():n+o(),Math.min(s,this.options.getMaxDelay()+o())},e.prototype.getExponentialBackOffTime=function(t){return Math.round(1/2*(Math.pow(2,t)-1))},e.prototype.sleep=function(t){return Lt.__awaiter(this,void 0,void 0,function(){var r;return Lt.__generator(this,function(n){return r=t*1e3,[2,new Promise(function(o){return setTimeout(o,r)})]})})},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof _y.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof r>"u"&&(r=Object.assign(new dp.RetryHandlerOptions,this.options)),r},e.prototype.executeWithRetry=function(t,r,n){return Lt.__awaiter(this,void 0,void 0,function(){var o;return Lt.__generator(this,function(i){switch(i.label){case 0:return[4,this.nextMiddleware.execute(t)];case 1:return i.sent(),r<n.maxRetries&&this.isRetry(t.response)&&this.isBuffered(t.request,t.options)&&n.shouldRetry(n.delay,r,t.request,t.options,t.response)?(++r,(0,pp.setRequestHeader)(t.request,t.options,e.RETRY_ATTEMPT_HEADER,r.toString()),o=this.getDelay(t.response,r,n.delay),[4,this.sleep(o)]):[3,4];case 2:return i.sent(),[4,this.executeWithRetry(t,r,n)];case 3:return[2,i.sent()];case 4:return[2]}})})},e.prototype.execute=function(t){return Lt.__awaiter(this,void 0,void 0,function(){var r,n;return Lt.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),mp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,mp.FeatureUsageFlag.RETRY_HANDLER_ENABLED),[4,this.executeWithRetry(t,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.RETRY_STATUS_CODES=[429,503,504],e.RETRY_ATTEMPT_HEADER="Retry-Attempt",e.RETRY_AFTER_HEADER="Retry-After",e})();bn.RetryHandler=Py});var Pr=b(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.RedirectHandlerOptions=void 0;var xy=(function(){function e(t,r){if(t===void 0&&(t=e.DEFAULT_MAX_REDIRECTS),r===void 0&&(r=e.defaultShouldRedirect),t>e.MAX_MAX_REDIRECTS){var n=new Error("MaxRedirects should not be more than ".concat(e.MAX_MAX_REDIRECTS));throw n.name="MaxLimitExceeded",n}if(t<0){var n=new Error("MaxRedirects should not be negative");throw n.name="MinExpectationNotMet",n}this.maxRedirects=t,this.shouldRedirect=r}return a(e,"RedirectHandlerOptions"),e.DEFAULT_MAX_REDIRECTS=5,e.MAX_MAX_REDIRECTS=20,e.defaultShouldRedirect=function(){return!0},e})();Tn.RedirectHandlerOptions=xy});var An=b(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.RedirectHandler=void 0;var jt=(ue(),ie(se)),by=vr(),Ey=at(),Ty=Nt(),Ii=Pr(),fp=Ut(),Iy=(function(){function e(t){t===void 0&&(t=new Ii.RedirectHandlerOptions),this.options=t}return a(e,"RedirectHandler"),e.prototype.isRedirect=function(t){return e.REDIRECT_STATUS_CODES.indexOf(t.status)!==-1},e.prototype.hasLocationHeader=function(t){return t.headers.has(e.LOCATION_HEADER)},e.prototype.getLocationHeader=function(t){return t.headers.get(e.LOCATION_HEADER)},e.prototype.isRelativeURL=function(t){return t.indexOf("://")===-1},e.prototype.shouldDropAuthorizationHeader=function(t,r){var n=/^[A-Za-z].+?:\/\/.+?(?=\/|$)/,o=n.exec(t),i,s;o!==null&&(i=o[0]);var u=n.exec(r);return u!==null&&(s=u[0]),typeof i<"u"&&typeof s<"u"&&i!==s},e.prototype.updateRequestUrl=function(t,r){return jt.__awaiter(this,void 0,void 0,function(){var n,o;return jt.__generator(this,function(i){switch(i.label){case 0:return n=r,typeof r.request!="string"?[3,1]:(o=t,[3,3]);case 1:return[4,(0,Ty.cloneRequestWithNewUrl)(t,r.request)];case 2:o=i.sent(),i.label=3;case 3:return n.request=o,[2]}})})},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof Ey.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Ii.RedirectHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Ii.RedirectHandlerOptions,this.options)),r},e.prototype.executeWithRedirect=function(t,r,n){return jt.__awaiter(this,void 0,void 0,function(){var o,i;return jt.__generator(this,function(s){switch(s.label){case 0:return[4,this.nextMiddleware.execute(t)];case 1:return s.sent(),o=t.response,r<n.maxRedirects&&this.isRedirect(o)&&this.hasLocationHeader(o)&&n.shouldRedirect(o)?(++r,o.status!==e.STATUS_CODE_SEE_OTHER?[3,2]:(t.options.method=by.RequestMethod.GET,delete t.options.body,[3,4])):[3,6];case 2:return i=this.getLocationHeader(o),!this.isRelativeURL(i)&&this.shouldDropAuthorizationHeader(o.url,i)&&delete t.options.headers[e.AUTHORIZATION_HEADER],[4,this.updateRequestUrl(i,t)];case 3:s.sent(),s.label=4;case 4:return[4,this.executeWithRedirect(t,r,n)];case 5:return s.sent(),[3,7];case 6:return[2];case 7:return[2]}})})},e.prototype.execute=function(t){return jt.__awaiter(this,void 0,void 0,function(){var r,n;return jt.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),t.options.redirect=e.MANUAL_REDIRECT,fp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,fp.FeatureUsageFlag.REDIRECT_HANDLER_ENABLED),[4,this.executeWithRedirect(t,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.REDIRECT_STATUS_CODES=[301,302,303,307,308],e.STATUS_CODE_SEE_OTHER=303,e.LOCATION_HEADER="Location",e.AUTHORIZATION_HEADER="Authorization",e.MANUAL_REDIRECT="manual",e})();In.RedirectHandler=Iy});var gp=b(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.PACKAGE_VERSION=void 0;Sn.PACKAGE_VERSION="3.0.7"});var On=b(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.TelemetryHandler=void 0;var hp=(ue(),ie(se)),yp=fn(),Ay=gp(),Sy=at(),$n=Nt(),$y=Ut(),wy=(function(){function e(){}return a(e,"TelemetryHandler"),e.prototype.execute=function(t){return hp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s;return hp.__generator(this,function(u){switch(u.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,yp.isGraphURL)(r)||t.customHosts&&(0,yp.isCustomHost)(r,t.customHosts)?(n=(0,$n.getRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER),n||(n=(0,$n.generateUUID)(),(0,$n.setRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER,n)),o="".concat(e.PRODUCT_NAME,"/").concat(Ay.PACKAGE_VERSION),i=void 0,t.middlewareControl instanceof Sy.MiddlewareControl&&(i=t.middlewareControl.getMiddlewareOptions($y.TelemetryHandlerOptions)),i&&(s=i.getFeatureUsage(),o+=" (".concat(e.FEATURE_USAGE_STRING,"=").concat(s,")")),(0,$n.appendRequestHeader)(t.request,t.options,e.SDK_VERSION_HEADER,o)):(delete t.options.headers[e.CLIENT_REQUEST_ID_HEADER],delete t.options.headers[e.SDK_VERSION_HEADER]),[4,this.nextMiddleware.execute(t)];case 1:return[2,u.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.CLIENT_REQUEST_ID_HEADER="client-request-id",e.SDK_VERSION_HEADER="SdkVersion",e.PRODUCT_NAME="graph-js",e.FEATURE_USAGE_STRING="featureUsage",e})();wn.TelemetryHandler=wy});var vp=b(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.MiddlewareFactory=void 0;var Oy=vn(),Ry=Pn(),zy=Pr(),ky=_r(),Cy=An(),Dy=En(),Ny=On(),My=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),Uy=(function(){function e(){}return a(e,"MiddlewareFactory"),e.getDefaultMiddlewareChain=function(t){var r=[],n=new Oy.AuthenticationHandler(t),o=new Dy.RetryHandler(new ky.RetryHandlerOptions),i=new Ny.TelemetryHandler,s=new Ry.HTTPMessageHandler;if(r.push(n),r.push(o),My()){var u=new Cy.RedirectHandler(new zy.RedirectHandlerOptions);r.push(u)}return r.push(i),r.push(s),r},e})();Rn.MiddlewareFactory=Uy});var kn=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.ChaosStrategy=void 0;var _p;(function(e){e[e.MANUAL=0]="MANUAL",e[e.RANDOM=1]="RANDOM"})(_p||(zn.ChaosStrategy=_p={}))});var Ai=b(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.ChaosHandlerOptions=void 0;var Ly=kn(),jy=(function(){function e(t,r,n,o,i,s){if(t===void 0&&(t=Ly.ChaosStrategy.RANDOM),r===void 0&&(r="Some error Happened"),this.chaosStrategy=t,this.statusCode=n,this.statusMessage=r,this.chaosPercentage=o!==void 0?o:10,this.responseBody=i,this.headers=s,this.chaosPercentage>100)throw new Error("Error Pecentage can not be more than 100")}return a(e,"ChaosHandlerOptions"),e})();Cn.ChaosHandlerOptions=jy});var Pp=b(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.httpStatusCode=Ft.methodStatusCode=void 0;Ft.methodStatusCode={GET:[429,500,502,503,504],POST:[429,500,502,503,504,507],PUT:[429,500,502,503,504,507],PATCH:[429,500,502,503,504],DELETE:[429,500,502,503,504,507]};Ft.httpStatusCode={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"}});var Ep=b(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ChaosHandler=void 0;var Dn=(ue(),ie(se)),Fy=at(),By=Nt(),xp=Pp(),Si=Ai(),bp=kn(),Vy=(function(){function e(t,r){t===void 0&&(t=new Si.ChaosHandlerOptions),this.options=t,this.manualMap=r}return a(e,"ChaosHandler"),e.prototype.createResponseHeaders=function(t,r,n){var o=t.headers?new Headers(t.headers):new Headers;return o.append("Cache-Control","no-store"),o.append("request-id",r),o.append("client-request-id",r),o.append("x-ms-ags-diagnostic",""),o.append("Date",n),o.append("Strict-Transport-Security",""),t.statusCode===429&&o.append("retry-after","3"),o},e.prototype.createResponseBody=function(t,r,n){if(t.responseBody)return t.responseBody;var o;if(t.statusCode>=400){var i=xp.httpStatusCode[t.statusCode],s=t.statusMessage;o={error:{code:i,message:s,innerError:{"request-id":r,date:n}}}}else o={};return o},e.prototype.createResponse=function(t,r){var n=r.request,o=(0,By.generateUUID)(),i=new Date,s=this.createResponseHeaders(t,o,i.toString()),u=this.createResponseBody(t,o,i.toString()),p={url:n,status:t.statusCode,statusText:t.statusMessage,headers:s};r.response=new Response(typeof u=="string"?u:JSON.stringify(u),p)},e.prototype.sendRequest=function(t,r){return Dn.__awaiter(this,void 0,void 0,function(){return Dn.__generator(this,function(n){switch(n.label){case 0:return this.setStatusCode(t,r.request,r.options.method),t.chaosStrategy===bp.ChaosStrategy.MANUAL&&!this.nextMiddleware||Math.floor(Math.random()*100)<t.chaosPercentage?(this.createResponse(t,r),[3,3]):[3,1];case 1:return this.nextMiddleware?[4,this.nextMiddleware.execute(r)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.getRandomStatusCode=function(t){var r=xp.methodStatusCode[t];return r[Math.floor(Math.random()*r.length)]},e.prototype.getRelativeURL=function(t){var r=/https?:\/\/graph\.microsoft\.com\/[^/]+(.+?)(\?|$)/,n;return r.exec(t)!==null&&(n=r.exec(t)[1]),n},e.prototype.setStatusCode=function(t,r,n){var o=this;if(t.chaosStrategy===bp.ChaosStrategy.MANUAL){if(t.statusCode===void 0){var i=this.getRelativeURL(r);this.manualMap.get(i)!==void 0?this.manualMap.get(i).get(n)!==void 0&&(t.statusCode=this.manualMap.get(i).get(n)):this.manualMap.forEach(function(s,u){var p=new RegExp(u+"$");p.test(i)&&o.manualMap.get(u).get(n)!==void 0&&(t.statusCode=o.manualMap.get(u).get(n))})}}else t.statusCode=this.getRandomStatusCode(n)},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof Fy.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Si.ChaosHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Si.ChaosHandlerOptions,this.options)),r},e.prototype.execute=function(t){return Dn.__awaiter(this,void 0,void 0,function(){var r;return Dn.__generator(this,function(n){switch(n.label){case 0:return r=this.getOptions(t),[4,this.sendRequest(r,t)];case 1:return[2,n.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e})();Nn.ChaosHandler=Vy});var xr=b(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.ResponseType=void 0;var Tp;(function(e){e.ARRAYBUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.RAW="raw",e.STREAM="stream",e.TEXT="text"})(Tp||(Mn.ResponseType=Tp={}))});var wi=b(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.GraphResponseHandler=Bt.DocumentType=void 0;var Un=(ue(),ie(se)),ht=xr(),$i;(function(e){e.TEXT_HTML="text/html",e.TEXT_XML="text/xml",e.APPLICATION_XML="application/xml",e.APPLICATION_XHTML="application/xhtml+xml"})($i||(Bt.DocumentType=$i={}));var Ln;(function(e){e.TEXT_PLAIN="text/plain",e.APPLICATION_JSON="application/json"})(Ln||(Ln={}));var jn;(function(e){e.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",e.IMAGE="^image\\/.+"})(jn||(jn={}));var Hy=(function(){function e(){}return a(e,"GraphResponseHandler"),e.parseDocumentResponse=function(t,r){return typeof DOMParser<"u"?new Promise(function(n,o){t.text().then(function(i){try{var s=new DOMParser,u=s.parseFromString(i,r);n(u)}catch(p){o(p)}})}):Promise.resolve(t.body)},e.convertResponse=function(t,r){return Un.__awaiter(this,void 0,void 0,function(){var n,o,i,s;return Un.__generator(this,function(u){switch(u.label){case 0:if(t.status===204)return[2,Promise.resolve()];switch(o=t.headers.get("Content-type"),i=r,i){case ht.ResponseType.ARRAYBUFFER:return[3,1];case ht.ResponseType.BLOB:return[3,3];case ht.ResponseType.DOCUMENT:return[3,5];case ht.ResponseType.JSON:return[3,7];case ht.ResponseType.STREAM:return[3,9];case ht.ResponseType.TEXT:return[3,11]}return[3,13];case 1:return[4,t.arrayBuffer()];case 2:return n=u.sent(),[3,24];case 3:return[4,t.blob()];case 4:return n=u.sent(),[3,24];case 5:return[4,e.parseDocumentResponse(t,$i.TEXT_XML)];case 6:return n=u.sent(),[3,24];case 7:return[4,t.json()];case 8:return n=u.sent(),[3,24];case 9:return[4,Promise.resolve(t.body)];case 10:return n=u.sent(),[3,24];case 11:return[4,t.text()];case 12:return n=u.sent(),[3,24];case 13:return o===null?[3,22]:(s=o.split(";")[0],new RegExp(jn.DOCUMENT).test(s)?[4,e.parseDocumentResponse(t,s)]:[3,15]);case 14:return n=u.sent(),[3,21];case 15:return new RegExp(jn.IMAGE).test(s)?(n=t.blob(),[3,21]):[3,16];case 16:return s!==Ln.TEXT_PLAIN?[3,18]:[4,t.text()];case 17:return n=u.sent(),[3,21];case 18:return s!==Ln.APPLICATION_JSON?[3,20]:[4,t.json()];case 19:return n=u.sent(),[3,21];case 20:n=Promise.resolve(t.body),u.label=21;case 21:return[3,23];case 22:n=Promise.resolve(t.body),u.label=23;case 23:return[3,24];case 24:return[2,n]}})})},e.getResponse=function(t,r,n){return Un.__awaiter(this,void 0,void 0,function(){var o;return Un.__generator(this,function(i){switch(i.label){case 0:return r!==ht.ResponseType.RAW?[3,1]:[2,Promise.resolve(t)];case 1:return[4,e.convertResponse(t,r)];case 2:if(o=i.sent(),t.ok)if(typeof n=="function")n(null,o);else return[2,o];else throw o;i.label=3;case 3:return[2]}})})},e})();Bt.GraphResponseHandler=Hy});var Oi=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Range=void 0;var Zy=(function(){function e(t,r){t===void 0&&(t=-1),r===void 0&&(r=-1),this.minValue=t,this.maxValue=r}return a(e,"Range"),e})();Fn.Range=Zy});var Ri=b(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.UploadResult=void 0;var qy=(function(){function e(t,r){this._location=r,this._responseBody=t}return a(e,"UploadResult"),Object.defineProperty(e.prototype,"location",{get:a(function(){return this._location},"get"),set:a(function(t){this._location=t},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseBody",{get:a(function(){return this._responseBody},"get"),set:a(function(t){this._responseBody=t},"set"),enumerable:!1,configurable:!0}),e.CreateUploadResult=function(t,r){return new e(t,r.get("location"))},e})();Bn.UploadResult=qy});var ki=b(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.LargeFileUploadTask=void 0;var Te=(ue(),ie(se)),zi=Ge(),Gy=wi(),Ip=xr(),Vn=Oi(),Wy=Ri(),Ky=(function(){function e(t,r,n,o){if(o===void 0&&(o={}),this.DEFAULT_FILE_SIZE=5*1024*1024,this.client=t,r.sliceFile)this.file=r;else throw new zi.GraphClientError("Please pass the FileUpload object, StreamUpload object or any custom implementation of the FileObject interface");this.file=r,o.rangeSize||(o.rangeSize=this.DEFAULT_FILE_SIZE),this.options=o,this.uploadSession=n,this.nextRange=new Vn.Range(0,this.options.rangeSize-1)}return a(e,"LargeFileUploadTask"),e.createUploadSession=function(t,r,n,o){return o===void 0&&(o={}),Te.__awaiter(this,void 0,void 0,function(){var i,s;return Te.__generator(this,function(u){switch(u.label){case 0:return[4,t.api(r).headers(o).post(n)];case 1:return i=u.sent(),s={url:i.uploadUrl,expiry:new Date(i.expirationDateTime),isCancelled:!1},[2,s]}})})},e.prototype.parseRange=function(t){var r=t[0];if(typeof r>"u"||r==="")return new Vn.Range;var n=r.split("-"),o=parseInt(n[0],10),i=parseInt(n[1],10);return Number.isNaN(i)&&(i=this.file.size-1),new Vn.Range(o,i)},e.prototype.updateTaskStatus=function(t){this.uploadSession.expiry=new Date(t.expirationDateTime),this.nextRange=this.parseRange(t.nextExpectedRanges)},e.prototype.getNextRange=function(){if(this.nextRange.minValue===-1)return this.nextRange;var t=this.nextRange.minValue,r=t+this.options.rangeSize-1;return r>=this.file.size&&(r=this.file.size-1),new Vn.Range(t,r)},e.prototype.sliceFile=function(t){if(console.warn("The LargeFileUploadTask.sliceFile() function has been deprecated and moved into the FileObject interface."),this.file.content instanceof ArrayBuffer||this.file.content instanceof Blob||this.file.content instanceof Uint8Array)return this.file.content.slice(t.minValue,t.maxValue+1);throw new zi.GraphClientError("The LargeFileUploadTask.sliceFile() function expects only Blob, ArrayBuffer or Uint8Array file content. Please note that the sliceFile() function is deprecated.")},e.prototype.upload=function(){return Te.__awaiter(this,void 0,void 0,function(){var t,r,n,o,i,s,u;return Te.__generator(this,function(p){switch(p.label){case 0:t=this.options&&this.options.uploadEventHandlers,p.label=1;case 1:if(this.uploadSession.isCancelled)return[3,5];if(r=this.getNextRange(),r.maxValue===-1)throw n=new Error("Task with which you are trying to upload is already completed, Please check for your uploaded file"),n.name="Invalid Session",n;return[4,this.file.sliceFile(r)];case 2:return o=p.sent(),[4,this.uploadSliceGetRawResponse(o,r,this.file.size)];case 3:if(i=p.sent(),!i)throw new zi.GraphClientError("Something went wrong! Large file upload slice response is null.");return[4,Gy.GraphResponseHandler.getResponse(i)];case 4:return s=p.sent(),i.status===201||i.status===200&&s.id?(this.reportProgress(t,r),[2,Wy.UploadResult.CreateUploadResult(s,i.headers)]):(u={expirationDateTime:s.expirationDateTime||s.ExpirationDateTime,nextExpectedRanges:s.NextExpectedRanges||s.nextExpectedRanges},this.updateTaskStatus(u),this.reportProgress(t,r),[3,1]);case 5:return[2]}})})},e.prototype.reportProgress=function(t,r){t&&t.progress&&t.progress(r,t.extraCallbackParam)},e.prototype.uploadSlice=function(t,r,n){return Te.__awaiter(this,void 0,void 0,function(){return Te.__generator(this,function(o){switch(o.label){case 0:return[4,this.client.api(this.uploadSession.url).headers({"Content-Length":"".concat(r.maxValue-r.minValue+1),"Content-Range":"bytes ".concat(r.minValue,"-").concat(r.maxValue,"/").concat(n),"Content-Type":"application/octet-stream"}).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.uploadSliceGetRawResponse=function(t,r,n){return Te.__awaiter(this,void 0,void 0,function(){return Te.__generator(this,function(o){switch(o.label){case 0:return[4,this.client.api(this.uploadSession.url).headers({"Content-Length":"".concat(r.maxValue-r.minValue+1),"Content-Range":"bytes ".concat(r.minValue,"-").concat(r.maxValue,"/").concat(n),"Content-Type":"application/octet-stream"}).responseType(Ip.ResponseType.RAW).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.cancel=function(){return Te.__awaiter(this,void 0,void 0,function(){var t;return Te.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).responseType(Ip.ResponseType.RAW).delete()];case 1:return t=r.sent(),t.status===204&&(this.uploadSession.isCancelled=!0),[2,t]}})})},e.prototype.getStatus=function(){return Te.__awaiter(this,void 0,void 0,function(){var t;return Te.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).get()];case 1:return t=r.sent(),this.updateTaskStatus(t),[2,t]}})})},e.prototype.resume=function(){return Te.__awaiter(this,void 0,void 0,function(){return Te.__generator(this,function(t){switch(t.label){case 0:return[4,this.getStatus()];case 1:return t.sent(),[4,this.upload()];case 2:return[2,t.sent()]}})})},e.prototype.getUploadSession=function(){return this.uploadSession},e})();Hn.LargeFileUploadTask=Ky});var Ci=b(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.FileUpload=void 0;var Jy=Ge(),Xy=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new Jy.GraphClientError("Please provide the upload content, name of the file and size of the file")}return a(e,"FileUpload"),e.prototype.sliceFile=function(t){return this.content.slice(t.minValue,t.maxValue+1)},e})();Zn.FileUpload=Xy});var Di=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.getValidRangeSize=void 0;var Yy=5*1024*1024,Qy=a(function(e){return e>320*1024&&(e=Math.floor(e/(320*1024))*320*1024),e},"roundTo320KB"),ev=a(function(e){e===void 0&&(e=Yy);var t=60*1024*1024;return e>t&&(e=t),Qy(e)},"getValidRangeSize");qn.getValidRangeSize=ev});var Sp=b(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.OneDriveLargeFileUploadTask=void 0;var We=(ue(),ie(se)),Ap=Ge(),tv=Ci(),rv=ki(),nv=Di(),ov=(function(e){We.__extends(t,e);function t(r,n,o,i){return e.call(this,r,n,o,i)||this}return a(t,"OneDriveLargeFileUploadTask"),t.constructCreateSessionUrl=function(r,n){return n===void 0&&(n=t.DEFAULT_UPLOAD_PATH),r=r.trim(),n=n.trim(),n===""&&(n="/"),n[0]!=="/"&&(n="/".concat(n)),n[n.length-1]!=="/"&&(n="".concat(n,"/")),"/me/drive/root:".concat(n.split("/").map(function(o){return encodeURIComponent(o)}).join("/")).concat(encodeURIComponent(r),":/createUploadSession")},t.getFileInfo=function(r,n){var o,i;if(typeof Blob<"u"&&r instanceof Blob)o=new File([r],n),i=o.size;else if(typeof File<"u"&&r instanceof File)o=r,i=o.size;else if(typeof Uint8Array<"u"&&r instanceof Uint8Array){var s=r;i=s.byteLength,o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}return{content:o,size:i}},t.create=function(r,n,o){return We.__awaiter(this,void 0,void 0,function(){var i,s,u;return We.__generator(this,function(p){if(!r||!n||!o)throw new Ap.GraphClientError("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");return i=o.fileName,s=t.getFileInfo(n,i),u=new tv.FileUpload(s.content,i,s.size),[2,this.createTaskWithFileObject(r,u,o)]})})},t.createTaskWithFileObject=function(r,n,o){return We.__awaiter(this,void 0,void 0,function(){var i,s,u,p;return We.__generator(this,function(d){switch(d.label){case 0:if(!r||!n||!o)throw new Ap.GraphClientError("Please provide the Graph client instance, FileObject interface implementation and OneDriveLargeFileUploadOptions value");return i=o.uploadSessionURL?o.uploadSessionURL:t.constructCreateSessionUrl(o.fileName,o.path),s={fileName:o.fileName,fileDescription:o.fileDescription,conflictBehavior:o.conflictBehavior},[4,t.createUploadSession(r,i,s)];case 1:return u=d.sent(),p=(0,nv.getValidRangeSize)(o.rangeSize),[2,new t(r,n,u,{rangeSize:p,uploadEventHandlers:o.uploadEventHandlers})]}})})},t.createUploadSession=function(r,n,o){return We.__awaiter(this,void 0,void 0,function(){var i;return We.__generator(this,function(s){return i={item:{"@microsoft.graph.conflictBehavior":o?.conflictBehavior||"rename",name:o?.fileName,description:o?.fileDescription}},[2,e.createUploadSession.call(this,r,n,i)]})})},t.prototype.commit=function(r,n){return n===void 0&&(n="rename"),We.__awaiter(this,void 0,void 0,function(){var o;return We.__generator(this,function(i){switch(i.label){case 0:return o={name:this.file.name,"@microsoft.graph.conflictBehavior":n,"@microsoft.graph.sourceUrl":this.uploadSession.url},[4,this.client.api(r).put(o)];case 1:return[2,i.sent()]}})})},t.DEFAULT_UPLOAD_PATH="/",t})(rv.LargeFileUploadTask);Gn.OneDriveLargeFileUploadTask=ov});var wp=b(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.StreamUpload=void 0;var $p=(ue(),ie(se)),br=Ge(),iv=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new br.GraphClientError("Please provide the Readable Stream content, name of the file and size of the file")}return a(e,"StreamUpload"),e.prototype.sliceFile=function(t){return $p.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,p;return $p.__generator(this,function(d){switch(d.label){case 0:if(r=t.maxValue-t.minValue+1,n=[],this.previousSlice){if(t.minValue<this.previousSlice.range.minValue)throw new br.GraphClientError("An error occurred while uploading the stream. Please restart the stream upload from the first byte of the file.");if(t.minValue<this.previousSlice.range.maxValue){if(o=this.previousSlice.range.minValue,i=this.previousSlice.range.maxValue,t.minValue===o&&t.maxValue===i)return[2,this.previousSlice.fileSlice];if(t.maxValue===i)return[2,this.previousSlice.fileSlice.slice(t.minValue,t.maxValue+1)];n.push(this.previousSlice.fileSlice.slice(t.minValue,i+1)),r=t.maxValue-i}}return this.content&&this.content.readable?this.content.readableLength>=r?(n.push(this.content.read(r)),[3,3]):[3,1]:[3,4];case 1:return u=(s=n).push,[4,this.readNBytesFromStream(r)];case 2:u.apply(s,[d.sent()]),d.label=3;case 3:return[3,5];case 4:throw new br.GraphClientError("Stream is not readable.");case 5:return p=Buffer.concat(n),this.previousSlice={fileSlice:p,range:t},[2,p]}})})},e.prototype.readNBytesFromStream=function(t){var r=this;return new Promise(function(n,o){var i=[],s=t,u=0;r.content.on("end",function(){if(s>0)return o(new br.GraphClientError("Stream ended before reading required range size"))}),r.content.on("readable",function(){for(var p;u<t&&(p=r.content.read(s))!==null;)u+=p.length,i.push(p),s>0&&(s=t-u);if(u===t)return n(Buffer.concat(i));if(!r.content||!r.content.readable)return o(new br.GraphClientError("Error encountered while reading the stream during the upload"))})})},e})();Wn.StreamUpload=iv});var Op=b(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.PageIterator=void 0;var Vt=(ue(),ie(se)),av=(function(){function e(t,r,n,o){this.client=t,this.collection=r.value,this.nextLink=r["@odata.nextLink"],this.deltaLink=r["@odata.deltaLink"],this.callback=n,this.cursor=0,this.complete=!1,this.requestOptions=o}return a(e,"PageIterator"),e.prototype.iterationHelper=function(){if(this.collection===void 0)return!1;for(var t=!0;t&&this.cursor<this.collection.length;){var r=this.collection[this.cursor];t=this.callback(r),this.cursor++}return t},e.prototype.fetchAndUpdateNextPageData=function(){return Vt.__awaiter(this,void 0,void 0,function(){var t,r;return Vt.__generator(this,function(n){switch(n.label){case 0:return t=this.client.api(this.nextLink),this.requestOptions&&(this.requestOptions.headers&&(t=t.headers(this.requestOptions.headers)),this.requestOptions.middlewareOptions&&(t=t.middlewareOptions(this.requestOptions.middlewareOptions)),this.requestOptions.options&&(t=t.options(this.requestOptions.options))),[4,t.get()];case 1:return r=n.sent(),this.collection=r.value,this.cursor=0,this.nextLink=r["@odata.nextLink"],this.deltaLink=r["@odata.deltaLink"],[2]}})})},e.prototype.getDeltaLink=function(){return this.deltaLink},e.prototype.iterate=function(){return Vt.__awaiter(this,void 0,void 0,function(){var t;return Vt.__generator(this,function(r){switch(r.label){case 0:t=this.iterationHelper(),r.label=1;case 1:return t?this.nextLink===void 0?[3,3]:[4,this.fetchAndUpdateNextPageData()]:[3,5];case 2:return r.sent(),t=this.iterationHelper(),[3,4];case 3:t=!1,r.label=4;case 4:return[3,1];case 5:return this.nextLink===void 0&&this.cursor>=this.collection.length&&(this.complete=!0),[2]}})})},e.prototype.resume=function(){return Vt.__awaiter(this,void 0,void 0,function(){return Vt.__generator(this,function(t){return[2,this.iterate()]})})},e.prototype.isComplete=function(){return this.complete},e})();Kn.PageIterator=av});var Ni=b(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.CustomAuthenticationProvider=void 0;var Jn=(ue(),ie(se)),Rp=Ge(),sv=(function(){function e(t){this.provider=t}return a(e,"CustomAuthenticationProvider"),e.prototype.getAccessToken=function(){return Jn.__awaiter(this,void 0,void 0,function(){var t=this;return Jn.__generator(this,function(r){return[2,new Promise(function(n,o){t.provider(function(i,s){return Jn.__awaiter(t,void 0,void 0,function(){var u,p;return Jn.__generator(this,function(d){switch(d.label){case 0:return s?(n(s),[3,3]):[3,1];case 1:return i||(u="Access token is undefined or empty. Please provide a valid token. For more help - https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/CustomAuthenticationProvider.md",i=new Rp.GraphClientError(u)),[4,Rp.GraphClientError.setGraphClientError(i)];case 2:p=d.sent(),o(p),d.label=3;case 3:return[2]}})})})})]})})},e})();Xn.CustomAuthenticationProvider=sv});var Mi=b(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.GraphError=void 0;var uv=(ue(),ie(se)),cv=(function(e){uv.__extends(t,e);function t(r,n,o){r===void 0&&(r=-1);var i=e.call(this,n||o&&o.message)||this;return Object.setPrototypeOf(i,t.prototype),i.statusCode=r,i.code=null,i.requestId=null,i.date=new Date,i.body=null,i.stack=o?o.stack:i.stack,i}return a(t,"GraphError"),t})(Error);Yn.GraphError=cv});var kp=b(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.GraphErrorHandler=void 0;var zp=(ue(),ie(se)),Ui=Mi(),lv=(function(){function e(){}return a(e,"GraphErrorHandler"),e.constructError=function(t,r,n){var o=new Ui.GraphError(r,"",t);return t.name!==void 0&&(o.code=t.name),o.body=t.toString(),o.date=new Date,o.headers=n?.headers,o},e.constructErrorFromResponse=function(t,r,n){var o=t.error,i=new Ui.GraphError(r,o.message);return i.code=o.code,o.innerError!==void 0&&(i.requestId=o.innerError["request-id"],i.date=new Date(o.innerError.date)),i.body=JSON.stringify(o),i.headers=n?.headers,i},e.getError=function(t,r,n,o){return t===void 0&&(t=null),r===void 0&&(r=-1),zp.__awaiter(this,void 0,void 0,function(){var i;return zp.__generator(this,function(s){if(t&&t.error?i=e.constructErrorFromResponse(t,r,o):t instanceof Error?i=e.constructError(t,r,o):(i=new Ui.GraphError(r),i.body=t),typeof n=="function")n(i,null);else return[2,i];return[2]})})},e})();Qn.GraphErrorHandler=lv});var Li=b(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.GraphRequest=void 0;var re=(ue(),ie(se)),pv=Ge(),dv=kp(),Er=fn(),mv=wi(),fv=at(),yt=vr(),gv=xr(),hv=(function(){function e(t,r,n){var o=this;this.parsePath=function(i){if(i.indexOf("https://")!==-1){i=i.replace("https://","");var s=i.indexOf("/");s!==-1&&(o.urlComponents.host="https://"+i.substring(0,s),i=i.substring(s+1,i.length));var u=i.indexOf("/");u!==-1&&(o.urlComponents.version=i.substring(0,u),i=i.substring(u+1,i.length))}i.charAt(0)==="/"&&(i=i.substr(1));var p=i.indexOf("?");if(p===-1)o.urlComponents.path=i;else{o.urlComponents.path=i.substr(0,p);for(var d=i.substring(p+1,i.length).split("&"),m=0,y=d;m<y.length;m++){var v=y[m];o.parseQueryParameter(v)}}},this.httpClient=t,this.config=r,this.urlComponents={host:this.config.baseUrl,version:this.config.defaultVersion,oDataQueryParams:{},otherURLQueryParams:{},otherURLQueryOptions:[]},this._headers={},this._options={},this._middlewareOptions=[],this.parsePath(n)}return a(e,"GraphRequest"),e.prototype.addCsvQueryParameter=function(t,r,n){this.urlComponents.oDataQueryParams[t]=this.urlComponents.oDataQueryParams[t]?this.urlComponents.oDataQueryParams[t]+",":"";var o=[];n.length>1&&typeof r=="string"?o=Array.prototype.slice.call(n):typeof r=="string"?o.push(r):o=o.concat(r),this.urlComponents.oDataQueryParams[t]+=o.join(",")},e.prototype.buildFullUrl=function(){var t=(0,Er.urlJoin)([this.urlComponents.host,this.urlComponents.version,this.urlComponents.path])+this.createQueryString();return this.config.debugLogging&&console.log(t),t},e.prototype.createQueryString=function(){var t=this.urlComponents,r=[];if(Object.keys(t.oDataQueryParams).length!==0)for(var n in t.oDataQueryParams)Object.prototype.hasOwnProperty.call(t.oDataQueryParams,n)&&r.push(n+"="+t.oDataQueryParams[n]);if(Object.keys(t.otherURLQueryParams).length!==0)for(var n in t.otherURLQueryParams)Object.prototype.hasOwnProperty.call(t.otherURLQueryParams,n)&&r.push(n+"="+t.otherURLQueryParams[n]);if(t.otherURLQueryOptions.length!==0)for(var o=0,i=t.otherURLQueryOptions;o<i.length;o++){var s=i[o];r.push(s)}return r.length>0?"?"+r.join("&"):""},e.prototype.parseQueryParameter=function(t){if(typeof t=="string")if(t.charAt(0)==="?"&&(t=t.substring(1)),t.indexOf("&")!==-1)for(var r=t.split("&"),n=0,o=r;n<o.length;n++){var i=o[n];this.parseQueryParamenterString(i)}else this.parseQueryParamenterString(t);else if(t.constructor===Object)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&this.setURLComponentsQueryParamater(s,t[s]);return this},e.prototype.parseQueryParamenterString=function(t){if(this.isValidQueryKeyValuePair(t)){var r=t.indexOf("="),n=t.substring(0,r),o=t.substring(r+1);this.setURLComponentsQueryParamater(n,o)}else this.urlComponents.otherURLQueryOptions.push(t)},e.prototype.setURLComponentsQueryParamater=function(t,r){if(Er.oDataQueryNames.indexOf(t)!==-1){var n=this.urlComponents.oDataQueryParams[t],o=n&&(t==="$expand"||t==="$select"||t==="$orderby");this.urlComponents.oDataQueryParams[t]=o?n+","+r:r}else this.urlComponents.otherURLQueryParams[t]=r},e.prototype.isValidQueryKeyValuePair=function(t){var r=t.indexOf("=");if(r===-1)return!1;var n=t.indexOf("(");return!(n!==-1&&t.indexOf("(")<r)},e.prototype.updateRequestOptions=function(t){var r=re.__assign({},t.headers);if(this.config.fetchOptions!==void 0){var n=re.__assign({},this.config.fetchOptions);Object.assign(t,n),typeof this.config.fetchOptions.headers!==void 0&&(t.headers=re.__assign({},this.config.fetchOptions.headers))}Object.assign(t,this._options),t.headers!==void 0&&Object.assign(r,t.headers),Object.assign(r,this._headers),t.headers=r},e.prototype.send=function(t,r,n){var o;return re.__awaiter(this,void 0,void 0,function(){var i,s,u,p,d,m,y,v;return re.__generator(this,function(l){switch(l.label){case 0:s=new fv.MiddlewareControl(this._middlewareOptions),this.updateRequestOptions(r),u=(o=this.config)===null||o===void 0?void 0:o.customHosts,l.label=1;case 1:return l.trys.push([1,4,,6]),[4,this.httpClient.sendRequest({request:t,options:r,middlewareControl:s,customHosts:u})];case 2:return p=l.sent(),i=p.response,[4,mv.GraphResponseHandler.getResponse(i,this._responseType,n)];case 3:return d=l.sent(),[2,d];case 4:if(m=l.sent(),m instanceof pv.GraphClientError)throw m;return y=void 0,i&&(y=i.status),[4,dv.GraphErrorHandler.getError(m,y,n,i)];case 5:throw v=l.sent(),v;case 6:return[2]}})})},e.prototype.setHeaderContentType=function(){if(!this._headers){this.header("Content-Type","application/json");return}for(var t=Object.keys(this._headers),r=0,n=t;r<n.length;r++){var o=n[r];if(o.toLowerCase()==="content-type")return}this.header("Content-Type","application/json")},e.prototype.header=function(t,r){return this._headers[t]=r,this},e.prototype.headers=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._headers[r]=t[r]);return this},e.prototype.option=function(t,r){return this._options[t]=r,this},e.prototype.options=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._options[r]=t[r]);return this},e.prototype.middlewareOptions=function(t){return this._middlewareOptions=t,this},e.prototype.version=function(t){return this.urlComponents.version=t,this},e.prototype.responseType=function(t){return this._responseType=t,this},e.prototype.select=function(t){return this.addCsvQueryParameter("$select",t,arguments),this},e.prototype.expand=function(t){return this.addCsvQueryParameter("$expand",t,arguments),this},e.prototype.orderby=function(t){return this.addCsvQueryParameter("$orderby",t,arguments),this},e.prototype.filter=function(t){return this.urlComponents.oDataQueryParams.$filter=t,this},e.prototype.search=function(t){return this.urlComponents.oDataQueryParams.$search=t,this},e.prototype.top=function(t){return this.urlComponents.oDataQueryParams.$top=t,this},e.prototype.skip=function(t){return this.urlComponents.oDataQueryParams.$skip=t,this},e.prototype.skipToken=function(t){return this.urlComponents.oDataQueryParams.$skipToken=t,this},e.prototype.count=function(t){return t===void 0&&(t=!0),this.urlComponents.oDataQueryParams.$count=t.toString(),this},e.prototype.query=function(t){return this.parseQueryParameter(t)},e.prototype.get=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n,o;return re.__generator(this,function(i){switch(i.label){case 0:return r=this.buildFullUrl(),n={method:yt.RequestMethod.GET},[4,this.send(r,n,t)];case 1:return o=i.sent(),[2,o]}})})},e.prototype.post=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o,i;return re.__generator(this,function(s){switch(s.label){case 0:return n=this.buildFullUrl(),o={method:yt.RequestMethod.POST,body:(0,Er.serializeContent)(t)},i=t&&t.constructor&&t.constructor.name,i==="FormData"?o.headers={}:(this.setHeaderContentType(),o.headers=this._headers),[4,this.send(n,o,r)];case 1:return[2,s.sent()]}})})},e.prototype.create=function(t,r){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(n){switch(n.label){case 0:return[4,this.post(t,r)];case 1:return[2,n.sent()]}})})},e.prototype.put=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),this.setHeaderContentType(),o={method:yt.RequestMethod.PUT,body:(0,Er.serializeContent)(t)},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e.prototype.patch=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),this.setHeaderContentType(),o={method:yt.RequestMethod.PATCH,body:(0,Er.serializeContent)(t)},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e.prototype.update=function(t,r){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(n){switch(n.label){case 0:return[4,this.patch(t,r)];case 1:return[2,n.sent()]}})})},e.prototype.delete=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n;return re.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:yt.RequestMethod.DELETE},[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.del=function(t){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(r){switch(r.label){case 0:return[4,this.delete(t)];case 1:return[2,r.sent()]}})})},e.prototype.getStream=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n;return re.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:yt.RequestMethod.GET},this.responseType(gv.ResponseType.STREAM),[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.putStream=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),o={method:yt.RequestMethod.PUT,headers:{"Content-Type":"application/octet-stream"},body:t},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e})();eo.GraphRequest=hv});var ji=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.HTTPClient=void 0;var Cp=(ue(),ie(se)),yv=(function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(!t||!t.length){var n=new Error;throw n.name="InvalidMiddlewareChain",n.message="Please provide a default middleware chain or custom middleware chain",n}this.setMiddleware.apply(this,t)}return a(e,"HTTPClient"),e.prototype.setMiddleware=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.length>1?this.parseMiddleWareArray(t):this.middleware=t[0]},e.prototype.parseMiddleWareArray=function(t){t.forEach(function(r,n){n<t.length-1&&r.setNext(t[n+1])}),this.middleware=t[0]},e.prototype.sendRequest=function(t){return Cp.__awaiter(this,void 0,void 0,function(){var r;return Cp.__generator(this,function(n){switch(n.label){case 0:if(typeof t.request=="string"&&t.options===void 0)throw r=new Error,r.name="InvalidRequestOptions",r.message="Unable to execute the middleware, Please provide valid options for a request",r;return[4,this.middleware.execute(t)];case 1:return n.sent(),[2,t]}})})},e})();to.HTTPClient=yv});var Np=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.HTTPClientFactory=void 0;var vv=(ue(),ie(se)),Dp=ji(),_v=vn(),Pv=Pn(),xv=Pr(),bv=_r(),Ev=An(),Tv=En(),Iv=On(),Av=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),Sv=(function(){function e(){}return a(e,"HTTPClientFactory"),e.createWithAuthenticationProvider=function(t){var r=new _v.AuthenticationHandler(t),n=new Tv.RetryHandler(new bv.RetryHandlerOptions),o=new Iv.TelemetryHandler,i=new Pv.HTTPMessageHandler;if(r.setNext(n),Av()){var s=new Ev.RedirectHandler(new xv.RedirectHandlerOptions);n.setNext(s),s.setNext(o)}else n.setNext(o);return o.setNext(i),e.createWithMiddleware(r)},e.createWithMiddleware=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new(Dp.HTTPClient.bind.apply(Dp.HTTPClient,vv.__spreadArray([void 0],t,!1)))},e})();ro.HTTPClientFactory=Sv});var Mp=b(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.validatePolyFilling=void 0;var $v=a(function(){if(typeof Promise>"u"&&typeof fetch>"u"){var e=new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them.");throw e.name="PolyFillNotAvailable",e}else if(typeof Promise>"u"){var e=new Error("Library cannot function without Promise. So, please provide polyfill for it.");throw e.name="PolyFillNotAvailable",e}else if(typeof fetch>"u"){var e=new Error("Library cannot function without fetch. So, please provide polyfill for it.");throw e.name="PolyFillNotAvailable",e}return!0},"validatePolyFilling");no.validatePolyFilling=$v});var jp=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.Client=void 0;var wv=(ue(),ie(se)),Up=xi(),Ov=Ni(),Rv=Li(),Lp=ji(),zv=Np(),kv=Mp(),Cv=(function(){function e(t){this.config={baseUrl:Up.GRAPH_BASE_URL,debugLogging:!1,defaultVersion:Up.GRAPH_API_VERSION},(0,kv.validatePolyFilling)();for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this.config[r]=t[r]);var n;if(t.authProvider!==void 0&&t.middleware!==void 0){var o=new Error;throw o.name="AmbiguityInInitialization",o.message="Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain not both",o}else if(t.authProvider!==void 0)n=zv.HTTPClientFactory.createWithAuthenticationProvider(t.authProvider);else if(t.middleware!==void 0)n=new(Lp.HTTPClient.bind.apply(Lp.HTTPClient,wv.__spreadArray([void 0],[].concat(t.middleware),!1)));else{var o=new Error;throw o.name="InvalidMiddlewareChain",o.message="Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain",o}this.httpClient=n}return a(e,"Client"),e.init=function(t){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=n==="authProvider"?new Ov.CustomAuthenticationProvider(t[n]):t[n]);return e.initWithMiddleware(r)},e.initWithMiddleware=function(t){return new e(t)},e.prototype.api=function(t){return new Rv.GraphRequest(this.httpClient,this.config,t)},e})();oo.Client=Cv});var Bp=b(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.ResponseType=w.GraphRequest=w.GraphClientError=w.GraphError=w.CustomAuthenticationProvider=w.Client=w.PageIterator=w.Range=w.UploadResult=w.FileUpload=w.StreamUpload=w.getValidRangeSize=w.OneDriveLargeFileUploadTask=w.LargeFileUploadTask=w.ChaosHandler=w.ChaosStrategy=w.ChaosHandlerOptions=w.TelemetryHandlerOptions=w.FeatureUsageFlag=w.RedirectHandlerOptions=w.RetryHandlerOptions=w.AuthenticationHandlerOptions=w.MiddlewareFactory=w.TelemetryHandler=w.RedirectHandler=w.RetryHandler=w.HTTPMessageHandler=w.AuthenticationHandler=w.BatchResponseContent=w.BatchRequestContent=void 0;var Dv=rp();Object.defineProperty(w,"BatchRequestContent",{enumerable:!0,get:a(function(){return Dv.BatchRequestContent},"get")});var Nv=np();Object.defineProperty(w,"BatchResponseContent",{enumerable:!0,get:a(function(){return Nv.BatchResponseContent},"get")});var Mv=vn();Object.defineProperty(w,"AuthenticationHandler",{enumerable:!0,get:a(function(){return Mv.AuthenticationHandler},"get")});var Uv=Pn();Object.defineProperty(w,"HTTPMessageHandler",{enumerable:!0,get:a(function(){return Uv.HTTPMessageHandler},"get")});var Lv=En();Object.defineProperty(w,"RetryHandler",{enumerable:!0,get:a(function(){return Lv.RetryHandler},"get")});var jv=An();Object.defineProperty(w,"RedirectHandler",{enumerable:!0,get:a(function(){return jv.RedirectHandler},"get")});var Fv=On();Object.defineProperty(w,"TelemetryHandler",{enumerable:!0,get:a(function(){return Fv.TelemetryHandler},"get")});var Bv=vp();Object.defineProperty(w,"MiddlewareFactory",{enumerable:!0,get:a(function(){return Bv.MiddlewareFactory},"get")});var Vv=bi();Object.defineProperty(w,"AuthenticationHandlerOptions",{enumerable:!0,get:a(function(){return Vv.AuthenticationHandlerOptions},"get")});var Hv=_r();Object.defineProperty(w,"RetryHandlerOptions",{enumerable:!0,get:a(function(){return Hv.RetryHandlerOptions},"get")});var Zv=Pr();Object.defineProperty(w,"RedirectHandlerOptions",{enumerable:!0,get:a(function(){return Zv.RedirectHandlerOptions},"get")});var Fp=Ut();Object.defineProperty(w,"FeatureUsageFlag",{enumerable:!0,get:a(function(){return Fp.FeatureUsageFlag},"get")});Object.defineProperty(w,"TelemetryHandlerOptions",{enumerable:!0,get:a(function(){return Fp.TelemetryHandlerOptions},"get")});var qv=Ai();Object.defineProperty(w,"ChaosHandlerOptions",{enumerable:!0,get:a(function(){return qv.ChaosHandlerOptions},"get")});var Gv=kn();Object.defineProperty(w,"ChaosStrategy",{enumerable:!0,get:a(function(){return Gv.ChaosStrategy},"get")});var Wv=Ep();Object.defineProperty(w,"ChaosHandler",{enumerable:!0,get:a(function(){return Wv.ChaosHandler},"get")});var Kv=ki();Object.defineProperty(w,"LargeFileUploadTask",{enumerable:!0,get:a(function(){return Kv.LargeFileUploadTask},"get")});var Jv=Sp();Object.defineProperty(w,"OneDriveLargeFileUploadTask",{enumerable:!0,get:a(function(){return Jv.OneDriveLargeFileUploadTask},"get")});var Xv=Di();Object.defineProperty(w,"getValidRangeSize",{enumerable:!0,get:a(function(){return Xv.getValidRangeSize},"get")});var Yv=wp();Object.defineProperty(w,"StreamUpload",{enumerable:!0,get:a(function(){return Yv.StreamUpload},"get")});var Qv=Ci();Object.defineProperty(w,"FileUpload",{enumerable:!0,get:a(function(){return Qv.FileUpload},"get")});var e_=Ri();Object.defineProperty(w,"UploadResult",{enumerable:!0,get:a(function(){return e_.UploadResult},"get")});var t_=Oi();Object.defineProperty(w,"Range",{enumerable:!0,get:a(function(){return t_.Range},"get")});var r_=Op();Object.defineProperty(w,"PageIterator",{enumerable:!0,get:a(function(){return r_.PageIterator},"get")});var n_=jp();Object.defineProperty(w,"Client",{enumerable:!0,get:a(function(){return n_.Client},"get")});var o_=Ni();Object.defineProperty(w,"CustomAuthenticationProvider",{enumerable:!0,get:a(function(){return o_.CustomAuthenticationProvider},"get")});var i_=Mi();Object.defineProperty(w,"GraphError",{enumerable:!0,get:a(function(){return i_.GraphError},"get")});var a_=Ge();Object.defineProperty(w,"GraphClientError",{enumerable:!0,get:a(function(){return a_.GraphClientError},"get")});var s_=Li();Object.defineProperty(w,"GraphRequest",{enumerable:!0,get:a(function(){return s_.GraphRequest},"get")});var u_=xr();Object.defineProperty(w,"ResponseType",{enumerable:!0,get:a(function(){return u_.ResponseType},"get")})});var Tr=b((Fi,Bi)=>{(function(e,t){typeof Fi=="object"&&typeof Bi<"u"?Bi.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Fi,(function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",s="hour",u="day",p="week",d="month",m="quarter",y="year",v="date",l="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|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,h={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:a(function(j){var A=["th","st","nd","rd"],I=j%100;return"["+j+(A[(I-20)%10]||A[I]||A[0])+"]"},"ordinal")},P=a(function(j,A,I){var R=String(j);return!R||R.length>=A?j:""+Array(A+1-R.length).join(I)+j},"m"),E={s:P,z:a(function(j){var A=-j.utcOffset(),I=Math.abs(A),R=Math.floor(I/60),S=I%60;return(A<=0?"+":"-")+P(R,2,"0")+":"+P(S,2,"0")},"z"),m:a(function j(A,I){if(A.date()<I.date())return-j(I,A);var R=12*(I.year()-A.year())+(I.month()-A.month()),S=A.clone().add(R,d),H=I-S<0,Z=A.clone().add(R+(H?-1:1),d);return+(-(R+(I-S)/(H?S-Z:Z-S))||0)},"t"),a:a(function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},"a"),p:a(function(j){return{M:d,y,w:p,d:u,D:v,h:s,m:i,s:o,ms:n,Q:m}[j]||String(j||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(j){return j===void 0},"u")},V="en",de={};de[V]=h;var Pe=a(function(j){return j instanceof vt},"p"),Ce=a(function j(A,I,R){var S;if(!A)return V;if(typeof A=="string"){var H=A.toLowerCase();de[H]&&(S=H),I&&(de[H]=I,S=H);var Z=A.split("-");if(!S&&Z.length>1)return j(Z[0])}else{var te=A.name;de[te]=A,S=te}return!R&&S&&(V=S),S||!R&&V},"t"),ee=a(function(j,A){if(Pe(j))return j.clone();var I=typeof A=="object"?A:{};return I.date=j,I.args=arguments,new vt(I)},"w"),G=E;G.l=Ce,G.i=Pe,G.w=function(j,A){return ee(j,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var vt=(function(){function j(I){this.$L=Ce(I.locale,null,!0),this.parse(I)}a(j,"M");var A=j.prototype;return A.parse=function(I){this.$d=(function(R){var S=R.date,H=R.utc;if(S===null)return new Date(NaN);if(G.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var Z=S.match(f);if(Z){var te=Z[2]-1||0,me=(Z[7]||"0").substring(0,3);return H?new Date(Date.UTC(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,me)):new Date(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,me)}}return new Date(S)})(I),this.$x=I.x||{},this.init()},A.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()},A.$utils=function(){return G},A.isValid=function(){return this.$d.toString()!==l},A.isSame=function(I,R){var S=ee(I);return this.startOf(R)<=S&&S<=this.endOf(R)},A.isAfter=function(I,R){return ee(I)<this.startOf(R)},A.isBefore=function(I,R){return this.endOf(R)<ee(I)},A.$g=function(I,R,S){return G.u(I)?this[R]:this.set(S,I)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(I,R){var S=this,H=!!G.u(R)||R,Z=G.p(I),te=a(function(pt,be){var Ke=G.w(S.$u?Date.UTC(S.$y,be,pt):new Date(S.$y,be,pt),S);return H?Ke:Ke.endOf(u)},"l"),me=a(function(pt,be){return G.w(S.toDate()[pt].apply(S.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(be)),S)},"$"),ye=this.$W,_e=this.$M,Se=this.$D,_t="set"+(this.$u?"UTC":"");switch(Z){case y:return H?te(1,0):te(31,11);case d:return H?te(1,_e):te(0,_e+1);case p:var lt=this.$locale().weekStart||0,Ht=(ye<lt?ye+7:ye)-lt;return te(H?Se-Ht:Se+(6-Ht),_e);case u:case v:return me(_t+"Hours",0);case s:return me(_t+"Minutes",1);case i:return me(_t+"Seconds",2);case o:return me(_t+"Milliseconds",3);default:return this.clone()}},A.endOf=function(I){return this.startOf(I,!1)},A.$set=function(I,R){var S,H=G.p(I),Z="set"+(this.$u?"UTC":""),te=(S={},S[u]=Z+"Date",S[v]=Z+"Date",S[d]=Z+"Month",S[y]=Z+"FullYear",S[s]=Z+"Hours",S[i]=Z+"Minutes",S[o]=Z+"Seconds",S[n]=Z+"Milliseconds",S)[H],me=H===u?this.$D+(R-this.$W):R;if(H===d||H===y){var ye=this.clone().set(v,1);ye.$d[te](me),ye.init(),this.$d=ye.set(v,Math.min(this.$D,ye.daysInMonth())).$d}else te&&this.$d[te](me);return this.init(),this},A.set=function(I,R){return this.clone().$set(I,R)},A.get=function(I){return this[G.p(I)]()},A.add=function(I,R){var S,H=this;I=Number(I);var Z=G.p(R),te=a(function(_e){var Se=ee(H);return G.w(Se.date(Se.date()+Math.round(_e*I)),H)},"y");if(Z===d)return this.set(d,this.$M+I);if(Z===y)return this.set(y,this.$y+I);if(Z===u)return te(1);if(Z===p)return te(7);var me=(S={},S[i]=t,S[s]=r,S[o]=e,S)[Z]||1,ye=this.$d.getTime()+I*me;return G.w(ye,this)},A.subtract=function(I,R){return this.add(-1*I,R)},A.format=function(I){var R=this,S=this.$locale();if(!this.isValid())return S.invalidDate||l;var H=I||"YYYY-MM-DDTHH:mm:ssZ",Z=G.z(this),te=this.$H,me=this.$m,ye=this.$M,_e=S.weekdays,Se=S.months,_t=S.meridiem,lt=a(function(be,Ke,Zt,Ir){return be&&(be[Ke]||be(R,H))||Zt[Ke].slice(0,Ir)},"h"),Ht=a(function(be){return G.s(te%12||12,be,"0")},"d"),pt=_t||function(be,Ke,Zt){var Ir=be<12?"AM":"PM";return Zt?Ir.toLowerCase():Ir};return H.replace(_,(function(be,Ke){return Ke||(function(Zt){switch(Zt){case"YY":return String(R.$y).slice(-2);case"YYYY":return G.s(R.$y,4,"0");case"M":return ye+1;case"MM":return G.s(ye+1,2,"0");case"MMM":return lt(S.monthsShort,ye,Se,3);case"MMMM":return lt(Se,ye);case"D":return R.$D;case"DD":return G.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return lt(S.weekdaysMin,R.$W,_e,2);case"ddd":return lt(S.weekdaysShort,R.$W,_e,3);case"dddd":return _e[R.$W];case"H":return String(te);case"HH":return G.s(te,2,"0");case"h":return Ht(1);case"hh":return Ht(2);case"a":return pt(te,me,!0);case"A":return pt(te,me,!1);case"m":return String(me);case"mm":return G.s(me,2,"0");case"s":return String(R.$s);case"ss":return G.s(R.$s,2,"0");case"SSS":return G.s(R.$ms,3,"0");case"Z":return Z}return null})(be)||Z.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(I,R,S){var H,Z=this,te=G.p(R),me=ee(I),ye=(me.utcOffset()-this.utcOffset())*t,_e=this-me,Se=a(function(){return G.m(Z,me)},"D");switch(te){case y:H=Se()/12;break;case d:H=Se();break;case m:H=Se()/3;break;case p:H=(_e-ye)/6048e5;break;case u:H=(_e-ye)/864e5;break;case s:H=_e/r;break;case i:H=_e/t;break;case o:H=_e/e;break;default:H=_e}return S?H:G.a(H)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return de[this.$L]},A.locale=function(I,R){if(!I)return this.$L;var S=this.clone(),H=Ce(I,R,!0);return H&&(S.$L=H),S},A.clone=function(){return G.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},j})(),ct=vt.prototype;return ee.prototype=ct,[["$ms",n],["$s",o],["$m",i],["$H",s],["$W",u],["$M",d],["$y",y],["$D",v]].forEach((function(j){ct[j[1]]=function(A){return this.$g(A,j[0],j[1])}})),ee.extend=function(j,A){return j.$i||(j(A,vt,ee),j.$i=!0),ee},ee.locale=Ce,ee.isDayjs=Pe,ee.unix=function(j){return ee(1e3*j)},ee.en=de[V],ee.Ls=de,ee.p={},ee}))});var g_={};uo(g_,{microsoftOutlook:()=>f_});module.exports=ie(g_);var dd=Object.freeze({status:"aborted"});function O(e,t,r){function n(u,p){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:p,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,p);let d=s.prototype,m=Object.keys(d);for(let y=0;y<m.length;y++){let v=m[y];v in u||(u[v]=d[v].bind(u))}}a(n,"init");let o=r?.Parent??Object;class i extends o{static{a(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function s(u){var p;let d=r?.Parent?new i:this;n(d,u),(p=d._zod).deferred??(p.deferred=[]);for(let m of d._zod.deferred)m();return d}return a(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a(u=>r?.Parent&&u instanceof r.Parent?!0:u?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a(O,"$constructor");var De=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},co={};function je(e){return e&&Object.assign(co,e),co}a(je,"config");function po(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)}a(po,"getEnumValues");function Wi(e,t){return typeof t=="bigint"?t.toString():t}a(Wi,"jsonStringifyReplacer");function $r(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a($r,"cached");function Ki(e){return e==null}a(Ki,"nullish");function wr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(wr,"cleanRegex");var Gi=Symbol("evaluating");function ge(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Gi)return n===void 0&&(n=Gi,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(ge,"defineLazy");var mo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Gt,"isObject");var md=$r(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ji(e){if(Gt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Gt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Ji,"isPlainObject");var Xi=new Set(["string","number","symbol"]);function Pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Pt,"escapeRegex");function Or(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a(Or,"clone");function ne(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>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:a(()=>t.error,"error")}:t}a(ne,"normalizeParams");function Yi(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(Yi,"optionalKeys");var Qi={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 xt(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}a(xt,"aborted");function Je(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}a(Je,"prefixIssues");function Sr(e){return typeof e=="string"?e:e?.message}a(Sr,"unwrapMessage");function Xe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Sr(e.inst?._zod.def?.error?.(e))??Sr(t?.error?.(e))??Sr(r.customError?.(e))??Sr(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}a(Xe,"finalizeIssue");function ea(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(ea,"getLengthableOrigin");function fo(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(fo,"issue");var ta=a((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,Wi,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),ra=O("$ZodError",ta),Wt=O("$ZodError",ta,{Parent:Error});var gd=a(e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new De;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(p=>Xe(p,i,je())));throw mo(u,o?.callee),u}return s.value},"_parse"),Rr=gd(Wt),hd=a(e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(o?.Err??e)(s.issues.map(p=>Xe(p,i,je())));throw mo(u,o?.callee),u}return s.value},"_parseAsync"),zr=hd(Wt),yd=a(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new De;return i.issues.length?{success:!1,error:new(e??ra)(i.issues.map(s=>Xe(s,o,je())))}:{success:!0,data:i.value}},"_safeParse"),Kt=yd(Wt),vd=a(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Xe(s,o,je())))}:{success:!0,data:i.value}},"_safeParseAsync"),Jt=vd(Wt);var _d="(?:(?:\\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])))",Pd=new RegExp(`^${_d}$`);var na=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),oa=/^-?\d+n?$/,ia=/^-?\d+$/,go=/^-?\d+(?:\.\d+)?$/,aa=/^(?:true|false)$/i;var Ye=O("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),xd={number:"number",bigint:"bigint",object:"date"};var sa=O("$ZodCheckGreaterThan",(e,t)=>{Ye.init(e,t);let r=xd[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(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 ua=O("$ZodCheckNumberFormat",(e,t)=>{Ye.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Qi[t.format];e._zod.onattach.push(s=>{let u=s._zod.bag;u.format=t.format,u.minimum=o,u.maximum=i,r&&(u.pattern=ia)}),e._zod.check=s=>{let u=s.value;if(r){if(!Number.isInteger(u)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,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}):s.issues.push({input:u,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}}u<o&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>i&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var ca=O("$ZodCheckMinLength",(e,t)=>{var r;Ye.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ki(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 s=ea(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var ho=O("$ZodCheckStringFormat",(e,t)=>{var r,n;Ye.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.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=()=>{})}),la=O("$ZodCheckRegex",(e,t)=>{ho.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 da={major:4,minor:3,patch:6};var ce=O("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=da;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=a((s,u,p)=>{let d=xt(s),m;for(let y of u){if(y._zod.def.when){if(!y._zod.def.when(s))continue}else if(d)continue;let v=s.issues.length,l=y._zod.check(s);if(l instanceof Promise&&p?.async===!1)throw new De;if(m||l instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await l,s.issues.length!==v&&(d||(d=xt(s,v)))});else{if(s.issues.length===v)continue;d||(d=xt(s,v))}}return m?m.then(()=>s):s},"runChecks"),i=a((s,u,p)=>{if(xt(s))return s.aborted=!0,s;let d=o(u,n,p);if(d instanceof Promise){if(p.async===!1)throw new De;return d.then(m=>e._zod.parse(m,p))}return e._zod.parse(d,p)},"handleCanaryResult");e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let d=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(m=>i(m,s,u)):i(d,s,u)}let p=e._zod.parse(s,u);if(p instanceof Promise){if(u.async===!1)throw new De;return p.then(d=>o(d,n,u))}return o(p,n,u)}}ge(e,"~standard",()=>({validate:a(o=>{try{let i=Kt(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Jt(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Dr=O("$ZodString",(e,t)=>{ce.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??na(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}}),yo=O("$ZodStringFormat",(e,t)=>{ho.init(e,t),Dr.init(e,t)});var ya=O("$ZodURL",(e,t)=>{yo.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 vo=O("$ZodNumber",(e,t)=>{ce.init(e,t),e._zod.pattern=e._zod.bag.pattern??go,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 i=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,...i?{received:i}:{}}),r}}),va=O("$ZodNumberFormat",(e,t)=>{ua.init(e,t),vo.init(e,t)}),_o=O("$ZodBoolean",(e,t)=>{ce.init(e,t),e._zod.pattern=aa,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}}),_a=O("$ZodBigInt",(e,t)=>{ce.init(e,t),e._zod.pattern=oa,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 Pa=O("$ZodAny",(e,t)=>{ce.init(e,t),e._zod.parse=r=>r}),xa=O("$ZodUnknown",(e,t)=>{ce.init(e,t),e._zod.parse=r=>r});var ba=O("$ZodVoid",(e,t)=>{ce.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}}),Ea=O("$ZodDate",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});function ma(e,t,r){e.issues.length&&t.issues.push(...Je(r,e.issues)),t.value[r]=e.value}a(ma,"handleArrayResult");var Ta=O("$ZodArray",(e,t)=>{ce.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 i=[];for(let s=0;s<o.length;s++){let u=o[s],p=t.element._zod.run({value:u,issues:[]},n);p instanceof Promise?i.push(p.then(d=>ma(d,r,s))):ma(p,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Cr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Je(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}a(Cr,"handlePropertyResult");function bd(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=Yi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(bd,"normalizeDef");function Ed(e,t,r,n,o,i){let s=[],u=o.keySet,p=o.catchall._zod,d=p.def.type,m=p.optout==="optional";for(let y in t){if(u.has(y))continue;if(d==="never"){s.push(y);continue}let v=p.run({value:t[y],issues:[]},n);v instanceof Promise?e.push(v.then(l=>Cr(l,r,y,t,m))):Cr(v,r,y,t,m)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}a(Ed,"handleCatchall");var Ia=O("$ZodObject",(e,t)=>{if(ce.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let u=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let p={...u};return Object.defineProperty(t,"shape",{value:p}),p},"get")})}let n=$r(()=>bd(t));ge(e._zod,"propValues",()=>{let u=t.shape,p={};for(let d in u){let m=u[d]._zod;if(m.values){p[d]??(p[d]=new Set);for(let y of m.values)p[d].add(y)}}return p});let o=Gt,i=t.catchall,s;e._zod.parse=(u,p)=>{s??(s=n.value);let d=u.value;if(!o(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value={};let m=[],y=s.shape;for(let v of s.keys){let l=y[v],f=l._zod.optout==="optional",_=l._zod.run({value:d[v],issues:[]},p);_ instanceof Promise?m.push(_.then(h=>Cr(h,u,v,d,f))):Cr(_,u,v,d,f)}return i?Ed(m,d,u,p,n.value,e):m.length?Promise.all(m).then(()=>u):u}});function fa(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!xt(i));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(i=>i.issues.map(s=>Xe(s,n,je())))}),t)}a(fa,"handleUnionResults");var Po=O("$ZodUnion",(e,t)=>{ce.init(e,t),ge(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ge(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ge(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ge(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>wr(i.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let s=!1,u=[];for(let p of t.options){let d=p._zod.run({value:o.value,issues:[]},i);if(d instanceof Promise)u.push(d),s=!0;else{if(d.issues.length===0)return d;u.push(d)}}return s?Promise.all(u).then(p=>fa(p,o,e,i)):fa(u,o,e,i)}});var Aa=O("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Po.init(e,t);let r=e._zod.parse;ge(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[u,p]of Object.entries(s)){o[u]||(o[u]=new Set);for(let d of p)o[u].add(d)}}return o});let n=$r(()=>{let o=t.options,i=new Map;for(let s of o){let u=s._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let p of u){if(i.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);i.set(p,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!Gt(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let u=n.value.get(s?.[t.discriminator]);return u?u._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}});var Sa=O("$ZodRecord",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Ji(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let u=new Set;for(let d of s)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){u.add(typeof d=="number"?d.toString():d);let m=t.valueType._zod.run({value:o[d],issues:[]},n);m instanceof Promise?i.push(m.then(y=>{y.issues.length&&r.issues.push(...Je(d,y.issues)),r.value[d]=y.value})):(m.issues.length&&r.issues.push(...Je(d,m.issues)),r.value[d]=m.value)}let p;for(let d in o)u.has(d)||(p=p??[],p.push(d));p&&p.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:p})}else{r.value={};for(let u of Reflect.ownKeys(o)){if(u==="__proto__")continue;let p=t.keyType._zod.run({value:u,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&go.test(u)&&p.issues.length){let y=t.keyType._zod.run({value:Number(u),issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(p=y)}if(p.issues.length){t.mode==="loose"?r.value[u]=o[u]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>Xe(y,n,je())),input:u,path:[u],inst:e});continue}let m=t.valueType._zod.run({value:o[u],issues:[]},n);m instanceof Promise?i.push(m.then(y=>{y.issues.length&&r.issues.push(...Je(u,y.issues)),r.value[p.value]=y.value})):(m.issues.length&&r.issues.push(...Je(u,m.issues)),r.value[p.value]=m.value)}}return i.length?Promise.all(i).then(()=>r):r}});var $a=O("$ZodEnum",(e,t)=>{ce.init(e,t);let r=po(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Xi.has(typeof o)).map(o=>typeof o=="string"?Pt(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),wa=O("$ZodLiteral",(e,t)=>{if(ce.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"?Pt(n):n?Pt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var Oa=O("$ZodTransform",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ar(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new De;return r.value=o,r}});function ga(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(ga,"handleOptionalResult");var Ra=O("$ZodOptional",(e,t)=>{ce.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${wr(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(i=>ga(i,r.value)):ga(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var za=O("$ZodNullable",(e,t)=>{ce.init(e,t),ge(e._zod,"optin",()=>t.innerType._zod.optin),ge(e._zod,"optout",()=>t.innerType._zod.optout),ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${wr(r.source)}|null)$`):void 0}),ge(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 ka=O("$ZodPipe",(e,t)=>{ce.init(e,t),ge(e._zod,"values",()=>t.in._zod.values),ge(e._zod,"optin",()=>t.in._zod.optin),ge(e._zod,"optout",()=>t.out._zod.optout),ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>kr(s,t.in,n)):kr(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>kr(i,t.out,n)):kr(o,t.out,n)}});function kr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(kr,"handlePipeResult");var Ca=O("$ZodCustom",(e,t)=>{Ye.init(e,t),ce.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(i=>ha(i,r,n,e));ha(o,r,n,e)}});function ha(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(fo(o))}}a(ha,"handleRefineResult");var Na;var xo=class{static{a(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 Ma(){return new xo}a(Ma,"registry");(Na=globalThis).__zod_globalRegistry??(Na.__zod_globalRegistry=Ma());var bo=globalThis.__zod_globalRegistry;function Ua(e,t){return new e({type:"string",...ne(t)})}a(Ua,"_string");function La(e,t){return new e({type:"string",coerce:!0,...ne(t)})}a(La,"_coercedString");function ja(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}a(ja,"_url");function Fa(e,t){return new e({type:"number",checks:[],...ne(t)})}a(Fa,"_number");function Ba(e,t){return new e({type:"number",coerce:!0,checks:[],...ne(t)})}a(Ba,"_coercedNumber");function Va(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}a(Va,"_int");function Ha(e,t){return new e({type:"boolean",...ne(t)})}a(Ha,"_boolean");function Za(e,t){return new e({type:"boolean",coerce:!0,...ne(t)})}a(Za,"_coercedBoolean");function qa(e,t){return new e({type:"bigint",coerce:!0,...ne(t)})}a(qa,"_coercedBigint");function Ga(e){return new e({type:"any"})}a(Ga,"_any");function Wa(e){return new e({type:"unknown"})}a(Wa,"_unknown");function Ka(e,t){return new e({type:"void",...ne(t)})}a(Ka,"_void");function Ja(e,t){return new e({type:"date",coerce:!0,...ne(t)})}a(Ja,"_coercedDate");function Nr(e,t){return new sa({check:"greater_than",...ne(t),value:e,inclusive:!0})}a(Nr,"_gte");function ze(e,t){return new ca({check:"min_length",...ne(t),minimum:e})}a(ze,"_minLength");function Qe(e,t){return new la({check:"string_format",format:"regex",...ne(t),pattern:e})}a(Qe,"_regex");function Xa(e,t,r){let n=ne(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(Xa,"_custom");var he=O("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ce.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Rr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Kt(e,r,n),e.parseAsync=async(r,n)=>zr(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Jt(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)=>Or(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ur=O("ZodMiniString",(e,t)=>{Dr.init(e,t),he.init(e,t)});function c(e){return Ua(Ur,e)}a(c,"string");var Ya=O("ZodMiniStringFormat",(e,t)=>{yo.init(e,t),Ur.init(e,t)});var Nd=O("ZodMiniURL",(e,t)=>{ya.init(e,t),Ya.init(e,t)});function Qa(e){return ja(Nd,e)}a(Qa,"url");var Lr=O("ZodMiniNumber",(e,t)=>{vo.init(e,t),he.init(e,t)});function xe(e){return Fa(Lr,e)}a(xe,"number");var Md=O("ZodMiniNumberFormat",(e,t)=>{va.init(e,t),Lr.init(e,t)});function es(e){return Va(Md,e)}a(es,"int");var Eo=O("ZodMiniBoolean",(e,t)=>{_o.init(e,t),he.init(e,t)});function Q(e){return Ha(Eo,e)}a(Q,"boolean");var ts=O("ZodMiniBigInt",(e,t)=>{_a.init(e,t),he.init(e,t)});var Ud=O("ZodMiniAny",(e,t)=>{Pa.init(e,t),he.init(e,t)});function Yt(){return Ga(Ud)}a(Yt,"any");var Ld=O("ZodMiniUnknown",(e,t)=>{xa.init(e,t),he.init(e,t)});function M(){return Wa(Ld)}a(M,"unknown");var jd=O("ZodMiniVoid",(e,t)=>{ba.init(e,t),he.init(e,t)});function rs(e){return Ka(jd,e)}a(rs,"_void");var ns=O("ZodMiniDate",(e,t)=>{Ea.init(e,t),he.init(e,t)});var Fd=O("ZodMiniArray",(e,t)=>{Ta.init(e,t),he.init(e,t)});function F(e,t){return new Fd({type:"array",element:e,...ne(t)})}a(F,"array");var Bd=O("ZodMiniObject",(e,t)=>{Ia.init(e,t),he.init(e,t),ge(e,"shape",()=>t.shape)});function g(e,t){let r={type:"object",shape:e??{},...ne(t)};return new Bd(r)}a(g,"object");var Vd=O("ZodMiniUnion",(e,t)=>{Po.init(e,t),he.init(e,t)});function B(e,t){return new Vd({type:"union",options:e,...ne(t)})}a(B,"union");var Hd=O("ZodMiniDiscriminatedUnion",(e,t)=>{Aa.init(e,t),he.init(e,t)});function et(e,t,r){return new Hd({type:"union",options:t,discriminator:e,...ne(r)})}a(et,"discriminatedUnion");var Zd=O("ZodMiniRecord",(e,t)=>{Sa.init(e,t),he.init(e,t)});function U(e,t,r){return new Zd({type:"record",keyType:e,valueType:t,...ne(r)})}a(U,"record");var qd=O("ZodMiniEnum",(e,t)=>{$a.init(e,t),he.init(e,t),e.options=Object.values(t.entries)});function W(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new qd({type:"enum",entries:r,...ne(t)})}a(W,"_enum");var Gd=O("ZodMiniLiteral",(e,t)=>{wa.init(e,t),he.init(e,t)});function k(e,t){return new Gd({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}a(k,"literal");var Wd=O("ZodMiniTransform",(e,t)=>{Oa.init(e,t),he.init(e,t)});function tt(e){return new Wd({type:"transform",transform:e})}a(tt,"transform");var Kd=O("ZodMiniOptional",(e,t)=>{Ra.init(e,t),he.init(e,t)});function x(e){return new Kd({type:"optional",innerType:e})}a(x,"optional");var Jd=O("ZodMiniNullable",(e,t)=>{za.init(e,t),he.init(e,t)});function Qt(e){return new Jd({type:"nullable",innerType:e})}a(Qt,"nullable");var Xd=O("ZodMiniPipe",(e,t)=>{ka.init(e,t),he.init(e,t)});function rt(e,t){return new Xd({type:"pipe",in:e,out:t})}a(rt,"pipe");var Yd=O("ZodMiniCustom",(e,t)=>{Ca.init(e,t),he.init(e,t)});function jr(e,t){return Xa(Yd,e??(()=>!0),t)}a(jr,"custom");var er={};uo(er,{bigint:()=>om,boolean:()=>nm,date:()=>im,number:()=>rm,string:()=>tm});function tm(e){return La(Ur,e)}a(tm,"string");function rm(e){return Ba(Lr,e)}a(rm,"number");function nm(e){return Za(Eo,e)}a(nm,"boolean");function om(e){return qa(ts,e)}a(om,"bigint");function im(e){return Ja(ns,e)}a(im,"date");var Io=g({retryOnFailure:g({defaultValue:x(Q()),hide:x(Q())}),continueOnFailure:g({defaultValue:x(Q()),hide:x(Q())})}),To=class{constructor(t,r,n,o,i,s,u,p,d,m,y){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=i;this.test=s;this.requireAuth=u;this.errorHandlingOptions=p;this.outputSchema=d;this.audience=m;this.aiMetadata=y}static{a(this,"IAction")}},oe=a(e=>new To(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=g({displayName:c(),description:x(c())}),q=a((e,t)=>g({type:k(t),required:Q(),defaultValue:x(Yt())}),"TPropertyValue");var Ie=g({...Y.shape,...q(c(),"SHORT_TEXT").shape}),Fe=g({...Y.shape,...q(c(),"LONG_TEXT").shape});var is=g({label:c(),value:M()}),Fr=g({disabled:x(Q()),placeholder:x(c()),options:F(is)});var Ae=g({...Y.shape,options:Fr,...q(M(),"STATIC_DROPDOWN").shape}),Be=g({...Y.shape,options:Fr,...q(F(M()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ao=g({...Y.shape,...q(M(),"DROPDOWN").shape,refreshers:F(c())}),tr=g({...Y.shape,...q(F(M()),"MULTI_SELECT_DROPDOWN").shape,refreshers:F(c())});var Ve=g({...Y.shape,...q(Q(),"CHECKBOX").shape});var He=g({...Y.shape,...q(xe(),"NUMBER").shape});var rr=g({...Y.shape,streaming:x(Q()),...q(M(),"FILE").shape});var nr=g({...Y.shape,...q(c(),"DATE_TIME").shape});var as=U(c(),B([Ie,Fe,Ae,tr,Be,Ve,He,rr,nr])),or=g({...Y.shape,properties:as,...q(F(M()),"ARRAY").shape});var ir=g({...Y.shape,...q(B([U(c(),M())]),"JSON").shape});var ss=B([Ie,Ae,ir,or,Be]),sm=U(c(),ss),So=g({refreshers:F(c()),...Y.shape,...q(M(),"DYNAMIC").shape});var Br=g({...Y.shape,...q(rs(),"MARKDOWN").shape});var ar=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ar||{}),bt=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(bt||{}),Et=(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))(Et||{});var sr=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(sr||{}),$o="both_client_credentials_and_authorization_code";var Ne=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ne||{}),ur=(i=>(i.NONE="NONE",i.HEADER_PRESENT="HEADER_PRESENT",i.QUERY_PRESENT="QUERY_PRESENT",i.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",i.HEAD_REQUEST="HEAD_REQUEST",i))(ur||{}),um=g({strategy:W(ur),paramName:x(c())}),cr=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(cr||{});var Vr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Vr||{}),us=g({status:x(xe()),body:x(M()),headers:x(U(c(),c()))}),cs=g({type:k("DELAY"),resumeDateTime:c(),requestIdToReply:x(c()),handlerId:x(c()),streamStepProgress:x(W(Vr))}),ls=g({type:k("WEBHOOK"),requestId:c(),requestIdToReply:x(c()),response:us,handlerId:x(c()),streamStepProgress:x(W(Vr))}),cm=B([cs,ls]);var lm=g({body:M(),rawBody:x(M()),headers:U(c(),c()),queryParams:U(c(),c())});function fe(e){return e==null}a(fe,"isNil");function lr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(lr,"isEmpty");function Ze(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(Ze,"assertNotNullOrUndefined");var wo=Re(require("crypto"),1);var pm=128,dt,Tt,dm=a(e=>{!dt||dt.length<e?(dt=Buffer.allocUnsafe(e*pm),wo.default.randomFillSync(dt),Tt=0):Tt+e>dt.length&&(wo.default.randomFillSync(dt),Tt=0),Tt+=e},"fillPool"),mm=a(e=>(dm(e|=0),dt.subarray(Tt-e,Tt)),"random"),fm=a((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(i=t)=>{let s="";for(;;){let u=r(o),p=o;for(;p--;)if(s+=e[u[p]&n]||"",s.length===i)return s}}},"customRandom"),ds=a((e,t=21)=>fm(e,t,mm),"customAlphabet");var gm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ms=21,K$=c().check(Qe(new RegExp(`^[0-9a-zA-Z]{${ms}}$`))),hm=ds(gm,ms);var nt=rt(tt(e=>e instanceof Date?e.toISOString():e),c()),$e={id:c(),created:nt,updated:nt},ae=a(e=>x(Qt(e)),"Nullable");function Oo(e){return x(Qt(W(e)))}a(Oo,"NullableEnum");var Y$=rt(tt(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),x(Q())),Hr=a(e=>rt(tt(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),x(F(e))),"OptionalArrayFromQuery");var tw=U(c(),M());var pr=(m=>(m.OPENAI="openai",m.OPENROUTER="openrouter",m.ANTHROPIC="anthropic",m.AZURE="azure",m.GOOGLE="google",m.ACTIVEPIECES="activepieces",m.CLOUDFLARE_GATEWAY="cloudflare-gateway",m.CUSTOM="custom",m.BEDROCK="bedrock",m.MISTRAL="mistral",m))(pr||{});var mw=c().check(Qe(/^#[0-9A-Fa-f]{6}$/));var gw=g({filename:c(),data:M(),type:k("file"),mimetype:x(c())});var ym=Re(gs());var bw=g({...$e,name:c(),permissions:F(c()),platformId:ae(c()),type:c(),userCount:x(xe())});var hs=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(hs||{}),Ro=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ro||{}),zo=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zo||{});var ko=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(ko||{});var Co=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Co||{});var vm=g({mode:W(hs),value:M()}),_m=g({auth:x(c()),fields:U(c(),vm)}),Pm=g({pieceName:c(),pieceVersion:c(),actionName:c(),predefinedInput:x(_m)}),xm=g({type:k("PIECE"),toolName:c().check(ze(1)),pieceMetadata:Pm}),bm=g({type:k("none")}),Em=g({type:k("access_token"),accessToken:c()}),Tm=g({type:k("api_key"),apiKey:c(),apiKeyHeader:c()}),Im=g({type:k("headers"),headers:U(c(),c())}),Am=et("type",[bm,Em,Tm,Im]),ys=g({type:k("FLOW"),toolName:c().check(ze(1)),externalFlowId:c(),flowDisplayName:x(c())}),vs=g({type:k("MCP"),toolName:c().check(ze(1)),serverUrl:Qa(),protocol:W(zo),auth:Am}),_s=g({type:k("KNOWLEDGE_BASE"),toolName:c().check(ze(1)),sourceType:W(Ro),sourceId:c(),sourceName:c()}),Sm=et("type",[xm,ys,vs,_s]),$m=g({displayName:c(),description:x(c()),type:W(ko)}),Ps=g({type:k("MARKDOWN"),markdown:c()}),It={type:k("TOOL_CALL"),input:ae(U(c(),M())),output:x(M()),toolName:c(),status:W(Co),toolCallId:c(),startTime:c(),endTime:x(c())},Qw=g(It),xs=et("toolCallType",[g({...It,toolCallType:k("PIECE"),pieceName:c(),pieceVersion:c(),actionName:c()}),g({...It,toolCallType:k("FLOW"),displayName:c(),externalFlowId:c()}),g({...It,toolCallType:k("MCP"),displayName:c(),serverUrl:c()}),g({...It,toolCallType:k("KNOWLEDGE_BASE"),displayName:c(),sourceType:c()}),g({...It,toolCallType:k("UNKNOWN"),displayName:c()})]),wm=B([Ps,xs]);var Do=(r=>(r.IMAGE="image",r.TEXT="text",r))(Do||{}),qe=g({apiKey:c()}),Om=qe,Rm=g({apiKey:c(),apiKeyHash:c()}),zm=qe,km=qe,Cm=qe,Dm=qe,Nm=qe,Mm=qe,Um=qe,As=g({accessKeyId:c().check(ze(1)),secretAccessKey:c().check(ze(1))}),Lm=g({}),jm=g({}),Fm=g({}),Bm=g({}),Vm=g({}),Hm=g({}),Ss=g({modelId:c(),modelName:c(),modelType:W(Do)}),$s=g({apiKeyHeader:c(),baseUrl:c(),models:F(Ss),defaultHeaders:x(U(c(),c()))}),ws=g({accountId:c(),gatewayId:c(),models:F(Ss),vertexProject:x(c()),vertexRegion:x(c())}),Os=g({resourceName:c(),apiVersion:rt(tt(e=>typeof e=="string"&&e.trim().length===0?void 0:e),x(c()))}),Rs=g({region:c().check(ze(1))}),Zm=B([Om,Cm,Dm,Nm,Mm,km,zm,Rm,As,Um]),zs=B([$s,ws,Os,Rs,Lm,Fm,Bm,Vm,jm,Hm]),qm=g({id:c(),name:c(),type:W(Do)}),Gm=g({id:c(),name:c(),provider:W(pr),config:zs,enabledForChat:Q()}),Wm=g({provider:W(pr),config:zs,auth:Zm,platformId:c()});var nO={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},bs=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Km=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Jm=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Es=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Xm=["grok-4.20","grok-4.1-fast"],Ym={openai:bs,anthropic:Km,google:Es,activepieces:[...Jm.map(e=>`anthropic/${e}`),...bs.map(e=>`openai/${e}`),...Es.map(e=>`google/${e}`),...Xm.map(e=>`x-ai/${e}`)]};var Ts=128e3,Qm={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function ef({provider:e}){return e?Qm[e]??Ts:Ts}a(ef,"getMaxContextTokens");var Is={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"},tf={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},rf=new Set(["anthropic","mistral"]);function Me(e){return{chatModels:Ym[e],maxContextTokens:ef({provider:e}),defaultEmbeddingModel:Is[e],supportsEmbedding:Is[e]!==void 0,supportsImageGeneration:!rf.has(e),webSearch:tf[e]}}a(Me,"buildProviderCapabilities");var nf={openai:Me("openai"),anthropic:Me("anthropic"),openrouter:Me("openrouter"),azure:Me("azure"),google:Me("google"),"cloudflare-gateway":Me("cloudflare-gateway"),custom:Me("custom"),bedrock:Me("bedrock"),mistral:Me("mistral"),activepieces:Me("activepieces")};var of=g({base64Url:c(),fileName:c(),extension:x(c())}),af=g({mimeType:c(),url:c(),fileName:x(c())}),No=B([of,af]);var sf=B([g({type:k("file"),value:No}),g({type:k("markdown"),value:c(),files:x(F(No))})]),uf=g({sessionId:c(),message:c(),files:x(F(c()))});var Cs=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Cs||{}),Ds=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ds||{}),Mo=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Mo||{});var cf=B([g({...$e,name:c(),externalId:c(),type:k("STATIC_DROPDOWN"),tableId:c(),projectId:c(),data:g({options:F(g({value:c()}))})}),g({...$e,name:c(),externalId:c(),type:B([k("TEXT"),k("NUMBER"),k("DATE")]),tableId:c(),projectId:c()})]),lf=g({...$e,name:c(),folderId:ae(c()),projectId:c(),externalId:c(),status:Oo(Ds),trigger:Oo(Cs)}),pf=g({...$e,tableId:c(),projectId:c(),cells:U(c(),g({updated:c(),created:c(),value:M(),fieldName:c()}))}),df=g({events:F(W(Mo)),webhookUrl:c(),flowId:c()}),mf=g({fields:F(g({id:c(),name:c()})),rows:F(U(c(),c())),name:c()}),ff=g({projectId:c(),limit:x(er.number()),cursor:x(c()),name:x(c()),externalIds:Hr(c()),folderId:x(c()),folderIds:Hr(c())}),gf=g({records:F(F(g({fieldId:c(),value:Ms()}))),tableId:c()}),hf=g({cells:x(F(g({fieldId:c(),value:Ms()}))),tableId:c(),agentUpdate:x(Q())}),Ns=et("operator",[mt("eq"),mt("neq"),mt("gt"),mt("gte"),mt("lt"),mt("lte"),mt("co"),ks("exists"),ks("not_exists")]),yf=g({tableId:c(),limit:x(er.number()),cursor:x(c()),filters:Hr(Ns)});function Ms(){return rt(tt(e=>e==null?e:String(e)),Qt(c()))}a(Ms,"coerceToString");function mt(e){return g({fieldId:c(),operator:k(e),value:c()})}a(mt,"valueFilter");function ks(e){return g({fieldId:c(),operator:k(e)})}a(ks,"existenceFilter");var vf=g({status:x(xe()),body:x(M()),headers:x(U(c(),c()))}),_f=g({...$e,deleted:ae(nt),ownerId:c(),displayName:c(),platformId:c(),externalId:ae(c())});var Us=g({name:c(),description:x(c()),type:c(),required:Q()}),Pf=g({pieceName:c(),triggerName:c(),input:g({toolName:c(),toolDescription:c(),inputSchema:F(Us),returnsResponse:Q()})});var Ls="^[0-9]+\\.[0-9]+\\.[0-9]+$",bO=new RegExp(Ls),bf="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",EO=c().check(Qe(new RegExp(Ls))),TO=c().check(Qe(new RegExp(bf))),Ef=g({packageType:k("ARCHIVE"),pieceType:W(bt),pieceName:c(),pieceVersion:c(),archiveId:c(),platformId:c()}),js=g({packageType:k("REGISTRY"),pieceType:k("OFFICIAL"),pieceName:c(),pieceVersion:c()}),Fs=g({packageType:k("REGISTRY"),pieceType:k("CUSTOM"),pieceName:c(),pieceVersion:c(),platformId:c()}),IO=B([js,Fs]),AO=B([Ef,js,Fs]);var Tf=et("type",[g({type:k("CRON_EXPRESSION"),cronExpression:c(),timezone:c()}),g({type:k("INTERVAL"),intervalMs:es().check(Nr(6e4))})]),SO=g({...$e,type:W(Ne),projectId:c(),flowId:c(),triggerName:c(),schedule:ae(Tf),flowVersionId:c(),pieceName:c(),pieceVersion:c(),deleted:ae(c()),simulate:Q()}),Bs=(h=>(h.UNKNOWN="UNKNOWN",h.FLOW_RUN_LOG="FLOW_RUN_LOG",h.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",h.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",h.FLOW_STEP_FILE="FLOW_STEP_FILE",h.SAMPLE_DATA="SAMPLE_DATA",h.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",h.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",h.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",h.PROJECT_RELEASE="PROJECT_RELEASE",h.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",h.PLATFORM_ASSET="PLATFORM_ASSET",h.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",h.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",h.KNOWLEDGE_BASE="KNOWLEDGE_BASE",h.FLOW_BUNDLE="FLOW_BUNDLE",h))(Bs||{}),Vs=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Vs||{}),Hs=(r=>(r.S3="S3",r.DB="DB",r))(Hs||{}),$O=g({...$e,projectId:ae(c()),platformId:ae(c()),type:W(Bs),compression:W(Vs),data:x(M()),location:W(Hs),size:ae(xe()),fileName:ae(c()),s3Key:ae(c()),metadata:ae(U(c(),c()))}),Zs=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Zs||{}),qs=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(qs||{}),wO=g({id:c(),email:c(),firstName:c(),status:W(qs),externalId:ae(c()),platformId:ae(c()),platformRole:W(Zs),lastName:c(),created:nt,updated:nt,lastActiveDate:ae(nt),imageUrl:ae(c())});var Lo=g({...Y.shape,...q(U(c(),M()),"OBJECT").shape});var Ks=g({...Y.shape,...q(c(),"COLOR").shape});var jo=B([Ie,Fe,Br,Ve,Ae,Be,Ao,tr,So,He,or,Lo,ir,nr,rr,Ks]),T={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Ue=g({displayName:c(),description:x(c())});var Js=g({username:c(),password:c()}),Fo=g({...Ue.shape,username:g({displayName:c(),description:x(c())}),password:g({displayName:c(),description:x(c())}),...q(Js,"BASIC_AUTH").shape});var $f=U(c(),B([Ie,Fe,He,Ve,Ae])),Bo=g({...Ue.shape,props:$f,...q(M(),"CUSTOM_AUTH").shape});var ft=g({...Ue.shape,...q(g({auth:c()}),"SECRET_TEXT").shape});var wf=U(c(),B([Ie,Fe,ft,He,Ve,Ae,Be,Br])),Xs=g({...Ue.shape,props:wf,...q(M(),"OIDC").shape});var Vo=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Vo||{}),Ys=B([Ie,ft,Ae]),Qs=U(c(),Ys),Of=g({props:x(U(c(),Ys)),authUrl:c(),tokenUrl:c(),scope:F(c()),prompt:x(B([k("none"),k("consent"),k("login"),k("omit")])),pkce:x(Q()),pkceMethod:x(B([k("plain"),k("S256")])),authorizationMethod:x(W(Vo)),grantType:x(B([W(sr),k($o)])),extra:x(U(c(),c()))}),eu=g({access_token:c(),props:x(Qs),data:U(c(),Yt())}),Ho=g({...Ue.shape,...Of.shape,...q(eu,"OAUTH2").shape});var At=B([Fo,Bo,Xs,Ho,ft]),dr="Connection",Zo={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||dr}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||dr,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||dr}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||dr}},None(){}};var sz={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 Rf=g({...Y.shape,...q(M(),"CUSTOM").shape,code:c()});var zf=B([jo,At]),qo=U(c(),zf),Sz=U(c(),jo);var tu=B([g({strategy:k("CRON"),cronExpression:c()}),g({strategy:k("NONE")})]),St=class{constructor(t,r,n,o,i,s,u,p,d,m,y,v,l,f,_,h,P,E,V){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=i;this.type=s;this.handshakeConfiguration=u;this.onHandshake=p;this.renewConfiguration=d;this.onRenew=m;this.onEnable=y;this.onDisable=v;this.onStart=l;this.run=f;this.test=_;this.sampleData=h;this.testStrategy=P;this.outputSchema=E;this.aiMetadata=V}static{a(this,"ITrigger")}},$t=a(e=>{switch(e.type){case"WEBHOOK":return new St(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 St(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 St(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 St(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,fe(e.sampleData)&&fe(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var ru="2",qr="0.82.0";var Go=class{constructor(t,r,n,o,i,s,u,p,d=qr,m,y="",v){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=u;this.auth=p;this.minimumSupportedRelease=d;this.maximumSupportedRelease=m;this.description=y;this.deprecated=v;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:ru}),"getContextInfo");(!kf(d)||Cf(d,qr))&&(this.minimumSupportedRelease=qr),i.forEach(l=>this._actions[l.name]=l),s.forEach(l=>this._triggers[l.name]=l)}static{a(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},nu=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(i=>i.type===r.type)))throw new Error("Auth properties must be unique by type");return new Go(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 kf(e){return/^\d+\.\d+\.\d+$/.test(e)}a(kf,"isValidSimpleSemver");function Cf(e,t){let[r,n,o]=e.split(".").map(Number),[i,s,u]=t.split(".").map(Number);return r!==i?r<i:n!==s?n<s:o<u}a(Cf,"isSemverLessThan");var Df=x(U(c(),U(c(),c()))),ou=g({id:x(c()),name:c(),displayName:c(),logoUrl:c(),description:c(),authors:F(c()),platformId:x(c()),directoryPath:x(c()),auth:x(B([At,F(At)])),version:c(),categories:x(F(W(Et))),minimumSupportedRelease:x(c()),maximumSupportedRelease:x(c()),deprecated:x(Q()),i18n:Df}),Nf=W(["human","ai","both"]),iu=g({description:x(c()),idempotent:x(Q())}),au=g({name:c(),displayName:c(),description:c(),props:qo,requireAuth:Q(),errorHandlingOptions:x(Io),outputSchema:x(jr()),audience:x(Nf),aiMetadata:x(iu)}),su=g({name:c(),displayName:c(),description:c(),props:qo,errorHandlingOptions:x(Io),type:W(Ne),sampleData:M(),handshakeConfiguration:x(jr()),renewConfiguration:x(tu),testStrategy:W(cr),outputSchema:x(jr()),aiMetadata:x(iu)}),Mf=g({...ou.shape,actions:U(c(),au),triggers:U(c(),su)}),Uf=g({...ou.shape,actions:xe(),triggers:xe(),suggestedActions:x(F(au)),suggestedTriggers:x(F(su))}),uu=g({projectUsage:xe(),pieceType:W(bt),packageType:W(ar),platformId:x(c()),archiveId:x(c())}),Sk=g({...Mf.shape,...uu.shape}),$k=g({...Uf.shape,...uu.shape}),wk=g({name:c(),version:c()});var Lf=Re(require("path")),jf=Re(require("fs/promises"));var du=require("node:stream");var Gr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{a(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((i,s)=>{o.append(s,i)}),{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 Wr=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new Wo,r=new Ko){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Wo=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Ko=class{static{a(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var mr=class extends Error{constructor(r,n){let o=n.status||500,i=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:i},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=i}static{a(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 cu({error:e,requestBody:t}){return e instanceof mr?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}a(cu,"toFailsafeOutput");var Jo=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(Jo||{});var Kr=class extends Gr{static{a(this,"FetchHttpClient")}constructor(t="",r=new Wr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),i=this.getHeaders(t),s=t.queryParams??{};for(let[V,de]of Object.entries(s))o.append(V,de);let u=o.toString(),p=u?`${n}?${u}`:n,d=t.responseType??"json",m=t.followRedirects??!0,y=t.retries??0,{body:v,extraHeaders:l,isStream:f}=Ff(t.method)?Bf(t.body,i):{body:void 0,extraHeaders:{},isStream:!1},_=Hf({...i,...l}),h=await Vf(async()=>{let V=new AbortController,de=t.timeout&&t.timeout>0?setTimeout(()=>V.abort(),t.timeout):void 0;try{let Pe={method:t.method.toString(),headers:_,body:v,redirect:m?"follow":"manual",signal:V.signal};return f&&(Pe.duplex="half"),r?.dispatcher!==void 0&&(Pe.dispatcher=r.dispatcher),await fetch(p,Pe)}finally{de!==void 0&&clearTimeout(de)}},y),P=m?300:400;if(h.status<200||h.status>=P){let V=await lu(h,d),de=new mr(t.body,{status:h.status,responseBody:V});throw console.error("[HttpClient#(sanitized error message)] Request failed:",de),de}let E=await lu(h,d);return{status:h.status,headers:Zf(h.headers),body:E}}};function Ff(e){return e!=="GET"&&e!=="HEAD"}a(Ff,"acceptsRequestBody");function Bf(e,t){if(Gf(e))return{body:void 0,extraHeaders:{},isStream:!1};if(qf(e)){let n=new du.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}a(Bf,"serializeBody");async function lu(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}a(lu,"parseResponseBody");async function Vf(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await pu(n);continue}return o}catch(o){if(r=o,n<t){await pu(n);continue}throw o}throw r}a(Vf,"sendWithRetries");function pu(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a(pu,"backoff");function Hf(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}a(Hf,"normalizeHeaders");function Zf(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(Zf,"toHttpHeaders");function qf(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}a(qf,"isNodeFormData");function Gf(e){return e==null}a(Gf,"isNil");var mu=new Kr;var Ch=Re(require("fs")),_l=Re(vl());var Dh={"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 Nh(e){let t=e.split(";")[0].trim().toLowerCase();return Dh[t]??""}a(Nh,"contentTypeToExtension");var Mh=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Uh=a((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 Pl({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:i,props:s,extraProps:u,authLocation:p="headers"}){return oe({audience:"human",name:i||"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:T.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:a(async({auth:d})=>({url:T.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
6
|
+
i.e ${Uh(t,d)}/resource or /resource`,required:!0,defaultValue:d?t(d):"",...s?.url??{}})}),"props")}),method:T.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Jo).map(d=>({label:d,value:d}))},...s?.method??{}}),headers:T.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...s?.headers??{}}),queryParams:T.Object({displayName:"Query Parameters",required:!0,...s?.queryParams??{}}),body_type:T.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:T.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:a(async({body_type:d})=>{if(!d)return{};let m=d,y={};switch(m){case"none":break;case"json":y.data=T.Json({displayName:"JSON Body",required:!0,...s?.body??{}});break;case"raw":y.data=T.LongText({displayName:"Raw Body",required:!0});break;case"form_data":y.data=T.Array({displayName:"Form Data",required:!0,properties:{fieldName:T.ShortText({displayName:"Field Name",required:!0}),fieldType:T.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:T.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:T.File({displayName:"File Field Value",required:!1})}});break}return y},"props")}),response_is_binary:T.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:T.Checkbox({displayName:"No Error on Failure",required:!1,...s?.failsafe??{}}),timeout:T.Number({displayName:"Timeout (in seconds)",required:!1,...s?.timeout??{}}),followRedirects:T.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...u},run:a(async d=>{let{method:m,url:y,headers:v,queryParams:l,body:f,body_type:_,failsafe:h,timeout:P,response_is_binary:E,followRedirects:V}=d.propsValue;Ze(m,"Method"),Ze(y,"URL");let de=fe(r)?{}:await r(d.auth,d.propsValue),Pe=y.url,Ce=Pe.startsWith("http://")||Pe.startsWith("https://")?Pe:Mh({baseUrl:t(d.auth),relativePath:Pe}),ee={method:m,url:Ce,headers:{...v??{},...p==="headers"||!fe(p)?de:{}},queryParams:{...p==="queryParams"?de:{},...l??{}},timeout:P?P*1e3:0,followRedirects:V};if(E&&(ee.responseType="arraybuffer"),f)if(_&&_!=="none"){let G=f.data;if(_==="form_data"){let vt=G,ct=new _l.default;for(let{fieldName:j,fieldType:A,textFieldValue:I,fileFieldValue:R}of vt)A==="text"&&!lr(I)?ct.append(j,I):A==="file"&&!lr(R)&&ct.append(j,R.data,{filename:R?.filename});ee.body=ct,ee.headers={...ee.headers,...ct.getHeaders()}}else ee.body=G}else _||(ee.body=f);try{let G=await mu.sendRequest(ee);return await Lh(d.files,G.body,G.status,G.headers,E)}catch(G){if(h)return cu({error:G,requestBody:ee.body});throw G}},"run")})}a(Pl,"createCustomApiCallAction");var Lh=a(async(e,t,r,n,o)=>{let i;if(o&&jh(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],u=Nh(s??"")||"txt",p;t instanceof ArrayBuffer?p=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?p=t:p=Buffer.from(t),i=await e.write({fileName:`output.${u}`,data:p})}else i=t;return{status:r,headers:n,body:i}},"handleBinaryResponse"),jh=a(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Le={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:i,server:s}){switch(e.strategy){case 0:{let u=await t.get("lastPoll");if(fe(u))throw new Error("lastPoll doesn't exist in the store.");let p=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:u,server:s}),d=p.reduce((m,y)=>Math.max(m,y.epochMilliSeconds),u);return await t.put("lastPoll",d),p.filter(m=>m.epochMilliSeconds>u).map(m=>m.data)}case 1:{let u=await t.get("lastItem"),p=await e.items({store:t,auth:r,propsValue:n,lastItemId:u,files:i,server:s}),d=p.findIndex(v=>v.id===u),m=[];fe(u)||d==-1?m=p??[]:m=p?.slice(0,d)??[],fe(o)||(m=m.slice(-o));let y=m?.[0]?.id;return fe(y)||await t.put("lastItem",y),m.map(v=>v.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let s=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;fe(s)?await t.delete("lastItem"):await t.put("lastItem",s);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:i}){let s=[];switch(e.strategy){case 0:{s=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:i});break}case 1:{s=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:i});break}}return Fh(s.map(u=>u.data))}};function Fh(e){return e.length<=5?e:e.slice(0,5)}a(Fh,"getFirstFiveOrAll");var yr="login.microsoftonline.com",El="login.microsoftonline.us",xl="Mail.ReadWrite Mail.Send Calendars.Read offline_access User.Read",Bh="https://graph.microsoft.com/.default",Vh="https://graph.microsoft.us/.default",bl={[yr]:"https://graph.microsoft.com",[El]:"https://graph.microsoft.us"},Tl=T.StaticDropdown({displayName:"Cloud Environment",description:"Select your Microsoft cloud environment.",required:!0,defaultValue:yr,options:{disabled:!1,options:[{label:"Commercial (Global)",value:yr},{label:"US Government (GCC High)",value:El}]}}),Il=T.StaticDropdown({displayName:"Access Mode",description:"Pick the option matching your Grant Type. Use a Delegated option with the Authorization Code grant (acts as the signed-in user). Use an App-only option with the Client Credentials grant (acts as the application \u2014 also set Tenant ID and Mailbox), choosing the one that matches your Cloud Environment.",required:!0,defaultValue:xl,options:{disabled:!1,options:[{label:"Delegated \u2014 Commercial (Global)",value:xl},{label:"App-only \u2014 Commercial (Global)",value:Bh},{label:"App-only \u2014 US Government (GCC High)",value:Vh}]}});function Al(e){return e??yr}a(Al,"resolveCloudHost");function Sl(e){return Al(e.props?.cloud)}a(Sl,"getMicrosoftCloudFromAuth");function an(e){let t=Al(e);return bl[t]??bl[yr]}a(an,"getGraphBaseUrl");var Vp=Re(Bp());function c_(e){let t=Sl(e);return Vp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:an(t)})}a(c_,"createClient");function l_(e){let t=e.props?.mailbox?.trim();return t?`/users/${encodeURIComponent(t)}`:"/me"}a(l_,"mailboxPrefix");var $={createClient:c_,mailboxPrefix:l_};var p_=`
|
|
7
7
|
This connection supports two access modes. Pick the matching **Grant Type** and **Access Mode** below.
|
|
8
8
|
|
|
9
9
|
**Delegated (Authorization Code)** \u2014 acts as the signed-in user. Keep **Access Mode** on the Delegated option, leave **Mailbox** blank, and keep **Tenant ID** as \`common\`. If you use your own Azure app, follow the [Azure app creation guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application), set the **Redirect URI** to {{redirectUrl}} and add these **Microsoft Graph (Delegated) permissions**:
|
|
@@ -18,7 +18,7 @@ This connection supports two access modes. Pick the matching **Grant Type** and
|
|
|
18
18
|
- Mail.Send
|
|
19
19
|
|
|
20
20
|
For app-only, Microsoft grants tenant-wide mailbox access by default \u2014 scope it to specific mailboxes with an [ApplicationAccessPolicy](https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access).
|
|
21
|
-
`,J=Bo.OAuth2({description:Hv,grantType:"both_client_credentials_and_authorization_code",props:{cloud:ll,accessMode:pl,tenant:E.ShortText({displayName:"Tenant ID",description:'Use "common" for the default delegated multi-tenant flow. For app-only (Client Credentials), set this to your Directory (tenant) ID.',required:!0,defaultValue:"common"}),mailbox:E.ShortText({displayName:"Mailbox (App-only)",description:"Email/UPN or user object ID of the mailbox to act on. Required for app-only (Client Credentials). Leave blank for delegated access (acts as the signed-in user).",required:!1})},authUrl:"https://{cloud}/{tenant}/oauth2/v2.0/authorize",tokenUrl:"https://{cloud}/{tenant}/oauth2/v2.0/token",required:!0,scope:["{accessMode}"],prompt:"omit",validate:a(async({auth:e})=>{try{let t=e;return await $.createClient(t).api(`${$.mailboxPrefix(t)}/mailFolders/inbox`).get(),{valid:!0}}catch(t){return{valid:!1,error:Zv(t)}}},"validate")});function Zv(e){if(typeof e=="object"&&e!==null){let t=[];if("statusCode"in e&&e.statusCode&&t.push(`HTTP ${String(e.statusCode)}`),"code"in e&&e.code&&t.push(String(e.code)),"message"in e&&e.message&&t.push(String(e.message)),"body"in e&&e.body){let r=e.body;t.push(typeof r=="string"?r.slice(0,800):JSON.stringify(r).slice(0,800))}if(t.length>0)return t.join(" | ")}return e instanceof Error&&e.message?e.message:"Unknown error while validating the connection."}a(Zv,"describeGraphError");var ot=a(e=>E.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(s=>({label:`${s.subject||"No Subject"}`,value:s.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),"messageIdDropdown"),Op=a(e=>E.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/mailFolders/drafts/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(s=>({label:`${s.subject||"No Subject"}`,value:s.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),"draftMessageIdDropdown"),it=a(e=>E.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/mailFolders`).get()).value.map(s=>({label:s.displayName||s.id||"Unknown",value:s.id||""}))}}catch{return{disabled:!0,options:[]}}},"options")}),"mailFolderIdDropdown");var zp=ne({auth:J,name:"addLabelToEmail",displayName:"Add Label to Email",description:"Adds a category (label) to an email message.",audience:"both",aiMetadata:{description:"Adds one or more Outlook categories (labels) to a specific message, merging them with any categories already present. Use this to tag or classify an email. Idempotent: re-adding the same categories leaves the message unchanged since duplicates are de-duplicated.",idempotent:!0},props:{messageId:ot({displayName:"Email",description:"Select the email message to add the label to.",required:!0}),categories:E.Array({displayName:"Categories",description:"Categories to add to the email.",required:!0})},async run(e){let{messageId:t,categories:r}=e.propsValue,n=$.createClient(e.auth),i=(await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get()).categories||[],s=[...new Set([...i,...r])];return await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).patch({categories:s})}});var Rp=ne({auth:J,name:"createDraftEmail",displayName:"Create Draft Email",description:"Creates a draft email message.",audience:"both",aiMetadata:{description:"Creates a new unsent draft email in the Outlook mailbox with recipients, subject, body, and optional attachments. Use this to stage a message for later review or sending (pair with Send Draft Email). Not idempotent: each call creates a separate draft.",idempotent:!1},props:{recipients:E.Array({displayName:"To Email(s)",required:!0}),ccRecipients:E.Array({displayName:"CC Email(s)",required:!1,defaultValue:[]}),bccRecipients:E.Array({displayName:"BCC Email(s)",required:!1,defaultValue:[]}),subject:E.ShortText({displayName:"Subject",required:!0}),bodyFormat:E.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),body:E.LongText({displayName:"Body",required:!0}),attachments:E.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:E.File({displayName:"File",required:!0}),fileName:E.ShortText({displayName:"File Name",required:!1})}})},async run(e){let t=e.propsValue.recipients,r=e.propsValue.ccRecipients,n=e.propsValue.bccRecipients,o=e.propsValue.attachments,{subject:i,body:s,bodyFormat:u}=e.propsValue,p={subject:i,body:{content:s,contentType:u},toRecipients:t.map(v=>({emailAddress:{address:v}})),ccRecipients:r.map(v=>({emailAddress:{address:v}})),bccRecipients:n.map(v=>({emailAddress:{address:v}})),attachments:o.map(v=>({"@odata.type":"#microsoft.graph.fileAttachment",name:v.fileName||v.file.filename,contentBytes:v.file.base64}))};return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages`).post(p)}});var kp=ne({auth:J,name:"downloadAttachment",displayName:"Download Attachment",description:"Download attachments from a specific email message.",audience:"both",aiMetadata:{description:"Fetches all file attachments from a specific Outlook message (by message ID) and writes them to storage for downstream steps. Use this after locating a message to retrieve its attached files. Requires a valid message ID; idempotent since it only reads.",idempotent:!0},props:{messageId:E.ShortText({displayName:"Message ID",description:"The ID of the email message containing the attachment.",required:!0})},async run(e){let{messageId:t}=e.propsValue,n=await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/attachments`).get(),o=[];for(let i of n.value)i.name&&i.contentBytes&&o.push({...i,file:await e.files.write({fileName:i.name||"test.png",data:Buffer.from(i.contentBytes,"base64")})});return o}});var ji=ze(br());var Dp=ne({auth:J,name:"findEmail",displayName:"Find Email",description:"Searches for emails using full-text search.",audience:"both",aiMetadata:{description:"Searches the Outlook mailbox for messages matching a full-text query (supports field syntax like from:, subject:, hasAttachments:), optionally scoped to one folder and capped by a max-results count. Use this to locate emails and obtain their message IDs for follow-up actions. Idempotent read-only lookup.",idempotent:!0},props:{searchQuery:E.ShortText({displayName:"Search Query",description:'Search terms to find emails (e.g., "from:john@example.com", "subject:urgent", "hasAttachments:true")',required:!0}),folderId:it({displayName:"Folder",description:"Search in a specific folder. Leave empty to search all folders.",required:!1}),top:E.Number({displayName:"Max Results",description:"Maximum number of results to return (1-1000).",required:!1,defaultValue:25})},async run(e){let{searchQuery:t,folderId:r,top:n}=e.propsValue,o=$.createClient(e.auth),i=r?`${$.mailboxPrefix(e.auth)}/mailFolders/${r}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,s=`$search="${t}"`,u=n?`$top=${Math.min(Math.max(n,1),1e3)}`:"$top=25",p=["id","subject","from","toRecipients","receivedDateTime"].join(","),d=[s,u,p].filter(Boolean).join("&"),f=`${i}?${d}`,v={ConsistencyLevel:"eventual",Prefer:'outlook.body-content-type="text"'},y=await o.api(f).headers(v).get(),l=y.value,m=y["@odata.nextLink"];return t&&l.sort((_,h)=>(0,ji.default)(h.receivedDateTime).valueOf()-(0,ji.default)(_.receivedDateTime).valueOf()),{found:l.length>0,result:l,hasMore:!!m,nextPageUrl:m,totalCount:l.length}}});var Cp=ne({auth:J,name:"forwardEmail",displayName:"Forward Email",description:"Forwards an email message.",audience:"both",aiMetadata:{description:"Forwards an existing Outlook message (by message ID) to new recipients, preserving the original body and attachments and prepending an optional comment. Use this to pass an existing email along rather than composing a new one. Not idempotent: each call sends a new forwarded email.",idempotent:!1},props:{messageId:ot({displayName:"Email",description:"Select the email message to forward.",required:!0}),recipients:E.Array({displayName:"To Email(s)",required:!0}),comment:E.LongText({displayName:"Comment",description:"Optional comment to include with the forwarded message.",required:!1})},async run(e){let{messageId:t,comment:r}=e.propsValue,n=e.propsValue.recipients,o=$.createClient(e.auth),i=await o.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get(),s={toRecipients:n.map(p=>({emailAddress:{address:p}})),body:{contentType:"html",content:(r??"")+"<br><br>"+i.body.content},attachments:i.attachments},u=await o.api(`${$.mailboxPrefix(e.auth)}/messages/${t}/forward`).post({message:s});return{success:!0,message:"Email forwarded successfully.",messageId:u.id,...u}}});var Np=ne({auth:J,name:"moveEmailToFolder",displayName:"Move Email to Folder",description:"Moves an email message to a specific folder.",audience:"both",aiMetadata:{description:"Moves a specific Outlook message into a chosen mail folder. Use this to organize, archive, or route an email after processing it. Note: the move assigns a new message ID, so re-running with the original ID will fail once moved.",idempotent:!1},props:{messageId:ot({displayName:"Email",description:"Select the email message to move.",required:!0}),destinationFolderId:it({displayName:"Destination Folder",description:"The folder to move the email to.",required:!0})},async run(e){let{messageId:t,destinationFolderId:r}=e.propsValue;return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/move`).post({destinationId:r})}});var Mp=ne({auth:J,name:"removeLabelFromEmail",displayName:"Remove Label from Email",description:"Removes a category (label) from an email message.",audience:"both",aiMetadata:{description:"Removes one or more Outlook categories (labels) from a specific message, leaving any other categories intact. Use this to untag or reclassify an email. Idempotent: re-running with the same categories yields the same final label set.",idempotent:!0},props:{messageId:ot({displayName:"Email",description:"Select the email message to remove the label from.",required:!0}),categories:E.Array({displayName:"Categories to Remove",description:"Categories to remove from the email.",required:!0})},async run(e){let{messageId:t,categories:r}=e.propsValue,n=$.createClient(e.auth),s=((await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get()).categories||[]).filter(p=>!r.includes(p));return await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).patch({categories:s})}});var Up=ne({auth:J,name:"reply-email",displayName:"Reply to Email",description:"Reply to an outlook email.",audience:"both",aiMetadata:{description:"Replies to an existing Outlook message (identified by message ID), supporting added CC/BCC recipients and attachments. Set the Create Draft flag to stage the reply without sending; otherwise it is sent immediately. Not idempotent when sending: each call creates and dispatches a new reply.",idempotent:!1},props:{messageId:E.Dropdown({auth:J,displayName:"Email",description:"Select the email message to reply to.",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[]};let t=$.createClient(e);try{return{disabled:!1,options:(await t.api(`${$.mailboxPrefix(e)}/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(o=>({label:`${o.subject||"No Subject"} - ${o.from?.emailAddress?.name||o.from?.emailAddress?.address||"Unknown Sender"}`,value:o.id||""}))}}catch{return{disabled:!0,options:[]}}},"options")}),bodyFormat:E.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),replyBody:E.LongText({displayName:"Reply Body",required:!0}),ccRecipients:E.Array({displayName:"CC Recipients",required:!1}),bccRecipients:E.Array({displayName:"BCC Recipients",required:!1}),attachments:E.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:E.File({displayName:"File",required:!0}),fileName:E.ShortText({displayName:"File Name",required:!1})}}),draft:E.Checkbox({displayName:"Create Draft",description:"If enabled, creates draft without sending.",required:!0,defaultValue:!1})},async run(e){let{replyBody:t,bodyFormat:r,messageId:n,draft:o}=e.propsValue,i=e.propsValue.ccRecipients,s=e.propsValue.bccRecipients,u=e.propsValue.attachments,p={body:{content:t,contentType:r},ccRecipients:i.map(f=>({emailAddress:{address:f}})),bccRecipients:s.map(f=>({emailAddress:{address:f}})),attachments:u.map(f=>({"@odata.type":"#microsoft.graph.fileAttachment",name:f.fileName||f.file.filename,contentBytes:f.file.base64}))},d=$.createClient(e.auth);try{let v=(await d.api(`${$.mailboxPrefix(e.auth)}/messages/${n}/createReply`).post({message:p})).id;return o?{success:!0,message:"Draft created successfully.",draftId:v,draftLink:`https://outlook.office.com/mail/drafts/id/${v}`}:(await d.api(`${$.mailboxPrefix(e.auth)}/messages/${v}/send`).post({}),{success:!0,message:"Reply sent successfully.",draftId:v})}catch(f){console.error("Reply Email Error:",f);let v=f instanceof Error?f.message:"Unknown error";throw new Error(v)}}});var Lp=ne({auth:J,name:"sendDraftEmail",displayName:"Send Draft Email",description:"Sends a draft email message.",audience:"both",aiMetadata:{description:"Sends an existing draft email (identified by draft message ID) from the Outlook mailbox. Use this to dispatch a draft previously staged by Create Draft Email or a draft reply. Not idempotent: once sent the draft no longer exists, so re-running with the same ID will fail.",idempotent:!1},props:{messageId:Op({displayName:"Draft Email",description:"Select the draft email message to send.",required:!0})},async run(e){let{messageId:t}=e.propsValue;return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/send`).post({}),{success:!0,message:"Draft sent successfully.",messageId:t}}});var jp=ne({auth:J,name:"send-email",displayName:"Send Email",description:"Sends an email using Microsoft Outlook.",audience:"both",aiMetadata:{description:"Composes and sends a new email from the authenticated Outlook mailbox to the given recipients, with optional CC/BCC and file attachments. Use this to send a fresh message (not a reply or forward). Not idempotent: each call dispatches a new email and saves a copy to Sent Items.",idempotent:!1},props:{recipients:E.Array({displayName:"To Email(s)",required:!0}),ccRecipients:E.Array({displayName:"CC Email(s)",required:!1,defaultValue:[]}),bccRecipients:E.Array({displayName:"BCC Email(s)",required:!1,defaultValue:[]}),subject:E.ShortText({displayName:"Subject",required:!0}),bodyFormat:E.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),body:E.LongText({displayName:"Body",required:!0}),attachments:E.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:E.File({displayName:"File",required:!0}),fileName:E.ShortText({displayName:"File Name",required:!1})}})},async run(e){let t=e.propsValue.recipients,r=e.propsValue.ccRecipients,n=e.propsValue.bccRecipients,o=e.propsValue.attachments,{subject:i,body:s,bodyFormat:u}=e.propsValue,p={subject:i,body:{content:s,contentType:u},toRecipients:t.map(v=>({emailAddress:{address:v}})),ccRecipients:r.map(v=>({emailAddress:{address:v}})),bccRecipients:n.map(v=>({emailAddress:{address:v}})),attachments:o.map(v=>({"@odata.type":"#microsoft.graph.fileAttachment",name:v.fileName||v.file.filename,contentBytes:v.file.base64}))};return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/sendMail`).post({message:p,saveToSentItems:"true"})}});var ro=ze(br());async function Fp(e,t,r,n,o,i){let s=[];for(let u of r){if(i&&u.sender?.emailAddress?.address&&!u.sender.emailAddress.address.toLowerCase().includes(i.toLowerCase()))continue;let p=await e.api(`${t}/messages/${u.id}/attachments`).get();for(let d of p.value){let{contentBytes:f,...v}=d;if(!(o&&d.name&&!d.name.toLowerCase().includes(o.toLowerCase()))&&d.name&&f){let y=await n.write({fileName:d.name,data:Buffer.from(f,"base64")});s.push({file:y,messageId:u.id,messageSubject:u.subject,messageSender:u.sender,messageReceivedDateTime:u.receivedDateTime,parentFolderId:u.parentFolderId,...v})}}}return s}a(Fp,"enrichAttachments");var Bp=St({auth:J,name:"newAttachment",displayName:"New Attachment",description:"Triggers when a new email containing one or more attachments arrives.",aiMetadata:{description:"Fires once per attachment when a new email carrying one or more file attachments arrives, optionally scoped to a folder, sender, or attachment-name filter. Each fire represents a single attachment from a newly received message."},props:{folderId:it({displayName:"Folder",description:"Monitor attachments in a specific folder. Leave empty to monitor all folders.",required:!1}),sender:E.ShortText({displayName:"From (Sender Email)",description:"Filter emails from a specific sender (optional). Leave empty to for all senders.",required:!1}),attachmentNameFilter:E.ShortText({displayName:"Attachment Name Filter",description:"Filter attachments by name (contains). Leave empty to include all attachments.",required:!1})},sampleData:{},type:"POLLING",async onEnable(e){await e.store.put("lastPoll",Date.now())},async onDisable(e){},async test(e){let{folderId:t,attachmentNameFilter:r,sender:n}=e.propsValue,o=$.createClient(e.auth),i=t?`${$.mailboxPrefix(e.auth)}/mailFolders/${t}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,s=await o.api(`${i}?$filter=hasAttachments eq true`).top(10).get();return(await Fp(o,$.mailboxPrefix(e.auth),s.value,e.files,r,n)).map(d=>({epochMilliSeconds:(0,ro.default)(d.messageReceivedDateTime).valueOf(),data:d})).map(d=>d.data)},async run(e){let t=await e.store.get("lastPoll");if(he(t))throw new Error("lastPoll doesn't exist in the store.");let{folderId:r,attachmentNameFilter:n,sender:o}=e.propsValue,i=$.createClient(e.auth),s=r?`${$.mailboxPrefix(e.auth)}/mailFolders/${r}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,u=await i.api(`${s}?$filter=receivedDateTime gt ${(0,ro.default)(t).toISOString()} and hasAttachments eq true`).orderby("receivedDateTime desc").get(),p=[];for(;u.value.length>0&&(p.push(...u.value),u["@odata.nextLink"]);)u=await i.api(u["@odata.nextLink"]).get();let f=(await Fp(i,$.mailboxPrefix(e.auth),p,e.files,n,o)).map(y=>({epochMilliSeconds:(0,ro.default)(y.messageReceivedDateTime).valueOf(),data:y})),v=f.reduce((y,l)=>Math.max(y,l.epochMilliSeconds),t);return await e.store.put("lastPoll",v),f.filter(y=>y.epochMilliSeconds>t).map(y=>y.data)}});var Fi=ze(br());var no={strategy:0,items:a(async({auth:e,lastFetchEpochMS:t,propsValue:r})=>{let n=$.createClient(e),o=[],i=r.folderId,s=t===0?"$top=10":`$filter=createdDateTime gt ${(0,Fi.default)(t).toISOString()}`,u=await n.api(`${$.mailboxPrefix(e)}/mailFolders/${i}/messages?${s}`).orderby("createdDateTime desc").get();if(t===0)for(let p of u.value)o.push(p);else for(;u.value.length>0;){for(let p of u.value)o.push(p);if(u["@odata.nextLink"])u=await n.api(u["@odata.nextLink"]).get();else break}return o.map(p=>({epochMilliSeconds:(0,Fi.default)(p.createdDateTime).valueOf(),data:p}))},"items")},Vp=St({auth:J,name:"newEmailInFolder",displayName:"New Email in Folder",description:"Triggers when a new email is delivered into the specified folder.",aiMetadata:{description:"Fires when a new message appears in the chosen Outlook mail folder. Each fire represents one new email added to that folder."},props:{folderId:it({displayName:"Folder",description:"",required:!0})},sampleData:{},type:"POLLING",async onEnable(e){await Ue.onEnable(no,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Ue.onDisable(no,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Ue.test(no,e)},async run(e){return await Ue.poll(no,e)}});var Bi=ze(br());var oo={strategy:0,items:a(async({auth:e,lastFetchEpochMS:t,propsValue:r})=>{let n=$.createClient(e),o=[],i=t===0?"$top=10":`$filter=receivedDateTime gt ${(0,Bi.default)(t).toISOString()}`,s=await n.api(`${$.mailboxPrefix(e)}/mailFolders/inbox/messages?${i}`).orderby("receivedDateTime desc").get();if(t===0)for(let p of s.value)o.push(p);else for(;s.value.length>0;){for(let p of s.value)o.push(p);if(s["@odata.nextLink"])s=await n.api(s["@odata.nextLink"]).get();else break}let u=o;return r?.sender&&(u=u.filter(p=>{let d=p.from?.emailAddress?.address?.toLowerCase(),f=r.sender?.toLowerCase();return d===f})),r?.recipient&&(u=u.filter(p=>p.toRecipients?.some(f=>{let v=f.emailAddress?.address?.toLowerCase(),y=r.recipient?.toLowerCase();return v===y}))),u.map(p=>({epochMilliSeconds:(0,Bi.default)(p.receivedDateTime).valueOf(),data:p}))},"items")},Hp=St({auth:J,name:"newEmail",displayName:"New Email",description:"Triggers when a new email is received in the inbox.",aiMetadata:{description:"Fires when a new message arrives in the mailbox Inbox, optionally narrowed to a specific sender and/or recipient address. Each fire represents one newly received email."},props:{sender:E.ShortText({displayName:"From (Sender Email)",description:"Filter emails from a specific sender (optional). Leave empty to for all senders.",required:!1}),recipient:E.ShortText({displayName:"To (Recipient Email)",description:"Filter emails to a specific recipient (optional). Leave empty to for all recipients.",required:!1})},sampleData:{},type:"POLLING",async onEnable(e){await Ue.onEnable(oo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Ue.onDisable(oo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Ue.test(oo,e)},async run(e){return await Ue.poll(oo,e)}});var Zp=ne({auth:J,name:"request_approval_in_mail",displayName:"Request Approval in Email",description:"Send approval request email and then wait until the email is approved or disapproved",audience:"both",aiMetadata:{description:"Sends an email with a single link to a confirmation page where the recipient chooses Approve or Disapprove, then pauses the flow until they respond, resuming with the decision. Use this as a human-in-the-loop approval gate before proceeding. Not idempotent: each call sends a new email and creates a new pending waitpoint.",idempotent:!1},props:{recipients:E.ShortText({displayName:"To Email Address",description:"The email address of the recipient who will receive the approval request.",required:!0}),subject:E.ShortText({displayName:"Subject",description:"The subject of the approval request email.",required:!0}),body:E.LongText({displayName:"Body",description:"The main content of the email. You can include details about the approval request here in the html format or plain text.",required:!0})},async run(e){if(e.executionType==="BEGIN")try{let t=e.auth.access_token,r=e.propsValue.recipients,{subject:n,body:o}=e.propsValue;He(t,"token"),He(r,"recipients"),He(n,"subject"),He(o,"body");let i=await e.run.createWaitpoint({type:"WEBHOOK"}),s=`${i.resumeUrl}/confirm`,u=`
|
|
21
|
+
`,J=Zo.OAuth2({description:p_,grantType:"both_client_credentials_and_authorization_code",props:{cloud:Tl,accessMode:Il,tenant:T.ShortText({displayName:"Tenant ID",description:'Use "common" for the default delegated multi-tenant flow. For app-only (Client Credentials), set this to your Directory (tenant) ID.',required:!0,defaultValue:"common"}),mailbox:T.ShortText({displayName:"Mailbox (App-only)",description:"Email/UPN or user object ID of the mailbox to act on. Required for app-only (Client Credentials). Leave blank for delegated access (acts as the signed-in user).",required:!1})},authUrl:"https://{cloud}/{tenant}/oauth2/v2.0/authorize",tokenUrl:"https://{cloud}/{tenant}/oauth2/v2.0/token",required:!0,scope:["{accessMode}"],prompt:"omit",validate:a(async({auth:e})=>{try{let t=e;return await $.createClient(t).api(`${$.mailboxPrefix(t)}/mailFolders/inbox`).get(),{valid:!0}}catch(t){return{valid:!1,error:d_(t)}}},"validate")});function d_(e){if(typeof e=="object"&&e!==null){let t=[];if("statusCode"in e&&e.statusCode&&t.push(`HTTP ${String(e.statusCode)}`),"code"in e&&e.code&&t.push(String(e.code)),"message"in e&&e.message&&t.push(String(e.message)),"body"in e&&e.body){let r=e.body;t.push(typeof r=="string"?r.slice(0,800):JSON.stringify(r).slice(0,800))}if(t.length>0)return t.join(" | ")}return e instanceof Error&&e.message?e.message:"Unknown error while validating the connection."}a(d_,"describeGraphError");var st=a(e=>T.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(s=>({label:`${s.subject||"No Subject"}`,value:s.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),"messageIdDropdown"),Hp=a(e=>T.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/mailFolders/drafts/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(s=>({label:`${s.subject||"No Subject"}`,value:s.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),"draftMessageIdDropdown"),ut=a(e=>T.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/mailFolders`).get()).value.map(s=>({label:s.displayName||s.id||"Unknown",value:s.id||""}))}}catch{return{disabled:!0,options:[]}}},"options")}),"mailFolderIdDropdown");var Zp=oe({auth:J,name:"addLabelToEmail",displayName:"Add Label to Email",description:"Adds a category (label) to an email message.",audience:"both",aiMetadata:{description:"Adds one or more Outlook categories (labels) to a specific message, merging them with any categories already present. Use this to tag or classify an email. Idempotent: re-adding the same categories leaves the message unchanged since duplicates are de-duplicated.",idempotent:!0},props:{messageId:st({displayName:"Email",description:"Select the email message to add the label to.",required:!0}),categories:T.Array({displayName:"Categories",description:"Categories to add to the email.",required:!0})},async run(e){let{messageId:t,categories:r}=e.propsValue,n=$.createClient(e.auth),i=(await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get()).categories||[],s=[...new Set([...i,...r])];return await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).patch({categories:s})}});var qp=oe({auth:J,name:"createDraftEmail",displayName:"Create Draft Email",description:"Creates a draft email message.",audience:"both",aiMetadata:{description:"Creates a new unsent draft email in the Outlook mailbox with recipients, subject, body, and optional attachments. Use this to stage a message for later review or sending (pair with Send Draft Email). Not idempotent: each call creates a separate draft.",idempotent:!1},props:{recipients:T.Array({displayName:"To Email(s)",required:!0}),ccRecipients:T.Array({displayName:"CC Email(s)",required:!1,defaultValue:[]}),bccRecipients:T.Array({displayName:"BCC Email(s)",required:!1,defaultValue:[]}),subject:T.ShortText({displayName:"Subject",required:!0}),bodyFormat:T.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),body:T.LongText({displayName:"Body",required:!0}),attachments:T.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:T.File({displayName:"File",required:!0}),fileName:T.ShortText({displayName:"File Name",required:!1})}})},async run(e){let t=e.propsValue.recipients,r=e.propsValue.ccRecipients,n=e.propsValue.bccRecipients,o=e.propsValue.attachments,{subject:i,body:s,bodyFormat:u}=e.propsValue,p={subject:i,body:{content:s,contentType:u},toRecipients:t.map(y=>({emailAddress:{address:y}})),ccRecipients:r.map(y=>({emailAddress:{address:y}})),bccRecipients:n.map(y=>({emailAddress:{address:y}})),attachments:o.map(y=>({"@odata.type":"#microsoft.graph.fileAttachment",name:y.fileName||y.file.filename,contentBytes:y.file.base64}))};return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages`).post(p)}});var Gp=oe({auth:J,name:"downloadAttachment",displayName:"Download Attachment",description:"Download attachments from a specific email message.",audience:"both",aiMetadata:{description:"Fetches all file attachments from a specific Outlook message (by message ID) and writes them to storage for downstream steps. Use this after locating a message to retrieve its attached files. Requires a valid message ID; idempotent since it only reads.",idempotent:!0},props:{messageId:T.ShortText({displayName:"Message ID",description:"The ID of the email message containing the attachment.",required:!0})},async run(e){let{messageId:t}=e.propsValue,n=await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/attachments`).get(),o=[];for(let i of n.value)i.name&&i.contentBytes&&o.push({...i,file:await e.files.write({fileName:i.name||"test.png",data:Buffer.from(i.contentBytes,"base64")})});return o}});var Vi=Re(Tr());var Wp=oe({auth:J,name:"findEmail",displayName:"Find Email",description:"Searches for emails using full-text search.",audience:"both",aiMetadata:{description:"Searches the Outlook mailbox for messages matching a full-text query (supports field syntax like from:, subject:, hasAttachments:), optionally scoped to one folder and capped by a max-results count. Use this to locate emails and obtain their message IDs for follow-up actions. Idempotent read-only lookup.",idempotent:!0},props:{searchQuery:T.ShortText({displayName:"Search Query",description:'Search terms to find emails (e.g., "from:john@example.com", "subject:urgent", "hasAttachments:true")',required:!0}),folderId:ut({displayName:"Folder",description:"Search in a specific folder. Leave empty to search all folders.",required:!1}),top:T.Number({displayName:"Max Results",description:"Maximum number of results to return (1-1000).",required:!1,defaultValue:25})},async run(e){let{searchQuery:t,folderId:r,top:n}=e.propsValue,o=$.createClient(e.auth),i=r?`${$.mailboxPrefix(e.auth)}/mailFolders/${r}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,s=`$search="${t}"`,u=n?`$top=${Math.min(Math.max(n,1),1e3)}`:"$top=25",p=["id","subject","from","toRecipients","receivedDateTime"].join(","),d=[s,u,p].filter(Boolean).join("&"),m=`${i}?${d}`,y={ConsistencyLevel:"eventual",Prefer:'outlook.body-content-type="text"'},v=await o.api(m).headers(y).get(),l=v.value,f=v["@odata.nextLink"];return t&&l.sort((_,h)=>(0,Vi.default)(h.receivedDateTime).valueOf()-(0,Vi.default)(_.receivedDateTime).valueOf()),{found:l.length>0,result:l,hasMore:!!f,nextPageUrl:f,totalCount:l.length}}});var Kp=oe({auth:J,name:"forwardEmail",displayName:"Forward Email",description:"Forwards an email message.",audience:"both",aiMetadata:{description:"Forwards an existing Outlook message (by message ID) to new recipients, preserving the original body and attachments and prepending an optional comment. Use this to pass an existing email along rather than composing a new one. Not idempotent: each call sends a new forwarded email.",idempotent:!1},props:{messageId:st({displayName:"Email",description:"Select the email message to forward.",required:!0}),recipients:T.Array({displayName:"To Email(s)",required:!0}),comment:T.LongText({displayName:"Comment",description:"Optional comment to include with the forwarded message.",required:!1})},async run(e){let{messageId:t,comment:r}=e.propsValue,n=e.propsValue.recipients,o=$.createClient(e.auth),i=await o.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get(),s={toRecipients:n.map(p=>({emailAddress:{address:p}})),body:{contentType:"html",content:(r??"")+"<br><br>"+i.body.content},attachments:i.attachments},u=await o.api(`${$.mailboxPrefix(e.auth)}/messages/${t}/forward`).post({message:s});return{success:!0,message:"Email forwarded successfully.",messageId:u.id,...u}}});var Jp=oe({auth:J,name:"moveEmailToFolder",displayName:"Move Email to Folder",description:"Moves an email message to a specific folder.",audience:"both",aiMetadata:{description:"Moves a specific Outlook message into a chosen mail folder. Use this to organize, archive, or route an email after processing it. Note: the move assigns a new message ID, so re-running with the original ID will fail once moved.",idempotent:!1},props:{messageId:st({displayName:"Email",description:"Select the email message to move.",required:!0}),destinationFolderId:ut({displayName:"Destination Folder",description:"The folder to move the email to.",required:!0})},async run(e){let{messageId:t,destinationFolderId:r}=e.propsValue;return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/move`).post({destinationId:r})}});var Xp=oe({auth:J,name:"removeLabelFromEmail",displayName:"Remove Label from Email",description:"Removes a category (label) from an email message.",audience:"both",aiMetadata:{description:"Removes one or more Outlook categories (labels) from a specific message, leaving any other categories intact. Use this to untag or reclassify an email. Idempotent: re-running with the same categories yields the same final label set.",idempotent:!0},props:{messageId:st({displayName:"Email",description:"Select the email message to remove the label from.",required:!0}),categories:T.Array({displayName:"Categories to Remove",description:"Categories to remove from the email.",required:!0})},async run(e){let{messageId:t,categories:r}=e.propsValue,n=$.createClient(e.auth),s=((await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get()).categories||[]).filter(p=>!r.includes(p));return await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).patch({categories:s})}});var Yp=oe({auth:J,name:"reply-email",displayName:"Reply to Email",description:"Reply to an outlook email.",audience:"both",aiMetadata:{description:"Replies to an existing Outlook message (identified by message ID), supporting added CC/BCC recipients and attachments. Set the Create Draft flag to stage the reply without sending; otherwise it is sent immediately. Not idempotent when sending: each call creates and dispatches a new reply.",idempotent:!1},props:{messageId:T.Dropdown({auth:J,displayName:"Email",description:"Select the email message to reply to.",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[]};let t=$.createClient(e);try{return{disabled:!1,options:(await t.api(`${$.mailboxPrefix(e)}/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(o=>({label:`${o.subject||"No Subject"} - ${o.from?.emailAddress?.name||o.from?.emailAddress?.address||"Unknown Sender"}`,value:o.id||""}))}}catch{return{disabled:!0,options:[]}}},"options")}),bodyFormat:T.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),replyBody:T.LongText({displayName:"Reply Body",required:!0}),ccRecipients:T.Array({displayName:"CC Recipients",required:!1}),bccRecipients:T.Array({displayName:"BCC Recipients",required:!1}),attachments:T.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:T.File({displayName:"File",required:!0}),fileName:T.ShortText({displayName:"File Name",required:!1})}}),draft:T.Checkbox({displayName:"Create Draft",description:"If enabled, creates draft without sending.",required:!0,defaultValue:!1})},async run(e){let{replyBody:t,bodyFormat:r,messageId:n,draft:o}=e.propsValue,i=e.propsValue.ccRecipients,s=e.propsValue.bccRecipients,u=e.propsValue.attachments,p={body:{content:t,contentType:r},ccRecipients:i.map(m=>({emailAddress:{address:m}})),bccRecipients:s.map(m=>({emailAddress:{address:m}})),attachments:u.map(m=>({"@odata.type":"#microsoft.graph.fileAttachment",name:m.fileName||m.file.filename,contentBytes:m.file.base64}))},d=$.createClient(e.auth);try{let y=(await d.api(`${$.mailboxPrefix(e.auth)}/messages/${n}/createReply`).post({message:p})).id;return o?{success:!0,message:"Draft created successfully.",draftId:y,draftLink:`https://outlook.office.com/mail/drafts/id/${y}`}:(await d.api(`${$.mailboxPrefix(e.auth)}/messages/${y}/send`).post({}),{success:!0,message:"Reply sent successfully.",draftId:y})}catch(m){console.error("Reply Email Error:",m);let y=m instanceof Error?m.message:"Unknown error";throw new Error(y)}}});var Qp=oe({auth:J,name:"sendDraftEmail",displayName:"Send Draft Email",description:"Sends a draft email message.",audience:"both",aiMetadata:{description:"Sends an existing draft email (identified by draft message ID) from the Outlook mailbox. Use this to dispatch a draft previously staged by Create Draft Email or a draft reply. Not idempotent: once sent the draft no longer exists, so re-running with the same ID will fail.",idempotent:!1},props:{messageId:Hp({displayName:"Draft Email",description:"Select the draft email message to send.",required:!0})},async run(e){let{messageId:t}=e.propsValue;return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/send`).post({}),{success:!0,message:"Draft sent successfully.",messageId:t}}});var ed=oe({auth:J,name:"send-email",displayName:"Send Email",description:"Sends an email using Microsoft Outlook.",audience:"both",aiMetadata:{description:"Composes and sends a new email from the authenticated Outlook mailbox to the given recipients, with optional CC/BCC and file attachments. Use this to send a fresh message (not a reply or forward). Not idempotent: each call dispatches a new email and saves a copy to Sent Items.",idempotent:!1},props:{recipients:T.Array({displayName:"To Email(s)",required:!0}),ccRecipients:T.Array({displayName:"CC Email(s)",required:!1,defaultValue:[]}),bccRecipients:T.Array({displayName:"BCC Email(s)",required:!1,defaultValue:[]}),subject:T.ShortText({displayName:"Subject",required:!0}),bodyFormat:T.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),body:T.LongText({displayName:"Body",required:!0}),attachments:T.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:T.File({displayName:"File",required:!0}),fileName:T.ShortText({displayName:"File Name",required:!1})}})},async run(e){let t=e.propsValue.recipients,r=e.propsValue.ccRecipients,n=e.propsValue.bccRecipients,o=e.propsValue.attachments,{subject:i,body:s,bodyFormat:u}=e.propsValue,p={subject:i,body:{content:s,contentType:u},toRecipients:t.map(y=>({emailAddress:{address:y}})),ccRecipients:r.map(y=>({emailAddress:{address:y}})),bccRecipients:n.map(y=>({emailAddress:{address:y}})),attachments:o.map(y=>({"@odata.type":"#microsoft.graph.fileAttachment",name:y.fileName||y.file.filename,contentBytes:y.file.base64}))};return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/sendMail`).post({message:p,saveToSentItems:"true"})}});var io=Re(Tr());async function td(e,t,r,n,o,i){let s=[];for(let u of r){if(i&&u.sender?.emailAddress?.address&&!u.sender.emailAddress.address.toLowerCase().includes(i.toLowerCase()))continue;let p=await e.api(`${t}/messages/${u.id}/attachments`).get();for(let d of p.value){let{contentBytes:m,...y}=d;if(!(o&&d.name&&!d.name.toLowerCase().includes(o.toLowerCase()))&&d.name&&m){let v=await n.write({fileName:d.name,data:Buffer.from(m,"base64")});s.push({file:v,messageId:u.id,messageSubject:u.subject,messageSender:u.sender,messageReceivedDateTime:u.receivedDateTime,parentFolderId:u.parentFolderId,...y})}}}return s}a(td,"enrichAttachments");var rd=$t({auth:J,name:"newAttachment",displayName:"New Attachment",description:"Triggers when a new email containing one or more attachments arrives.",aiMetadata:{description:"Fires once per attachment when a new email carrying one or more file attachments arrives, optionally scoped to a folder, sender, or attachment-name filter. Each fire represents a single attachment from a newly received message."},props:{folderId:ut({displayName:"Folder",description:"Monitor attachments in a specific folder. Leave empty to monitor all folders.",required:!1}),sender:T.ShortText({displayName:"From (Sender Email)",description:"Filter emails from a specific sender (optional). Leave empty to for all senders.",required:!1}),attachmentNameFilter:T.ShortText({displayName:"Attachment Name Filter",description:"Filter attachments by name (contains). Leave empty to include all attachments.",required:!1})},sampleData:{},type:"POLLING",async onEnable(e){await e.store.put("lastPoll",Date.now())},async onDisable(e){},async test(e){let{folderId:t,attachmentNameFilter:r,sender:n}=e.propsValue,o=$.createClient(e.auth),i=t?`${$.mailboxPrefix(e.auth)}/mailFolders/${t}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,s=await o.api(`${i}?$filter=hasAttachments eq true`).top(10).get();return(await td(o,$.mailboxPrefix(e.auth),s.value,e.files,r,n)).map(d=>({epochMilliSeconds:(0,io.default)(d.messageReceivedDateTime).valueOf(),data:d})).map(d=>d.data)},async run(e){let t=await e.store.get("lastPoll");if(fe(t))throw new Error("lastPoll doesn't exist in the store.");let{folderId:r,attachmentNameFilter:n,sender:o}=e.propsValue,i=$.createClient(e.auth),s=r?`${$.mailboxPrefix(e.auth)}/mailFolders/${r}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,u=await i.api(`${s}?$filter=receivedDateTime gt ${(0,io.default)(t).toISOString()} and hasAttachments eq true`).orderby("receivedDateTime desc").get(),p=[];for(;u.value.length>0&&(p.push(...u.value),u["@odata.nextLink"]);)u=await i.api(u["@odata.nextLink"]).get();let m=(await td(i,$.mailboxPrefix(e.auth),p,e.files,n,o)).map(v=>({epochMilliSeconds:(0,io.default)(v.messageReceivedDateTime).valueOf(),data:v})),y=m.reduce((v,l)=>Math.max(v,l.epochMilliSeconds),t);return await e.store.put("lastPoll",y),m.filter(v=>v.epochMilliSeconds>t).map(v=>v.data)}});var Hi=Re(Tr());var ao={strategy:0,items:a(async({auth:e,lastFetchEpochMS:t,propsValue:r})=>{let n=$.createClient(e),o=[],i=r.folderId,s=t===0?"$top=10":`$filter=createdDateTime gt ${(0,Hi.default)(t).toISOString()}`,u=await n.api(`${$.mailboxPrefix(e)}/mailFolders/${i}/messages?${s}`).orderby("createdDateTime desc").get();if(t===0)for(let p of u.value)o.push(p);else for(;u.value.length>0;){for(let p of u.value)o.push(p);if(u["@odata.nextLink"])u=await n.api(u["@odata.nextLink"]).get();else break}return o.map(p=>({epochMilliSeconds:(0,Hi.default)(p.createdDateTime).valueOf(),data:p}))},"items")},nd=$t({auth:J,name:"newEmailInFolder",displayName:"New Email in Folder",description:"Triggers when a new email is delivered into the specified folder.",aiMetadata:{description:"Fires when a new message appears in the chosen Outlook mail folder. Each fire represents one new email added to that folder."},props:{folderId:ut({displayName:"Folder",description:"",required:!0})},sampleData:{},type:"POLLING",async onEnable(e){await Le.onEnable(ao,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Le.onDisable(ao,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Le.test(ao,e)},async run(e){return await Le.poll(ao,e)}});var Zi=Re(Tr());var so={strategy:0,items:a(async({auth:e,lastFetchEpochMS:t,propsValue:r})=>{let n=$.createClient(e),o=[],i=t===0?"$top=10":`$filter=receivedDateTime gt ${(0,Zi.default)(t).toISOString()}`,s=await n.api(`${$.mailboxPrefix(e)}/mailFolders/inbox/messages?${i}`).orderby("receivedDateTime desc").get();if(t===0)for(let p of s.value)o.push(p);else for(;s.value.length>0;){for(let p of s.value)o.push(p);if(s["@odata.nextLink"])s=await n.api(s["@odata.nextLink"]).get();else break}let u=o;return r?.sender&&(u=u.filter(p=>{let d=p.from?.emailAddress?.address?.toLowerCase(),m=r.sender?.toLowerCase();return d===m})),r?.recipient&&(u=u.filter(p=>p.toRecipients?.some(m=>{let y=m.emailAddress?.address?.toLowerCase(),v=r.recipient?.toLowerCase();return y===v}))),u.map(p=>({epochMilliSeconds:(0,Zi.default)(p.receivedDateTime).valueOf(),data:p}))},"items")},od=$t({auth:J,name:"newEmail",displayName:"New Email",description:"Triggers when a new email is received in the inbox.",aiMetadata:{description:"Fires when a new message arrives in the mailbox Inbox, optionally narrowed to a specific sender and/or recipient address. Each fire represents one newly received email."},props:{sender:T.ShortText({displayName:"From (Sender Email)",description:"Filter emails from a specific sender (optional). Leave empty to for all senders.",required:!1}),recipient:T.ShortText({displayName:"To (Recipient Email)",description:"Filter emails to a specific recipient (optional). Leave empty to for all recipients.",required:!1})},sampleData:{},type:"POLLING",async onEnable(e){await Le.onEnable(so,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Le.onDisable(so,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Le.test(so,e)},async run(e){return await Le.poll(so,e)}});var id=oe({auth:J,name:"request_approval_in_mail",displayName:"Request Approval in Email",description:"Send approval request email and then wait until the email is approved or disapproved",audience:"both",aiMetadata:{description:"Sends an email with a single link to a confirmation page where the recipient chooses Approve or Disapprove, then pauses the flow until they respond, resuming with the decision. Use this as a human-in-the-loop approval gate before proceeding. Not idempotent: each call sends a new email and creates a new pending waitpoint.",idempotent:!1},props:{recipients:T.ShortText({displayName:"To Email Address",description:"The email address of the recipient who will receive the approval request.",required:!0}),subject:T.ShortText({displayName:"Subject",description:"The subject of the approval request email.",required:!0}),body:T.LongText({displayName:"Body",description:"The main content of the email. You can include details about the approval request here in the html format or plain text.",required:!0})},async run(e){if(e.executionType==="BEGIN")try{let t=e.auth.access_token,r=e.propsValue.recipients,{subject:n,body:o}=e.propsValue;Ze(t,"token"),Ze(r,"recipients"),Ze(n,"subject"),Ze(o,"body");let i=await e.run.createWaitpoint({type:"WEBHOOK"}),s=`${i.resumeUrl}/confirm`,u=`
|
|
22
22
|
<div>
|
|
23
23
|
<p>${o}</p>
|
|
24
24
|
<br />
|
|
@@ -26,7 +26,7 @@ For app-only, Microsoft grants tenant-wide mailbox access by default \u2014 scop
|
|
|
26
26
|
<a href="${s}" style="display: inline-block; padding: 10px 20px; background-color: #6e41e2; color: white; text-decoration: none; border-radius: 4px;">Review & Respond</a>
|
|
27
27
|
</p>
|
|
28
28
|
</div>
|
|
29
|
-
`,p=$.createClient(e.auth),d={subject:n,body:{content:u,contentType:"html"},toRecipients:[{emailAddress:{address:r}}]},
|
|
29
|
+
`,p=$.createClient(e.auth),d={subject:n,body:{content:u,contentType:"html"},toRecipients:[{emailAddress:{address:r}}]},m=await p.api(`${$.mailboxPrefix(e.auth)}/sendMail`).post({message:d,saveToSentItems:!0});return e.run.waitForWaitpoint(i.id),{approved:!1}}catch(t){throw console.error("[RequestApprovalEmail] Error during BEGIN execution:",t),t}else return{approved:e.resumePayload.queryParams.action==="approve"}}});var f_=nu({displayName:"Microsoft Outlook",auth:J,minimumSupportedRelease:"0.87.0",logoUrl:"https://cdn.activepieces.com/pieces/microsoft-outlook.png",categories:["PRODUCTIVITY"],authors:["lucaslimasouza","kishanprmr","sanket-a11y"],actions:[ed,Gp,Yp,qp,Zp,Xp,id,Jp,Qp,Kp,Wp,Pl({auth:J,baseUrl:a(e=>{let t=e.props?.cloud;return an(t)+"/v1.0/"},"baseUrl"),authMapping:a(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[od,nd,rd]});0&&(module.exports={microsoftOutlook});
|
|
30
30
|
/*! Bundled license information:
|
|
31
31
|
|
|
32
32
|
mime-types/index.js:
|