@activepieces/piece-microsoft-outlook 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +6 -6
package/src/index.js CHANGED
@@ -1,9 +1,9 @@
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:
1
+ "use strict";var md=Object.create;var qt=Object.defineProperty;var gd=Object.getOwnPropertyDescriptor;var hd=Object.getOwnPropertyNames;var yd=Object.getPrototypeOf,vd=Object.prototype.hasOwnProperty;var i=(e,t)=>qt(e,"name",{value:t,configurable:!0});var _d=(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}},co=(e,t)=>{for(var r in t)qt(e,r,{get:t[r],enumerable:!0})},Ki=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of hd(t))!vd.call(e,o)&&o!==r&&qt(e,o,{get:()=>t[o],enumerable:!(n=gd(t,o))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?md(yd(e)):{},Ki(t||!e||!e.__esModule?qt(r,"default",{value:e,enumerable:!0}):r,e)),ie=e=>Ki(qt({},"__esModule",{value:!0}),e);var Ps=b((_s,qr)=>{(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"),a="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${a})?$`,"i")};function p(l,m){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let P=0,h=-1,x=(l.match(u.zoneIndex)||[])[0],E,H;for(x&&(x=x.substring(1),l=l.replace(/%.+$/,""));(h=l.indexOf(":",h+1))>=0;)P++;if(l.substr(0,2)==="::"&&P--,l.substr(-2,2)==="::"&&P--,P>m)return null;for(H=m-P,E=":";H--;)E+="0:";return l=l.replace("::",E),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),m=(function(){let de=l.split(":"),xe=[];for(let Ie=0;Ie<de.length;Ie++)xe.push(parseInt(de[Ie],16));return xe})(),{parts:m,zoneId:x}}i(p,"expandIPv6");function d(l,m,P,h){if(l.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,E;for(;h>0;){if(E=P-h,E<0&&(E=0),l[x]>>E!==m[x]>>E)return!1;h-=P,x+=1}return!0}i(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)}i(f,"parseIntAuto");function _(l,m){for(;l.length<m;)l=`0${l}`;return l}i(_,"padPart");let y={};y.IPv4=(function(){function l(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let P,h;for(P=0;P<m.length;P++)if(h=m[P],!(0<=h&&h<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return i(l,"IPv4"),l.prototype.SpecialRanges={unspecified:[[new l([0,0,0,0]),8]],broadcast:[[new l([255,255,255,255]),32]],multicast:[[new l([224,0,0,0]),4]],linkLocal:[[new l([169,254,0,0]),16]],loopback:[[new l([127,0,0,0]),8]],carrierGradeNat:[[new l([100,64,0,0]),10]],private:[[new l([10,0,0,0]),8],[new l([172,16,0,0]),12],[new l([192,168,0,0]),16]],reserved:[[new l([192,0,0,0]),24],[new l([192,0,2,0]),24],[new l([192,88,99,0]),24],[new l([198,18,0,0]),15],[new l([198,51,100,0]),24],[new l([203,0,113,0]),24],[new l([240,0,0,0]),4]],as112:[[new l([192,175,48,0]),24],[new l([192,31,196,0]),24]],amt:[[new l([192,52,193,0]),24]]},l.prototype.kind=function(){return"ipv4"},l.prototype.match=function(m,P){let h;if(P===void 0&&(h=m,m=h[0],P=h[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return d(this.octets,m.octets,8,P)},l.prototype.prefixLengthFromSubnetMask=function(){let m=0,P=!1,h={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,E,H;for(x=3;x>=0;x-=1)if(E=this.octets[x],E in h){if(H=h[E],P&&H!==0)return null;H!==8&&(P=!0),m+=H}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),P=m[0].toByteArray(),h=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],E=0;for(;E<4;)x.push(parseInt(P[E],10)|parseInt(h[E],10)^255),E++;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,P,h,x,E;try{for(m=this.parseCIDR(l),h=m[0].toByteArray(),E=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],P=0;P<4;)x.push(parseInt(h[P],10)&parseInt(E[P],10)),P++;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 P=parseInt(m[2]);if(P>=0&&P<=32){let h=[this.parse(m[1]),P];return Object.defineProperty(h,"toString",{value:i(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,P,h;if(m=l.match(r.fourOctet))return(function(){let x=m.slice(1,6),E=[];for(let H=0;H<x.length;H++)P=x[H],E.push(f(P));return E})();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=[],E;for(E=0;E<=24;E+=8)x.push(h>>E&255);return x})().reverse()}else return(m=l.match(r.twoOctet))?(function(){let x=m.slice(1,4),E=[];if(h=f(x[1]),h>16777215||h<0)throw new Error("ipaddr: address outside defined range");return E.push(f(x[0])),E.push(h>>16&255),E.push(h>>8&255),E.push(h&255),E})():(m=l.match(r.threeOctet))?(function(){let x=m.slice(1,5),E=[];if(h=f(x[2]),h>65535||h<0)throw new Error("ipaddr: address outside defined range");return E.push(f(x[0])),E.push(f(x[1])),E.push(h>>8&255),E.push(h&255),E})():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],P=0,h=Math.floor(l/8);for(;P<h;)m[P]=255,P++;return h<4&&(m[h]=Math.pow(2,l%8)-1<<8-l%8),new this(m)},y.IPv6=(function(){function l(m,P){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");P&&(this.zoneId=P)}return i(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(m,P){let h;if(P===void 0&&(h=m,m=h[0],P=h[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return d(this.parts,m.parts,16,P)},l.prototype.prefixLengthFromSubnetMask=function(){let m=0,P=!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,E;for(let H=7;H>=0;H-=1)if(x=this.parts[H],x in h){if(E=h[x],P&&E!==0)return null;E!==16&&(P=!0),m+=E}else return null;return 128-m},l.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let m,P=[],h=this.parts;for(let x=0;x<h.length;x++)m=h[x],P.push(m>>8),P.push(m&255);return P},l.prototype.toFixedLengthString=function(){let m=(function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(_(this.parts[x].toString(16),4));return h}).call(this).join(":"),P="";return this.zoneId&&(P=`%${this.zoneId}`),m+P},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),P=m[0],h=m[1];return new y.IPv4([P>>8,P&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(":"),P="";return this.zoneId&&(P=`%${this.zoneId}`),m+P},l.prototype.toRFC5952String=function(){let m=/((^|:)(0(:|$)){2,})/g,P=this.toNormalizedString(),h=0,x=-1,E;for(;E=m.exec(P);)E[0].length>x&&(h=E.index,x=E[0].length);return x<0?P:`${P.substring(0,h)}::${P.substring(h+x)}`},l.prototype.toString=function(){return this.toRFC5952String()},l})(),y.IPv6.broadcastAddressFromCIDR=function(l){try{let m=this.parseCIDR(l),P=m[0].toByteArray(),h=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],E=0;for(;E<16;)x.push(parseInt(P[E],10)|parseInt(h[E],10)^255),E++;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,P,h,x,E;try{for(m=this.parseCIDR(l),h=m[0].toByteArray(),E=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],P=0;P<16;)x.push(parseInt(h[P],10)&parseInt(E[P],10)),P++;return new this(x)}catch(H){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${H})`)}},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,P,h;if((P=l.match(/^(.+)\/(\d+)$/))&&(m=parseInt(P[2]),m>=0&&m<=128))return h=[this.parse(P[1]),m],Object.defineProperty(h,"toString",{value:i(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,P,h,x,E,H;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))&&(H=h[6]||"",m=h[1],h[1].endsWith("::")||(m=m.slice(0,-1)),m=p(m+H,6),m.parts)){for(E=[parseInt(h[2]),parseInt(h[3]),parseInt(h[4]),parseInt(h[5])],P=0;P<E.length;P++)if(x=E[P],!(0<=x&&x<=255))return null;return m.parts.push(E[0]<<8|E[1]),m.parts.push(E[2]<<8|E[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],P=0,h=Math.floor(l/8);for(;P<h;)m[P]=255,P++;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,P){let h,x,E,H;P==null&&(P="unicast");for(x in m)if(Object.prototype.hasOwnProperty.call(m,x)){for(E=m[x],E[0]&&!(E[0]instanceof Array)&&(E=[E]),h=0;h<E.length;h++)if(H=E[h],l.kind()===H[0].kind()&&l.match.apply(l,H))return x}return P},typeof qr<"u"&&qr.exports?qr.exports=y:e.ipaddr=y})(_s)});var Tu=b((Pk,Eu)=>{var bu=require("stream").Stream,og=require("util");Eu.exports=ke;function ke(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(ke,"DelayedStream");og.inherits(ke,bu);ke.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ke.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});ke.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ke.prototype.resume=function(){this._released||this.release(),this.source.resume()};ke.prototype.pause=function(){this.source.pause()};ke.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ke.prototype.pipe=function(){var e=bu.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 $u=b((bk,Su)=>{var ig=require("util"),Iu=require("stream").Stream,Au=Tu();Su.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}i(pe,"CombinedStream");ig.inherits(pe,Iu);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 Au)){var r=Au.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 Iu.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 Ou=b((Tk,wu)=>{"use strict";wu.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 Cu=b(Te=>{"use strict";var Xr=Ou(),ag=require("path").extname,Ru=/^\s*([^;\s]*)(?:;|\s|$)/,sg=/^text\//i;Te.charset=zu;Te.charsets={lookup:zu};Te.contentType=ug;Te.extension=cg;Te.extensions=Object.create(null);Te.lookup=lg;Te.types=Object.create(null);pg(Te.extensions,Te.types);function zu(e){if(!e||typeof e!="string")return!1;var t=Ru.exec(e),r=t&&Xr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&sg.test(t[1])?"UTF-8":!1}i(zu,"charset");function ug(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}i(ug,"contentType");function cg(e){if(!e||typeof e!="string")return!1;var t=Ru.exec(e),r=t&&Te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(cg,"extension");function lg(e){if(!e||typeof e!="string")return!1;var t=ag("x."+e).toLowerCase().substr(1);return t&&Te.types[t]||!1}i(lg,"lookup");function pg(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Xr).forEach(i(function(o){var a=Xr[o],s=a.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(Xr[t[p]].source),f=r.indexOf(a.source);if(t[p]!=="application/octet-stream"&&(d>f||d===f&&t[p].substr(0,12)==="application/"))continue}t[p]=o}}},"forEachMimeType"))}i(pg,"populateMaps")});var ku=b((Sk,Du)=>{Du.exports=dg;function dg(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(dg,"defer")});var ei=b((wk,Mu)=>{var Nu=ku();Mu.exports=fg;function fg(e){var t=!1;return Nu(function(){t=!0}),i(function(n,o){t?e(n,o):Nu(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(fg,"async")});var ti=b((Rk,Uu)=>{Uu.exports=mg;function mg(e){Object.keys(e.jobs).forEach(gg.bind(e)),e.jobs={}}i(mg,"abort");function gg(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(gg,"clean")});var ri=b((Ck,ju)=>{var Lu=ei(),hg=ti();ju.exports=yg;function yg(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=vg(t,o,e[o],function(a,s){o in r.jobs&&(delete r.jobs[o],a?hg(r):r.results[o]=s,n(a,r.results))})}i(yg,"iterate");function vg(e,t,r,n){var o;return e.length==2?o=e(r,Lu(n)):o=e(r,t,Lu(n)),o}i(vg,"runJob")});var ni=b((kk,Fu)=>{Fu.exports=_g;function _g(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,a){return t(e[o],e[a])}),n}i(_g,"state")});var oi=b((Mk,Bu)=>{var Pg=ti(),xg=ei();Bu.exports=bg;function bg(e){Object.keys(this.jobs).length&&(this.index=this.size,Pg(this),xg(e)(null,this.results))}i(bg,"terminator")});var Hu=b((Lk,Vu)=>{var Eg=ri(),Tg=ni(),Ag=oi();Vu.exports=Ig;function Ig(e,t,r){for(var n=Tg(e);n.index<(n.keyedList||e).length;)Eg(e,t,n,function(o,a){if(o){r(o,a);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Ag.bind(n,r)}i(Ig,"parallel")});var ii=b((Fk,Yr)=>{var Zu=ri(),Sg=ni(),$g=oi();Yr.exports=wg;Yr.exports.ascending=qu;Yr.exports.descending=Og;function wg(e,t,r,n){var o=Sg(e,r);return Zu(e,t,o,i(function a(s,u){if(s){n(s,u);return}if(o.index++,o.index<(o.keyedList||e).length){Zu(e,t,o,a);return}n(null,o.results)},"iteratorHandler")),$g.bind(o,n)}i(wg,"serialOrdered");function qu(e,t){return e<t?-1:e>t?1:0}i(qu,"ascending");function Og(e,t){return-1*qu(e,t)}i(Og,"descending")});var Wu=b((Vk,Gu)=>{var Rg=ii();Gu.exports=zg;function zg(e,t,r){return Rg(e,t,null,r)}i(zg,"serial")});var Ju=b((Zk,Ku)=>{Ku.exports={parallel:Hu(),serial:Wu(),serialOrdered:ii()}});var ai=b((qk,Xu)=>{"use strict";Xu.exports=Object});var Qu=b((Gk,Yu)=>{"use strict";Yu.exports=Error});var tc=b((Wk,ec)=>{"use strict";ec.exports=EvalError});var nc=b((Kk,rc)=>{"use strict";rc.exports=RangeError});var ic=b((Jk,oc)=>{"use strict";oc.exports=ReferenceError});var sc=b((Xk,ac)=>{"use strict";ac.exports=SyntaxError});var Qr=b((Yk,uc)=>{"use strict";uc.exports=TypeError});var lc=b((Qk,cc)=>{"use strict";cc.exports=URIError});var dc=b((eN,pc)=>{"use strict";pc.exports=Math.abs});var mc=b((tN,fc)=>{"use strict";fc.exports=Math.floor});var hc=b((rN,gc)=>{"use strict";gc.exports=Math.max});var vc=b((nN,yc)=>{"use strict";yc.exports=Math.min});var Pc=b((oN,_c)=>{"use strict";_c.exports=Math.pow});var bc=b((iN,xc)=>{"use strict";xc.exports=Math.round});var Tc=b((aN,Ec)=>{"use strict";Ec.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Ic=b((uN,Ac)=>{"use strict";var Cg=Tc();Ac.exports=i(function(t){return Cg(t)||t===0?t:t<0?-1:1},"sign")});var $c=b((lN,Sc)=>{"use strict";Sc.exports=Object.getOwnPropertyDescriptor});var si=b((pN,wc)=>{"use strict";var en=$c();if(en)try{en([],"length")}catch{en=null}wc.exports=en});var Rc=b((dN,Oc)=>{"use strict";var tn=Object.defineProperty||!1;if(tn)try{tn({},"a",{value:1})}catch{tn=!1}Oc.exports=tn});var ui=b((fN,zc)=>{"use strict";zc.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var a 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 kc=b((gN,Dc)=>{"use strict";var Cc=typeof Symbol<"u"&&Symbol,Dg=ui();Dc.exports=i(function(){return typeof Cc!="function"||typeof Symbol!="function"||typeof Cc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Dg()},"hasNativeSymbols")});var ci=b((yN,Nc)=>{"use strict";Nc.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var li=b((vN,Mc)=>{"use strict";var kg=ai();Mc.exports=kg.getPrototypeOf||null});var jc=b((_N,Lc)=>{"use strict";var Ng="Function.prototype.bind called on incompatible ",Mg=Object.prototype.toString,Ug=Math.max,Lg="[object Function]",Uc=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var a=0;a<r.length;a+=1)n[a+t.length]=r[a];return n},"concatty"),jg=i(function(t,r){for(var n=[],o=r||0,a=0;o<t.length;o+=1,a+=1)n[a]=t[o];return n},"slicy"),Fg=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Lc.exports=i(function(t){var r=this;if(typeof r!="function"||Mg.apply(r)!==Lg)throw new TypeError(Ng+r);for(var n=jg(arguments,1),o,a=i(function(){if(this instanceof o){var f=r.apply(this,Uc(n,arguments));return Object(f)===f?f:this}return r.apply(t,Uc(n,arguments))},"binder"),s=Ug(0,r.length-n.length),u=[],p=0;p<s;p++)u[p]="$"+p;if(o=Function("binder","return function ("+Fg(u,",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var d=i(function(){},"Empty");d.prototype=r.prototype,o.prototype=new d,d.prototype=null}return o},"bind")});var wt=b((xN,Fc)=>{"use strict";var Bg=jc();Fc.exports=Function.prototype.bind||Bg});var rn=b((bN,Bc)=>{"use strict";Bc.exports=Function.prototype.call});var pi=b((EN,Vc)=>{"use strict";Vc.exports=Function.prototype.apply});var Zc=b((TN,Hc)=>{"use strict";Hc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Gc=b((AN,qc)=>{"use strict";var Vg=wt(),Hg=pi(),Zg=rn(),qg=Zc();qc.exports=qg||Vg.call(Zg,Hg)});var Kc=b((IN,Wc)=>{"use strict";var Gg=wt(),Wg=Qr(),Kg=rn(),Jg=Gc();Wc.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Wg("a function is required");return Jg(Gg,Kg,t)},"callBindBasic")});var tl=b(($N,el)=>{"use strict";var Xg=Kc(),Jc=si(),Yc;try{Yc=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var di=!!Yc&&Jc&&Jc(Object.prototype,"__proto__"),Qc=Object,Xc=Qc.getPrototypeOf;el.exports=di&&typeof di.get=="function"?Xg([di.get]):typeof Xc=="function"?i(function(t){return Xc(t==null?t:Qc(t))},"getDunder"):!1});var al=b((ON,il)=>{"use strict";var rl=ci(),nl=li(),ol=tl();il.exports=rl?i(function(t){return rl(t)},"getProto"):nl?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return nl(t)},"getProto"):ol?i(function(t){return ol(t)},"getProto"):null});var fi=b((zN,sl)=>{"use strict";var Yg=Function.prototype.call,Qg=Object.prototype.hasOwnProperty,eh=wt();sl.exports=eh.call(Yg,Qg)});var ml=b((CN,fl)=>{"use strict";var K,th=ai(),rh=Qu(),nh=tc(),oh=nc(),ih=ic(),Ct=sc(),zt=Qr(),ah=lc(),sh=dc(),uh=mc(),ch=hc(),lh=vc(),ph=Pc(),dh=bc(),fh=Ic(),pl=Function,mi=i(function(e){try{return pl('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),mr=si(),mh=Rc(),gi=i(function(){throw new zt},"throwTypeError"),gh=mr?(function(){try{return arguments.callee,gi}catch{try{return mr(arguments,"callee").get}catch{return gi}}})():gi,Ot=kc()(),_e=al(),hh=li(),yh=ci(),dl=pi(),gr=rn(),Rt={},vh=typeof Uint8Array>"u"||!_e?K:_e(Uint8Array),gt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":Ot&&_e?_e([][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%":rh,"%eval%":eval,"%EvalError%":nh,"%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%":pl,"%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&&_e?_e(_e([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ot||!_e?K:_e(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":th,"%Object.getOwnPropertyDescriptor%":mr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":oh,"%ReferenceError%":ih,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ot||!_e?K:_e(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ot&&_e?_e(""[Symbol.iterator]()):K,"%Symbol%":Ot?Symbol:K,"%SyntaxError%":Ct,"%ThrowTypeError%":gh,"%TypedArray%":vh,"%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%":ah,"%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%":dl,"%Object.defineProperty%":mh,"%Object.getPrototypeOf%":hh,"%Math.abs%":sh,"%Math.floor%":uh,"%Math.max%":ch,"%Math.min%":lh,"%Math.pow%":ph,"%Math.round%":dh,"%Math.sign%":fh,"%Reflect.getPrototypeOf%":yh};if(_e)try{null.error}catch(e){ul=_e(_e(e)),gt["%Error.prototype%"]=ul}var ul,_h=i(function e(t){var r;if(t==="%AsyncFunction%")r=mi("async function () {}");else if(t==="%GeneratorFunction%")r=mi("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=mi("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&_e&&(r=_e(o.prototype))}return gt[t]=r,r},"doEval"),cl={__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(),nn=fi(),Ph=hr.call(gr,Array.prototype.concat),xh=hr.call(dl,Array.prototype.splice),ll=hr.call(gr,String.prototype.replace),on=hr.call(gr,String.prototype.slice),bh=hr.call(gr,RegExp.prototype.exec),Eh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Th=/\\(\\)?/g,Ah=i(function(t){var r=on(t,0,1),n=on(t,-1);if(r==="%"&&n!=="%")throw new Ct("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ct("invalid intrinsic syntax, expected opening `%`");var o=[];return ll(t,Eh,function(a,s,u,p){o[o.length]=u?ll(p,Th,"$1"):s||a}),o},"stringToPath"),Ih=i(function(t,r){var n=t,o;if(nn(cl,n)&&(o=cl[n],n="%"+o[0]+"%"),nn(gt,n)){var a=gt[n];if(a===Rt&&(a=_h(n)),typeof a>"u"&&!r)throw new zt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new Ct("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");fl.exports=i(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(bh(/^%?[^%]*%?$/,t)===null)throw new Ct("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ah(t),o=n.length>0?n[0]:"",a=Ih("%"+o+"%",r),s=a.name,u=a.value,p=!1,d=a.alias;d&&(o=d[0],xh(n,Ph([0,1],d)));for(var f=1,_=!0;f<n.length;f+=1){var y=n[f],l=on(y,0,1),m=on(y,-1);if((l==='"'||l==="'"||l==="`"||m==='"'||m==="'"||m==="`")&&l!==m)throw new Ct("property names with quotes must have matching quotes");if((y==="constructor"||!_)&&(p=!0),o+="."+y,s="%"+o+"%",nn(gt,s))u=gt[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(mr&&f+1>=n.length){var P=mr(u,y);_=!!P,_&&"get"in P&&!("originalValue"in P.get)?u=P.get:u=u[y]}else _=nn(u,y),u=u[y];_&&!p&&(gt[s]=u)}}return u},"GetIntrinsic")});var hl=b((kN,gl)=>{"use strict";var Sh=ui();gl.exports=i(function(){return Sh()&&!!Symbol.toStringTag},"hasToStringTagShams")});var _l=b((MN,vl)=>{"use strict";var $h=ml(),yl=$h("%Object.defineProperty%",!0),wh=hl()(),Oh=fi(),Rh=Qr(),an=wh?Symbol.toStringTag:null;vl.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new Rh("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");an&&(n||!Oh(t,an))&&(yl?yl(t,an,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[an]=r)},"setToStringTag")});var xl=b((LN,Pl)=>{"use strict";var zh=Function.prototype.call,Ch=Object.prototype.hasOwnProperty,Dh=wt();Pl.exports=Dh.call(zh,Ch)});var El=b((jN,bl)=>{"use strict";bl.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Il=b((FN,Al)=>{"use strict";var _i=$u(),kh=require("util"),hi=require("path"),Nh=require("http"),Mh=require("https"),Uh=require("url").parse,Lh=require("fs"),jh=require("stream").Stream,Fh=require("crypto"),yi=Cu(),Bh=Ju(),Vh=_l(),at=xl(),vi=El();function Tl(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Tl,"escapeHeaderParam");function Q(e){if(!(this instanceof Q))return new Q(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],_i.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(Q,"FormData");kh.inherits(Q,_i);Q.LINE_BREAK=`\r
2
+ `;Q.DEFAULT_CONTENT_TYPE="application/octet-stream";Q.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=_i.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),a=this._multiPartFooter();n(o),n(t),n(a),this._trackLength(o,t,r)};Q.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+Q.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&at(t,"httpVersion"))&&!(t instanceof jh))&&(r.knownLength||this._valuesToMeasure.push(t))};Q.prototype._lengthRetriever=function(e,t){at(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Lh.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):at(e,"httpVersion")?t(null,Number(e.headers["content-length"])):at(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Q.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),a="",s={"Content-Disposition":["form-data",'name="'+Tl(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&vi(s,r.header);var u;for(var p in s)if(at(s,p)){if(u=s[p],u==null)continue;Array.isArray(u)||(u=[u]),u.length&&(a+=p+": "+u.join("; ")+Q.LINE_BREAK)}return"--"+this.getBoundary()+Q.LINE_BREAK+a+Q.LINE_BREAK};Q.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=hi.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=hi.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&at(e,"httpVersion")&&(r=hi.basename(e.client._httpMessage.path||"")),r)return'filename="'+Tl(r)+'"'};Q.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=yi.lookup(e.name)),!r&&e&&e.path&&(r=yi.lookup(e.path)),!r&&e&&e.readable&&at(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=yi.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Q.DEFAULT_CONTENT_TYPE),r};Q.prototype._multiPartFooter=function(){return function(e){var t=Q.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Q.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Q.LINE_BREAK};Q.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)at(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Q.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Q.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Q.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(Q.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Q.prototype._generateBoundary=function(){this._boundary="--------------------------"+Fh.randomBytes(12).toString("hex")};Q.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};Q.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Q.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Bh.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};Q.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Uh(e),n=vi({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=vi(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Mh.request(n):r=Nh.request(n),this.getLength(function(a,s){if(a&&a!=="Unknown stream"){this._error(a);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),t){var u,p=i(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};Q.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Q.prototype.toString=function(){return"[object FormData]"};Vh(Q.prototype,"FormData");Al.exports=Q});var ue={};co(ue,{__addDisposableResource:()=>ap,__assign:()=>un,__asyncDelegator:()=>Yl,__asyncGenerator:()=>Xl,__asyncValues:()=>Ql,__await:()=>Dt,__awaiter:()=>Zl,__classPrivateFieldGet:()=>np,__classPrivateFieldIn:()=>ip,__classPrivateFieldSet:()=>op,__createBinding:()=>ln,__decorate:()=>Ul,__disposeResources:()=>sp,__esDecorate:()=>jl,__exportStar:()=>Gl,__extends:()=>Nl,__generator:()=>ql,__importDefault:()=>rp,__importStar:()=>tp,__makeTemplateObject:()=>ep,__metadata:()=>Hl,__param:()=>Ll,__propKey:()=>Bl,__read:()=>bi,__rest:()=>Ml,__rewriteRelativeImportExtension:()=>up,__runInitializers:()=>Fl,__setFunctionName:()=>Vl,__spread:()=>Wl,__spreadArray:()=>Jl,__spreadArrays:()=>Kl,__values:()=>cn,default:()=>ry});function Nl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Pi(e,t);function r(){this.constructor=e}i(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Ml(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 Ul(e,t,r,n){var o=arguments.length,a=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(s=e[u])&&(a=(o<3?s(a):o>3?s(t,r,a):s(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function Ll(e,t){return function(r,n){t(r,n,e)}}function jl(e,t,r,n,o,a){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}i(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):{}),_,y=!1,l=r.length-1;l>=0;l--){var m={};for(var P in n)m[P]=P==="access"?{}:n[P];for(var P in n.access)m.access[P]=n.access[P];m.addInitializer=function(x){if(y)throw new TypeError("Cannot add initializers after decoration has completed");a.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");(_=s(h.get))&&(f.get=_),(_=s(h.set))&&(f.set=_),(_=s(h.init))&&o.unshift(_)}else(_=s(h))&&(u==="field"?o.unshift(_):f[p]=_)}d&&Object.defineProperty(d,n.name,f),y=!0}function Fl(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 Bl(e){return typeof e=="symbol"?e:"".concat(e)}function Vl(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 Hl(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Zl(e,t,r,n){function o(a){return a instanceof r?a:new r(function(s){s(a)})}return i(o,"adopt"),new(r||(r=Promise))(function(a,s){function u(f){try{d(n.next(f))}catch(_){s(_)}}i(u,"fulfilled");function p(f){try{d(n.throw(f))}catch(_){s(_)}}i(p,"rejected");function d(f){f.done?a(f.value):o(f.value).then(u,p)}i(d,"step"),d((n=n.apply(e,t||[])).next())})}function ql(e,t){var r={label:0,sent:i(function(){if(a[0]&1)throw a[1];return a[1]},"sent"),trys:[],ops:[]},n,o,a,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&&(a=d[0]&2?o.return:d[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,d[1])).done)return a;switch(o=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=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(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){r.label=d[1];break}if(d[0]===6&&r.label<a[1]){r.label=a[1],a=d;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(d);break}a[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(f){d=[6,f],o=0}finally{n=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Gl(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&ln(t,e,r)}function cn(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:i(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 bi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.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 a}function Wl(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(bi(arguments[t]));return e}function Kl(){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 a=arguments[t],s=0,u=a.length;s<u;s++,o++)n[o]=a[s];return n}function Jl(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Dt(e){return this instanceof Dt?(this.v=e,this):new Dt(e)}function Xl(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];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,_)}}function u(l,m){n[l]&&(o[l]=function(P){return new Promise(function(h,x){a.push([l,P,h,x])>1||p(l,P)})},m&&(o[l]=m(o[l])))}function p(l,m){try{d(n[l](m))}catch(P){y(a[0][3],P)}}function d(l){l.value instanceof Dt?Promise.resolve(l.value.v).then(f,_):y(a[0][2],l)}function f(l){p("next",l)}function _(l){p("throw",l)}function y(l,m){l(m),a.shift(),a.length&&p(a[0][0],a[0][1])}}function Yl(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,a){t[o]=e[o]?function(s){return(r=!r)?{value:Dt(e[o](s)),done:!1}:a?a(s):s}:a}}function Ql(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 cn=="function"?cn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(s){return new Promise(function(u,p){s=e[a](s),o(u,p,s.done,s.value)})}}function o(a,s,u,p){Promise.resolve(p).then(function(d){a({value:d,done:u})},s)}}function ep(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function tp(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=xi(e),n=0;n<r.length;n++)r[n]!=="default"&&ln(t,e,r[n]);return ey(t,e),t}function rp(e){return e&&e.__esModule?e:{default:e}}function np(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 op(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 ip(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 ap(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=i(function(){try{o.call(this)}catch(a){return Promise.reject(a)}},"dispose")),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function sp(e){function t(a){e.error=e.hasError?new ty(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}i(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 a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).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 i(o,"next"),o()}function up(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,a,s){return n?t?".jsx":".js":o&&(!a||!s)?r:o+a+"."+s.toLowerCase()+"js"}):e}var Pi,un,ln,ey,xi,ty,ry,ce=_d(()=>{Pi=i(function(e,t){return Pi=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])},Pi(e,t)},"extendStatics");i(Nl,"__extends");un=i(function(){return un=Object.assign||i(function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},"__assign"),un.apply(this,arguments)},"__assign");i(Ml,"__rest");i(Ul,"__decorate");i(Ll,"__param");i(jl,"__esDecorate");i(Fl,"__runInitializers");i(Bl,"__propKey");i(Vl,"__setFunctionName");i(Hl,"__metadata");i(Zl,"__awaiter");i(ql,"__generator");ln=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:i(function(){return t[r]},"get")}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]});i(Gl,"__exportStar");i(cn,"__values");i(bi,"__read");i(Wl,"__spread");i(Kl,"__spreadArrays");i(Jl,"__spreadArray");i(Dt,"__await");i(Xl,"__asyncGenerator");i(Yl,"__asyncDelegator");i(Ql,"__asyncValues");i(ep,"__makeTemplateObject");ey=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},xi=i(function(e){return xi=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},xi(e)},"ownKeys");i(tp,"__importStar");i(rp,"__importDefault");i(np,"__classPrivateFieldGet");i(op,"__classPrivateFieldSet");i(ip,"__classPrivateFieldIn");i(ap,"__addDisposableResource");ty=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};i(sp,"__disposeResources");i(up,"__rewriteRelativeImportExtension");ry={__extends:Nl,__assign:un,__rest:Ml,__decorate:Ul,__param:Ll,__esDecorate:jl,__runInitializers:Fl,__propKey:Bl,__setFunctionName:Vl,__metadata:Hl,__awaiter:Zl,__generator:ql,__createBinding:ln,__exportStar:Gl,__values:cn,__read:bi,__spread:Wl,__spreadArrays:Kl,__spreadArray:Jl,__await:Dt,__asyncGenerator:Xl,__asyncDelegator:Yl,__asyncValues:Ql,__makeTemplateObject:ep,__importStar:tp,__importDefault:rp,__classPrivateFieldGet:np,__classPrivateFieldSet:op,__classPrivateFieldIn:ip,__addDisposableResource:ap,__disposeResources:sp,__rewriteRelativeImportExtension:up}});var vr=b(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.RequestMethod=void 0;var cp;(function(e){e.GET="GET",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"})(cp||(pn.RequestMethod=cp={}))});var lp=b(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.BatchRequestContent=void 0;var kt=(ce(),ie(ue)),Ei=vr(),ny=(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,a=t;o<a.length;o++){var s=a[o];this.addRequest(s)}}}return i(e,"BatchRequestContent"),e.validateDependencies=function(t){var r=i(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=i(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 _=p.value[1];if(_.dependsOn===void 0||_.dependsOn.length!==1||_.dependsOn[0]!==f.value[1].id)return!1;f=p,p=u.next()}return!0},"isSerial"),o=i(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 _=d.dependsOn[0];if(_!==d.id&&s.has(_))f=_;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 a=new Error("Empty requests map, Please provide at least one request.");throw a.name="Empty Requests Error",a}return r(t)||n(t)||o(t)},e.getRequestData=function(t){return kt.__awaiter(this,void 0,void 0,function(){var r,n,o,a;return kt.__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===Ei.RequestMethod.PATCH||t.method===Ei.RequestMethod.POST||t.method===Ei.RequestMethod.PUT?(a=r,[4,e.getRequestBody(t)]):[3,2];case 1:a.body=s.sent(),s.label=2;case 2:return[2,r]}})})},e.getRequestBody=function(t){return kt.__awaiter(this,void 0,void 0,function(){var r,n,o,a,s,u,p,d;return kt.__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 a=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(_){u.addEventListener("load",function(){var y=u.result,l=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$"),m=l.exec(y);_(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 a=o.value[1].dependsOn;if(typeof a<"u"){var s=a.indexOf(t);s!==-1&&a.splice(s,1),a.length===0&&delete o.value[1].dependsOn}o=n.next()}return r},e.prototype.getContent=function(){return kt.__awaiter(this,void 0,void 0,function(){var t,r,n,o,u,u,a,s,u;return kt.__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})();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_=`
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]:(a=o.value[1],[4,e.getRequestData(a.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(a.id,", For request having body, Content-type header should be mentioned")),u.name="Invalid Content-type header",u;return s.id=a.id,a.dependsOn!==void 0&&a.dependsOn.length>0&&(s.dependsOn=a.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 a=this.requests.entries(),s=void 0,u=a.next();!u.done&&u.value[1].id!==t;)s=u,u=a.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})();dn.BatchRequestContent=ny});var pp=b(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.BatchResponseContent=void 0;var oy=(ce(),ie(ue)),iy=(function(){function e(t){this.responses=new Map,this.update(t)}return i(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 oy.__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})();fn.BatchResponseContent=iy});var Ti=b(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.GRAPH_URLS=st.GRAPH_BASE_URL=st.GRAPH_API_VERSION=void 0;st.GRAPH_API_VERSION="v1.0";st.GRAPH_BASE_URL="https://graph.microsoft.com/";st.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 We=b(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.GraphClientError=void 0;var ay=(ce(),ie(ue)),sy=(function(e){ay.__extends(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return i(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=sy});var gn=b(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.isCustomHost=Re.isGraphURL=Re.serializeContent=Re.urlJoin=Re.oDataQueryNames=void 0;var uy=Ti(),cy=We();Re.oDataQueryNames=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"];var ly=i(function(e){var t=i(function(a){return a.replace(/\/+$/,"")},"removePostSlash"),r=i(function(a){return a.replace(/^\/+/,"")},"removePreSlash"),n=i(function(a,s){return[t(a),r(s)].join("/")},"joiner"),o=Array.prototype.slice.call(e);return o.reduce(n)},"urlJoin");Re.urlJoin=ly;var py=i(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");Re.serializeContent=py;var dy=i(function(e){return dp(e)},"isGraphURL");Re.isGraphURL=dy;var fy=i(function(e,t){return t.forEach(function(r){return my(r)}),dp(e,t)},"isCustomHost");Re.isCustomHost=fy;var dp=i(function(e,t){if(t===void 0&&(t=uy.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"),my=i(function(e){if(e.indexOf("/")!==-1)throw new cy.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 ut=b(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.MiddlewareControl=void 0;var gy=(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],a=o.constructor;this.middlewareOptions.set(a,o)}}return i(e,"MiddlewareControl"),e.prototype.getMiddlewareOptions=function(t){return this.middlewareOptions.get(t)},e.prototype.setMiddlewareOptions=function(t,r){this.middlewareOptions.set(t,r)},e})();hn.MiddlewareControl=gy});var Nt=b(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.cloneRequestWithNewUrl=ze.appendRequestHeader=ze.setRequestHeader=ze.getRequestHeader=ze.generateUUID=void 0;var fp=(ce(),ie(ue)),hy=i(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");ze.generateUUID=hy;var yy=i(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,a=0,s=o.length;a<s;a++)if(o[a][0]===r){n=o[a][1];break}}else t.headers[r]!==void 0&&(n=t.headers[r]);return n},"getRequestHeader");ze.getRequestHeader=yy;var vy=i(function(e,t,r,n){var o,a;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,(a={},a[r]=n,a))},"setRequestHeader");ze.setRequestHeader=vy;var _y=i(function(e,t,r,n){var o,a;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=(a={},a[r]=n,a):t.headers[r]===void 0?t.headers[r]=n:t.headers[r]+=", ".concat(n))},"appendRequestHeader");ze.appendRequestHeader=_y;var Py=i(function(e,t){return fp.__awaiter(void 0,void 0,void 0,function(){var r,n,o,a,s,u,p,d,f,_,y,l,m;return fp.__generator(this,function(P){switch(P.label){case 0:return t.headers.get("Content-Type")?[4,t.blob()]:[3,2];case 1:return n=P.sent(),[3,4];case 2:return[4,Promise.resolve(void 0)];case 3:n=P.sent(),P.label=4;case 4:return r=n,o=t.method,a=t.headers,s=t.referrer,u=t.referrerPolicy,p=t.mode,d=t.credentials,f=t.cache,_=t.redirect,y=t.integrity,l=t.keepalive,m=t.signal,[2,new Request(e,{method:o,headers:a,body:r,referrer:s,referrerPolicy:u,mode:p,credentials:d,cache:f,redirect:_,integrity:y,keepalive:l,signal:m})]}})})},"cloneRequestWithNewUrl");ze.cloneRequestWithNewUrl=Py});var Ai=b(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.AuthenticationHandlerOptions=void 0;var xy=(function(){function e(t,r){this.authenticationProvider=t,this.authenticationProviderOptions=r}return i(e,"AuthenticationHandlerOptions"),e})();yn.AuthenticationHandlerOptions=xy});var Ut=b(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.TelemetryHandlerOptions=Mt.FeatureUsageFlag=void 0;var mp=ut(),Ii;(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"})(Ii||(Mt.FeatureUsageFlag=Ii={}));var by=(function(){function e(){this.featureUsage=Ii.NONE}return i(e,"TelemetryHandlerOptions"),e.updateFeatureUsageFlag=function(t,r){var n;t.middlewareControl instanceof mp.MiddlewareControl?n=t.middlewareControl.getMiddlewareOptions(e):t.middlewareControl=new mp.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=by});var _n=b(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.AuthenticationHandler=void 0;var gp=(ce(),ie(ue)),hp=gn(),Ey=ut(),Ty=Nt(),Ay=Ai(),yp=Ut(),Iy=(function(){function e(t){this.authenticationProvider=t}return i(e,"AuthenticationHandler"),e.prototype.execute=function(t){return gp.__awaiter(this,void 0,void 0,function(){var r,n,o,a,s,u;return gp.__generator(this,function(p){switch(p.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,hp.isGraphURL)(r)||t.customHosts&&(0,hp.isCustomHost)(r,t.customHosts)?(n=void 0,t.middlewareControl instanceof Ey.MiddlewareControl&&(n=t.middlewareControl.getMiddlewareOptions(Ay.AuthenticationHandlerOptions)),o=void 0,a=void 0,n&&(o=n.authenticationProvider,a=n.authenticationProviderOptions),o||(o=this.authenticationProvider),[4,o.getAccessToken(a)]):[3,2];case 1:return s=p.sent(),u="Bearer ".concat(s),(0,Ty.appendRequestHeader)(t.request,t.options,e.AUTHORIZATION_HEADER,u),yp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,yp.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})();vn.AuthenticationHandler=Iy});var xn=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.HTTPMessageHandler=void 0;var vp=(ce(),ie(ue)),Sy=(function(){function e(){}return i(e,"HTTPMessageHandler"),e.prototype.execute=function(t){return vp.__awaiter(this,void 0,void 0,function(){var r;return vp.__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})();Pn.HTTPMessageHandler=Sy});var _r=b(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.RetryHandlerOptions=void 0;var $y=(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 i(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})();bn.RetryHandlerOptions=$y});var Tn=b(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.RetryHandler=void 0;var Lt=(ce(),ie(ue)),Si=vr(),wy=ut(),_p=Nt(),Pp=_r(),xp=Ut(),Oy=(function(){function e(t){t===void 0&&(t=new Pp.RetryHandlerOptions),this.options=t}return i(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===Si.RequestMethod.PUT||n===Si.RequestMethod.PATCH||n===Si.RequestMethod.POST;if(o){var a=(0,_p.getRequestHeader)(t,r,"Content-Type")==="application/octet-stream";if(a)return!1}return!0},e.prototype.getDelay=function(t,r,n){var o=i(function(){return Number(Math.random().toFixed(3))},"getRandomness"),a=t.headers!==void 0?t.headers.get(e.RETRY_AFTER_HEADER):null,s;return a!==null?Number.isNaN(Number(a))?s=Math.round((new Date(a).getTime()-Date.now())/1e3):s=Number(a):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 wy.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof r>"u"&&(r=Object.assign(new Pp.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(a){switch(a.label){case 0:return[4,this.nextMiddleware.execute(t)];case 1:return a.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,_p.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 a.sent(),[4,this.executeWithRetry(t,r,n)];case 3:return[2,a.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),xp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,xp.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})();En.RetryHandler=Oy});var Pr=b(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.RedirectHandlerOptions=void 0;var Ry=(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 i(e,"RedirectHandlerOptions"),e.DEFAULT_MAX_REDIRECTS=5,e.MAX_MAX_REDIRECTS=20,e.defaultShouldRedirect=function(){return!0},e})();An.RedirectHandlerOptions=Ry});var Sn=b(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.RedirectHandler=void 0;var jt=(ce(),ie(ue)),zy=vr(),Cy=ut(),Dy=Nt(),$i=Pr(),bp=Ut(),ky=(function(){function e(t){t===void 0&&(t=new $i.RedirectHandlerOptions),this.options=t}return i(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),a,s;o!==null&&(a=o[0]);var u=n.exec(r);return u!==null&&(s=u[0]),typeof a<"u"&&typeof s<"u"&&a!==s},e.prototype.updateRequestUrl=function(t,r){return jt.__awaiter(this,void 0,void 0,function(){var n,o;return jt.__generator(this,function(a){switch(a.label){case 0:return n=r,typeof r.request!="string"?[3,1]:(o=t,[3,3]);case 1:return[4,(0,Dy.cloneRequestWithNewUrl)(t,r.request)];case 2:o=a.sent(),a.label=3;case 3:return n.request=o,[2]}})})},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof Cy.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions($i.RedirectHandlerOptions)),typeof r>"u"&&(r=Object.assign(new $i.RedirectHandlerOptions,this.options)),r},e.prototype.executeWithRedirect=function(t,r,n){return jt.__awaiter(this,void 0,void 0,function(){var o,a;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=zy.RequestMethod.GET,delete t.options.body,[3,4])):[3,6];case 2:return a=this.getLocationHeader(o),!this.isRelativeURL(a)&&this.shouldDropAuthorizationHeader(o.url,a)&&delete t.options.headers[e.AUTHORIZATION_HEADER],[4,this.updateRequestUrl(a,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,bp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,bp.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=ky});var Ep=b($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.PACKAGE_VERSION=void 0;$n.PACKAGE_VERSION="3.0.7"});var Rn=b(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.TelemetryHandler=void 0;var Tp=(ce(),ie(ue)),Ap=gn(),Ny=Ep(),My=ut(),wn=Nt(),Uy=Ut(),Ly=(function(){function e(){}return i(e,"TelemetryHandler"),e.prototype.execute=function(t){return Tp.__awaiter(this,void 0,void 0,function(){var r,n,o,a,s;return Tp.__generator(this,function(u){switch(u.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,Ap.isGraphURL)(r)||t.customHosts&&(0,Ap.isCustomHost)(r,t.customHosts)?(n=(0,wn.getRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER),n||(n=(0,wn.generateUUID)(),(0,wn.setRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER,n)),o="".concat(e.PRODUCT_NAME,"/").concat(Ny.PACKAGE_VERSION),a=void 0,t.middlewareControl instanceof My.MiddlewareControl&&(a=t.middlewareControl.getMiddlewareOptions(Uy.TelemetryHandlerOptions)),a&&(s=a.getFeatureUsage(),o+=" (".concat(e.FEATURE_USAGE_STRING,"=").concat(s,")")),(0,wn.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})();On.TelemetryHandler=Ly});var Ip=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.MiddlewareFactory=void 0;var jy=_n(),Fy=xn(),By=Pr(),Vy=_r(),Hy=Sn(),Zy=Tn(),qy=Rn(),Gy=i(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),Wy=(function(){function e(){}return i(e,"MiddlewareFactory"),e.getDefaultMiddlewareChain=function(t){var r=[],n=new jy.AuthenticationHandler(t),o=new Zy.RetryHandler(new Vy.RetryHandlerOptions),a=new qy.TelemetryHandler,s=new Fy.HTTPMessageHandler;if(r.push(n),r.push(o),Gy()){var u=new Hy.RedirectHandler(new By.RedirectHandlerOptions);r.push(u)}return r.push(a),r.push(s),r},e})();zn.MiddlewareFactory=Wy});var Dn=b(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.ChaosStrategy=void 0;var Sp;(function(e){e[e.MANUAL=0]="MANUAL",e[e.RANDOM=1]="RANDOM"})(Sp||(Cn.ChaosStrategy=Sp={}))});var wi=b(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ChaosHandlerOptions=void 0;var Ky=Dn(),Jy=(function(){function e(t,r,n,o,a,s){if(t===void 0&&(t=Ky.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=a,this.headers=s,this.chaosPercentage>100)throw new Error("Error Pecentage can not be more than 100")}return i(e,"ChaosHandlerOptions"),e})();kn.ChaosHandlerOptions=Jy});var $p=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 Rp=b(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.ChaosHandler=void 0;var Nn=(ce(),ie(ue)),Xy=ut(),Yy=Nt(),wp=$p(),Oi=wi(),Op=Dn(),Qy=(function(){function e(t,r){t===void 0&&(t=new Oi.ChaosHandlerOptions),this.options=t,this.manualMap=r}return i(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 a=wp.httpStatusCode[t.statusCode],s=t.statusMessage;o={error:{code:a,message:s,innerError:{"request-id":r,date:n}}}}else o={};return o},e.prototype.createResponse=function(t,r){var n=r.request,o=(0,Yy.generateUUID)(),a=new Date,s=this.createResponseHeaders(t,o,a.toString()),u=this.createResponseBody(t,o,a.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 Nn.__awaiter(this,void 0,void 0,function(){return Nn.__generator(this,function(n){switch(n.label){case 0:return this.setStatusCode(t,r.request,r.options.method),t.chaosStrategy===Op.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=wp.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===Op.ChaosStrategy.MANUAL){if(t.statusCode===void 0){var a=this.getRelativeURL(r);this.manualMap.get(a)!==void 0?this.manualMap.get(a).get(n)!==void 0&&(t.statusCode=this.manualMap.get(a).get(n)):this.manualMap.forEach(function(s,u){var p=new RegExp(u+"$");p.test(a)&&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(Oi.ChaosHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Oi.ChaosHandlerOptions,this.options)),r},e.prototype.execute=function(t){return Nn.__awaiter(this,void 0,void 0,function(){var r;return Nn.__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})();Mn.ChaosHandler=Qy});var xr=b(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.ResponseType=void 0;var zp;(function(e){e.ARRAYBUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.RAW="raw",e.STREAM="stream",e.TEXT="text"})(zp||(Un.ResponseType=zp={}))});var zi=b(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.GraphResponseHandler=Bt.DocumentType=void 0;var Ln=(ce(),ie(ue)),ht=xr(),Ri;(function(e){e.TEXT_HTML="text/html",e.TEXT_XML="text/xml",e.APPLICATION_XML="application/xml",e.APPLICATION_XHTML="application/xhtml+xml"})(Ri||(Bt.DocumentType=Ri={}));var jn;(function(e){e.TEXT_PLAIN="text/plain",e.APPLICATION_JSON="application/json"})(jn||(jn={}));var Fn;(function(e){e.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",e.IMAGE="^image\\/.+"})(Fn||(Fn={}));var ev=(function(){function e(){}return i(e,"GraphResponseHandler"),e.parseDocumentResponse=function(t,r){return typeof DOMParser<"u"?new Promise(function(n,o){t.text().then(function(a){try{var s=new DOMParser,u=s.parseFromString(a,r);n(u)}catch(p){o(p)}})}):Promise.resolve(t.body)},e.convertResponse=function(t,r){return Ln.__awaiter(this,void 0,void 0,function(){var n,o,a,s;return Ln.__generator(this,function(u){switch(u.label){case 0:if(t.status===204)return[2,Promise.resolve()];switch(o=t.headers.get("Content-type"),a=r,a){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,Ri.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(Fn.DOCUMENT).test(s)?[4,e.parseDocumentResponse(t,s)]:[3,15]);case 14:return n=u.sent(),[3,21];case 15:return new RegExp(Fn.IMAGE).test(s)?(n=t.blob(),[3,21]):[3,16];case 16:return s!==jn.TEXT_PLAIN?[3,18]:[4,t.text()];case 17:return n=u.sent(),[3,21];case 18:return s!==jn.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 Ln.__awaiter(this,void 0,void 0,function(){var o;return Ln.__generator(this,function(a){switch(a.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=a.sent(),t.ok)if(typeof n=="function")n(null,o);else return[2,o];else throw o;a.label=3;case 3:return[2]}})})},e})();Bt.GraphResponseHandler=ev});var Ci=b(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.Range=void 0;var tv=(function(){function e(t,r){t===void 0&&(t=-1),r===void 0&&(r=-1),this.minValue=t,this.maxValue=r}return i(e,"Range"),e})();Bn.Range=tv});var Di=b(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.UploadResult=void 0;var rv=(function(){function e(t,r){this._location=r,this._responseBody=t}return i(e,"UploadResult"),Object.defineProperty(e.prototype,"location",{get:i(function(){return this._location},"get"),set:i(function(t){this._location=t},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseBody",{get:i(function(){return this._responseBody},"get"),set:i(function(t){this._responseBody=t},"set"),enumerable:!1,configurable:!0}),e.CreateUploadResult=function(t,r){return new e(t,r.get("location"))},e})();Vn.UploadResult=rv});var Ni=b(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.LargeFileUploadTask=void 0;var Ae=(ce(),ie(ue)),ki=We(),nv=zi(),Cp=xr(),Hn=Ci(),ov=Di(),iv=(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 ki.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 Hn.Range(0,this.options.rangeSize-1)}return i(e,"LargeFileUploadTask"),e.createUploadSession=function(t,r,n,o){return o===void 0&&(o={}),Ae.__awaiter(this,void 0,void 0,function(){var a,s;return Ae.__generator(this,function(u){switch(u.label){case 0:return[4,t.api(r).headers(o).post(n)];case 1:return a=u.sent(),s={url:a.uploadUrl,expiry:new Date(a.expirationDateTime),isCancelled:!1},[2,s]}})})},e.prototype.parseRange=function(t){var r=t[0];if(typeof r>"u"||r==="")return new Hn.Range;var n=r.split("-"),o=parseInt(n[0],10),a=parseInt(n[1],10);return Number.isNaN(a)&&(a=this.file.size-1),new Hn.Range(o,a)},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 Hn.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 ki.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 Ae.__awaiter(this,void 0,void 0,function(){var t,r,n,o,a,s,u;return Ae.__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(a=p.sent(),!a)throw new ki.GraphClientError("Something went wrong! Large file upload slice response is null.");return[4,nv.GraphResponseHandler.getResponse(a)];case 4:return s=p.sent(),a.status===201||a.status===200&&s.id?(this.reportProgress(t,r),[2,ov.UploadResult.CreateUploadResult(s,a.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 Ae.__awaiter(this,void 0,void 0,function(){return Ae.__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 Ae.__awaiter(this,void 0,void 0,function(){return Ae.__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(Cp.ResponseType.RAW).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.cancel=function(){return Ae.__awaiter(this,void 0,void 0,function(){var t;return Ae.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).responseType(Cp.ResponseType.RAW).delete()];case 1:return t=r.sent(),t.status===204&&(this.uploadSession.isCancelled=!0),[2,t]}})})},e.prototype.getStatus=function(){return Ae.__awaiter(this,void 0,void 0,function(){var t;return Ae.__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 Ae.__awaiter(this,void 0,void 0,function(){return Ae.__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})();Zn.LargeFileUploadTask=iv});var Mi=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.FileUpload=void 0;var av=We(),sv=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new av.GraphClientError("Please provide the upload content, name of the file and size of the file")}return i(e,"FileUpload"),e.prototype.sliceFile=function(t){return this.content.slice(t.minValue,t.maxValue+1)},e})();qn.FileUpload=sv});var Ui=b(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.getValidRangeSize=void 0;var uv=5*1024*1024,cv=i(function(e){return e>320*1024&&(e=Math.floor(e/(320*1024))*320*1024),e},"roundTo320KB"),lv=i(function(e){e===void 0&&(e=uv);var t=60*1024*1024;return e>t&&(e=t),cv(e)},"getValidRangeSize");Gn.getValidRangeSize=lv});var kp=b(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.OneDriveLargeFileUploadTask=void 0;var Ke=(ce(),ie(ue)),Dp=We(),pv=Mi(),dv=Ni(),fv=Ui(),mv=(function(e){Ke.__extends(t,e);function t(r,n,o,a){return e.call(this,r,n,o,a)||this}return i(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,a;if(typeof Blob<"u"&&r instanceof Blob)o=new File([r],n),a=o.size;else if(typeof File<"u"&&r instanceof File)o=r,a=o.size;else if(typeof Uint8Array<"u"&&r instanceof Uint8Array){var s=r;a=s.byteLength,o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}return{content:o,size:a}},t.create=function(r,n,o){return Ke.__awaiter(this,void 0,void 0,function(){var a,s,u;return Ke.__generator(this,function(p){if(!r||!n||!o)throw new Dp.GraphClientError("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");return a=o.fileName,s=t.getFileInfo(n,a),u=new pv.FileUpload(s.content,a,s.size),[2,this.createTaskWithFileObject(r,u,o)]})})},t.createTaskWithFileObject=function(r,n,o){return Ke.__awaiter(this,void 0,void 0,function(){var a,s,u,p;return Ke.__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 a=o.uploadSessionURL?o.uploadSessionURL:t.constructCreateSessionUrl(o.fileName,o.path),s={fileName:o.fileName,fileDescription:o.fileDescription,conflictBehavior:o.conflictBehavior},[4,t.createUploadSession(r,a,s)];case 1:return u=d.sent(),p=(0,fv.getValidRangeSize)(o.rangeSize),[2,new t(r,n,u,{rangeSize:p,uploadEventHandlers:o.uploadEventHandlers})]}})})},t.createUploadSession=function(r,n,o){return Ke.__awaiter(this,void 0,void 0,function(){var a;return Ke.__generator(this,function(s){return a={item:{"@microsoft.graph.conflictBehavior":o?.conflictBehavior||"rename",name:o?.fileName,description:o?.fileDescription}},[2,e.createUploadSession.call(this,r,n,a)]})})},t.prototype.commit=function(r,n){return n===void 0&&(n="rename"),Ke.__awaiter(this,void 0,void 0,function(){var o;return Ke.__generator(this,function(a){switch(a.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,a.sent()]}})})},t.DEFAULT_UPLOAD_PATH="/",t})(dv.LargeFileUploadTask);Wn.OneDriveLargeFileUploadTask=mv});var Mp=b(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.StreamUpload=void 0;var Np=(ce(),ie(ue)),br=We(),gv=(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 i(e,"StreamUpload"),e.prototype.sliceFile=function(t){return Np.__awaiter(this,void 0,void 0,function(){var r,n,o,a,s,u,p;return Np.__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,a=this.previousSlice.range.maxValue,t.minValue===o&&t.maxValue===a)return[2,this.previousSlice.fileSlice];if(t.maxValue===a)return[2,this.previousSlice.fileSlice.slice(t.minValue,t.maxValue+1)];n.push(this.previousSlice.fileSlice.slice(t.minValue,a+1)),r=t.maxValue-a}}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 a=[],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,a.push(p),s>0&&(s=t-u);if(u===t)return n(Buffer.concat(a));if(!r.content||!r.content.readable)return o(new br.GraphClientError("Error encountered while reading the stream during the upload"))})})},e})();Kn.StreamUpload=gv});var Up=b(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.PageIterator=void 0;var Vt=(ce(),ie(ue)),hv=(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 i(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})();Jn.PageIterator=hv});var Li=b(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.CustomAuthenticationProvider=void 0;var Xn=(ce(),ie(ue)),Lp=We(),yv=(function(){function e(t){this.provider=t}return i(e,"CustomAuthenticationProvider"),e.prototype.getAccessToken=function(){return Xn.__awaiter(this,void 0,void 0,function(){var t=this;return Xn.__generator(this,function(r){return[2,new Promise(function(n,o){t.provider(function(a,s){return Xn.__awaiter(t,void 0,void 0,function(){var u,p;return Xn.__generator(this,function(d){switch(d.label){case 0:return s?(n(s),[3,3]):[3,1];case 1:return a||(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",a=new Lp.GraphClientError(u)),[4,Lp.GraphClientError.setGraphClientError(a)];case 2:p=d.sent(),o(p),d.label=3;case 3:return[2]}})})})})]})})},e})();Yn.CustomAuthenticationProvider=yv});var ji=b(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.GraphError=void 0;var vv=(ce(),ie(ue)),_v=(function(e){vv.__extends(t,e);function t(r,n,o){r===void 0&&(r=-1);var a=e.call(this,n||o&&o.message)||this;return Object.setPrototypeOf(a,t.prototype),a.statusCode=r,a.code=null,a.requestId=null,a.date=new Date,a.body=null,a.stack=o?o.stack:a.stack,a}return i(t,"GraphError"),t})(Error);Qn.GraphError=_v});var Fp=b(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.GraphErrorHandler=void 0;var jp=(ce(),ie(ue)),Fi=ji(),Pv=(function(){function e(){}return i(e,"GraphErrorHandler"),e.constructError=function(t,r,n){var o=new Fi.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,a=new Fi.GraphError(r,o.message);return a.code=o.code,o.innerError!==void 0&&(a.requestId=o.innerError["request-id"],a.date=new Date(o.innerError.date)),a.body=JSON.stringify(o),a.headers=n?.headers,a},e.getError=function(t,r,n,o){return t===void 0&&(t=null),r===void 0&&(r=-1),jp.__awaiter(this,void 0,void 0,function(){var a;return jp.__generator(this,function(s){if(t&&t.error?a=e.constructErrorFromResponse(t,r,o):t instanceof Error?a=e.constructError(t,r,o):(a=new Fi.GraphError(r),a.body=t),typeof n=="function")n(a,null);else return[2,a];return[2]})})},e})();eo.GraphErrorHandler=Pv});var Bi=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.GraphRequest=void 0;var te=(ce(),ie(ue)),xv=We(),bv=Fp(),Er=gn(),Ev=zi(),Tv=ut(),yt=vr(),Av=xr(),Iv=(function(){function e(t,r,n){var o=this;this.parsePath=function(a){if(a.indexOf("https://")!==-1){a=a.replace("https://","");var s=a.indexOf("/");s!==-1&&(o.urlComponents.host="https://"+a.substring(0,s),a=a.substring(s+1,a.length));var u=a.indexOf("/");u!==-1&&(o.urlComponents.version=a.substring(0,u),a=a.substring(u+1,a.length))}a.charAt(0)==="/"&&(a=a.substr(1));var p=a.indexOf("?");if(p===-1)o.urlComponents.path=a;else{o.urlComponents.path=a.substr(0,p);for(var d=a.substring(p+1,a.length).split("&"),f=0,_=d;f<_.length;f++){var y=_[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 i(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,a=t.otherURLQueryOptions;o<a.length;o++){var s=a[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 a=o[n];this.parseQueryParamenterString(a)}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=te.__assign({},t.headers);if(this.config.fetchOptions!==void 0){var n=te.__assign({},this.config.fetchOptions);Object.assign(t,n),typeof this.config.fetchOptions.headers!==void 0&&(t.headers=te.__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 te.__awaiter(this,void 0,void 0,function(){var a,s,u,p,d,f,_,y;return te.__generator(this,function(l){switch(l.label){case 0:s=new Tv.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(),a=p.response,[4,Ev.GraphResponseHandler.getResponse(a,this._responseType,n)];case 3:return d=l.sent(),[2,d];case 4:if(f=l.sent(),f instanceof xv.GraphClientError)throw f;return _=void 0,a&&(_=a.status),[4,bv.GraphErrorHandler.getError(f,_,n,a)];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 te.__awaiter(this,void 0,void 0,function(){var r,n,o;return te.__generator(this,function(a){switch(a.label){case 0:return r=this.buildFullUrl(),n={method:yt.RequestMethod.GET},[4,this.send(r,n,t)];case 1:return o=a.sent(),[2,o]}})})},e.prototype.post=function(t,r){return te.__awaiter(this,void 0,void 0,function(){var n,o,a;return te.__generator(this,function(s){switch(s.label){case 0:return n=this.buildFullUrl(),o={method:yt.RequestMethod.POST,body:(0,Er.serializeContent)(t)},a=t&&t.constructor&&t.constructor.name,a==="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 te.__awaiter(this,void 0,void 0,function(){return te.__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 te.__awaiter(this,void 0,void 0,function(){var n,o;return te.__generator(this,function(a){switch(a.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,a.sent()]}})})},e.prototype.patch=function(t,r){return te.__awaiter(this,void 0,void 0,function(){var n,o;return te.__generator(this,function(a){switch(a.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,a.sent()]}})})},e.prototype.update=function(t,r){return te.__awaiter(this,void 0,void 0,function(){return te.__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 te.__awaiter(this,void 0,void 0,function(){var r,n;return te.__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 te.__awaiter(this,void 0,void 0,function(){return te.__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 te.__awaiter(this,void 0,void 0,function(){var r,n;return te.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:yt.RequestMethod.GET},this.responseType(Av.ResponseType.STREAM),[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.putStream=function(t,r){return te.__awaiter(this,void 0,void 0,function(){var n,o;return te.__generator(this,function(a){switch(a.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,a.sent()]}})})},e})();to.GraphRequest=Iv});var Vi=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.HTTPClient=void 0;var Bp=(ce(),ie(ue)),Sv=(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 i(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 Bp.__awaiter(this,void 0,void 0,function(){var r;return Bp.__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})();ro.HTTPClient=Sv});var Hp=b(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.HTTPClientFactory=void 0;var $v=(ce(),ie(ue)),Vp=Vi(),wv=_n(),Ov=xn(),Rv=Pr(),zv=_r(),Cv=Sn(),Dv=Tn(),kv=Rn(),Nv=i(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),Mv=(function(){function e(){}return i(e,"HTTPClientFactory"),e.createWithAuthenticationProvider=function(t){var r=new wv.AuthenticationHandler(t),n=new Dv.RetryHandler(new zv.RetryHandlerOptions),o=new kv.TelemetryHandler,a=new Ov.HTTPMessageHandler;if(r.setNext(n),Nv()){var s=new Cv.RedirectHandler(new Rv.RedirectHandlerOptions);n.setNext(s),s.setNext(o)}else n.setNext(o);return o.setNext(a),e.createWithMiddleware(r)},e.createWithMiddleware=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new(Vp.HTTPClient.bind.apply(Vp.HTTPClient,$v.__spreadArray([void 0],t,!1)))},e})();no.HTTPClientFactory=Mv});var Zp=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.validatePolyFilling=void 0;var Uv=i(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");oo.validatePolyFilling=Uv});var Wp=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.Client=void 0;var Lv=(ce(),ie(ue)),qp=Ti(),jv=Li(),Fv=Bi(),Gp=Vi(),Bv=Hp(),Vv=Zp(),Hv=(function(){function e(t){this.config={baseUrl:qp.GRAPH_BASE_URL,debugLogging:!1,defaultVersion:qp.GRAPH_API_VERSION},(0,Vv.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=Bv.HTTPClientFactory.createWithAuthenticationProvider(t.authProvider);else if(t.middleware!==void 0)n=new(Gp.HTTPClient.bind.apply(Gp.HTTPClient,Lv.__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 i(e,"Client"),e.init=function(t){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=n==="authProvider"?new jv.CustomAuthenticationProvider(t[n]):t[n]);return e.initWithMiddleware(r)},e.initWithMiddleware=function(t){return new e(t)},e.prototype.api=function(t){return new Fv.GraphRequest(this.httpClient,this.config,t)},e})();io.Client=Hv});var Jp=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 Zv=lp();Object.defineProperty(w,"BatchRequestContent",{enumerable:!0,get:i(function(){return Zv.BatchRequestContent},"get")});var qv=pp();Object.defineProperty(w,"BatchResponseContent",{enumerable:!0,get:i(function(){return qv.BatchResponseContent},"get")});var Gv=_n();Object.defineProperty(w,"AuthenticationHandler",{enumerable:!0,get:i(function(){return Gv.AuthenticationHandler},"get")});var Wv=xn();Object.defineProperty(w,"HTTPMessageHandler",{enumerable:!0,get:i(function(){return Wv.HTTPMessageHandler},"get")});var Kv=Tn();Object.defineProperty(w,"RetryHandler",{enumerable:!0,get:i(function(){return Kv.RetryHandler},"get")});var Jv=Sn();Object.defineProperty(w,"RedirectHandler",{enumerable:!0,get:i(function(){return Jv.RedirectHandler},"get")});var Xv=Rn();Object.defineProperty(w,"TelemetryHandler",{enumerable:!0,get:i(function(){return Xv.TelemetryHandler},"get")});var Yv=Ip();Object.defineProperty(w,"MiddlewareFactory",{enumerable:!0,get:i(function(){return Yv.MiddlewareFactory},"get")});var Qv=Ai();Object.defineProperty(w,"AuthenticationHandlerOptions",{enumerable:!0,get:i(function(){return Qv.AuthenticationHandlerOptions},"get")});var e_=_r();Object.defineProperty(w,"RetryHandlerOptions",{enumerable:!0,get:i(function(){return e_.RetryHandlerOptions},"get")});var t_=Pr();Object.defineProperty(w,"RedirectHandlerOptions",{enumerable:!0,get:i(function(){return t_.RedirectHandlerOptions},"get")});var Kp=Ut();Object.defineProperty(w,"FeatureUsageFlag",{enumerable:!0,get:i(function(){return Kp.FeatureUsageFlag},"get")});Object.defineProperty(w,"TelemetryHandlerOptions",{enumerable:!0,get:i(function(){return Kp.TelemetryHandlerOptions},"get")});var r_=wi();Object.defineProperty(w,"ChaosHandlerOptions",{enumerable:!0,get:i(function(){return r_.ChaosHandlerOptions},"get")});var n_=Dn();Object.defineProperty(w,"ChaosStrategy",{enumerable:!0,get:i(function(){return n_.ChaosStrategy},"get")});var o_=Rp();Object.defineProperty(w,"ChaosHandler",{enumerable:!0,get:i(function(){return o_.ChaosHandler},"get")});var i_=Ni();Object.defineProperty(w,"LargeFileUploadTask",{enumerable:!0,get:i(function(){return i_.LargeFileUploadTask},"get")});var a_=kp();Object.defineProperty(w,"OneDriveLargeFileUploadTask",{enumerable:!0,get:i(function(){return a_.OneDriveLargeFileUploadTask},"get")});var s_=Ui();Object.defineProperty(w,"getValidRangeSize",{enumerable:!0,get:i(function(){return s_.getValidRangeSize},"get")});var u_=Mp();Object.defineProperty(w,"StreamUpload",{enumerable:!0,get:i(function(){return u_.StreamUpload},"get")});var c_=Mi();Object.defineProperty(w,"FileUpload",{enumerable:!0,get:i(function(){return c_.FileUpload},"get")});var l_=Di();Object.defineProperty(w,"UploadResult",{enumerable:!0,get:i(function(){return l_.UploadResult},"get")});var p_=Ci();Object.defineProperty(w,"Range",{enumerable:!0,get:i(function(){return p_.Range},"get")});var d_=Up();Object.defineProperty(w,"PageIterator",{enumerable:!0,get:i(function(){return d_.PageIterator},"get")});var f_=Wp();Object.defineProperty(w,"Client",{enumerable:!0,get:i(function(){return f_.Client},"get")});var m_=Li();Object.defineProperty(w,"CustomAuthenticationProvider",{enumerable:!0,get:i(function(){return m_.CustomAuthenticationProvider},"get")});var g_=ji();Object.defineProperty(w,"GraphError",{enumerable:!0,get:i(function(){return g_.GraphError},"get")});var h_=We();Object.defineProperty(w,"GraphClientError",{enumerable:!0,get:i(function(){return h_.GraphClientError},"get")});var y_=Bi();Object.defineProperty(w,"GraphRequest",{enumerable:!0,get:i(function(){return y_.GraphRequest},"get")});var v_=xr();Object.defineProperty(w,"ResponseType",{enumerable:!0,get:i(function(){return v_.ResponseType},"get")})});var Tr=b((Hi,Zi)=>{(function(e,t){typeof Hi=="object"&&typeof Zi<"u"?Zi.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Hi,(function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",s="hour",u="day",p="week",d="month",f="quarter",_="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+)?$/,P=/\[([^\]]+)]|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:i(function(N){var S=["th","st","nd","rd"],A=N%100;return"["+N+(S[(A-20)%10]||S[A]||S[0])+"]"},"ordinal")},x=i(function(N,S,A){var R=String(N);return!R||R.length>=S?N:""+Array(S+1-R.length).join(A)+N},"m"),E={s:x,z:i(function(N){var S=-N.utcOffset(),A=Math.abs(S),R=Math.floor(A/60),I=A%60;return(S<=0?"+":"-")+x(R,2,"0")+":"+x(I,2,"0")},"z"),m:i(function N(S,A){if(S.date()<A.date())return-N(A,S);var R=12*(A.year()-S.year())+(A.month()-S.month()),I=S.clone().add(R,d),q=A-I<0,G=S.clone().add(R+(q?-1:1),d);return+(-(R+(A-I)/(q?I-G:G-I))||0)},"t"),a:i(function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},"a"),p:i(function(N){return{M:d,y:_,w:p,d:u,D:y,h:s,m:a,s:o,ms:n,Q:f}[N]||String(N||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(N){return N===void 0},"u")},H="en",de={};de[H]=h;var xe=i(function(N){return N instanceof be},"p"),Ie=i(function N(S,A,R){var I;if(!S)return H;if(typeof S=="string"){var q=S.toLowerCase();de[q]&&(I=q),A&&(de[q]=A,I=q);var G=S.split("-");if(!I&&G.length>1)return N(G[0])}else{var ee=S.name;de[ee]=S,I=ee}return!R&&I&&(H=I),I||!R&&H},"t"),me=i(function(N,S){if(xe(N))return N.clone();var A=typeof S=="object"?S:{};return A.date=N,A.args=arguments,new be(A)},"w"),W=E;W.l=Ie,W.i=xe,W.w=function(N,S){return me(N,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var be=(function(){function N(A){this.$L=Ie(A.locale,null,!0),this.parse(A)}i(N,"M");var S=N.prototype;return S.parse=function(A){this.$d=(function(R){var I=R.date,q=R.utc;if(I===null)return new Date(NaN);if(W.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var G=I.match(m);if(G){var ee=G[2]-1||0,fe=(G[7]||"0").substring(0,3);return q?new Date(Date.UTC(G[1],ee,G[3]||1,G[4]||0,G[5]||0,G[6]||0,fe)):new Date(G[1],ee,G[3]||1,G[4]||0,G[5]||0,G[6]||0,fe)}}return new Date(I)})(A),this.$x=A.x||{},this.init()},S.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},S.$utils=function(){return W},S.isValid=function(){return this.$d.toString()!==l},S.isSame=function(A,R){var I=me(A);return this.startOf(R)<=I&&I<=this.endOf(R)},S.isAfter=function(A,R){return me(A)<this.startOf(R)},S.isBefore=function(A,R){return this.endOf(R)<me(A)},S.$g=function(A,R,I){return W.u(A)?this[R]:this.set(I,A)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(A,R){var I=this,q=!!W.u(R)||R,G=W.p(A),ee=i(function(dt,Ee){var Je=W.w(I.$u?Date.UTC(I.$y,Ee,dt):new Date(I.$y,Ee,dt),I);return q?Je:Je.endOf(u)},"l"),fe=i(function(dt,Ee){return W.w(I.toDate()[dt].apply(I.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(Ee)),I)},"$"),ye=this.$W,Pe=this.$M,we=this.$D,vt="set"+(this.$u?"UTC":"");switch(G){case _:return q?ee(1,0):ee(31,11);case d:return q?ee(1,Pe):ee(0,Pe+1);case p:var pt=this.$locale().weekStart||0,Ht=(ye<pt?ye+7:ye)-pt;return ee(q?we-Ht:we+(6-Ht),Pe);case u:case y:return fe(vt+"Hours",0);case s:return fe(vt+"Minutes",1);case a:return fe(vt+"Seconds",2);case o:return fe(vt+"Milliseconds",3);default:return this.clone()}},S.endOf=function(A){return this.startOf(A,!1)},S.$set=function(A,R){var I,q=W.p(A),G="set"+(this.$u?"UTC":""),ee=(I={},I[u]=G+"Date",I[y]=G+"Date",I[d]=G+"Month",I[_]=G+"FullYear",I[s]=G+"Hours",I[a]=G+"Minutes",I[o]=G+"Seconds",I[n]=G+"Milliseconds",I)[q],fe=q===u?this.$D+(R-this.$W):R;if(q===d||q===_){var ye=this.clone().set(y,1);ye.$d[ee](fe),ye.init(),this.$d=ye.set(y,Math.min(this.$D,ye.daysInMonth())).$d}else ee&&this.$d[ee](fe);return this.init(),this},S.set=function(A,R){return this.clone().$set(A,R)},S.get=function(A){return this[W.p(A)]()},S.add=function(A,R){var I,q=this;A=Number(A);var G=W.p(R),ee=i(function(Pe){var we=me(q);return W.w(we.date(we.date()+Math.round(Pe*A)),q)},"y");if(G===d)return this.set(d,this.$M+A);if(G===_)return this.set(_,this.$y+A);if(G===u)return ee(1);if(G===p)return ee(7);var fe=(I={},I[a]=t,I[s]=r,I[o]=e,I)[G]||1,ye=this.$d.getTime()+A*fe;return W.w(ye,this)},S.subtract=function(A,R){return this.add(-1*A,R)},S.format=function(A){var R=this,I=this.$locale();if(!this.isValid())return I.invalidDate||l;var q=A||"YYYY-MM-DDTHH:mm:ssZ",G=W.z(this),ee=this.$H,fe=this.$m,ye=this.$M,Pe=I.weekdays,we=I.months,vt=I.meridiem,pt=i(function(Ee,Je,Zt,Ir){return Ee&&(Ee[Je]||Ee(R,q))||Zt[Je].slice(0,Ir)},"h"),Ht=i(function(Ee){return W.s(ee%12||12,Ee,"0")},"d"),dt=vt||function(Ee,Je,Zt){var Ir=Ee<12?"AM":"PM";return Zt?Ir.toLowerCase():Ir};return q.replace(P,(function(Ee,Je){return Je||(function(Zt){switch(Zt){case"YY":return String(R.$y).slice(-2);case"YYYY":return W.s(R.$y,4,"0");case"M":return ye+1;case"MM":return W.s(ye+1,2,"0");case"MMM":return pt(I.monthsShort,ye,we,3);case"MMMM":return pt(we,ye);case"D":return R.$D;case"DD":return W.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return pt(I.weekdaysMin,R.$W,Pe,2);case"ddd":return pt(I.weekdaysShort,R.$W,Pe,3);case"dddd":return Pe[R.$W];case"H":return String(ee);case"HH":return W.s(ee,2,"0");case"h":return Ht(1);case"hh":return Ht(2);case"a":return dt(ee,fe,!0);case"A":return dt(ee,fe,!1);case"m":return String(fe);case"mm":return W.s(fe,2,"0");case"s":return String(R.$s);case"ss":return W.s(R.$s,2,"0");case"SSS":return W.s(R.$ms,3,"0");case"Z":return G}return null})(Ee)||G.replace(":","")}))},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(A,R,I){var q,G=this,ee=W.p(R),fe=me(A),ye=(fe.utcOffset()-this.utcOffset())*t,Pe=this-fe,we=i(function(){return W.m(G,fe)},"D");switch(ee){case _:q=we()/12;break;case d:q=we();break;case f:q=we()/3;break;case p:q=(Pe-ye)/6048e5;break;case u:q=(Pe-ye)/864e5;break;case s:q=Pe/r;break;case a:q=Pe/t;break;case o:q=Pe/e;break;default:q=Pe}return I?q:W.a(q)},S.daysInMonth=function(){return this.endOf(d).$D},S.$locale=function(){return de[this.$L]},S.locale=function(A,R){if(!A)return this.$L;var I=this.clone(),q=Ie(A,R,!0);return q&&(I.$L=q),I},S.clone=function(){return W.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},N})(),Ar=be.prototype;return me.prototype=Ar,[["$ms",n],["$s",o],["$m",a],["$H",s],["$W",u],["$M",d],["$y",_],["$D",y]].forEach((function(N){Ar[N[1]]=function(S){return this.$g(S,N[0],N[1])}})),me.extend=function(N,S){return N.$i||(N(S,be,me),N.$i=!0),me},me.locale=Ie,me.isDayjs=xe,me.unix=function(N){return me(1e3*N)},me.en=de[H],me.Ls=de,me.p={},me}))});var A_={};co(A_,{microsoftOutlook:()=>T_});module.exports=ie(A_);var Pd=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,f=Object.keys(d);for(let _=0;_<f.length;_++){let y=f[_];y in u||(u[y]=d[y].bind(u))}}i(n,"init");let o=r?.Parent??Object;class a extends o{static{i(this,"Definition")}}Object.defineProperty(a,"name",{value:e});function s(u){var p;let d=r?.Parent?new a:this;n(d,u),(p=d._zod).deferred??(p.deferred=[]);for(let f of d._zod.deferred)f();return d}return i(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:i(u=>r?.Parent&&u instanceof r.Parent?!0:u?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}i(O,"$constructor");var Ne=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Sr=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},lo={};function Fe(e){return e&&Object.assign(lo,e),lo}i(Fe,"config");function fo(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(fo,"getEnumValues");function Xi(e,t){return typeof t=="bigint"?t.toString():t}i(Xi,"jsonStringifyReplacer");function wr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(wr,"cached");function Yi(e){return e==null}i(Yi,"nullish");function Or(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Or,"cleanRegex");var Ji=Symbol("evaluating");function ge(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ji)return n===void 0&&(n=Ji,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(ge,"defineLazy");var mo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(Gt,"isObject");var xd=wr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Qi(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)}i(Qi,"isPlainObject");var ea=new Set(["string","number","symbol"]);function _t(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(_t,"escapeRegex");function Rr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(Rr,"clone");function re(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(re,"normalizeParams");function ta(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(ta,"optionalKeys");var ra={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 Pt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(Pt,"aborted");function Xe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Xe,"prefixIssues");function $r(e){return typeof e=="string"?e:e?.message}i($r,"unwrapMessage");function Ye(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=$r(e.inst?._zod.def?.error?.(e))??$r(t?.error?.(e))??$r(r.customError?.(e))??$r(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ye,"finalizeIssue");function na(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(na,"getLengthableOrigin");function go(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(go,"issue");var oa=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Xi,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),ia=O("$ZodError",oa),Wt=O("$ZodError",oa,{Parent:Error});var Ed=i(e=>(t,r,n,o)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new Ne;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(p=>Ye(p,a,Fe())));throw mo(u,o?.callee),u}return s.value},"_parse"),zr=Ed(Wt),Td=i(e=>async(t,r,n,o)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(o?.Err??e)(s.issues.map(p=>Ye(p,a,Fe())));throw mo(u,o?.callee),u}return s.value},"_parseAsync"),Cr=Td(Wt),Ad=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Ne;return a.issues.length?{success:!1,error:new(e??ia)(a.issues.map(s=>Ye(s,o,Fe())))}:{success:!0,data:a.value}},"_safeParse"),Kt=Ad(Wt),Id=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(s=>Ye(s,o,Fe())))}:{success:!0,data:a.value}},"_safeParseAsync"),Jt=Id(Wt);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])))",$d=new RegExp(`^${Sd}$`);var aa=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),sa=/^-?\d+n?$/,ua=/^-?\d+$/,ho=/^-?\d+(?:\.\d+)?$/,ca=/^(?:true|false)$/i;var Qe=O("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),wd={number:"number",bigint:"bigint",object:"date"};var la=O("$ZodCheckGreaterThan",(e,t)=>{Qe.init(e,t);let r=wd[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,a=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(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 pa=O("$ZodCheckNumberFormat",(e,t)=>{Qe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,a]=ra[t.format];e._zod.onattach.push(s=>{let u=s._zod.bag;u.format=t.format,u.minimum=o,u.maximum=a,r&&(u.pattern=ua)}),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>a&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}});var da=O("$ZodCheckMinLength",(e,t)=>{var r;Qe.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Yi(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=na(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var yo=O("$ZodCheckStringFormat",(e,t)=>{var r,n;Qe.init(e,t),e._zod.onattach.push(o=>{let a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.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=()=>{})}),fa=O("$ZodCheckRegex",(e,t)=>{yo.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 ga={major:4,minor:3,patch:6};var le=O("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ga;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let a of o._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((s,u,p)=>{let d=Pt(s),f;for(let _ of u){if(_._zod.def.when){if(!_._zod.def.when(s))continue}else if(d)continue;let y=s.issues.length,l=_._zod.check(s);if(l instanceof Promise&&p?.async===!1)throw new Ne;if(f||l instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await l,s.issues.length!==y&&(d||(d=Pt(s,y)))});else{if(s.issues.length===y)continue;d||(d=Pt(s,y))}}return f?f.then(()=>s):s},"runChecks"),a=i((s,u,p)=>{if(Pt(s))return s.aborted=!0,s;let d=o(u,n,p);if(d instanceof Promise){if(p.async===!1)throw new Ne;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=>a(f,s,u)):a(d,s,u)}let p=e._zod.parse(s,u);if(p instanceof Promise){if(u.async===!1)throw new Ne;return p.then(d=>o(d,n,u))}return o(p,n,u)}}ge(e,"~standard",()=>({validate:i(o=>{try{let a=Kt(e,o);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Jt(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nr=O("$ZodString",(e,t)=>{le.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??aa(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}}),vo=O("$ZodStringFormat",(e,t)=>{yo.init(e,t),Nr.init(e,t)});var Pa=O("$ZodURL",(e,t)=>{vo.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 _o=O("$ZodNumber",(e,t)=>{le.init(e,t),e._zod.pattern=e._zod.bag.pattern??ho,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 a=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,...a?{received:a}:{}}),r}}),xa=O("$ZodNumberFormat",(e,t)=>{pa.init(e,t),_o.init(e,t)}),Po=O("$ZodBoolean",(e,t)=>{le.init(e,t),e._zod.pattern=ca,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}}),ba=O("$ZodBigInt",(e,t)=>{le.init(e,t),e._zod.pattern=sa,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 Ea=O("$ZodAny",(e,t)=>{le.init(e,t),e._zod.parse=r=>r}),Ta=O("$ZodUnknown",(e,t)=>{le.init(e,t),e._zod.parse=r=>r});var Aa=O("$ZodVoid",(e,t)=>{le.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}}),Ia=O("$ZodDate",(e,t)=>{le.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,a=o instanceof Date;return a&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...a?{received:"Invalid Date"}:{},inst:e}),r}});function ha(e,t,r){e.issues.length&&t.issues.push(...Xe(r,e.issues)),t.value[r]=e.value}i(ha,"handleArrayResult");var Sa=O("$ZodArray",(e,t)=>{le.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 a=[];for(let s=0;s<o.length;s++){let u=o[s],p=t.element._zod.run({value:u,issues:[]},n);p instanceof Promise?a.push(p.then(d=>ha(d,r,s))):ha(p,r,s)}return a.length?Promise.all(a).then(()=>r):r}});function kr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Xe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(kr,"handlePropertyResult");function Od(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=ta(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(Od,"normalizeDef");function Rd(e,t,r,n,o,a){let s=[],u=o.keySet,p=o.catchall._zod,d=p.def.type,f=p.optout==="optional";for(let _ in t){if(u.has(_))continue;if(d==="never"){s.push(_);continue}let y=p.run({value:t[_],issues:[]},n);y instanceof Promise?e.push(y.then(l=>kr(l,r,_,t,f))):kr(y,r,_,t,f)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}i(Rd,"handleCatchall");var $a=O("$ZodObject",(e,t)=>{if(le.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let u=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let p={...u};return Object.defineProperty(t,"shape",{value:p}),p},"get")})}let n=wr(()=>Od(t));ge(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 _ of f.values)p[d].add(_)}}return p});let o=Gt,a=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=[],_=s.shape;for(let y of s.keys){let l=_[y],m=l._zod.optout==="optional",P=l._zod.run({value:d[y],issues:[]},p);P instanceof Promise?f.push(P.then(h=>kr(h,u,y,d,m))):kr(P,u,y,d,m)}return a?Rd(f,d,u,p,n.value,e):f.length?Promise.all(f).then(()=>u):u}});function ya(e,t,r,n){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let o=e.filter(a=>!Pt(a));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(a=>a.issues.map(s=>Ye(s,n,Fe())))}),t)}i(ya,"handleUnionResults");var xo=O("$ZodUnion",(e,t)=>{le.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(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>Or(a.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(r)return n(o,a);let s=!1,u=[];for(let p of t.options){let d=p._zod.run({value:o.value,issues:[]},a);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=>ya(p,o,e,a)):ya(u,o,e,a)}});var wa=O("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xo.init(e,t);let r=e._zod.parse;ge(e._zod,"propValues",()=>{let o={};for(let a of t.options){let s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);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=wr(()=>{let o=t.options,a=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(a.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);a.set(p,s)}}return a});e._zod.parse=(o,a)=>{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,a):t.unionFallback?r(o,a):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}});var Oa=O("$ZodRecord",(e,t)=>{le.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Qi(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let a=[],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?a.push(f.then(_=>{_.issues.length&&r.issues.push(...Xe(d,_.issues)),r.value[d]=_.value})):(f.issues.length&&r.issues.push(...Xe(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"&&ho.test(u)&&p.issues.length){let _=t.keyType._zod.run({value:Number(u),issues:[]},n);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(p=_)}if(p.issues.length){t.mode==="loose"?r.value[u]=o[u]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(_=>Ye(_,n,Fe())),input:u,path:[u],inst:e});continue}let f=t.valueType._zod.run({value:o[u],issues:[]},n);f instanceof Promise?a.push(f.then(_=>{_.issues.length&&r.issues.push(...Xe(u,_.issues)),r.value[p.value]=_.value})):(f.issues.length&&r.issues.push(...Xe(u,f.issues)),r.value[p.value]=f.value)}}return a.length?Promise.all(a).then(()=>r):r}});var Ra=O("$ZodEnum",(e,t)=>{le.init(e,t);let r=fo(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>ea.has(typeof o)).map(o=>typeof o=="string"?_t(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),za=O("$ZodLiteral",(e,t)=>{if(le.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"?_t(n):n?_t(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}});var Ca=O("$ZodTransform",(e,t)=>{le.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Sr(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 Ne;return r.value=o,r}});function va(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(va,"handleOptionalResult");var Da=O("$ZodOptional",(e,t)=>{le.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(`^(${Or(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(a=>va(a,r.value)):va(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var ka=O("$ZodNullable",(e,t)=>{le.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(`^(${Or(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 Na=O("$ZodPipe",(e,t)=>{le.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 a=t.out._zod.run(r,n);return a instanceof Promise?a.then(s=>Dr(s,t.in,n)):Dr(a,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>Dr(a,t.out,n)):Dr(o,t.out,n)}});function Dr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Dr,"handlePipeResult");var Ma=O("$ZodCustom",(e,t)=>{Qe.init(e,t),le.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(a=>_a(a,r,n,e));_a(o,r,n,e)}});function _a(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(go(o))}}i(_a,"handleRefineResult");var La;var bo=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ja(){return new bo}i(ja,"registry");(La=globalThis).__zod_globalRegistry??(La.__zod_globalRegistry=ja());var Eo=globalThis.__zod_globalRegistry;function Fa(e,t){return new e({type:"string",...re(t)})}i(Fa,"_string");function Ba(e,t){return new e({type:"string",coerce:!0,...re(t)})}i(Ba,"_coercedString");function Va(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}i(Va,"_url");function Ha(e,t){return new e({type:"number",checks:[],...re(t)})}i(Ha,"_number");function Za(e,t){return new e({type:"number",coerce:!0,checks:[],...re(t)})}i(Za,"_coercedNumber");function qa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}i(qa,"_int");function Ga(e,t){return new e({type:"boolean",...re(t)})}i(Ga,"_boolean");function Wa(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}i(Wa,"_coercedBoolean");function Ka(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}i(Ka,"_coercedBigint");function Ja(e){return new e({type:"any"})}i(Ja,"_any");function Xa(e){return new e({type:"unknown"})}i(Xa,"_unknown");function Ya(e,t){return new e({type:"void",...re(t)})}i(Ya,"_void");function Qa(e,t){return new e({type:"date",coerce:!0,...re(t)})}i(Qa,"_coercedDate");function Mr(e,t){return new la({check:"greater_than",...re(t),value:e,inclusive:!0})}i(Mr,"_gte");function De(e,t){return new da({check:"min_length",...re(t),minimum:e})}i(De,"_minLength");function et(e,t){return new fa({check:"string_format",format:"regex",...re(t),pattern:e})}i(et,"_regex");function es(e,t,r){let n=re(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(es,"_custom");var he=O("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");le.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>zr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Kt(e,r,n),e.parseAsync=async(r,n)=>Cr(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)=>Rr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Lr=O("ZodMiniString",(e,t)=>{Nr.init(e,t),he.init(e,t)});function c(e){return Fa(Lr,e)}i(c,"string");var ts=O("ZodMiniStringFormat",(e,t)=>{vo.init(e,t),Lr.init(e,t)});var Hd=O("ZodMiniURL",(e,t)=>{Pa.init(e,t),ts.init(e,t)});function rs(e){return Va(Hd,e)}i(rs,"url");var jr=O("ZodMiniNumber",(e,t)=>{_o.init(e,t),he.init(e,t)});function ve(e){return Ha(jr,e)}i(ve,"number");var Zd=O("ZodMiniNumberFormat",(e,t)=>{xa.init(e,t),jr.init(e,t)});function ns(e){return qa(Zd,e)}i(ns,"int");var To=O("ZodMiniBoolean",(e,t)=>{Po.init(e,t),he.init(e,t)});function Y(e){return Ga(To,e)}i(Y,"boolean");var os=O("ZodMiniBigInt",(e,t)=>{ba.init(e,t),he.init(e,t)});var qd=O("ZodMiniAny",(e,t)=>{Ea.init(e,t),he.init(e,t)});function Yt(){return Ja(qd)}i(Yt,"any");var Gd=O("ZodMiniUnknown",(e,t)=>{Ta.init(e,t),he.init(e,t)});function F(){return Xa(Gd)}i(F,"unknown");var Wd=O("ZodMiniVoid",(e,t)=>{Aa.init(e,t),he.init(e,t)});function is(e){return Ya(Wd,e)}i(is,"_void");var as=O("ZodMiniDate",(e,t)=>{Ia.init(e,t),he.init(e,t)});var Kd=O("ZodMiniArray",(e,t)=>{Sa.init(e,t),he.init(e,t)});function M(e,t){return new Kd({type:"array",element:e,...re(t)})}i(M,"array");var Jd=O("ZodMiniObject",(e,t)=>{$a.init(e,t),he.init(e,t),ge(e,"shape",()=>t.shape)});function g(e,t){let r={type:"object",shape:e??{},...re(t)};return new Jd(r)}i(g,"object");var Xd=O("ZodMiniUnion",(e,t)=>{xo.init(e,t),he.init(e,t)});function Z(e,t){return new Xd({type:"union",options:e,...re(t)})}i(Z,"union");var Yd=O("ZodMiniDiscriminatedUnion",(e,t)=>{wa.init(e,t),he.init(e,t)});function tt(e,t,r){return new Yd({type:"union",options:t,discriminator:e,...re(r)})}i(tt,"discriminatedUnion");var Qd=O("ZodMiniRecord",(e,t)=>{Oa.init(e,t),he.init(e,t)});function B(e,t,r){return new Qd({type:"record",keyType:e,valueType:t,...re(r)})}i(B,"record");var ef=O("ZodMiniEnum",(e,t)=>{Ra.init(e,t),he.init(e,t),e.options=Object.values(t.entries)});function D(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ef({type:"enum",entries:r,...re(t)})}i(D,"_enum");var tf=O("ZodMiniLiteral",(e,t)=>{za.init(e,t),he.init(e,t)});function C(e,t){return new tf({type:"literal",values:Array.isArray(e)?e:[e],...re(t)})}i(C,"literal");var rf=O("ZodMiniTransform",(e,t)=>{Ca.init(e,t),he.init(e,t)});function rt(e){return new rf({type:"transform",transform:e})}i(rt,"transform");var nf=O("ZodMiniOptional",(e,t)=>{Da.init(e,t),he.init(e,t)});function v(e){return new nf({type:"optional",innerType:e})}i(v,"optional");var of=O("ZodMiniNullable",(e,t)=>{ka.init(e,t),he.init(e,t)});function Qt(e){return new of({type:"nullable",innerType:e})}i(Qt,"nullable");var af=O("ZodMiniPipe",(e,t)=>{Na.init(e,t),he.init(e,t)});function nt(e,t){return new af({type:"pipe",in:e,out:t})}i(nt,"pipe");var sf=O("ZodMiniCustom",(e,t)=>{Ma.init(e,t),he.init(e,t)});function Fr(e,t){return es(sf,e??(()=>!0),t)}i(Fr,"custom");var er={};co(er,{bigint:()=>ff,boolean:()=>df,date:()=>mf,number:()=>pf,string:()=>lf});function lf(e){return Ba(Lr,e)}i(lf,"string");function pf(e){return Za(jr,e)}i(pf,"number");function df(e){return Wa(To,e)}i(df,"boolean");function ff(e){return Ka(os,e)}i(ff,"bigint");function mf(e){return Qa(as,e)}i(mf,"date");var Io=g({retryOnFailure:g({defaultValue:v(Y()),hide:v(Y())}),continueOnFailure:g({defaultValue:v(Y()),hide:v(Y())})}),Ao=class{constructor(t,r,n,o,a,s,u,p,d,f,_,y,l){this.name=t;this.displayName=r;this.description=n;this.props=o;this.propertyGroups=a;this.run=s;this.test=u;this.requireAuth=p;this.errorHandlingOptions=d;this.outputSchema=f;this.audience=_;this.aiMetadata=y;this.classification=l}static{i(this,"IAction")}},ne=i(e=>new Ao(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var J=g({displayName:c(),description:v(c()),advanced:v(Y()),width:v(D(["half","full"])),icon:v(c()),placeholder:v(c())}),V=i((e,t)=>g({type:C(t),required:Y(),defaultValue:v(Yt())}),"TPropertyValue");var Se=g({...J.shape,...V(c(),"SHORT_TEXT").shape}),Be=g({...J.shape,...V(c(),"LONG_TEXT").shape});var us=g({label:c(),value:F(),description:v(c()),icon:v(c())}),Br=g({disabled:v(Y()),placeholder:v(c()),options:M(us)});var hf=D(["cards"]),$e=g({...J.shape,options:Br,display:v(hf),...V(F(),"STATIC_DROPDOWN").shape}),Ve=g({...J.shape,options:Br,...V(M(F()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var So=g({...J.shape,...V(F(),"DROPDOWN").shape,refreshers:M(c())}),tr=g({...J.shape,...V(M(F()),"MULTI_SELECT_DROPDOWN").shape,refreshers:M(c())});var He=g({...J.shape,reveals:v(M(c())),...V(Y(),"CHECKBOX").shape});var Ze=g({...J.shape,display:v(D(["stepper"])),min:v(ve()),max:v(ve()),step:v(ve()),...V(ve(),"NUMBER").shape});var rr=g({...J.shape,streaming:v(Y()),...V(F(),"FILE").shape});var nr=g({...J.shape,...V(c(),"DATE_TIME").shape});var cs=B(c(),Z([Se,Be,$e,tr,Ve,He,Ze,rr,nr])),or=g({...J.shape,properties:cs,...V(M(F()),"ARRAY").shape});var ls=D(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),ps=g({preset:v(ls),after:v(c()),before:v(c())}),$o=g({...J.shape,display:v(D(["dropdown"])),...V(ps,"DATE_RANGE").shape});var ir=g({...J.shape,...V(Z([B(c(),F())]),"JSON").shape});var ds=Z([Se,$e,ir,or,Ve]),yf=B(c(),ds),wo=g({refreshers:M(c()),...J.shape,...V(F(),"DYNAMIC").shape});var Vr=g({...J.shape,...V(is(),"MARKDOWN").shape});var ar=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ar||{}),xt=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(xt||{}),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 sr=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(sr||{}),Oo="both_client_credentials_and_authorization_code";var Me=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Me||{}),ur=(a=>(a.NONE="NONE",a.HEADER_PRESENT="HEADER_PRESENT",a.QUERY_PRESENT="QUERY_PRESENT",a.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",a.HEAD_REQUEST="HEAD_REQUEST",a))(ur||{}),vf=g({strategy:D(ur),paramName:v(c())}),cr=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(cr||{});var Hr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Hr||{}),fs=g({status:v(ve()),body:v(F()),headers:v(B(c(),c()))}),ms=g({type:C("DELAY"),resumeDateTime:c(),requestIdToReply:v(c()),handlerId:v(c()),streamStepProgress:v(D(Hr))}),gs=g({type:C("WEBHOOK"),requestId:c(),requestIdToReply:v(c()),response:fs,handlerId:v(c()),streamStepProgress:v(D(Hr))}),_f=Z([ms,gs]);var Pf=g({body:F(),rawBody:v(F()),headers:B(c(),c()),queryParams:B(c(),c())});function ae(e){return e==null}i(ae,"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}i(lr,"isEmpty");function qe(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(qe,"assertNotNullOrUndefined");var Ro=Ce(require("crypto"),1);var xf=128,ot,Et,bf=i(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!ot||ot.length<e?(ot=Buffer.allocUnsafe(e*xf),Ro.default.randomFillSync(ot),Et=0):Et+e>ot.length&&(Ro.default.randomFillSync(ot),Et=0)}catch(t){throw ot=void 0,t}Et+=e},"fillPool"),Ef=i(e=>(bf(e|=0),ot.subarray(Et-e,Et)),"random"),Tf=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(a=t)=>{if(a<=0)return"";let s="";for(;;){let u=r(o),p=o;for(;p--;)if(s+=e[u[p]&n]||"",s.length===a)return s}}},"customRandom"),ys=i((e,t=21)=>Tf(e,t,Ef),"customAlphabet");var Af="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",vs=21,cw=c().check(et(new RegExp(`^[0-9a-zA-Z]{${vs}}$`))),If=ys(Af,vs);var it=nt(rt(e=>e instanceof Date?e.toISOString():e),c()),Oe={id:c(),created:it,updated:it},se=i(e=>v(Qt(e)),"Nullable");function zo(e){return v(Qt(D(e)))}i(zo,"NullableEnum");var dw=nt(rt(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(Y())),Zr=i(e=>nt(rt(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(M(e))),"OptionalArrayFromQuery");var gw=B(c(),F());var pr=(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))(pr||{});var Sw=c().check(et(/^#[0-9A-Fa-f]{6}$/));var ww=g({filename:c(),data:F(),type:C("file"),mimetype:v(c())});var Sf=Ce(Ps());var Nw=g({...Oe,name:c(),permissions:M(c()),platformId:se(c()),type:c(),userCount:v(ve())});var xs=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(xs||{}),Co=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Co||{}),Do=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Do||{});var ko=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(ko||{});var No=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(No||{});var $f=g({mode:D(xs),value:F()}),wf=g({auth:v(c()),fields:B(c(),$f)}),Of=g({pieceName:c(),pieceVersion:c(),actionName:c(),predefinedInput:v(wf)}),Rf=g({type:C("PIECE"),toolName:c().check(De(1)),pieceMetadata:Of}),zf=g({type:C("none")}),Cf=g({type:C("access_token"),accessToken:c()}),Df=g({type:C("api_key"),apiKey:c(),apiKeyHeader:c()}),kf=g({type:C("headers"),headers:B(c(),c())}),Nf=tt("type",[zf,Cf,Df,kf]),bs=g({type:C("FLOW"),toolName:c().check(De(1)),externalFlowId:c(),flowDisplayName:v(c())}),Es=g({type:C("MCP"),toolName:c().check(De(1)),serverUrl:rs(),protocol:D(Do),auth:Nf}),Ts=g({type:C("KNOWLEDGE_BASE"),toolName:c().check(De(1)),sourceType:D(Co),sourceId:c(),sourceName:c()}),Mf=tt("type",[Rf,bs,Es,Ts]),Uf=g({displayName:c(),description:v(c()),type:D(ko)}),As=g({type:C("MARKDOWN"),markdown:c()}),Tt={type:C("TOOL_CALL"),input:se(B(c(),F())),output:v(F()),toolName:c(),status:D(No),toolCallId:c(),startTime:c(),endTime:v(c())},fO=g(Tt),Is=tt("toolCallType",[g({...Tt,toolCallType:C("PIECE"),pieceName:c(),pieceVersion:c(),actionName:c()}),g({...Tt,toolCallType:C("FLOW"),displayName:c(),externalFlowId:c()}),g({...Tt,toolCallType:C("MCP"),displayName:c(),serverUrl:c()}),g({...Tt,toolCallType:C("KNOWLEDGE_BASE"),displayName:c(),sourceType:c()}),g({...Tt,toolCallType:C("UNKNOWN"),displayName:c()})]),Lf=Z([As,Is]);var Mo=(r=>(r.IMAGE="image",r.TEXT="text",r))(Mo||{}),Ge=g({apiKey:c()}),jf=Ge,Ff=g({apiKey:c(),apiKeyHash:c()}),Bf=Ge,Vf=Ge,Hf=Ge,Zf=Ge,qf=Ge,Gf=Ge,Wf=Ge,Rs=g({accessKeyId:c().check(De(1)),secretAccessKey:c().check(De(1))}),Kf=g({}),Jf=g({}),Xf=g({}),Yf=g({}),Qf=g({}),em=g({}),zs=g({modelId:c(),modelName:c(),modelType:D(Mo)}),Cs=g({apiKeyHeader:c(),baseUrl:c(),models:M(zs),defaultHeaders:v(B(c(),c()))}),Ds=g({accountId:c(),gatewayId:c(),models:M(zs),vertexProject:v(c()),vertexRegion:v(c())}),ks=g({resourceName:c(),apiVersion:nt(rt(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(c()))}),Ns=g({region:c().check(De(1))}),tm=Z([jf,Hf,Zf,qf,Gf,Vf,Bf,Ff,Rs,Wf]),Ms=Z([Cs,Ds,ks,Ns,Kf,Xf,Yf,Qf,Jf,em]),rm=g({id:c(),name:c(),type:D(Mo)}),nm=g({id:c(),name:c(),provider:D(pr),config:Ms,enabledForChat:Y()}),om=g({provider:D(pr),config:Ms,auth:tm,platformId:c()});var yO={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Ss=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],im=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],am=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],$s=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],sm=["grok-4.20","grok-4.1-fast"],um={openai:Ss,anthropic:im,google:$s,activepieces:[...am.map(e=>`anthropic/${e}`),...Ss.map(e=>`openai/${e}`),...$s.map(e=>`google/${e}`),...sm.map(e=>`x-ai/${e}`)]};var ws=128e3,cm={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function lm({provider:e}){return e?cm[e]??ws:ws}i(lm,"getMaxContextTokens");var Os={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"},pm={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},dm=new Set(["anthropic","mistral"]);function Ue(e){return{chatModels:um[e],maxContextTokens:lm({provider:e}),defaultEmbeddingModel:Os[e],supportsEmbedding:Os[e]!==void 0,supportsImageGeneration:!dm.has(e),webSearch:pm[e]}}i(Ue,"buildProviderCapabilities");var fm={openai:Ue("openai"),anthropic:Ue("anthropic"),openrouter:Ue("openrouter"),azure:Ue("azure"),google:Ue("google"),"cloudflare-gateway":Ue("cloudflare-gateway"),custom:Ue("custom"),bedrock:Ue("bedrock"),mistral:Ue("mistral"),activepieces:Ue("activepieces")};var mm=g({base64Url:c(),fileName:c(),extension:v(c())}),gm=g({mimeType:c(),url:c(),fileName:v(c())}),Uo=Z([mm,gm]);var hm=Z([g({type:C("file"),value:Uo}),g({type:C("markdown"),value:c(),files:v(M(Uo))})]),ym=g({sessionId:c(),message:c(),files:v(M(c()))});var Ls=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ls||{}),js=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(js||{}),Lo=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Lo||{});var vm=Z([g({...Oe,name:c(),externalId:c(),type:C("STATIC_DROPDOWN"),tableId:c(),projectId:c(),data:g({options:M(g({value:c()}))})}),g({...Oe,name:c(),externalId:c(),type:Z([C("TEXT"),C("NUMBER"),C("DATE"),C("DATETIME")]),tableId:c(),projectId:c()})]),_m=g({...Oe,name:c(),folderId:se(c()),projectId:c(),externalId:c(),status:zo(js),trigger:zo(Ls)}),Pm=g({...Oe,tableId:c(),projectId:c(),cells:B(c(),g({updated:c(),created:c(),value:F(),fieldName:c()}))}),xm=g({events:M(D(Lo)),webhookUrl:c(),flowId:c()}),bm=g({fields:M(g({id:c(),name:c()})),rows:M(B(c(),c())),name:c()}),Em=g({projectId:c(),limit:v(er.number()),cursor:v(c()),name:v(c()),externalIds:Zr(c()),folderId:v(c()),folderIds:Zr(c())}),Tm=g({records:M(M(g({fieldId:c(),value:Bs()}))),tableId:c()}),Am=g({cells:v(M(g({fieldId:c(),value:Bs()}))),tableId:c(),agentUpdate:v(Y())}),Fs=tt("operator",[ft("eq"),ft("neq"),ft("gt"),ft("gte"),ft("lt"),ft("lte"),ft("co"),Us("exists"),Us("not_exists")]),Im=g({tableId:c(),limit:v(er.number()),cursor:v(c()),filters:Zr(Fs)});function Bs(){return nt(rt(e=>e==null?e:String(e)),Qt(c()))}i(Bs,"coerceToString");function ft(e){return g({fieldId:c(),operator:C(e),value:c()})}i(ft,"valueFilter");function Us(e){return g({fieldId:c(),operator:C(e)})}i(Us,"existenceFilter");var Sm=g({status:v(ve()),body:v(F()),headers:v(B(c(),c()))}),$m=g({...Oe,deleted:se(it),ownerId:c(),displayName:c(),platformId:c(),externalId:se(c())});var Vs=g({name:c(),description:v(c()),type:c(),required:Y()}),wm=g({pieceName:c(),triggerName:c(),input:g({toolName:c(),toolDescription:c(),inputSchema:M(Vs),returnsResponse:Y()})});var Hs="^[0-9]+\\.[0-9]+\\.[0-9]+$",NO=new RegExp(Hs),Rm="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",MO=c().check(et(new RegExp(Hs))),UO=c().check(et(new RegExp(Rm))),zm=g({packageType:C("ARCHIVE"),pieceType:D(xt),pieceName:c(),pieceVersion:c(),archiveId:c(),platformId:c()}),Zs=g({packageType:C("REGISTRY"),pieceType:C("OFFICIAL"),pieceName:c(),pieceVersion:c()}),qs=g({packageType:C("REGISTRY"),pieceType:C("CUSTOM"),pieceName:c(),pieceVersion:c(),platformId:c()}),LO=Z([Zs,qs]),jO=Z([zm,Zs,qs]);var Cm=tt("type",[g({type:C("CRON_EXPRESSION"),cronExpression:c(),timezone:c()}),g({type:C("INTERVAL"),intervalMs:ns().check(Mr(6e4))})]),FO=g({...Oe,type:D(Me),projectId:c(),flowId:c(),triggerName:c(),schedule:se(Cm),flowVersionId:c(),pieceName:c(),pieceVersion:c(),deleted:se(c()),simulate:Y()}),Gs=(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))(Gs||{}),Ws=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ws||{}),Ks=(r=>(r.S3="S3",r.DB="DB",r))(Ks||{}),BO=g({...Oe,projectId:se(c()),platformId:se(c()),type:D(Gs),compression:D(Ws),data:v(F()),location:D(Ks),size:se(ve()),fileName:se(c()),s3Key:se(c()),metadata:se(B(c(),c()))}),Js=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Js||{}),Xs=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Xs||{}),VO=g({id:c(),email:c(),firstName:c(),status:D(Xs),externalId:se(c()),platformId:se(c()),platformRole:D(Js),lastName:c(),created:it,updated:it,lastActiveDate:se(it),imageUrl:se(c())});var Fo=g({...J.shape,...V(B(c(),F()),"OBJECT").shape});var Bo=g({...J.shape,formatProperty:v(c()),...V(c(),"RICH_TEXT").shape});var eu=g({...J.shape,...V(c(),"COLOR").shape});var Vo=Z([Se,Be,Bo,Vr,He,$e,Ve,So,tr,wo,Ze,or,Fo,ir,nr,$o,rr,eu]),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"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_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"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Le=g({displayName:c(),description:v(c()),hasConnectionIdentifier:v(Y())});var tu=g({username:c(),password:c()}),Ho=g({...Le.shape,username:g({displayName:c(),description:v(c())}),password:g({displayName:c(),description:v(c())}),...V(tu,"BASIC_AUTH").shape});var Mm=B(c(),Z([Se,Be,Ze,He,$e])),Zo=g({...Le.shape,props:Mm,...V(F(),"CUSTOM_AUTH").shape});var mt=g({...Le.shape,...V(g({auth:c()}),"SECRET_TEXT").shape});var Um=B(c(),Z([Se,Be,mt,Ze,He,$e,Ve,Vr])),ru=g({...Le.shape,props:Um,...V(F(),"OIDC").shape});var qo=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(qo||{}),nu=Z([Se,mt,$e]),ou=B(c(),nu),Lm=g({props:v(B(c(),nu)),authUrl:c(),tokenUrl:c(),scope:M(c()),prompt:v(Z([C("none"),C("consent"),C("login"),C("omit")])),pkce:v(Y()),pkceMethod:v(Z([C("plain"),C("S256")])),authorizationMethod:v(D(qo)),grantType:v(Z([D(sr),C(Oo)])),extra:v(B(c(),c()))}),iu=g({access_token:c(),props:v(ou),data:B(c(),Yt())}),Go=g({...Le.shape,...Lm.shape,...V(iu,"OAUTH2").shape});var At=Z([Ho,Zo,ru,Go,mt]),dr="Connection",Wo={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 Iz={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 jm=g({...J.shape,...V(F(),"CUSTOM").shape,code:c()});var Fm=Z([Vo,At]),Ko=B(c(),Fm),Gz=B(c(),Vo);var au=Z([g({strategy:C("CRON"),cronExpression:c()}),g({strategy:C("NONE")})]),It=class{constructor(t,r,n,o,a,s,u,p,d,f,_,y,l,m,P,h,x,E,H,de,xe){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=a;this.type=s;this.handshakeConfiguration=u;this.onHandshake=p;this.renewConfiguration=d;this.onRenew=f;this.onEnable=_;this.onDisable=y;this.onStart=l;this.run=m;this.test=P;this.sampleData=h;this.testStrategy=x;this.outputSchema=E;this.aiMetadata=H;this.classification=de;this.propertyGroups=xe}static{i(this,"ITrigger")}},St=i(e=>{switch(e.type){case"WEBHOOK":return new It(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,e.classification,e.propertyGroups);case"POLLING":return new It(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,e.classification,e.propertyGroups);case"MANUAL":return new It(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,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new It(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,ae(e.sampleData)&&ae(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var su="2",Gr="0.82.0";var Jo=class{constructor(t,r,n,o,a,s,u,p,d=Gr,f,_="",y){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=_;this.deprecated=y;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:su}),"getContextInfo");(!Vm(d)||Hm(d,Gr))&&(this.minimumSupportedRelease=Gr),a.forEach(l=>this._actions[l.name]=l),s.forEach(l=>this._triggers[l.name]=l)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:Bm(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}},cu=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(a=>a.type===r.type)))throw new Error("Auth properties must be unique by type");return new Jo(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 Bm(e){if(e!==void 0)return Array.isArray(e)?e.map(uu):uu(e)}i(Bm,"withConnectionIdentifierFlag");function uu(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}i(uu,"flagConnectionIdentifier");function Vm(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Vm,"isValidSimpleSemver");function Hm(e,t){let[r,n,o]=e.split(".").map(Number),[a,s,u]=t.split(".").map(Number);return r!==a?r<a:n!==s?n<s:o<u}i(Hm,"isSemverLessThan");var Zm=v(B(c(),B(c(),c()))),lu=g({id:v(c()),name:c(),displayName:c(),logoUrl:c(),description:c(),authors:M(c()),platformId:v(c()),directoryPath:v(c()),auth:v(Z([At,M(At)])),version:c(),categories:v(M(D(bt))),minimumSupportedRelease:v(c()),maximumSupportedRelease:v(c()),deprecated:v(Y()),i18n:Zm}),qm=D(["human","ai","both"]),pu=g({description:v(c()),idempotent:v(Y())}),du=D(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Gm=D(["tabs","section","summary","builder","footer"]),fu=g({key:c(),display:Gm,label:v(c()),description:v(c()),icon:v(c()),props:M(c())}),mu=g({name:c(),displayName:c(),description:c(),props:Ko,propertyGroups:v(M(fu)),requireAuth:Y(),errorHandlingOptions:v(Io),outputSchema:v(Fr()),audience:v(qm),aiMetadata:v(pu),classification:v(du)}),gu=g({name:c(),displayName:c(),description:c(),props:Ko,propertyGroups:v(M(fu)),errorHandlingOptions:v(Io),type:D(Me),sampleData:F(),handshakeConfiguration:v(Fr()),renewConfiguration:v(au),testStrategy:D(cr),outputSchema:v(Fr()),aiMetadata:v(pu),classification:v(du)}),Wm=g({...lu.shape,actions:B(c(),mu),triggers:B(c(),gu)}),Km=g({...lu.shape,actions:ve(),triggers:ve(),suggestedActions:v(M(mu)),suggestedTriggers:v(M(gu))}),hu=g({projectUsage:ve(),pieceType:D(xt),packageType:D(ar),platformId:v(c()),archiveId:v(c())}),KC=g({...Wm.shape,...hu.shape}),JC=g({...Km.shape,...hu.shape}),XC=g({name:c(),version:c()});var Jm=Ce(require("path")),Xm=Ce(require("fs/promises"));var $t=require("node:stream");var Wr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((a,s)=>{o.append(s,a)}),{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 Kr=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Xo,r=new Yo){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Xo=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Yo=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var fr=class extends Error{constructor(r,n){let o=n.status||500,a=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:a},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=a}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function yu({error:e,requestBody:t}){return e instanceof fr?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(yu,"toFailsafeOutput");var Qo=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(Qo||{});var Jr=class extends Wr{static{i(this,"FetchHttpClient")}constructor(t="",r=new Kr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),a=this.getHeaders(t),s=t.queryParams??{};for(let[H,de]of Object.entries(s))o.append(H,de);let u=o.toString(),p=u?`${n}?${u}`:n,d=t.responseType??"json",f=t.followRedirects??!0,_=t.retries??0,{body:y,extraHeaders:l,isStream:m}=Ym(t.method)?Qm(t.body,a):{body:void 0,extraHeaders:{},isStream:!1},P=tg({...a,...l}),h=await eg(async()=>{let H=new AbortController,de=t.timeout&&t.timeout>0?setTimeout(()=>H.abort(),t.timeout):void 0;try{let xe={method:t.method.toString(),headers:P,body:y,redirect:f?"follow":"manual",signal:H.signal};return m&&(xe.duplex="half"),r?.dispatcher!==void 0&&(xe.dispatcher=r.dispatcher),await fetch(p,xe)}finally{de!==void 0&&clearTimeout(de)}},m?0:_),x=f?300:400;if(h.status<200||h.status>=x){let H=await vu(h,d==="stream"?"text":d),de=new fr(t.body,{status:h.status,responseBody:H});throw console.error("[HttpClient#(sanitized error message)] Request failed:",de),de}let E=await vu(h,d);return{status:h.status,headers:rg(h.headers),body:E}}};function Ym(e){return e!=="GET"&&e!=="HEAD"}i(Ym,"acceptsRequestBody");function Qm(e,t){if(Pu(e))return{body:void 0,extraHeaders:{},isStream:!1};if(ng(e)){let n=new $t.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof $t.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(Qm,"serializeBody");async function vu(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Pu(e.body)?$t.Readable.from([]):$t.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(vu,"parseResponseBody");async function eg(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await _u(n);continue}return o}catch(o){if(r=o,n<t){await _u(n);continue}throw o}throw r}i(eg,"sendWithRetries");function _u(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(_u,"backoff");function tg(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}i(tg,"normalizeHeaders");function rg(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(rg,"toHttpHeaders");function ng(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(ng,"isNodeFormData");function Pu(e){return e==null}i(Pu,"isNil");var xu=new Jr;var Hh=Ce(require("fs")),Sl=Ce(Il());var Zh={"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 qh(e){let t=e.split(";")[0].trim().toLowerCase();return Zh[t]??""}i(qh,"contentTypeToExtension");var Gh=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Wh=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function $l({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:a,props:s,extraProps:u,authLocation:p="headers",classification:d="WRITE"}){return ne({audience:"human",name:a||"custom_api_call",classification:d,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:i(async({auth:f})=>({url:T.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
6
+ i.e ${Wh(t,f)}/resource or /resource`,required:!0,defaultValue:f?t(f):"",...s?.url??{}})}),"props")}),method:T.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Qo).map(f=>({label:f,value:f}))},...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:i(async({body_type:f})=>{if(!f)return{};let _=f,y={};switch(_){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:i(async f=>{let{method:_,url:y,headers:l,queryParams:m,body:P,body_type:h,failsafe:x,timeout:E,response_is_binary:H,followRedirects:de}=f.propsValue;qe(_,"Method"),qe(y,"URL");let xe=ae(r)?{}:await r(f.auth,f.propsValue),Ie=y.url,me=Ie.startsWith("http://")||Ie.startsWith("https://")?Ie:Gh({baseUrl:t(f.auth),relativePath:Ie}),W={method:_,url:me,headers:{...l??{},...p==="headers"||!ae(p)?xe:{}},queryParams:{...p==="queryParams"?xe:{},...m??{}},timeout:E?E*1e3:0,followRedirects:de};if(H&&(W.responseType="arraybuffer"),P)if(h&&h!=="none"){let be=P.data;if(h==="form_data"){let Ar=be,N=new Sl.default;for(let{fieldName:S,fieldType:A,textFieldValue:R,fileFieldValue:I}of Ar)A==="text"&&!lr(R)?N.append(S,R):A==="file"&&!lr(I)&&N.append(S,I.data,{filename:I?.filename});W.body=N,W.headers={...W.headers,...N.getHeaders()}}else W.body=be}else h||(W.body=P);try{let be=await xu.sendRequest(W);return await Kh(f.files,be.body,be.status,be.headers,H)}catch(be){if(x)return yu({error:be,requestBody:W.body});throw be}},"run")})}i($l,"createCustomApiCallAction");var Kh=i(async(e,t,r,n,o)=>{let a;if(o&&Jh(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],u=qh(s??"")||"txt",p;t instanceof ArrayBuffer?p=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?p=t:p=Buffer.from(t),a=await e.write({fileName:`output.${u}`,data:p})}else a=t;return{status:r,headers:n,body:a}},"handleBinaryResponse"),Jh=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var je={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:a,server:s}){switch(e.strategy){case 0:{let u=await t.get("lastPoll");if(ae(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((f,_)=>Math.max(f,_.epochMilliSeconds),u);return await t.put("lastPoll",d),p.filter(f=>f.epochMilliSeconds>u).map(f=>f.data)}case 1:{let u=await t.get("lastItem"),p=await e.items({store:t,auth:r,propsValue:n,lastItemId:u,files:a,server:s}),d=p.findIndex(y=>y.id===u),f=[];ae(u)||d==-1?f=p??[]:f=p?.slice(0,d)??[],ae(o)||(f=f.slice(-o));let _=f?.[0]?.id;return ae(_)||await t.put("lastItem",_),f.map(y=>y.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o,isRepublish:a}){switch(e.strategy){case 0:{if(a&&!ae(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(a&&!ae(await t.get("lastItem")))break;let u=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;ae(u)?await t.delete("lastItem"):await t.put("lastItem",u);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:a}){let s=[];switch(e.strategy){case 0:{s=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:a});break}case 1:{s=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:a});break}}return Xh(s.map(u=>u.data))}};function Xh(e){return e.length<=5?e:e.slice(0,5)}i(Xh,"getFirstFiveOrAll");var yr="login.microsoftonline.com",Rl="login.microsoftonline.us",wl="Mail.ReadWrite Mail.Send Calendars.Read offline_access User.Read openid email profile",Yh="https://graph.microsoft.com/.default",Qh="https://graph.microsoft.us/.default",Ol={[yr]:"https://graph.microsoft.com",[Rl]:"https://graph.microsoft.us"},zl=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:Rl}]}}),Cl=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:wl,options:{disabled:!1,options:[{label:"Delegated \u2014 Commercial (Global)",value:wl},{label:"App-only \u2014 Commercial (Global)",value:Yh},{label:"App-only \u2014 US Government (GCC High)",value:Qh}]}});function Dl(e){return e??yr}i(Dl,"resolveCloudHost");function kl(e){return Dl(e.props?.cloud)}i(kl,"getMicrosoftCloudFromAuth");function sn(e){let t=Dl(e);return Ol[t]??Ol[yr]}i(sn,"getGraphBaseUrl");var Xp=Ce(Jp());function __(e){let t=kl(e);return Xp.Client.initWithMiddleware({authProvider:{getAccessToken:i(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:sn(t)})}i(__,"createClient");function P_(e){let t=e.props?.mailbox?.trim();return t?`/users/${encodeURIComponent(t)}`:"/me"}i(P_,"mailboxPrefix");var $={createClient:__,mailboxPrefix:P_};var x_=`
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=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=`
21
+ `,X=Wo.OAuth2({description:x_,grantType:"both_client_credentials_and_authorization_code",props:{cloud:zl,accessMode:Cl,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:i(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:b_(t)}}},"validate")});function b_(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."}i(b_,"describeGraphError");var ct=i(e=>T.Dropdown({auth:X,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:i(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"),Yp=i(e=>T.Dropdown({auth:X,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:i(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"),lt=i(e=>T.Dropdown({auth:X,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:i(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 Qp=ne({auth:X,name:"addLabelToEmail",classification:"WRITE",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:ct({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),a=(await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get()).categories||[],s=[...new Set([...a,...r])];return await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).patch({categories:s})}});var ed=ne({auth:X,name:"createDraftEmail",classification:"WRITE",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:a,body:s,bodyFormat:u}=e.propsValue,p={subject:a,body:{content:s,contentType:u},toRecipients:t.map(_=>({emailAddress:{address:_}})),ccRecipients:r.map(_=>({emailAddress:{address:_}})),bccRecipients:n.map(_=>({emailAddress:{address:_}})),attachments:o.map(_=>({"@odata.type":"#microsoft.graph.fileAttachment",name:_.fileName||_.file.filename,contentBytes:_.file.base64}))};return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages`).post(p)}});var td=ne({auth:X,name:"downloadAttachment",classification:"READ",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 a of n.value)a.name&&a.contentBytes&&o.push({...a,file:await e.files.write({fileName:a.name||"test.png",data:Buffer.from(a.contentBytes,"base64")})});return o}});var qi=Ce(Tr());var rd=ne({auth:X,name:"findEmail",classification:"SEARCH",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:lt({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),a=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=`${a}?${d}`,_={ConsistencyLevel:"eventual",Prefer:'outlook.body-content-type="text"'},y=await o.api(f).headers(_).get(),l=y.value,m=y["@odata.nextLink"];return t&&l.sort((P,h)=>(0,qi.default)(h.receivedDateTime).valueOf()-(0,qi.default)(P.receivedDateTime).valueOf()),{found:l.length>0,result:l,hasMore:!!m,nextPageUrl:m,totalCount:l.length}}});var nd=ne({auth:X,name:"forwardEmail",classification:"WRITE",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:ct({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),a=await o.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get(),s={toRecipients:n.map(p=>({emailAddress:{address:p}})),body:{contentType:"html",content:(r??"")+"<br><br>"+a.body.content},attachments:a.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 od=ne({auth:X,name:"moveEmailToFolder",classification:"WRITE",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:ct({displayName:"Email",description:"Select the email message to move.",required:!0}),destinationFolderId:lt({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 id=ne({auth:X,name:"removeLabelFromEmail",classification:"WRITE",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:ct({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 ad=ne({auth:X,name:"reply-email",classification:"WRITE",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:X,displayName:"Email",description:"Select the email message to reply to.",required:!0,refreshers:[],options:i(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,a=e.propsValue.ccRecipients,s=e.propsValue.bccRecipients,u=e.propsValue.attachments,p={body:{content:t,contentType:r},ccRecipients:a.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 _=(await d.api(`${$.mailboxPrefix(e.auth)}/messages/${n}/createReply`).post({message:p})).id;return o?{success:!0,message:"Draft created successfully.",draftId:_,draftLink:`https://outlook.office.com/mail/drafts/id/${_}`}:(await d.api(`${$.mailboxPrefix(e.auth)}/messages/${_}/send`).post({}),{success:!0,message:"Reply sent successfully.",draftId:_})}catch(f){console.error("Reply Email Error:",f);let _=f instanceof Error?f.message:"Unknown error";throw new Error(_)}}});var sd=ne({auth:X,name:"sendDraftEmail",classification:"WRITE",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:Yp({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 ud=ne({auth:X,name:"send-email",classification:"WRITE",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:a,body:s,bodyFormat:u}=e.propsValue,p={subject:a,body:{content:s,contentType:u},toRecipients:t.map(_=>({emailAddress:{address:_}})),ccRecipients:r.map(_=>({emailAddress:{address:_}})),bccRecipients:n.map(_=>({emailAddress:{address:_}})),attachments:o.map(_=>({"@odata.type":"#microsoft.graph.fileAttachment",name:_.fileName||_.file.filename,contentBytes:_.file.base64}))};return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/sendMail`).post({message:p,saveToSentItems:"true"})}});var ao=Ce(Tr());async function cd(e,t,r,n,o,a){let s=[];for(let u of r){if(a&&u.sender?.emailAddress?.address&&!u.sender.emailAddress.address.toLowerCase().includes(a.toLowerCase()))continue;let p=await e.api(`${t}/messages/${u.id}/attachments`).get();for(let d of p.value){let{contentBytes:f,..._}=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,..._})}}}return s}i(cd,"enrichAttachments");var ld=St({auth:X,name:"newAttachment",classification:"READ",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:lt({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),a=t?`${$.mailboxPrefix(e.auth)}/mailFolders/${t}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,s=await o.api(`${a}?$filter=hasAttachments eq true`).top(10).get();return(await cd(o,$.mailboxPrefix(e.auth),s.value,e.files,r,n)).map(d=>({epochMilliSeconds:(0,ao.default)(d.messageReceivedDateTime).valueOf(),data:d})).map(d=>d.data)},async run(e){let t=await e.store.get("lastPoll");if(ae(t))throw new Error("lastPoll doesn't exist in the store.");let{folderId:r,attachmentNameFilter:n,sender:o}=e.propsValue,a=$.createClient(e.auth),s=r?`${$.mailboxPrefix(e.auth)}/mailFolders/${r}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,u=await a.api(`${s}?$filter=receivedDateTime gt ${(0,ao.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 a.api(u["@odata.nextLink"]).get();let f=(await cd(a,$.mailboxPrefix(e.auth),p,e.files,n,o)).map(y=>({epochMilliSeconds:(0,ao.default)(y.messageReceivedDateTime).valueOf(),data:y})),_=f.reduce((y,l)=>Math.max(y,l.epochMilliSeconds),t);return await e.store.put("lastPoll",_),f.filter(y=>y.epochMilliSeconds>t).map(y=>y.data)}});var Gi=Ce(Tr());var so={strategy:0,items:i(async({auth:e,lastFetchEpochMS:t,propsValue:r})=>{let n=$.createClient(e),o=[],a=r.folderId,s=t===0?"$top=10":`$filter=createdDateTime gt ${(0,Gi.default)(t).toISOString()}`,u=await n.api(`${$.mailboxPrefix(e)}/mailFolders/${a}/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,Gi.default)(p.createdDateTime).valueOf(),data:p}))},"items")},pd=St({auth:X,name:"newEmailInFolder",classification:"READ",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:lt({displayName:"Folder",description:"",required:!0})},sampleData:{},type:"POLLING",async onEnable(e){await je.onEnable(so,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await je.onDisable(so,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await je.test(so,e)},async run(e){return await je.poll(so,e)}});var Wi=Ce(Tr());var uo={strategy:0,items:i(async({auth:e,lastFetchEpochMS:t,propsValue:r})=>{let n=$.createClient(e),o=[],a=t===0?"$top=10":`$filter=receivedDateTime gt ${(0,Wi.default)(t).toISOString()}`,s=await n.api(`${$.mailboxPrefix(e)}/mailFolders/inbox/messages?${a}`).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 _=f.emailAddress?.address?.toLowerCase(),y=r.recipient?.toLowerCase();return _===y}))),u.map(p=>({epochMilliSeconds:(0,Wi.default)(p.receivedDateTime).valueOf(),data:p}))},"items")},dd=St({auth:X,name:"newEmail",classification:"READ",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 je.onEnable(uo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await je.onDisable(uo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await je.test(uo,e)},async run(e){return await je.poll(uo,e)}});var fd=ne({auth:X,name:"request_approval_in_mail",classification:"WRITE",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;qe(t,"token"),qe(r,"recipients"),qe(n,"subject"),qe(o,"body");let a=await e.run.createWaitpoint({type:"WEBHOOK"}),s=`${a.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 &amp; 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}}]},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});
29
+ `,p=$.createClient(e.auth),d={subject:n,body:{content:u,contentType:"html"},toRecipients:[{emailAddress:{address:r}}]},f=await p.api(`${$.mailboxPrefix(e.auth)}/sendMail`).post({message:d,saveToSentItems:!0});return e.run.waitForWaitpoint(a.id),{approved:!1}}catch(t){throw console.error("[RequestApprovalEmail] Error during BEGIN execution:",t),t}else return{approved:e.resumePayload.queryParams.action==="approve"}}});var T_=cu({displayName:"Microsoft Outlook",auth:X,minimumSupportedRelease:"0.87.0",logoUrl:"https://cdn.activepieces.com/pieces/microsoft-outlook.png",categories:["PRODUCTIVITY"],authors:["lucaslimasouza","kishanprmr","sanket-a11y"],actions:[ud,td,ad,ed,Qp,id,fd,od,sd,nd,rd,$l({auth:X,baseUrl:i(e=>{let t=e.props?.cloud;return sn(t)+"/v1.0/"},"baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[dd,pd,ld]});0&&(module.exports={microsoftOutlook});
30
30
  /*! Bundled license information:
31
31
 
32
32
  mime-types/index.js: