@http-forge/core 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +188 -188
- package/dist/index.mjs +187 -187
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,228 +1,228 @@
|
|
|
1
|
-
var dN=Object.create;var DE=Object.defineProperty;var hN=Object.getOwnPropertyDescriptor;var pN=Object.getOwnPropertyNames;var mN=Object.getPrototypeOf,gN=Object.prototype.hasOwnProperty;var qt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var yN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pN(e))!gN.call(t,i)&&i!==r&&DE(t,i,{get:()=>e[i],enumerable:!(n=hN(e,i))||n.enumerable});return t};var tv=(t,e,r)=>(r=t!=null?dN(mN(t)):{},yN(e||!t||!t.__esModule?DE(r,"default",{value:t,enumerable:!0}):r,t));var ZE=F((el,zu)=>{(function(){var t,e="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",h=1,g=2,m=4,S=1,_=2,C=1,x=2,A=4,T=8,j=16,Y=32,V=64,K=128,ee=256,k=512,E=30,P="...",N=800,D=16,L=1,z=2,Z=3,ie=1/0,fe=9007199254740991,bt=17976931348623157e292,we=NaN,he=4294967295,Ze=he-1,_t=he>>>1,Mt=[["ary",K],["bind",C],["bindKey",x],["curry",T],["curryRight",j],["flip",k],["partial",Y],["partialRight",V],["rearg",ee]],le="[object Arguments]",ei="[object Array]",su="[object AsyncFunction]",ct="[object Boolean]",_n="[object Date]",as="[object DOMException]",jt="[object Error]",ft="[object Function]",ti="[object GeneratorFunction]",rr="[object Map]",Qr="[object Number]",Lm="[object Null]",wn="[object Object]",Lf="[object Promise]",jm="[object Proxy]",ls="[object RegExp]",gt="[object Set]",Ri="[object String]",ma="[object Symbol]",Um="[object Undefined]",us="[object WeakMap]",dr="[object WeakSet]",cs="[object ArrayBuffer]",ri="[object DataView]",fs="[object Float32Array]",Xe="[object Float64Array]",ga="[object Int8Array]",ya="[object Int16Array]",ds="[object Int32Array]",uo="[object Uint8Array]",hs="[object Uint8ClampedArray]",ni="[object Uint16Array]",ps="[object Uint32Array]",Bm=/\b__p \+= '';/g,va=/\b(__p \+=) '' \+/g,Hm=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ms=/&(?:amp|lt|gt|quot|#39);/g,Ii=/[&<>"']/g,ou=RegExp(ms.source),Sa=RegExp(Ii.source),oe=/<%-([\s\S]+?)%>/g,Vm=/<%([\s\S]+?)%>/g,jf=/<%=([\s\S]+?)%>/g,En=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_r=/^\w*$/,$e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,co=/[\\^$.*+?()[\]{}|]/g,Ke=RegExp(co.source),Oi=/^\s+/,Wm=/\s/,ba=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vt=/\{\n\/\* \[wrapped with (.+)\] \*/,Cn=/,? & /,Zr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pt=/[()=,{}\[\]\/\s]/,jr=/\\(\\)?/g,xn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ii=/\w*$/,Ym=/^[-+]0x[0-9a-f]+$/i,Jm=/^0b[01]+$/i,fo=/^\[object .+?Constructor\]$/,Uf=/^0o[0-7]+$/i,zm=/^(?:0|[1-9]\d*)$/,gs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,si=/($^)/,Bf=/['\n\r\u2028\u2029\\]/g,_a="\\ud800-\\udfff",Km="\\u0300-\\u036f",Gm="\\ufe20-\\ufe2f",yt="\\u20d0-\\u20ff",wa=Km+Gm+yt,Hf="\\u2700-\\u27bf",au="a-z\\xdf-\\xf6\\xf8-\\xff",Vf="\\xac\\xb1\\xd7\\xf7",Qm="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Zm="\\u2000-\\u206f",Xm=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wf="A-Z\\xc0-\\xd6\\xd8-\\xde",Yf="\\ufe0e\\ufe0f",Jf=Vf+Qm+Zm+Xm,Ea="['\u2019]",zf="["+_a+"]",Kf="["+Jf+"]",Ca="["+wa+"]",Gf="\\d+",Qf="["+Hf+"]",Zf="["+au+"]",ys="[^"+_a+Jf+Gf+Hf+au+Wf+"]",vs="\\ud83c[\\udffb-\\udfff]",Xf="(?:"+Ca+"|"+vs+")",Ss="[^"+_a+"]",Ur="(?:\\ud83c[\\udde6-\\uddff]){2}",lu="[\\ud800-\\udbff][\\udc00-\\udfff]",bs="["+Wf+"]",ed="\\u200d",td="(?:"+Zf+"|"+ys+")",eg="(?:"+bs+"|"+ys+")",rd="(?:"+Ea+"(?:d|ll|m|re|s|t|ve))?",nd="(?:"+Ea+"(?:D|LL|M|RE|S|T|VE))?",id=Xf+"?",xa="["+Yf+"]?",tg="(?:"+ed+"(?:"+[Ss,Ur,lu].join("|")+")"+xa+id+")*",sd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",od=xa+id+tg,ng="(?:"+[Qf,Ur,lu].join("|")+")"+od,ig="(?:"+[Ss+Ca+"?",Ca,Ur,lu,zf].join("|")+")",sg=RegExp(Ea,"g"),og=RegExp(Ca,"g"),uu=RegExp(vs+"(?="+vs+")|"+ig+od,"g"),ag=RegExp([bs+"?"+Zf+"+"+rd+"(?="+[Kf,bs,"$"].join("|")+")",eg+"+"+nd+"(?="+[Kf,bs+td,"$"].join("|")+")",bs+"?"+td+"+"+rd,bs+"+"+nd,rg,sd,Gf,ng].join("|"),"g"),lg=RegExp("["+ed+_a+wa+Yf+"]"),ug=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cg=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],fg=-1,st={};st[fs]=st[Xe]=st[ga]=st[ya]=st[ds]=st[uo]=st[hs]=st[ni]=st[ps]=!0,st[le]=st[ei]=st[cs]=st[ct]=st[ri]=st[_n]=st[jt]=st[ft]=st[rr]=st[Qr]=st[wn]=st[ls]=st[gt]=st[Ri]=st[us]=!1;var rt={};rt[le]=rt[ei]=rt[cs]=rt[ri]=rt[ct]=rt[_n]=rt[fs]=rt[Xe]=rt[ga]=rt[ya]=rt[ds]=rt[rr]=rt[Qr]=rt[wn]=rt[ls]=rt[gt]=rt[Ri]=rt[ma]=rt[uo]=rt[hs]=rt[ni]=rt[ps]=!0,rt[jt]=rt[ft]=rt[us]=!1;var dg={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},cu={"&":"&","<":"<",">":">",'"':""","'":"'"},fu={"&":"&","<":"<",">":">",""":'"',"'":"'"},hg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ad=parseFloat,ld=parseInt,ud=typeof global=="object"&&global&&global.Object===Object&&global,pg=typeof self=="object"&&self&&self.Object===Object&&self,Nt=ud||pg||Function("return this")(),du=typeof el=="object"&&el&&!el.nodeType&&el,oi=du&&typeof zu=="object"&&zu&&!zu.nodeType&&zu,ot=oi&&oi.exports===du,Pi=ot&&ud.process,Wt=function(){try{var U=oi&&oi.require&&oi.require("util").types;return U||Pi&&Pi.binding&&Pi.binding("util")}catch{}}(),cd=Wt&&Wt.isArrayBuffer,hu=Wt&&Wt.isDate,fd=Wt&&Wt.isMap,dd=Wt&&Wt.isRegExp,ho=Wt&&Wt.isSet,Rn=Wt&&Wt.isTypedArray;function Jt(U,J,H){switch(H.length){case 0:return U.call(J);case 1:return U.call(J,H[0]);case 2:return U.call(J,H[0],H[1]);case 3:return U.call(J,H[0],H[1],H[2])}return U.apply(J,H)}function mg(U,J,H,ae){for(var ve=-1,We=U==null?0:U.length;++ve<We;){var kt=U[ve];J(ae,kt,H(kt),U)}return ae}function wt(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae&&J(U[H],H,U)!==!1;);return U}function gg(U,J){for(var H=U==null?0:U.length;H--&&J(U[H],H,U)!==!1;);return U}function Ra(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae;)if(!J(U[H],H,U))return!1;return!0}function ai(U,J){for(var H=-1,ae=U==null?0:U.length,ve=0,We=[];++H<ae;){var kt=U[H];J(kt,H,U)&&(We[ve++]=kt)}return We}function Ia(U,J){var H=U==null?0:U.length;return!!H&&_s(U,J,0)>-1}function pu(U,J,H){for(var ae=-1,ve=U==null?0:U.length;++ae<ve;)if(H(J,U[ae]))return!0;return!1}function et(U,J){for(var H=-1,ae=U==null?0:U.length,ve=Array(ae);++H<ae;)ve[H]=J(U[H],H,U);return ve}function Xr(U,J){for(var H=-1,ae=J.length,ve=U.length;++H<ae;)U[ve+H]=J[H];return U}function mu(U,J,H,ae){var ve=-1,We=U==null?0:U.length;for(ae&&We&&(H=U[++ve]);++ve<We;)H=J(H,U[ve],ve,U);return H}function yg(U,J,H,ae){var ve=U==null?0:U.length;for(ae&&ve&&(H=U[--ve]);ve--;)H=J(H,U[ve],ve,U);return H}function gu(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae;)if(J(U[H],H,U))return!0;return!1}var hd=yu("length");function vg(U){return U.split("")}function Sg(U){return U.match(Zr)||[]}function pd(U,J,H){var ae;return H(U,function(ve,We,kt){if(J(ve,We,kt))return ae=We,!1}),ae}function Oa(U,J,H,ae){for(var ve=U.length,We=H+(ae?1:-1);ae?We--:++We<ve;)if(J(U[We],We,U))return We;return-1}function _s(U,J,H){return J===J?_d(U,J,H):Oa(U,gd,H)}function md(U,J,H,ae){for(var ve=H-1,We=U.length;++ve<We;)if(ae(U[ve],J))return ve;return-1}function gd(U){return U!==U}function ki(U,J){var H=U==null?0:U.length;return H?Su(U,J)/H:we}function yu(U){return function(J){return J==null?t:J[U]}}function po(U){return function(J){return U==null?t:U[J]}}function yd(U,J,H,ae,ve){return ve(U,function(We,kt,Ae){H=ae?(ae=!1,We):J(H,We,kt,Ae)}),H}function vu(U,J){var H=U.length;for(U.sort(J);H--;)U[H]=U[H].value;return U}function Su(U,J){for(var H,ae=-1,ve=U.length;++ae<ve;){var We=J(U[ae]);We!==t&&(H=H===t?We:H+We)}return H}function bu(U,J){for(var H=-1,ae=Array(U);++H<U;)ae[H]=J(H);return ae}function bg(U,J){return et(J,function(H){return[H,U[H]]})}function vd(U){return U&&U.slice(0,Pa(U)+1).replace(Oi,"")}function nr(U){return function(J){return U(J)}}function _u(U,J){return et(J,function(H){return U[H]})}function ws(U,J){return U.has(J)}function nt(U,J){for(var H=-1,ae=U.length;++H<ae&&_s(J,U[H],0)>-1;);return H}function Sd(U,J){for(var H=U.length;H--&&_s(J,U[H],0)>-1;);return H}function _g(U,J){for(var H=U.length,ae=0;H--;)U[H]===J&&++ae;return ae}var bd=po(dg),wg=po(cu);function Eg(U){return"\\"+hg[U]}function Cg(U,J){return U==null?t:U[J]}function en(U){return lg.test(U)}function xg(U){return ug.test(U)}function Rg(U){for(var J,H=[];!(J=U.next()).done;)H.push(J.value);return H}function wu(U){var J=-1,H=Array(U.size);return U.forEach(function(ae,ve){H[++J]=[ve,ae]}),H}function mo(U,J){return function(H){return U(J(H))}}function Br(U,J){for(var H=-1,ae=U.length,ve=0,We=[];++H<ae;){var kt=U[H];(kt===J||kt===f)&&(U[H]=f,We[ve++]=H)}return We}function Es(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=ae}),H}function Ig(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=[ae,ae]}),H}function _d(U,J,H){for(var ae=H-1,ve=U.length;++ae<ve;)if(U[ae]===J)return ae;return-1}function Og(U,J,H){for(var ae=H+1;ae--;)if(U[ae]===J)return ae;return ae}function li(U){return en(U)?kg(U):hd(U)}function hr(U){return en(U)?Ag(U):vg(U)}function Pa(U){for(var J=U.length;J--&&Wm.test(U.charAt(J)););return J}var Pg=po(fu);function kg(U){for(var J=uu.lastIndex=0;uu.test(U);)++J;return J}function Ag(U){return U.match(uu)||[]}function Tg(U){return U.match(ag)||[]}var qg=function U(J){J=J==null?Nt:ui.defaults(Nt.Object(),J,ui.pick(Nt,cg));var H=J.Array,ae=J.Date,ve=J.Error,We=J.Function,kt=J.Math,Ae=J.Object,In=J.RegExp,wd=J.String,wr=J.TypeError,go=H.prototype,Ed=We.prototype,Cs=Ae.prototype,ka=J["__core-js_shared__"],yo=Ed.toString,ze=Cs.hasOwnProperty,$g=0,Cd=function(){var o=/[^.]+$/.exec(ka&&ka.keys&&ka.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Aa=Cs.toString,Mg=yo.call(Ae),Ng=Nt._,Dg=In("^"+yo.call(ze).replace(co,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ta=ot?J.Buffer:t,ci=J.Symbol,qa=J.Uint8Array,xd=Ta?Ta.allocUnsafe:t,$a=mo(Ae.getPrototypeOf,Ae),Rd=Ae.create,Id=Cs.propertyIsEnumerable,Ai=go.splice,Od=ci?ci.isConcatSpreadable:t,vo=ci?ci.iterator:t,Ti=ci?ci.toStringTag:t,Ma=function(){try{var o=Oo(Ae,"defineProperty");return o({},"",{}),o}catch{}}(),Fg=J.clearTimeout!==Nt.clearTimeout&&J.clearTimeout,Lg=ae&&ae.now!==Nt.Date.now&&ae.now,jg=J.setTimeout!==Nt.setTimeout&&J.setTimeout,Na=kt.ceil,So=kt.floor,Da=Ae.getOwnPropertySymbols,Pd=Ta?Ta.isBuffer:t,bo=J.isFinite,xs=go.join,Fa=mo(Ae.keys,Ae),Et=kt.max,vt=kt.min,kd=ae.now,Ad=J.parseInt,Td=kt.random,Ug=go.reverse,Eu=Oo(J,"DataView"),_o=Oo(J,"Map"),Cu=Oo(J,"Promise"),Rs=Oo(J,"Set"),wo=Oo(J,"WeakMap"),Eo=Oo(Ae,"create"),La=wo&&new wo,Is={},Bg=Po(Eu),Hg=Po(_o),Vg=Po(Cu),Wg=Po(Rs),Yg=Po(wo),ja=ci?ci.prototype:t,Co=ja?ja.valueOf:t,qd=ja?ja.toString:t;function I(o){if(Ct(o)&&!Ee(o)&&!(o instanceof Ie)){if(o instanceof Er)return o;if(ze.call(o,"__wrapped__"))return rE(o)}return new Er(o)}var Os=function(){function o(){}return function(l){if(!St(l))return{};if(Rd)return Rd(l);o.prototype=l;var d=new o;return o.prototype=t,d}}();function Ua(){}function Er(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}I.templateSettings={escape:oe,evaluate:Vm,interpolate:jf,variable:"",imports:{_:I}},I.prototype=Ua.prototype,I.prototype.constructor=I,Er.prototype=Os(Ua.prototype),Er.prototype.constructor=Er;function Ie(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=he,this.__views__=[]}function Jg(){var o=new Ie(this.__wrapped__);return o.__actions__=xr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=xr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=xr(this.__views__),o}function zg(){if(this.__filtered__){var o=new Ie(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function Kg(){var o=this.__wrapped__.value(),l=this.__dir__,d=Ee(o),v=l<0,w=d?o.length:0,O=LA(0,w,this.__views__),q=O.start,M=O.end,B=M-q,G=v?M:q-1,Q=this.__iteratees__,X=Q.length,re=0,ue=vt(B,this.__takeCount__);if(!d||!v&&w==B&&ue==B)return xw(o,this.__actions__);var me=[];e:for(;B--&&re<ue;){G+=l;for(var Pe=-1,ge=o[G];++Pe<X;){var De=Q[Pe],je=De.iteratee,Yr=De.type,gr=je(ge);if(Yr==z)ge=gr;else if(!gr){if(Yr==L)continue e;break e}}me[re++]=ge}return me}Ie.prototype=Os(Ua.prototype),Ie.prototype.constructor=Ie;function On(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function Ba(){this.__data__=Eo?Eo(null):{},this.size=0}function Gg(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function Qg(o){var l=this.__data__;if(Eo){var d=l[o];return d===a?t:d}return ze.call(l,o)?l[o]:t}function Zg(o){var l=this.__data__;return Eo?l[o]!==t:ze.call(l,o)}function Xg(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=Eo&&l===t?a:l,this}On.prototype.clear=Ba,On.prototype.delete=Gg,On.prototype.get=Qg,On.prototype.has=Zg,On.prototype.set=Xg;function Pn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function ey(){this.__data__=[],this.size=0}function $d(o){var l=this.__data__,d=Cr(l,o);if(d<0)return!1;var v=l.length-1;return d==v?l.pop():Ai.call(l,d,1),--this.size,!0}function ty(o){var l=this.__data__,d=Cr(l,o);return d<0?t:l[d][1]}function ry(o){return Cr(this.__data__,o)>-1}function Md(o,l){var d=this.__data__,v=Cr(d,o);return v<0?(++this.size,d.push([o,l])):d[v][1]=l,this}Pn.prototype.clear=ey,Pn.prototype.delete=$d,Pn.prototype.get=ty,Pn.prototype.has=ry,Pn.prototype.set=Md;function kn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function ny(){this.size=0,this.__data__={hash:new On,map:new(_o||Pn),string:new On}}function iy(o){var l=eh(this,o).delete(o);return this.size-=l?1:0,l}function fi(o){return eh(this,o).get(o)}function Nd(o){return eh(this,o).has(o)}function sy(o,l){var d=eh(this,o),v=d.size;return d.set(o,l),this.size+=d.size==v?0:1,this}kn.prototype.clear=ny,kn.prototype.delete=iy,kn.prototype.get=fi,kn.prototype.has=Nd,kn.prototype.set=sy;function qi(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new kn;++l<d;)this.add(o[l])}function oy(o){return this.__data__.set(o,a),this}function te(o){return this.__data__.has(o)}qi.prototype.add=qi.prototype.push=oy,qi.prototype.has=te;function Hr(o){var l=this.__data__=new Pn(o);this.size=l.size}function ay(){this.__data__=new Pn,this.size=0}function Dd(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function Be(o){return this.__data__.get(o)}function Ha(o){return this.__data__.has(o)}function Fd(o,l){var d=this.__data__;if(d instanceof Pn){var v=d.__data__;if(!_o||v.length<r-1)return v.push([o,l]),this.size=++d.size,this;d=this.__data__=new kn(v)}return d.set(o,l),this.size=d.size,this}Hr.prototype.clear=ay,Hr.prototype.delete=Dd,Hr.prototype.get=Be,Hr.prototype.has=Ha,Hr.prototype.set=Fd;function Va(o,l){var d=Ee(o),v=!d&&ko(o),w=!d&&!v&&qs(o),O=!d&&!v&&!w&&Ga(o),q=d||v||w||O,M=q?bu(o.length,wd):[],B=M.length;for(var G in o)(l||ze.call(o,G))&&!(q&&(G=="length"||w&&(G=="offset"||G=="parent")||O&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Fi(G,B)))&&M.push(G);return M}function Ld(o){var l=o.length;return l?o[_y(0,l-1)]:t}function ly(o,l){return th(xr(o),$i(l,0,o.length))}function uy(o){return th(xr(o))}function xu(o,l,d){(d!==t&&!$n(o[l],d)||d===t&&!(l in o))&&An(o,l,d)}function xo(o,l,d){var v=o[l];(!(ze.call(o,l)&&$n(v,d))||d===t&&!(l in o))&&An(o,l,d)}function Cr(o,l){for(var d=o.length;d--;)if($n(o[d][0],l))return d;return-1}function cy(o,l,d,v){return di(o,function(w,O,q){l(v,w,d(w),q)}),v}function Ru(o,l){return o&&pi(l,Yt(l),o)}function fy(o,l){return o&&pi(l,Ir(l),o)}function An(o,l,d){l=="__proto__"&&Ma?Ma(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function Wa(o,l){for(var d=-1,v=l.length,w=H(v),O=o==null;++d<v;)w[d]=O?t:Yy(o,l[d]);return w}function $i(o,l,d){return o===o&&(d!==t&&(o=o<=d?o:d),l!==t&&(o=o>=l?o:l)),o}function pr(o,l,d,v,w,O){var q,M=l&h,B=l&g,G=l&m;if(d&&(q=w?d(o,v,w,O):d(o)),q!==t)return q;if(!St(o))return o;var Q=Ee(o);if(Q){if(q=UA(o),!M)return xr(o,q)}else{var X=ir(o),re=X==ft||X==ti;if(qs(o))return Ow(o,M);if(X==wn||X==le||re&&!w){if(q=B||re?{}:Jw(o),!M)return B?kA(o,fy(q,o)):PA(o,Ru(q,o))}else{if(!rt[X])return w?o:{};q=BA(o,X,M)}}O||(O=new Hr);var ue=O.get(o);if(ue)return ue;O.set(o,q),wE(o)?o.forEach(function(ge){q.add(pr(ge,l,d,ge,o,O))}):bE(o)&&o.forEach(function(ge,De){q.set(De,pr(ge,l,d,De,o,O))});var me=G?B?Ty:Ay:B?Ir:Yt,Pe=Q?t:me(o);return wt(Pe||o,function(ge,De){Pe&&(De=ge,ge=o[De]),xo(q,De,pr(ge,l,d,De,o,O))}),q}function Iu(o){var l=Yt(o);return function(d){return jd(d,o,l)}}function jd(o,l,d){var v=d.length;if(o==null)return!v;for(o=Ae(o);v--;){var w=d[v],O=l[w],q=o[w];if(q===t&&!(w in o)||!O(q))return!1}return!0}function tn(o,l,d){if(typeof o!="function")throw new wr(i);return Nu(function(){o.apply(t,d)},l)}function Ps(o,l,d,v){var w=-1,O=Ia,q=!0,M=o.length,B=[],G=l.length;if(!M)return B;d&&(l=et(l,nr(d))),v?(O=pu,q=!1):l.length>=r&&(O=ws,q=!1,l=new qi(l));e:for(;++w<M;){var Q=o[w],X=d==null?Q:d(Q);if(Q=v||Q!==0?Q:0,q&&X===X){for(var re=G;re--;)if(l[re]===X)continue e;B.push(Q)}else O(l,X,v)||B.push(Q)}return B}var di=qw(rn),Ud=qw(Pu,!0);function dy(o,l){var d=!0;return di(o,function(v,w,O){return d=!!l(v,w,O),d}),d}function Ya(o,l,d){for(var v=-1,w=o.length;++v<w;){var O=o[v],q=l(O);if(q!=null&&(M===t?q===q&&!Wr(q):d(q,M)))var M=q,B=O}return B}function hy(o,l,d,v){var w=o.length;for(d=Ce(d),d<0&&(d=-d>w?0:w+d),v=v===t||v>w?w:Ce(v),v<0&&(v+=w),v=d>v?0:CE(v);d<v;)o[d++]=l;return o}function Bd(o,l){var d=[];return di(o,function(v,w,O){l(v,w,O)&&d.push(v)}),d}function Ut(o,l,d,v,w){var O=-1,q=o.length;for(d||(d=VA),w||(w=[]);++O<q;){var M=o[O];l>0&&d(M)?l>1?Ut(M,l-1,d,v,w):Xr(w,M):v||(w[w.length]=M)}return w}var Ou=$w(),Hd=$w(!0);function rn(o,l){return o&&Ou(o,l,Yt)}function Pu(o,l){return o&&Hd(o,l,Yt)}function nn(o,l){return ai(l,function(d){return Li(o[d])})}function Mi(o,l){l=As(l,o);for(var d=0,v=l.length;o!=null&&d<v;)o=o[mi(l[d++])];return d&&d==v?o:t}function Vd(o,l,d){var v=l(o);return Ee(o)?v:Xr(v,d(o))}function zt(o){return o==null?o===t?Um:Lm:Ti&&Ti in Ae(o)?FA(o):QA(o)}function ku(o,l){return o>l}function py(o,l){return o!=null&&ze.call(o,l)}function my(o,l){return o!=null&&l in Ae(o)}function gy(o,l,d){return o>=vt(l,d)&&o<Et(l,d)}function Au(o,l,d){for(var v=d?pu:Ia,w=o[0].length,O=o.length,q=O,M=H(O),B=1/0,G=[];q--;){var Q=o[q];q&&l&&(Q=et(Q,nr(l))),B=vt(Q.length,B),M[q]=!d&&(l||w>=120&&Q.length>=120)?new qi(q&&Q):t}Q=o[0];var X=-1,re=M[0];e:for(;++X<w&&G.length<B;){var ue=Q[X],me=l?l(ue):ue;if(ue=d||ue!==0?ue:0,!(re?ws(re,me):v(G,me,d))){for(q=O;--q;){var Pe=M[q];if(!(Pe?ws(Pe,me):v(o[q],me,d)))continue e}re&&re.push(me),G.push(ue)}}return G}function Tn(o,l,d,v){return rn(o,function(w,O,q){l(v,d(w),O,q)}),v}function sn(o,l,d){l=As(l,o),o=Qw(o,l);var v=o==null?o:o[mi(ln(l))];return v==null?t:Jt(v,o,d)}function Wd(o){return Ct(o)&&zt(o)==le}function yy(o){return Ct(o)&&zt(o)==cs}function vy(o){return Ct(o)&&zt(o)==_n}function Ro(o,l,d,v,w){return o===l?!0:o==null||l==null||!Ct(o)&&!Ct(l)?o!==o&&l!==l:Sy(o,l,d,v,Ro,w)}function Sy(o,l,d,v,w,O){var q=Ee(o),M=Ee(l),B=q?ei:ir(o),G=M?ei:ir(l);B=B==le?wn:B,G=G==le?wn:G;var Q=B==wn,X=G==wn,re=B==G;if(re&&qs(o)){if(!qs(l))return!1;q=!0,Q=!1}if(re&&!Q)return O||(O=new Hr),q||Ga(o)?Vw(o,l,d,v,w,O):NA(o,l,B,d,v,w,O);if(!(d&S)){var ue=Q&&ze.call(o,"__wrapped__"),me=X&&ze.call(l,"__wrapped__");if(ue||me){var Pe=ue?o.value():o,ge=me?l.value():l;return O||(O=new Hr),w(Pe,ge,d,v,O)}}return re?(O||(O=new Hr),DA(o,l,d,v,w,O)):!1}function Tu(o){return Ct(o)&&ir(o)==rr}function hi(o,l,d,v){var w=d.length,O=w,q=!v;if(o==null)return!O;for(o=Ae(o);w--;){var M=d[w];if(q&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++w<O;){M=d[w];var B=M[0],G=o[B],Q=M[1];if(q&&M[2]){if(G===t&&!(B in o))return!1}else{var X=new Hr;if(v)var re=v(G,Q,B,o,l,X);if(!(re===t?Ro(Q,G,S|_,v,X):re))return!1}}return!0}function Io(o){if(!St(o)||YA(o))return!1;var l=Li(o)?Dg:fo;return l.test(Po(o))}function Le(o){return Ct(o)&&zt(o)==ls}function c(o){return Ct(o)&&ir(o)==gt}function p(o){return Ct(o)&&ah(o.length)&&!!st[zt(o)]}function y(o){return typeof o=="function"?o:o==null?Or:typeof o=="object"?Ee(o)?ye(o[0],o[1]):se(o):ME(o)}function b(o){if(!Mu(o))return Fa(o);var l=[];for(var d in Ae(o))ze.call(o,d)&&d!="constructor"&&l.push(d);return l}function R(o){if(!St(o))return GA(o);var l=Mu(o),d=[];for(var v in o)v=="constructor"&&(l||!ze.call(o,v))||d.push(v);return d}function $(o,l){return o<l}function W(o,l){var d=-1,v=Rr(o)?H(o.length):[];return di(o,function(w,O,q){v[++d]=l(w,O,q)}),v}function se(o){var l=$y(o);return l.length==1&&l[0][2]?Kw(l[0][0],l[0][1]):function(d){return d===o||hi(d,o,l)}}function ye(o,l){return Ny(o)&&zw(l)?Kw(mi(o),l):function(d){var v=Yy(d,o);return v===t&&v===l?Jy(d,o):Ro(l,v,S|_)}}function Oe(o,l,d,v,w){o!==l&&Ou(l,function(O,q){if(w||(w=new Hr),St(O))Kt(o,l,q,d,Oe,v,w);else{var M=v?v(Fy(o,q),O,q+"",o,l,w):t;M===t&&(M=O),xu(o,q,M)}},Ir)}function Kt(o,l,d,v,w,O,q){var M=Fy(o,d),B=Fy(l,d),G=q.get(B);if(G){xu(o,d,G);return}var Q=O?O(M,B,d+"",o,l,q):t,X=Q===t;if(X){var re=Ee(B),ue=!re&&qs(B),me=!re&&!ue&&Ga(B);Q=B,re||ue||me?Ee(M)?Q=M:At(M)?Q=xr(M):ue?(X=!1,Q=Ow(B,!0)):me?(X=!1,Q=Pw(B,!0)):Q=[]:Du(B)||ko(B)?(Q=M,ko(M)?Q=xE(M):(!St(M)||Li(M))&&(Q=Jw(B))):X=!1}X&&(q.set(B,Q),w(Q,B,v,O,q),q.delete(B)),xu(o,d,Q)}function on(o,l){var d=o.length;if(d)return l+=l<0?d:0,Fi(l,d)?o[l]:t}function qn(o,l,d){l.length?l=et(l,function(O){return Ee(O)?function(q){return Mi(q,O.length===1?O[0]:O)}:O}):l=[Or];var v=-1;l=et(l,nr(pe()));var w=W(o,function(O,q,M){var B=et(l,function(G){return G(O)});return{criteria:B,index:++v,value:O}});return vu(w,function(O,q){return OA(O,q,d)})}function gA(o,l){return Sw(o,l,function(d,v){return Jy(o,v)})}function Sw(o,l,d){for(var v=-1,w=l.length,O={};++v<w;){var q=l[v],M=Mi(o,q);d(M,q)&&qu(O,As(q,o),M)}return O}function yA(o){return function(l){return Mi(l,o)}}function by(o,l,d,v){var w=v?md:_s,O=-1,q=l.length,M=o;for(o===l&&(l=xr(l)),d&&(M=et(o,nr(d)));++O<q;)for(var B=0,G=l[O],Q=d?d(G):G;(B=w(M,Q,B,v))>-1;)M!==o&&Ai.call(M,B,1),Ai.call(o,B,1);return o}function bw(o,l){for(var d=o?l.length:0,v=d-1;d--;){var w=l[d];if(d==v||w!==O){var O=w;Fi(w)?Ai.call(o,w,1):Cy(o,w)}}return o}function _y(o,l){return o+So(Td()*(l-o+1))}function vA(o,l,d,v){for(var w=-1,O=Et(Na((l-o)/(d||1)),0),q=H(O);O--;)q[v?O:++w]=o,o+=d;return q}function wy(o,l){var d="";if(!o||l<1||l>fe)return d;do l%2&&(d+=o),l=So(l/2),l&&(o+=o);while(l);return d}function Te(o,l){return Ly(Gw(o,l,Or),o+"")}function SA(o){return Ld(Qa(o))}function bA(o,l){var d=Qa(o);return th(d,$i(l,0,d.length))}function qu(o,l,d,v){if(!St(o))return o;l=As(l,o);for(var w=-1,O=l.length,q=O-1,M=o;M!=null&&++w<O;){var B=mi(l[w]),G=d;if(B==="__proto__"||B==="constructor"||B==="prototype")return o;if(w!=q){var Q=M[B];G=v?v(Q,B,M):t,G===t&&(G=St(Q)?Q:Fi(l[w+1])?[]:{})}xo(M,B,G),M=M[B]}return o}var _w=La?function(o,l){return La.set(o,l),o}:Or,_A=Ma?function(o,l){return Ma(o,"toString",{configurable:!0,enumerable:!1,value:Ky(l),writable:!0})}:Or;function wA(o){return th(Qa(o))}function an(o,l,d){var v=-1,w=o.length;l<0&&(l=-l>w?0:w+l),d=d>w?w:d,d<0&&(d+=w),w=l>d?0:d-l>>>0,l>>>=0;for(var O=H(w);++v<w;)O[v]=o[v+l];return O}function EA(o,l){var d;return di(o,function(v,w,O){return d=l(v,w,O),!d}),!!d}function Yd(o,l,d){var v=0,w=o==null?v:o.length;if(typeof l=="number"&&l===l&&w<=_t){for(;v<w;){var O=v+w>>>1,q=o[O];q!==null&&!Wr(q)&&(d?q<=l:q<l)?v=O+1:w=O}return w}return Ey(o,l,Or,d)}function Ey(o,l,d,v){var w=0,O=o==null?0:o.length;if(O===0)return 0;l=d(l);for(var q=l!==l,M=l===null,B=Wr(l),G=l===t;w<O;){var Q=So((w+O)/2),X=d(o[Q]),re=X!==t,ue=X===null,me=X===X,Pe=Wr(X);if(q)var ge=v||me;else G?ge=me&&(v||re):M?ge=me&&re&&(v||!ue):B?ge=me&&re&&!ue&&(v||!Pe):ue||Pe?ge=!1:ge=v?X<=l:X<l;ge?w=Q+1:O=Q}return vt(O,Ze)}function ww(o,l){for(var d=-1,v=o.length,w=0,O=[];++d<v;){var q=o[d],M=l?l(q):q;if(!d||!$n(M,B)){var B=M;O[w++]=q===0?0:q}}return O}function Ew(o){return typeof o=="number"?o:Wr(o)?we:+o}function Vr(o){if(typeof o=="string")return o;if(Ee(o))return et(o,Vr)+"";if(Wr(o))return qd?qd.call(o):"";var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function ks(o,l,d){var v=-1,w=Ia,O=o.length,q=!0,M=[],B=M;if(d)q=!1,w=pu;else if(O>=r){var G=l?null:$A(o);if(G)return Es(G);q=!1,w=ws,B=new qi}else B=l?[]:M;e:for(;++v<O;){var Q=o[v],X=l?l(Q):Q;if(Q=d||Q!==0?Q:0,q&&X===X){for(var re=B.length;re--;)if(B[re]===X)continue e;l&&B.push(X),M.push(Q)}else w(B,X,d)||(B!==M&&B.push(X),M.push(Q))}return M}function Cy(o,l){return l=As(l,o),o=Qw(o,l),o==null||delete o[mi(ln(l))]}function Cw(o,l,d,v){return qu(o,l,d(Mi(o,l)),v)}function Jd(o,l,d,v){for(var w=o.length,O=v?w:-1;(v?O--:++O<w)&&l(o[O],O,o););return d?an(o,v?0:O,v?O+1:w):an(o,v?O+1:0,v?w:O)}function xw(o,l){var d=o;return d instanceof Ie&&(d=d.value()),mu(l,function(v,w){return w.func.apply(w.thisArg,Xr([v],w.args))},d)}function xy(o,l,d){var v=o.length;if(v<2)return v?ks(o[0]):[];for(var w=-1,O=H(v);++w<v;)for(var q=o[w],M=-1;++M<v;)M!=w&&(O[w]=Ps(O[w]||q,o[M],l,d));return ks(Ut(O,1),l,d)}function Rw(o,l,d){for(var v=-1,w=o.length,O=l.length,q={};++v<w;){var M=v<O?l[v]:t;d(q,o[v],M)}return q}function Ry(o){return At(o)?o:[]}function Iy(o){return typeof o=="function"?o:Or}function As(o,l){return Ee(o)?o:Ny(o,l)?[o]:tE(Ge(o))}var CA=Te;function Ts(o,l,d){var v=o.length;return d=d===t?v:d,!l&&d>=v?o:an(o,l,d)}var Iw=Fg||function(o){return Nt.clearTimeout(o)};function Ow(o,l){if(l)return o.slice();var d=o.length,v=xd?xd(d):new o.constructor(d);return o.copy(v),v}function Oy(o){var l=new o.constructor(o.byteLength);return new qa(l).set(new qa(o)),l}function xA(o,l){var d=l?Oy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function RA(o){var l=new o.constructor(o.source,ii.exec(o));return l.lastIndex=o.lastIndex,l}function IA(o){return Co?Ae(Co.call(o)):{}}function Pw(o,l){var d=l?Oy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function kw(o,l){if(o!==l){var d=o!==t,v=o===null,w=o===o,O=Wr(o),q=l!==t,M=l===null,B=l===l,G=Wr(l);if(!M&&!G&&!O&&o>l||O&&q&&B&&!M&&!G||v&&q&&B||!d&&B||!w)return 1;if(!v&&!O&&!G&&o<l||G&&d&&w&&!v&&!O||M&&d&&w||!q&&w||!B)return-1}return 0}function OA(o,l,d){for(var v=-1,w=o.criteria,O=l.criteria,q=w.length,M=d.length;++v<q;){var B=kw(w[v],O[v]);if(B){if(v>=M)return B;var G=d[v];return B*(G=="desc"?-1:1)}}return o.index-l.index}function Aw(o,l,d,v){for(var w=-1,O=o.length,q=d.length,M=-1,B=l.length,G=Et(O-q,0),Q=H(B+G),X=!v;++M<B;)Q[M]=l[M];for(;++w<q;)(X||w<O)&&(Q[d[w]]=o[w]);for(;G--;)Q[M++]=o[w++];return Q}function Tw(o,l,d,v){for(var w=-1,O=o.length,q=-1,M=d.length,B=-1,G=l.length,Q=Et(O-M,0),X=H(Q+G),re=!v;++w<Q;)X[w]=o[w];for(var ue=w;++B<G;)X[ue+B]=l[B];for(;++q<M;)(re||w<O)&&(X[ue+d[q]]=o[w++]);return X}function xr(o,l){var d=-1,v=o.length;for(l||(l=H(v));++d<v;)l[d]=o[d];return l}function pi(o,l,d,v){var w=!d;d||(d={});for(var O=-1,q=l.length;++O<q;){var M=l[O],B=v?v(d[M],o[M],M,d,o):t;B===t&&(B=o[M]),w?An(d,M,B):xo(d,M,B)}return d}function PA(o,l){return pi(o,My(o),l)}function kA(o,l){return pi(o,Ww(o),l)}function zd(o,l){return function(d,v){var w=Ee(d)?mg:cy,O=l?l():{};return w(d,o,pe(v,2),O)}}function Ja(o){return Te(function(l,d){var v=-1,w=d.length,O=w>1?d[w-1]:t,q=w>2?d[2]:t;for(O=o.length>3&&typeof O=="function"?(w--,O):t,q&&mr(d[0],d[1],q)&&(O=w<3?t:O,w=1),l=Ae(l);++v<w;){var M=d[v];M&&o(l,M,v,O)}return l})}function qw(o,l){return function(d,v){if(d==null)return d;if(!Rr(d))return o(d,v);for(var w=d.length,O=l?w:-1,q=Ae(d);(l?O--:++O<w)&&v(q[O],O,q)!==!1;);return d}}function $w(o){return function(l,d,v){for(var w=-1,O=Ae(l),q=v(l),M=q.length;M--;){var B=q[o?M:++w];if(d(O[B],B,O)===!1)break}return l}}function AA(o,l,d){var v=l&C,w=$u(o);function O(){var q=this&&this!==Nt&&this instanceof O?w:o;return q.apply(v?d:this,arguments)}return O}function Mw(o){return function(l){l=Ge(l);var d=en(l)?hr(l):t,v=d?d[0]:l.charAt(0),w=d?Ts(d,1).join(""):l.slice(1);return v[o]()+w}}function za(o){return function(l){return mu(qE(TE(l).replace(sg,"")),o,"")}}function $u(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=Os(o.prototype),v=o.apply(d,l);return St(v)?v:d}}function TA(o,l,d){var v=$u(o);function w(){for(var O=arguments.length,q=H(O),M=O,B=Ka(w);M--;)q[M]=arguments[M];var G=O<3&&q[0]!==B&&q[O-1]!==B?[]:Br(q,B);if(O-=G.length,O<d)return jw(o,l,Kd,w.placeholder,t,q,G,t,t,d-O);var Q=this&&this!==Nt&&this instanceof w?v:o;return Jt(Q,this,q)}return w}function Nw(o){return function(l,d,v){var w=Ae(l);if(!Rr(l)){var O=pe(d,3);l=Yt(l),d=function(M){return O(w[M],M,w)}}var q=o(l,d,v);return q>-1?w[O?l[q]:q]:t}}function Dw(o){return Di(function(l){var d=l.length,v=d,w=Er.prototype.thru;for(o&&l.reverse();v--;){var O=l[v];if(typeof O!="function")throw new wr(i);if(w&&!q&&Xd(O)=="wrapper")var q=new Er([],!0)}for(v=q?v:d;++v<d;){O=l[v];var M=Xd(O),B=M=="wrapper"?qy(O):t;B&&Dy(B[0])&&B[1]==(K|T|Y|ee)&&!B[4].length&&B[9]==1?q=q[Xd(B[0])].apply(q,B[3]):q=O.length==1&&Dy(O)?q[M]():q.thru(O)}return function(){var G=arguments,Q=G[0];if(q&&G.length==1&&Ee(Q))return q.plant(Q).value();for(var X=0,re=d?l[X].apply(this,G):Q;++X<d;)re=l[X].call(this,re);return re}})}function Kd(o,l,d,v,w,O,q,M,B,G){var Q=l&K,X=l&C,re=l&x,ue=l&(T|j),me=l&k,Pe=re?t:$u(o);function ge(){for(var De=arguments.length,je=H(De),Yr=De;Yr--;)je[Yr]=arguments[Yr];if(ue)var gr=Ka(ge),Jr=_g(je,gr);if(v&&(je=Aw(je,v,w,ue)),O&&(je=Tw(je,O,q,ue)),De-=Jr,ue&&De<G){var Tt=Br(je,gr);return jw(o,l,Kd,ge.placeholder,d,je,Tt,M,B,G-De)}var Mn=X?d:this,Ui=re?Mn[o]:o;return De=je.length,M?je=ZA(je,M):me&&De>1&&je.reverse(),Q&&B<De&&(je.length=B),this&&this!==Nt&&this instanceof ge&&(Ui=Pe||$u(Ui)),Ui.apply(Mn,je)}return ge}function Fw(o,l){return function(d,v){return Tn(d,o,l(v),{})}}function Gd(o,l){return function(d,v){var w;if(d===t&&v===t)return l;if(d!==t&&(w=d),v!==t){if(w===t)return v;typeof d=="string"||typeof v=="string"?(d=Vr(d),v=Vr(v)):(d=Ew(d),v=Ew(v)),w=o(d,v)}return w}}function Py(o){return Di(function(l){return l=et(l,nr(pe())),Te(function(d){var v=this;return o(l,function(w){return Jt(w,v,d)})})})}function Qd(o,l){l=l===t?" ":Vr(l);var d=l.length;if(d<2)return d?wy(l,o):l;var v=wy(l,Na(o/li(l)));return en(l)?Ts(hr(v),0,o).join(""):v.slice(0,o)}function qA(o,l,d,v){var w=l&C,O=$u(o);function q(){for(var M=-1,B=arguments.length,G=-1,Q=v.length,X=H(Q+B),re=this&&this!==Nt&&this instanceof q?O:o;++G<Q;)X[G]=v[G];for(;B--;)X[G++]=arguments[++M];return Jt(re,w?d:this,X)}return q}function Lw(o){return function(l,d,v){return v&&typeof v!="number"&&mr(l,d,v)&&(d=v=t),l=ji(l),d===t?(d=l,l=0):d=ji(d),v=v===t?l<d?1:-1:ji(v),vA(l,d,v,o)}}function Zd(o){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=un(l),d=un(d)),o(l,d)}}function jw(o,l,d,v,w,O,q,M,B,G){var Q=l&T,X=Q?q:t,re=Q?t:q,ue=Q?O:t,me=Q?t:O;l|=Q?Y:V,l&=~(Q?V:Y),l&A||(l&=~(C|x));var Pe=[o,l,w,ue,X,me,re,M,B,G],ge=d.apply(t,Pe);return Dy(o)&&Zw(ge,Pe),ge.placeholder=v,Xw(ge,o,l)}function ky(o){var l=kt[o];return function(d,v){if(d=un(d),v=v==null?0:vt(Ce(v),292),v&&bo(d)){var w=(Ge(d)+"e").split("e"),O=l(w[0]+"e"+(+w[1]+v));return w=(Ge(O)+"e").split("e"),+(w[0]+"e"+(+w[1]-v))}return l(d)}}var $A=Rs&&1/Es(new Rs([,-0]))[1]==ie?function(o){return new Rs(o)}:Zy;function Uw(o){return function(l){var d=ir(l);return d==rr?wu(l):d==gt?Ig(l):bg(l,o(l))}}function Ni(o,l,d,v,w,O,q,M){var B=l&x;if(!B&&typeof o!="function")throw new wr(i);var G=v?v.length:0;if(G||(l&=~(Y|V),v=w=t),q=q===t?q:Et(Ce(q),0),M=M===t?M:Ce(M),G-=w?w.length:0,l&V){var Q=v,X=w;v=w=t}var re=B?t:qy(o),ue=[o,l,d,v,w,Q,X,O,q,M];if(re&&KA(ue,re),o=ue[0],l=ue[1],d=ue[2],v=ue[3],w=ue[4],M=ue[9]=ue[9]===t?B?0:o.length:Et(ue[9]-G,0),!M&&l&(T|j)&&(l&=~(T|j)),!l||l==C)var me=AA(o,l,d);else l==T||l==j?me=TA(o,l,M):(l==Y||l==(C|Y))&&!w.length?me=qA(o,l,d,v):me=Kd.apply(t,ue);var Pe=re?_w:Zw;return Xw(Pe(me,ue),o,l)}function Bw(o,l,d,v){return o===t||$n(o,Cs[d])&&!ze.call(v,d)?l:o}function Hw(o,l,d,v,w,O){return St(o)&&St(l)&&(O.set(l,o),Oe(o,l,t,Hw,O),O.delete(l)),o}function MA(o){return Du(o)?t:o}function Vw(o,l,d,v,w,O){var q=d&S,M=o.length,B=l.length;if(M!=B&&!(q&&B>M))return!1;var G=O.get(o),Q=O.get(l);if(G&&Q)return G==l&&Q==o;var X=-1,re=!0,ue=d&_?new qi:t;for(O.set(o,l),O.set(l,o);++X<M;){var me=o[X],Pe=l[X];if(v)var ge=q?v(Pe,me,X,l,o,O):v(me,Pe,X,o,l,O);if(ge!==t){if(ge)continue;re=!1;break}if(ue){if(!gu(l,function(De,je){if(!ws(ue,je)&&(me===De||w(me,De,d,v,O)))return ue.push(je)})){re=!1;break}}else if(!(me===Pe||w(me,Pe,d,v,O))){re=!1;break}}return O.delete(o),O.delete(l),re}function NA(o,l,d,v,w,O,q){switch(d){case ri:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case cs:return!(o.byteLength!=l.byteLength||!O(new qa(o),new qa(l)));case ct:case _n:case Qr:return $n(+o,+l);case jt:return o.name==l.name&&o.message==l.message;case ls:case Ri:return o==l+"";case rr:var M=wu;case gt:var B=v&S;if(M||(M=Es),o.size!=l.size&&!B)return!1;var G=q.get(o);if(G)return G==l;v|=_,q.set(o,l);var Q=Vw(M(o),M(l),v,w,O,q);return q.delete(o),Q;case ma:if(Co)return Co.call(o)==Co.call(l)}return!1}function DA(o,l,d,v,w,O){var q=d&S,M=Ay(o),B=M.length,G=Ay(l),Q=G.length;if(B!=Q&&!q)return!1;for(var X=B;X--;){var re=M[X];if(!(q?re in l:ze.call(l,re)))return!1}var ue=O.get(o),me=O.get(l);if(ue&&me)return ue==l&&me==o;var Pe=!0;O.set(o,l),O.set(l,o);for(var ge=q;++X<B;){re=M[X];var De=o[re],je=l[re];if(v)var Yr=q?v(je,De,re,l,o,O):v(De,je,re,o,l,O);if(!(Yr===t?De===je||w(De,je,d,v,O):Yr)){Pe=!1;break}ge||(ge=re=="constructor")}if(Pe&&!ge){var gr=o.constructor,Jr=l.constructor;gr!=Jr&&"constructor"in o&&"constructor"in l&&!(typeof gr=="function"&&gr instanceof gr&&typeof Jr=="function"&&Jr instanceof Jr)&&(Pe=!1)}return O.delete(o),O.delete(l),Pe}function Di(o){return Ly(Gw(o,t,sE),o+"")}function Ay(o){return Vd(o,Yt,My)}function Ty(o){return Vd(o,Ir,Ww)}var qy=La?function(o){return La.get(o)}:Zy;function Xd(o){for(var l=o.name+"",d=Is[l],v=ze.call(Is,l)?d.length:0;v--;){var w=d[v],O=w.func;if(O==null||O==o)return w.name}return l}function Ka(o){var l=ze.call(I,"placeholder")?I:o;return l.placeholder}function pe(){var o=I.iteratee||Gy;return o=o===Gy?y:o,arguments.length?o(arguments[0],arguments[1]):o}function eh(o,l){var d=o.__data__;return WA(l)?d[typeof l=="string"?"string":"hash"]:d.map}function $y(o){for(var l=Yt(o),d=l.length;d--;){var v=l[d],w=o[v];l[d]=[v,w,zw(w)]}return l}function Oo(o,l){var d=Cg(o,l);return Io(d)?d:t}function FA(o){var l=ze.call(o,Ti),d=o[Ti];try{o[Ti]=t;var v=!0}catch{}var w=Aa.call(o);return v&&(l?o[Ti]=d:delete o[Ti]),w}var My=Da?function(o){return o==null?[]:(o=Ae(o),ai(Da(o),function(l){return Id.call(o,l)}))}:Xy,Ww=Da?function(o){for(var l=[];o;)Xr(l,My(o)),o=$a(o);return l}:Xy,ir=zt;(Eu&&ir(new Eu(new ArrayBuffer(1)))!=ri||_o&&ir(new _o)!=rr||Cu&&ir(Cu.resolve())!=Lf||Rs&&ir(new Rs)!=gt||wo&&ir(new wo)!=us)&&(ir=function(o){var l=zt(o),d=l==wn?o.constructor:t,v=d?Po(d):"";if(v)switch(v){case Bg:return ri;case Hg:return rr;case Vg:return Lf;case Wg:return gt;case Yg:return us}return l});function LA(o,l,d){for(var v=-1,w=d.length;++v<w;){var O=d[v],q=O.size;switch(O.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=vt(l,o+q);break;case"takeRight":o=Et(o,l-q);break}}return{start:o,end:l}}function jA(o){var l=o.match(Vt);return l?l[1].split(Cn):[]}function Yw(o,l,d){l=As(l,o);for(var v=-1,w=l.length,O=!1;++v<w;){var q=mi(l[v]);if(!(O=o!=null&&d(o,q)))break;o=o[q]}return O||++v!=w?O:(w=o==null?0:o.length,!!w&&ah(w)&&Fi(q,w)&&(Ee(o)||ko(o)))}function UA(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&ze.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function Jw(o){return typeof o.constructor=="function"&&!Mu(o)?Os($a(o)):{}}function BA(o,l,d){var v=o.constructor;switch(l){case cs:return Oy(o);case ct:case _n:return new v(+o);case ri:return xA(o,d);case fs:case Xe:case ga:case ya:case ds:case uo:case hs:case ni:case ps:return Pw(o,d);case rr:return new v;case Qr:case Ri:return new v(o);case ls:return RA(o);case gt:return new v;case ma:return IA(o)}}function HA(o,l){var d=l.length;if(!d)return o;var v=d-1;return l[v]=(d>1?"& ":"")+l[v],l=l.join(d>2?", ":" "),o.replace(ba,`{
|
|
1
|
+
var _N=Object.create;var FE=Object.defineProperty;var wN=Object.getOwnPropertyDescriptor;var EN=Object.getOwnPropertyNames;var xN=Object.getPrototypeOf,CN=Object.prototype.hasOwnProperty;var kt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var RN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of EN(e))!CN.call(t,i)&&i!==r&&FE(t,i,{get:()=>e[i],enumerable:!(n=wN(e,i))||n.enumerable});return t};var ev=(t,e,r)=>(r=t!=null?_N(xN(t)):{},RN(e||!t||!t.__esModule?FE(r,"default",{value:t,enumerable:!0}):r,t));var XE=F((ol,sc)=>{(function(){var t,e="4.18.1",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="Invalid `imports` option passed into `_.template`",u="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",g=1,m=2,S=4,E=1,x=2,C=1,A=2,T=4,B=8,Y=16,H=32,K=64,X=128,k=256,w=512,P=30,N="...",D=800,L=16,z=1,Z=2,ae=3,de=1/0,rt=9007199254740991,Re=17976931348623157e292,ge=NaN,Ae=4294967295,bt=Ae-1,Tt=Ae>>>1,le=[["ary",X],["bind",C],["bindKey",A],["curry",B],["curryRight",Y],["flip",w],["partial",H],["partialRight",K],["rearg",k]],Zr="[object Arguments]",ns="[object Array]",_t="[object AsyncFunction]",En="[object Boolean]",Xr="[object Date]",er="[object DOMException]",dt="[object Error]",en="[object Function]",Xs="[object GeneratorFunction]",Ht="[object Map]",eo="[object Number]",Fm="[object Null]",xn="[object Object]",Gf="[object Promise]",Qf="[object Proxy]",Vt="[object RegExp]",fr="[object Set]",to="[object String]",ma="[object Symbol]",Zf="[object Undefined]",Ft="[object WeakMap]",Xf="[object WeakSet]",wi="[object ArrayBuffer]",Cn="[object DataView]",nt="[object Float32Array]",ga="[object Float64Array]",ya="[object Int8Array]",is="[object Int16Array]",ro="[object Int32Array]",ss="[object Uint8Array]",ni="[object Uint8ClampedArray]",os="[object Uint16Array]",hu="[object Uint32Array]",va=/\b__p \+= '';/g,Lm=/\b(__p \+=) '' \+/g,no=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ei=/&(?:amp|lt|gt|quot|#39);/g,Sa=/[&<>"']/g,ba=RegExp(Ei.source),oe=RegExp(Sa.source),jm=/<%-([\s\S]+?)%>/g,Um=/<%([\s\S]+?)%>/g,tn=/<%=([\s\S]+?)%>/g,xr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Te=/^\w*$/,pu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,io=RegExp(Ke.source),mu=/^\s+/,_a=/\s/,Wt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Rn=/\{\n\/\* \[wrapped with (.+)\] \*/,rn=/,? & /,It=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cr=/[()=,{}\[\]\/\s]/,In=/\\(\\)?/g,xi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ed=/\w*$/,Bm=/^[-+]0x[0-9a-f]+$/i,so=/^0b[01]+$/i,td=/^\[object .+?Constructor\]$/,Hm=/^0o[0-7]+$/i,as=/^(?:0|[1-9]\d*)$/,oo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ao=/($^)/,Vm=/['\n\r\u2028\u2029\\]/g,wa="\\ud800-\\udfff",Wm="\\u0300-\\u036f",vt="\\ufe20-\\ufe2f",gu="\\u20d0-\\u20ff",rd=Wm+vt+gu,yu="\\u2700-\\u27bf",vu="a-z\\xdf-\\xf6\\xf8-\\xff",Ym="\\xac\\xb1\\xd7\\xf7",Jm="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zm="\\u2000-\\u206f",Km=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",nd="A-Z\\xc0-\\xd6\\xd8-\\xde",id="\\ufe0e\\ufe0f",Su=Ym+Jm+zm+Km,Ea="['\u2019]",Gm="["+wa+"]",sd="["+Su+"]",xa="["+rd+"]",bu="\\d+",Qm="["+yu+"]",ls="["+vu+"]",lo="[^"+wa+Su+bu+yu+vu+nd+"]",Ca="\\ud83c[\\udffb-\\udfff]",uo="(?:"+xa+"|"+Ca+")",nn="[^"+wa+"]",_u="(?:\\ud83c[\\udde6-\\uddff]){2}",wu="[\\ud800-\\udbff][\\udc00-\\udfff]",us="["+nd+"]",od="\\u200d",ad="(?:"+ls+"|"+lo+")",Zm="(?:"+us+"|"+lo+")",ld="(?:"+Ea+"(?:d|ll|m|re|s|t|ve))?",ud="(?:"+Ea+"(?:D|LL|M|RE|S|T|VE))?",Ra=uo+"?",cd="["+id+"]?",fd="(?:"+od+"(?:"+[nn,_u,wu].join("|")+")"+cd+Ra+")*",Xm="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",eg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",dd=cd+Ra+fd,tg="(?:"+[Qm,_u,wu].join("|")+")"+dd,rg="(?:"+[nn+xa+"?",xa,_u,wu,Gm].join("|")+")",ng=RegExp(Ea,"g"),ig=RegExp(xa,"g"),Eu=RegExp(Ca+"(?="+Ca+")|"+rg+dd,"g"),sg=RegExp([us+"?"+ls+"+"+ld+"(?="+[sd,us,"$"].join("|")+")",Zm+"+"+ud+"(?="+[sd,us+ad,"$"].join("|")+")",us+"?"+ad+"+"+ld,us+"+"+ud,eg,Xm,bu,tg].join("|"),"g"),og=RegExp("["+od+wa+rd+id+"]"),ag=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,lg=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ug=-1,lt={};lt[nt]=lt[ga]=lt[ya]=lt[is]=lt[ro]=lt[ss]=lt[ni]=lt[os]=lt[hu]=!0,lt[Zr]=lt[ns]=lt[wi]=lt[En]=lt[Cn]=lt[Xr]=lt[dt]=lt[en]=lt[Ht]=lt[eo]=lt[xn]=lt[Vt]=lt[fr]=lt[to]=lt[Ft]=!1;var st={};st[Zr]=st[ns]=st[wi]=st[Cn]=st[En]=st[Xr]=st[nt]=st[ga]=st[ya]=st[is]=st[ro]=st[Ht]=st[eo]=st[xn]=st[Vt]=st[fr]=st[to]=st[ma]=st[ss]=st[ni]=st[os]=st[hu]=!0,st[dt]=st[en]=st[Ft]=!1;var xu={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Cu={"&":"&","<":"<",">":">",'"':""","'":"'"},cg={"&":"&","<":"<",">":">",""":'"',"'":"'"},hd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pd=parseFloat,fg=parseInt,md=typeof global=="object"&&global&&global.Object===Object&&global,dg=typeof self=="object"&&self&&self.Object===Object&&self,qt=md||dg||Function("return this")(),Ia=typeof ol=="object"&&ol&&!ol.nodeType&&ol,Ge=Ia&&typeof sc=="object"&&sc&&!sc.nodeType&&sc,cs=Ge&&Ge.exports===Ia,Ci=cs&&md.process,Rr=(function(){try{var j=Ge&&Ge.require&&Ge.require("util").types;return j||Ci&&Ci.binding&&Ci.binding("util")}catch{}})(),Ru=Rr&&Rr.isArrayBuffer,gd=Rr&&Rr.isDate,yd=Rr&&Rr.isMap,co=Rr&&Rr.isRegExp,On=Rr&&Rr.isSet,Oa=Rr&&Rr.isTypedArray;function dr(j,J,V){switch(V.length){case 0:return j.call(J);case 1:return j.call(J,V[0]);case 2:return j.call(J,V[0],V[1]);case 3:return j.call(J,V[0],V[1],V[2])}return j.apply(J,V)}function Pn(j,J,V,se){for(var ve=-1,Je=j==null?0:j.length;++ve<Je;){var Xe=j[ve];J(se,Xe,V(Xe),j)}return se}function hr(j,J){for(var V=-1,se=j==null?0:j.length;++V<se&&J(j[V],V,j)!==!1;);return j}function Iu(j,J){for(var V=j==null?0:j.length;V--&&J(j[V],V,j)!==!1;);return j}function vd(j,J){for(var V=-1,se=j==null?0:j.length;++V<se;)if(!J(j[V],V,j))return!1;return!0}function ii(j,J){for(var V=-1,se=j==null?0:j.length,ve=0,Je=[];++V<se;){var Xe=j[V];J(Xe,V,j)&&(Je[ve++]=Xe)}return Je}function Pa(j,J){var V=j==null?0:j.length;return!!V&&Ri(j,J,0)>-1}function fs(j,J,V){for(var se=-1,ve=j==null?0:j.length;++se<ve;)if(V(J,j[se]))return!0;return!1}function ot(j,J){for(var V=-1,se=j==null?0:j.length,ve=Array(se);++V<se;)ve[V]=J(j[V],V,j);return ve}function si(j,J){for(var V=-1,se=J.length,ve=j.length;++V<se;)j[ve+V]=J[V];return j}function Ou(j,J,V,se){var ve=-1,Je=j==null?0:j.length;for(se&&Je&&(V=j[++ve]);++ve<Je;)V=J(V,j[ve],ve,j);return V}function hg(j,J,V,se){var ve=j==null?0:j.length;for(se&&ve&&(V=j[--ve]);ve--;)V=J(V,j[ve],ve,j);return V}function ka(j,J){for(var V=-1,se=j==null?0:j.length;++V<se;)if(J(j[V],V,j))return!0;return!1}var pg=fo("length");function mg(j){return j.split("")}function gg(j){return j.match(It)||[]}function Sd(j,J,V){var se;return V(j,function(ve,Je,Xe){if(J(ve,Je,Xe))return se=Je,!1}),se}function Aa(j,J,V,se){for(var ve=j.length,Je=V+(se?1:-1);se?Je--:++Je<ve;)if(J(j[Je],Je,j))return Je;return-1}function Ri(j,J,V){return J===J?Cg(j,J,V):Aa(j,Ii,V)}function yg(j,J,V,se){for(var ve=V-1,Je=j.length;++ve<Je;)if(se(j[ve],J))return ve;return-1}function Ii(j){return j!==j}function bd(j,J){var V=j==null?0:j.length;return V?ku(j,J)/V:ge}function fo(j){return function(J){return J==null?t:J[j]}}function Pu(j){return function(J){return j==null?t:j[J]}}function Ta(j,J,V,se,ve){return ve(j,function(Je,Xe,je){V=se?(se=!1,Je):J(V,Je,Xe,je)}),V}function vg(j,J){var V=j.length;for(j.sort(J);V--;)j[V]=j[V].value;return j}function ku(j,J){for(var V,se=-1,ve=j.length;++se<ve;){var Je=J(j[se]);Je!==t&&(V=V===t?Je:V+Je)}return V}function Au(j,J){for(var V=-1,se=Array(j);++V<j;)se[V]=J(V);return se}function Sg(j,J){return ot(J,function(V){return[V,j[V]]})}function Tu(j){return j&&j.slice(0,Cd(j)+1).replace(mu,"")}function pr(j){return function(J){return j(J)}}function qa(j,J){return ot(J,function(V){return j[V]})}function Ze(j,J){return j.has(J)}function _d(j,J){for(var V=-1,se=j.length;++V<se&&Ri(J,j[V],0)>-1;);return V}function wd(j,J){for(var V=j.length;V--&&Ri(J,j[V],0)>-1;);return V}function Ed(j,J){for(var V=j.length,se=0;V--;)j[V]===J&&++se;return se}var bg=Pu(xu),_g=Pu(Cu);function wg(j){return"\\"+hd[j]}function ho(j,J){return j==null?t:j[J]}function ds(j){return og.test(j)}function Eg(j){return ag.test(j)}function xg(j){for(var J,V=[];!(J=j.next()).done;)V.push(J.value);return V}function hs(j){var J=-1,V=Array(j.size);return j.forEach(function(se,ve){V[++J]=[ve,se]}),V}function po(j,J){return function(V){return j(J(V))}}function sn(j,J){for(var V=-1,se=j.length,ve=0,Je=[];++V<se;){var Xe=j[V];(Xe===J||Xe===h)&&(j[V]=h,Je[ve++]=V)}return Je}function $a(j){var J=-1,V=Array(j.size);return j.forEach(function(se){V[++J]=se}),V}function xd(j){var J=-1,V=Array(j.size);return j.forEach(function(se){V[++J]=[se,se]}),V}function Cg(j,J,V){for(var se=V-1,ve=j.length;++se<ve;)if(j[se]===J)return se;return-1}function qu(j,J,V){for(var se=V+1;se--;)if(j[se]===J)return se;return se}function oi(j){return ds(j)?Ig(j):pg(j)}function mr(j){return ds(j)?Og(j):mg(j)}function Cd(j){for(var J=j.length;J--&&_a.test(j.charAt(J)););return J}var Rg=Pu(cg);function Ig(j){for(var J=Eu.lastIndex=0;Eu.test(j);)++J;return J}function Og(j){return j.match(Eu)||[]}function Pg(j){return j.match(sg)||[]}var kg=(function j(J){J=J==null?qt:ai.defaults(qt.Object(),J,ai.pick(qt,lg));var V=J.Array,se=J.Date,ve=J.Error,Je=J.Function,Xe=J.Math,je=J.Object,Ma=J.RegExp,Ag=J.String,gr=J.TypeError,mo=V.prototype,Tg=Je.prototype,ps=je.prototype,go=J["__core-js_shared__"],Na=Tg.toString,Qe=ps.hasOwnProperty,qg=0,Rd=(function(){var o=/[^.]+$/.exec(go&&go.keys&&go.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Da=ps.toString,$g=Na.call(je),Mg=qt._,Ng=Ma("^"+Na.call(Qe).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fa=cs?J.Buffer:t,li=J.Symbol,La=J.Uint8Array,Id=Fa?Fa.allocUnsafe:t,ja=po(je.getPrototypeOf,je),Od=je.create,yo=ps.propertyIsEnumerable,Ua=mo.splice,Pd=li?li.isConcatSpreadable:t,vo=li?li.iterator:t,Oi=li?li.toStringTag:t,Ba=(function(){try{var o=Oo(je,"defineProperty");return o({},"",{}),o}catch{}})(),Dg=J.clearTimeout!==qt.clearTimeout&&J.clearTimeout,Fg=se&&se.now!==qt.Date.now&&se.now,Lg=J.setTimeout!==qt.setTimeout&&J.setTimeout,So=Xe.ceil,bo=Xe.floor,Ha=je.getOwnPropertySymbols,Va=Fa?Fa.isBuffer:t,Pi=J.isFinite,Wa=mo.join,kd=po(je.keys,je),ht=Xe.max,Lt=Xe.min,Ad=se.now,jg=J.parseInt,Td=Xe.random,Ug=mo.reverse,$u=Oo(J,"DataView"),_o=Oo(J,"Map"),Mu=Oo(J,"Promise"),ms=Oo(J,"Set"),wo=Oo(J,"WeakMap"),Eo=Oo(je,"create"),Ya=wo&&new wo,gs={},Bg=Po($u),Hg=Po(_o),Vg=Po(Mu),Wg=Po(ms),Yg=Po(wo),Ja=li?li.prototype:t,xo=Ja?Ja.valueOf:t,qd=Ja?Ja.toString:t;function I(o){if(wt(o)&&!we(o)&&!(o instanceof qe)){if(o instanceof tr)return o;if(Qe.call(o,"__wrapped__"))return rE(o)}return new tr(o)}var ys=(function(){function o(){}return function(l){if(!St(l))return{};if(Od)return Od(l);o.prototype=l;var d=new o;return o.prototype=t,d}})();function za(){}function tr(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}I.templateSettings={escape:jm,evaluate:Um,interpolate:tn,variable:"",imports:{_:I}},I.prototype=za.prototype,I.prototype.constructor=I,tr.prototype=ys(za.prototype),tr.prototype.constructor=tr;function qe(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ae,this.__views__=[]}function Jg(){var o=new qe(this.__wrapped__);return o.__actions__=Ir(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Ir(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Ir(this.__views__),o}function zg(){if(this.__filtered__){var o=new qe(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function Nu(){var o=this.__wrapped__.value(),l=this.__dir__,d=we(o),y=l<0,_=d?o.length:0,O=KA(0,_,this.__views__),q=O.start,M=O.end,U=M-q,G=y?M:q-1,Q=this.__iteratees__,ee=Q.length,re=0,ue=Lt(U,this.__takeCount__);if(!d||!y&&_==U&&ue==U)return Cw(o,this.__actions__);var me=[];e:for(;U--&&re<ue;){G+=l;for(var Ie=-1,he=o[G];++Ie<ee;){var Fe=Q[Ie],Ue=Fe.iteratee,Jr=Fe.type,Sr=Ue(he);if(Jr==Z)he=Sr;else if(!Sr){if(Jr==z)continue e;break e}}me[re++]=he}return me}qe.prototype=ys(za.prototype),qe.prototype.constructor=qe;function on(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var y=o[l];this.set(y[0],y[1])}}function Kg(){this.__data__=Eo?Eo(null):{},this.size=0}function Gg(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function Qg(o){var l=this.__data__;if(Eo){var d=l[o];return d===u?t:d}return Qe.call(l,o)?l[o]:t}function Zg(o){var l=this.__data__;return Eo?l[o]!==t:Qe.call(l,o)}function Xg(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=Eo&&l===t?u:l,this}on.prototype.clear=Kg,on.prototype.delete=Gg,on.prototype.get=Qg,on.prototype.has=Zg,on.prototype.set=Xg;function kn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var y=o[l];this.set(y[0],y[1])}}function $d(){this.__data__=[],this.size=0}function ey(o){var l=this.__data__,d=Ga(l,o);if(d<0)return!1;var y=l.length-1;return d==y?l.pop():Ua.call(l,d,1),--this.size,!0}function ty(o){var l=this.__data__,d=Ga(l,o);return d<0?t:l[d][1]}function Md(o){return Ga(this.__data__,o)>-1}function ry(o,l){var d=this.__data__,y=Ga(d,o);return y<0?(++this.size,d.push([o,l])):d[y][1]=l,this}kn.prototype.clear=$d,kn.prototype.delete=ey,kn.prototype.get=ty,kn.prototype.has=Md,kn.prototype.set=ry;function An(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var y=o[l];this.set(y[0],y[1])}}function ny(){this.size=0,this.__data__={hash:new on,map:new(_o||kn),string:new on}}function ui(o){var l=rh(this,o).delete(o);return this.size-=l?1:0,l}function Nd(o){return rh(this,o).get(o)}function iy(o){return rh(this,o).has(o)}function sy(o,l){var d=rh(this,o),y=d.size;return d.set(o,l),this.size+=d.size==y?0:1,this}An.prototype.clear=ny,An.prototype.delete=ui,An.prototype.get=Nd,An.prototype.has=iy,An.prototype.set=sy;function ki(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new An;++l<d;)this.add(o[l])}function te(o){return this.__data__.set(o,u),this}function oy(o){return this.__data__.has(o)}ki.prototype.add=ki.prototype.push=te,ki.prototype.has=oy;function Br(o){var l=this.__data__=new kn(o);this.size=l.size}function Dd(){this.__data__=new kn,this.size=0}function He(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function Ka(o){return this.__data__.get(o)}function Fd(o){return this.__data__.has(o)}function Du(o,l){var d=this.__data__;if(d instanceof kn){var y=d.__data__;if(!_o||y.length<r-1)return y.push([o,l]),this.size=++d.size,this;d=this.__data__=new An(y)}return d.set(o,l),this.size=d.size,this}Br.prototype.clear=Dd,Br.prototype.delete=He,Br.prototype.get=Ka,Br.prototype.has=Fd,Br.prototype.set=Du;function Ld(o,l){var d=we(o),y=!d&&ko(o),_=!d&&!y&&xs(o),O=!d&&!y&&!_&&rl(o),q=d||y||_||O,M=q?Au(o.length,Ag):[],U=M.length;for(var G in o)(l||Qe.call(o,G))&&!(q&&(G=="length"||_&&(G=="offset"||G=="parent")||O&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||$i(G,U)))&&M.push(G);return M}function jd(o){var l=o.length;return l?o[Sy(0,l-1)]:t}function ay(o,l){return nh(Ir(o),ci(l,0,o.length))}function ly(o){return nh(Ir(o))}function Fu(o,l,d){(d!==t&&!Nn(o[l],d)||d===t&&!(l in o))&&Hr(o,l,d)}function yr(o,l,d){var y=o[l];(!(Qe.call(o,l)&&Nn(y,d))||d===t&&!(l in o))&&Hr(o,l,d)}function Ga(o,l){for(var d=o.length;d--;)if(Nn(o[d][0],l))return d;return-1}function Ud(o,l,d,y){return fi(o,function(_,O,q){l(y,_,d(_),q)}),y}function Bd(o,l){return o&&di(l,Yt(l),o)}function uy(o,l){return o&&di(l,Pr(l),o)}function Hr(o,l,d){l=="__proto__"&&Ba?Ba(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function Lu(o,l){for(var d=-1,y=l.length,_=V(y),O=o==null;++d<y;)_[d]=O?t:Wy(o,l[d]);return _}function ci(o,l,d){return o===o&&(d!==t&&(o=o<=d?o:d),l!==t&&(o=o>=l?o:l)),o}function rr(o,l,d,y,_,O){var q,M=l&g,U=l&m,G=l&S;if(d&&(q=_?d(o,y,_,O):d(o)),q!==t)return q;if(!St(o))return o;var Q=we(o);if(Q){if(q=QA(o),!M)return Ir(o,q)}else{var ee=nr(o),re=ee==en||ee==Xs;if(xs(o))return Ow(o,M);if(ee==xn||ee==Zr||re&&!_){if(q=U||re?{}:Jw(o),!M)return U?jA(o,uy(q,o)):LA(o,Bd(q,o))}else{if(!st[ee])return _?o:{};q=ZA(o,ee,M)}}O||(O=new Br);var ue=O.get(o);if(ue)return ue;O.set(o,q),wE(o)?o.forEach(function(he){q.add(rr(he,l,d,he,o,O))}):bE(o)&&o.forEach(function(he,Fe){q.set(Fe,rr(he,l,d,Fe,o,O))});var me=G?U?ky:Py:U?Pr:Yt,Ie=Q?t:me(o);return hr(Ie||o,function(he,Fe){Ie&&(Fe=he,he=o[Fe]),yr(q,Fe,rr(he,l,d,Fe,o,O))}),q}function cy(o){var l=Yt(o);return function(d){return an(d,o,l)}}function an(o,l,d){var y=d.length;if(o==null)return!y;for(o=je(o);y--;){var _=d[y],O=l[_],q=o[_];if(q===t&&!(_ in o)||!O(q))return!1}return!0}function ju(o,l,d){if(typeof o!="function")throw new gr(i);return Ju(function(){o.apply(t,d)},l)}function Co(o,l,d,y){var _=-1,O=Pa,q=!0,M=o.length,U=[],G=l.length;if(!M)return U;d&&(l=ot(l,pr(d))),y?(O=fs,q=!1):l.length>=r&&(O=Ze,q=!1,l=new ki(l));e:for(;++_<M;){var Q=o[_],ee=d==null?Q:d(Q);if(Q=y||Q!==0?Q:0,q&&ee===ee){for(var re=G;re--;)if(l[re]===ee)continue e;U.push(Q)}else O(l,ee,y)||U.push(Q)}return U}var fi=qw(ln),Hd=qw(Tn,!0);function fy(o,l){var d=!0;return fi(o,function(y,_,O){return d=!!l(y,_,O),d}),d}function Qa(o,l,d){for(var y=-1,_=o.length;++y<_;){var O=o[y],q=l(O);if(q!=null&&(M===t?q===q&&!Yr(q):d(q,M)))var M=q,U=O}return U}function dy(o,l,d,y){var _=o.length;for(d=Ee(d),d<0&&(d=-d>_?0:_+d),y=y===t||y>_?_:Ee(y),y<0&&(y+=_),y=d>y?0:xE(y);d<y;)o[d++]=l;return o}function Vd(o,l){var d=[];return fi(o,function(y,_,O){l(y,_,O)&&d.push(y)}),d}function jt(o,l,d,y,_){var O=-1,q=o.length;for(d||(d=eT),_||(_=[]);++O<q;){var M=o[O];l>0&&d(M)?l>1?jt(M,l-1,d,y,_):si(_,M):y||(_[_.length]=M)}return _}var Uu=$w(),Wd=$w(!0);function ln(o,l){return o&&Uu(o,l,Yt)}function Tn(o,l){return o&&Wd(o,l,Yt)}function Za(o,l){return ii(l,function(d){return Mi(o[d])})}function Ai(o,l){l=ws(l,o);for(var d=0,y=l.length;o!=null&&d<y;)o=o[Mn(l[d++])];return d&&d==y?o:t}function Yd(o,l,d){var y=l(o);return we(o)?y:si(y,d(o))}function Jt(o){return o==null?o===t?Zf:Fm:Oi&&Oi in je(o)?zA(o):aT(o)}function Bu(o,l){return o>l}function hy(o,l){return o!=null&&Qe.call(o,l)}function py(o,l){return o!=null&&l in je(o)}function my(o,l,d){return o>=Lt(l,d)&&o<ht(l,d)}function Vr(o,l,d){for(var y=d?fs:Pa,_=o[0].length,O=o.length,q=O,M=V(O),U=1/0,G=[];q--;){var Q=o[q];q&&l&&(Q=ot(Q,pr(l))),U=Lt(Q.length,U),M[q]=!d&&(l||_>=120&&Q.length>=120)?new ki(q&&Q):t}Q=o[0];var ee=-1,re=M[0];e:for(;++ee<_&&G.length<U;){var ue=Q[ee],me=l?l(ue):ue;if(ue=d||ue!==0?ue:0,!(re?Ze(re,me):y(G,me,d))){for(q=O;--q;){var Ie=M[q];if(!(Ie?Ze(Ie,me):y(o[q],me,d)))continue e}re&&re.push(me),G.push(ue)}}return G}function vs(o,l,d,y){return ln(o,function(_,O,q){l(y,d(_),O,q)}),y}function Ro(o,l,d){l=ws(l,o),o=Qw(o,l);var y=o==null?o:o[Mn(cn(l))];return y==null?t:dr(y,o,d)}function Jd(o){return wt(o)&&Jt(o)==Zr}function gy(o){return wt(o)&&Jt(o)==wi}function yy(o){return wt(o)&&Jt(o)==Xr}function Io(o,l,d,y,_){return o===l?!0:o==null||l==null||!wt(o)&&!wt(l)?o!==o&&l!==l:Hu(o,l,d,y,Io,_)}function Hu(o,l,d,y,_,O){var q=we(o),M=we(l),U=q?ns:nr(o),G=M?ns:nr(l);U=U==Zr?xn:U,G=G==Zr?xn:G;var Q=U==xn,ee=G==xn,re=U==G;if(re&&xs(o)){if(!xs(l))return!1;q=!0,Q=!1}if(re&&!Q)return O||(O=new Br),q||rl(o)?Vw(o,l,d,y,_,O):YA(o,l,U,d,y,_,O);if(!(d&E)){var ue=Q&&Qe.call(o,"__wrapped__"),me=ee&&Qe.call(l,"__wrapped__");if(ue||me){var Ie=ue?o.value():o,he=me?l.value():l;return O||(O=new Br),_(Ie,he,d,y,O)}}return re?(O||(O=new Br),JA(o,l,d,y,_,O)):!1}function Ss(o){return wt(o)&&nr(o)==Ht}function bs(o,l,d,y){var _=d.length,O=_,q=!y;if(o==null)return!O;for(o=je(o);_--;){var M=d[_];if(q&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++_<O;){M=d[_];var U=M[0],G=o[U],Q=M[1];if(q&&M[2]){if(G===t&&!(U in o))return!1}else{var ee=new Br;if(y)var re=y(G,Q,U,o,l,ee);if(!(re===t?Io(Q,G,E|x,y,ee):re))return!1}}return!0}function De(o){if(!St(o)||rT(o))return!1;var l=Mi(o)?Ng:td;return l.test(Po(o))}function c(o){return wt(o)&&Jt(o)==Vt}function p(o){return wt(o)&&nr(o)==fr}function v(o){return wt(o)&&uh(o.length)&&!!lt[Jt(o)]}function b(o){return typeof o=="function"?o:o==null?kr:typeof o=="object"?we(o)?$e(o[0],o[1]):ye(o):NE(o)}function R(o){if(!Yu(o))return kd(o);var l=[];for(var d in je(o))Qe.call(o,d)&&d!="constructor"&&l.push(d);return l}function $(o){if(!St(o))return oT(o);var l=Yu(o),d=[];for(var y in o)y=="constructor"&&(l||!Qe.call(o,y))||d.push(y);return d}function W(o,l){return o<l}function ie(o,l){var d=-1,y=Or(o)?V(o.length):[];return fi(o,function(_,O,q){y[++d]=l(_,O,q)}),y}function ye(o){var l=Ty(o);return l.length==1&&l[0][2]?Kw(l[0][0],l[0][1]):function(d){return d===o||bs(d,o,l)}}function $e(o,l){return $y(o)&&zw(l)?Kw(Mn(o),l):function(d){var y=Wy(d,o);return y===t&&y===l?Yy(d,o):Io(l,y,E|x)}}function $t(o,l,d,y,_){o!==l&&Uu(l,function(O,q){if(_||(_=new Br),St(O))qn(o,l,q,d,$t,y,_);else{var M=y?y(Ny(o,q),O,q+"",o,l,_):t;M===t&&(M=O),Fu(o,q,M)}},Pr)}function qn(o,l,d,y,_,O,q){var M=Ny(o,d),U=Ny(l,d),G=q.get(U);if(G){Fu(o,d,G);return}var Q=O?O(M,U,d+"",o,l,q):t,ee=Q===t;if(ee){var re=we(U),ue=!re&&xs(U),me=!re&&!ue&&rl(U);Q=U,re||ue||me?we(M)?Q=M:Ot(M)?Q=Ir(M):ue?(ee=!1,Q=Ow(U,!0)):me?(ee=!1,Q=Pw(U,!0)):Q=[]:zu(U)||ko(U)?(Q=M,ko(M)?Q=CE(M):(!St(M)||Mi(M))&&(Q=Jw(U))):ee=!1}ee&&(q.set(U,Q),_(Q,U,y,O,q),q.delete(U)),Fu(o,d,Q)}function $n(o,l){var d=o.length;if(d)return l+=l<0?d:0,$i(l,d)?o[l]:t}function vw(o,l,d){l.length?l=ot(l,function(O){return we(O)?function(q){return Ai(q,O.length===1?O[0]:O)}:O}):l=[kr];var y=-1;l=ot(l,pr(pe()));var _=ie(o,function(O,q,M){var U=ot(l,function(G){return G(O)});return{criteria:U,index:++y,value:O}});return vg(_,function(O,q){return FA(O,q,d)})}function RA(o,l){return Sw(o,l,function(d,y){return Yy(o,y)})}function Sw(o,l,d){for(var y=-1,_=l.length,O={};++y<_;){var q=l[y],M=Ai(o,q);d(M,q)&&Vu(O,ws(q,o),M)}return O}function IA(o){return function(l){return Ai(l,o)}}function vy(o,l,d,y){var _=y?yg:Ri,O=-1,q=l.length,M=o;for(o===l&&(l=Ir(l)),d&&(M=ot(o,pr(d)));++O<q;)for(var U=0,G=l[O],Q=d?d(G):G;(U=_(M,Q,U,y))>-1;)M!==o&&Ua.call(M,U,1),Ua.call(o,U,1);return o}function bw(o,l){for(var d=o?l.length:0,y=d-1;d--;){var _=l[d];if(d==y||_!==O){var O=_;$i(_)?Ua.call(o,_,1):wy(o,_)}}return o}function Sy(o,l){return o+bo(Td()*(l-o+1))}function OA(o,l,d,y){for(var _=-1,O=ht(So((l-o)/(d||1)),0),q=V(O);O--;)q[y?O:++_]=o,o+=d;return q}function by(o,l){var d="";if(!o||l<1||l>rt)return d;do l%2&&(d+=o),l=bo(l/2),l&&(o+=o);while(l);return d}function Pe(o,l){return Dy(Gw(o,l,kr),o+"")}function PA(o){return jd(nl(o))}function kA(o,l){var d=nl(o);return nh(d,ci(l,0,d.length))}function Vu(o,l,d,y){if(!St(o))return o;l=ws(l,o);for(var _=-1,O=l.length,q=O-1,M=o;M!=null&&++_<O;){var U=Mn(l[_]),G=d;if(U==="__proto__"||U==="constructor"||U==="prototype")return o;if(_!=q){var Q=M[U];G=y?y(Q,U,M):t,G===t&&(G=St(Q)?Q:$i(l[_+1])?[]:{})}yr(M,U,G),M=M[U]}return o}var _w=Ya?function(o,l){return Ya.set(o,l),o}:kr,AA=Ba?function(o,l){return Ba(o,"toString",{configurable:!0,enumerable:!1,value:zy(l),writable:!0})}:kr;function TA(o){return nh(nl(o))}function un(o,l,d){var y=-1,_=o.length;l<0&&(l=-l>_?0:_+l),d=d>_?_:d,d<0&&(d+=_),_=l>d?0:d-l>>>0,l>>>=0;for(var O=V(_);++y<_;)O[y]=o[y+l];return O}function qA(o,l){var d;return fi(o,function(y,_,O){return d=l(y,_,O),!d}),!!d}function zd(o,l,d){var y=0,_=o==null?y:o.length;if(typeof l=="number"&&l===l&&_<=Tt){for(;y<_;){var O=y+_>>>1,q=o[O];q!==null&&!Yr(q)&&(d?q<=l:q<l)?y=O+1:_=O}return _}return _y(o,l,kr,d)}function _y(o,l,d,y){var _=0,O=o==null?0:o.length;if(O===0)return 0;l=d(l);for(var q=l!==l,M=l===null,U=Yr(l),G=l===t;_<O;){var Q=bo((_+O)/2),ee=d(o[Q]),re=ee!==t,ue=ee===null,me=ee===ee,Ie=Yr(ee);if(q)var he=y||me;else G?he=me&&(y||re):M?he=me&&re&&(y||!ue):U?he=me&&re&&!ue&&(y||!Ie):ue||Ie?he=!1:he=y?ee<=l:ee<l;he?_=Q+1:O=Q}return Lt(O,bt)}function ww(o,l){for(var d=-1,y=o.length,_=0,O=[];++d<y;){var q=o[d],M=l?l(q):q;if(!d||!Nn(M,U)){var U=M;O[_++]=q===0?0:q}}return O}function Ew(o){return typeof o=="number"?o:Yr(o)?ge:+o}function Wr(o){if(typeof o=="string")return o;if(we(o))return ot(o,Wr)+"";if(Yr(o))return qd?qd.call(o):"";var l=o+"";return l=="0"&&1/o==-de?"-0":l}function _s(o,l,d){var y=-1,_=Pa,O=o.length,q=!0,M=[],U=M;if(d)q=!1,_=fs;else if(O>=r){var G=l?null:VA(o);if(G)return $a(G);q=!1,_=Ze,U=new ki}else U=l?[]:M;e:for(;++y<O;){var Q=o[y],ee=l?l(Q):Q;if(Q=d||Q!==0?Q:0,q&&ee===ee){for(var re=U.length;re--;)if(U[re]===ee)continue e;l&&U.push(ee),M.push(Q)}else _(U,ee,d)||(U!==M&&U.push(ee),M.push(Q))}return M}function wy(o,l){l=ws(l,o);var d=-1,y=l.length;if(!y)return!0;for(;++d<y;){var _=Mn(l[d]);if(_==="__proto__"&&!Qe.call(o,"__proto__")||(_==="constructor"||_==="prototype")&&d<y-1)return!1}var O=Qw(o,l);return O==null||delete O[Mn(cn(l))]}function xw(o,l,d,y){return Vu(o,l,d(Ai(o,l)),y)}function Kd(o,l,d,y){for(var _=o.length,O=y?_:-1;(y?O--:++O<_)&&l(o[O],O,o););return d?un(o,y?0:O,y?O+1:_):un(o,y?O+1:0,y?_:O)}function Cw(o,l){var d=o;return d instanceof qe&&(d=d.value()),Ou(l,function(y,_){return _.func.apply(_.thisArg,si([y],_.args))},d)}function Ey(o,l,d){var y=o.length;if(y<2)return y?_s(o[0]):[];for(var _=-1,O=V(y);++_<y;)for(var q=o[_],M=-1;++M<y;)M!=_&&(O[_]=Co(O[_]||q,o[M],l,d));return _s(jt(O,1),l,d)}function Rw(o,l,d){for(var y=-1,_=o.length,O=l.length,q={};++y<_;){var M=y<O?l[y]:t;d(q,o[y],M)}return q}function xy(o){return Ot(o)?o:[]}function Cy(o){return typeof o=="function"?o:kr}function ws(o,l){return we(o)?o:$y(o,l)?[o]:tE(et(o))}var $A=Pe;function Es(o,l,d){var y=o.length;return d=d===t?y:d,!l&&d>=y?o:un(o,l,d)}var Iw=Dg||function(o){return qt.clearTimeout(o)};function Ow(o,l){if(l)return o.slice();var d=o.length,y=Id?Id(d):new o.constructor(d);return o.copy(y),y}function Ry(o){var l=new o.constructor(o.byteLength);return new La(l).set(new La(o)),l}function MA(o,l){var d=l?Ry(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function NA(o){var l=new o.constructor(o.source,ed.exec(o));return l.lastIndex=o.lastIndex,l}function DA(o){return xo?je(xo.call(o)):{}}function Pw(o,l){var d=l?Ry(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function kw(o,l){if(o!==l){var d=o!==t,y=o===null,_=o===o,O=Yr(o),q=l!==t,M=l===null,U=l===l,G=Yr(l);if(!M&&!G&&!O&&o>l||O&&q&&U&&!M&&!G||y&&q&&U||!d&&U||!_)return 1;if(!y&&!O&&!G&&o<l||G&&d&&_&&!y&&!O||M&&d&&_||!q&&_||!U)return-1}return 0}function FA(o,l,d){for(var y=-1,_=o.criteria,O=l.criteria,q=_.length,M=d.length;++y<q;){var U=kw(_[y],O[y]);if(U){if(y>=M)return U;var G=d[y];return U*(G=="desc"?-1:1)}}return o.index-l.index}function Aw(o,l,d,y){for(var _=-1,O=o.length,q=d.length,M=-1,U=l.length,G=ht(O-q,0),Q=V(U+G),ee=!y;++M<U;)Q[M]=l[M];for(;++_<q;)(ee||_<O)&&(Q[d[_]]=o[_]);for(;G--;)Q[M++]=o[_++];return Q}function Tw(o,l,d,y){for(var _=-1,O=o.length,q=-1,M=d.length,U=-1,G=l.length,Q=ht(O-M,0),ee=V(Q+G),re=!y;++_<Q;)ee[_]=o[_];for(var ue=_;++U<G;)ee[ue+U]=l[U];for(;++q<M;)(re||_<O)&&(ee[ue+d[q]]=o[_++]);return ee}function Ir(o,l){var d=-1,y=o.length;for(l||(l=V(y));++d<y;)l[d]=o[d];return l}function di(o,l,d,y){var _=!d;d||(d={});for(var O=-1,q=l.length;++O<q;){var M=l[O],U=y?y(d[M],o[M],M,d,o):t;U===t&&(U=o[M]),_?Hr(d,M,U):yr(d,M,U)}return d}function LA(o,l){return di(o,qy(o),l)}function jA(o,l){return di(o,Ww(o),l)}function Gd(o,l){return function(d,y){var _=we(d)?Pn:Ud,O=l?l():{};return _(d,o,pe(y,2),O)}}function Xa(o){return Pe(function(l,d){var y=-1,_=d.length,O=_>1?d[_-1]:t,q=_>2?d[2]:t;for(O=o.length>3&&typeof O=="function"?(_--,O):t,q&&vr(d[0],d[1],q)&&(O=_<3?t:O,_=1),l=je(l);++y<_;){var M=d[y];M&&o(l,M,y,O)}return l})}function qw(o,l){return function(d,y){if(d==null)return d;if(!Or(d))return o(d,y);for(var _=d.length,O=l?_:-1,q=je(d);(l?O--:++O<_)&&y(q[O],O,q)!==!1;);return d}}function $w(o){return function(l,d,y){for(var _=-1,O=je(l),q=y(l),M=q.length;M--;){var U=q[o?M:++_];if(d(O[U],U,O)===!1)break}return l}}function UA(o,l,d){var y=l&C,_=Wu(o);function O(){var q=this&&this!==qt&&this instanceof O?_:o;return q.apply(y?d:this,arguments)}return O}function Mw(o){return function(l){l=et(l);var d=ds(l)?mr(l):t,y=d?d[0]:l.charAt(0),_=d?Es(d,1).join(""):l.slice(1);return y[o]()+_}}function el(o){return function(l){return Ou($E(qE(l).replace(ng,"")),o,"")}}function Wu(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=ys(o.prototype),y=o.apply(d,l);return St(y)?y:d}}function BA(o,l,d){var y=Wu(o);function _(){for(var O=arguments.length,q=V(O),M=O,U=tl(_);M--;)q[M]=arguments[M];var G=O<3&&q[0]!==U&&q[O-1]!==U?[]:sn(q,U);if(O-=G.length,O<d)return jw(o,l,Qd,_.placeholder,t,q,G,t,t,d-O);var Q=this&&this!==qt&&this instanceof _?y:o;return dr(Q,this,q)}return _}function Nw(o){return function(l,d,y){var _=je(l);if(!Or(l)){var O=pe(d,3);l=Yt(l),d=function(M){return O(_[M],M,_)}}var q=o(l,d,y);return q>-1?_[O?l[q]:q]:t}}function Dw(o){return qi(function(l){var d=l.length,y=d,_=tr.prototype.thru;for(o&&l.reverse();y--;){var O=l[y];if(typeof O!="function")throw new gr(i);if(_&&!q&&th(O)=="wrapper")var q=new tr([],!0)}for(y=q?y:d;++y<d;){O=l[y];var M=th(O),U=M=="wrapper"?Ay(O):t;U&&My(U[0])&&U[1]==(X|B|H|k)&&!U[4].length&&U[9]==1?q=q[th(U[0])].apply(q,U[3]):q=O.length==1&&My(O)?q[M]():q.thru(O)}return function(){var G=arguments,Q=G[0];if(q&&G.length==1&&we(Q))return q.plant(Q).value();for(var ee=0,re=d?l[ee].apply(this,G):Q;++ee<d;)re=l[ee].call(this,re);return re}})}function Qd(o,l,d,y,_,O,q,M,U,G){var Q=l&X,ee=l&C,re=l&A,ue=l&(B|Y),me=l&w,Ie=re?t:Wu(o);function he(){for(var Fe=arguments.length,Ue=V(Fe),Jr=Fe;Jr--;)Ue[Jr]=arguments[Jr];if(ue)var Sr=tl(he),zr=Ed(Ue,Sr);if(y&&(Ue=Aw(Ue,y,_,ue)),O&&(Ue=Tw(Ue,O,q,ue)),Fe-=zr,ue&&Fe<G){var Pt=sn(Ue,Sr);return jw(o,l,Qd,he.placeholder,d,Ue,Pt,M,U,G-Fe)}var Dn=ee?d:this,Di=re?Dn[o]:o;return Fe=Ue.length,M?Ue=lT(Ue,M):me&&Fe>1&&Ue.reverse(),Q&&U<Fe&&(Ue.length=U),this&&this!==qt&&this instanceof he&&(Di=Ie||Wu(Di)),Di.apply(Dn,Ue)}return he}function Fw(o,l){return function(d,y){return vs(d,o,l(y),{})}}function Zd(o,l){return function(d,y){var _;if(d===t&&y===t)return l;if(d!==t&&(_=d),y!==t){if(_===t)return y;typeof d=="string"||typeof y=="string"?(d=Wr(d),y=Wr(y)):(d=Ew(d),y=Ew(y)),_=o(d,y)}return _}}function Iy(o){return qi(function(l){return l=ot(l,pr(pe())),Pe(function(d){var y=this;return o(l,function(_){return dr(_,y,d)})})})}function Xd(o,l){l=l===t?" ":Wr(l);var d=l.length;if(d<2)return d?by(l,o):l;var y=by(l,So(o/oi(l)));return ds(l)?Es(mr(y),0,o).join(""):y.slice(0,o)}function HA(o,l,d,y){var _=l&C,O=Wu(o);function q(){for(var M=-1,U=arguments.length,G=-1,Q=y.length,ee=V(Q+U),re=this&&this!==qt&&this instanceof q?O:o;++G<Q;)ee[G]=y[G];for(;U--;)ee[G++]=arguments[++M];return dr(re,_?d:this,ee)}return q}function Lw(o){return function(l,d,y){return y&&typeof y!="number"&&vr(l,d,y)&&(d=y=t),l=Ni(l),d===t?(d=l,l=0):d=Ni(d),y=y===t?l<d?1:-1:Ni(y),OA(l,d,y,o)}}function eh(o){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=fn(l),d=fn(d)),o(l,d)}}function jw(o,l,d,y,_,O,q,M,U,G){var Q=l&B,ee=Q?q:t,re=Q?t:q,ue=Q?O:t,me=Q?t:O;l|=Q?H:K,l&=~(Q?K:H),l&T||(l&=~(C|A));var Ie=[o,l,_,ue,ee,me,re,M,U,G],he=d.apply(t,Ie);return My(o)&&Zw(he,Ie),he.placeholder=y,Xw(he,o,l)}function Oy(o){var l=Xe[o];return function(d,y){if(d=fn(d),y=y==null?0:Lt(Ee(y),292),y&&Pi(d)){var _=(et(d)+"e").split("e"),O=l(_[0]+"e"+(+_[1]+y));return _=(et(O)+"e").split("e"),+(_[0]+"e"+(+_[1]-y))}return l(d)}}var VA=ms&&1/$a(new ms([,-0]))[1]==de?function(o){return new ms(o)}:Qy;function Uw(o){return function(l){var d=nr(l);return d==Ht?hs(l):d==fr?xd(l):Sg(l,o(l))}}function Ti(o,l,d,y,_,O,q,M){var U=l&A;if(!U&&typeof o!="function")throw new gr(i);var G=y?y.length:0;if(G||(l&=~(H|K),y=_=t),q=q===t?q:ht(Ee(q),0),M=M===t?M:Ee(M),G-=_?_.length:0,l&K){var Q=y,ee=_;y=_=t}var re=U?t:Ay(o),ue=[o,l,d,y,_,Q,ee,O,q,M];if(re&&sT(ue,re),o=ue[0],l=ue[1],d=ue[2],y=ue[3],_=ue[4],M=ue[9]=ue[9]===t?U?0:o.length:ht(ue[9]-G,0),!M&&l&(B|Y)&&(l&=~(B|Y)),!l||l==C)var me=UA(o,l,d);else l==B||l==Y?me=BA(o,l,M):(l==H||l==(C|H))&&!_.length?me=HA(o,l,d,y):me=Qd.apply(t,ue);var Ie=re?_w:Zw;return Xw(Ie(me,ue),o,l)}function Bw(o,l,d,y){return o===t||Nn(o,ps[d])&&!Qe.call(y,d)?l:o}function Hw(o,l,d,y,_,O){return St(o)&&St(l)&&(O.set(l,o),$t(o,l,t,Hw,O),O.delete(l)),o}function WA(o){return zu(o)?t:o}function Vw(o,l,d,y,_,O){var q=d&E,M=o.length,U=l.length;if(M!=U&&!(q&&U>M))return!1;var G=O.get(o),Q=O.get(l);if(G&&Q)return G==l&&Q==o;var ee=-1,re=!0,ue=d&x?new ki:t;for(O.set(o,l),O.set(l,o);++ee<M;){var me=o[ee],Ie=l[ee];if(y)var he=q?y(Ie,me,ee,l,o,O):y(me,Ie,ee,o,l,O);if(he!==t){if(he)continue;re=!1;break}if(ue){if(!ka(l,function(Fe,Ue){if(!Ze(ue,Ue)&&(me===Fe||_(me,Fe,d,y,O)))return ue.push(Ue)})){re=!1;break}}else if(!(me===Ie||_(me,Ie,d,y,O))){re=!1;break}}return O.delete(o),O.delete(l),re}function YA(o,l,d,y,_,O,q){switch(d){case Cn:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case wi:return!(o.byteLength!=l.byteLength||!O(new La(o),new La(l)));case En:case Xr:case eo:return Nn(+o,+l);case dt:return o.name==l.name&&o.message==l.message;case Vt:case to:return o==l+"";case Ht:var M=hs;case fr:var U=y&E;if(M||(M=$a),o.size!=l.size&&!U)return!1;var G=q.get(o);if(G)return G==l;y|=x,q.set(o,l);var Q=Vw(M(o),M(l),y,_,O,q);return q.delete(o),Q;case ma:if(xo)return xo.call(o)==xo.call(l)}return!1}function JA(o,l,d,y,_,O){var q=d&E,M=Py(o),U=M.length,G=Py(l),Q=G.length;if(U!=Q&&!q)return!1;for(var ee=U;ee--;){var re=M[ee];if(!(q?re in l:Qe.call(l,re)))return!1}var ue=O.get(o),me=O.get(l);if(ue&&me)return ue==l&&me==o;var Ie=!0;O.set(o,l),O.set(l,o);for(var he=q;++ee<U;){re=M[ee];var Fe=o[re],Ue=l[re];if(y)var Jr=q?y(Ue,Fe,re,l,o,O):y(Fe,Ue,re,o,l,O);if(!(Jr===t?Fe===Ue||_(Fe,Ue,d,y,O):Jr)){Ie=!1;break}he||(he=re=="constructor")}if(Ie&&!he){var Sr=o.constructor,zr=l.constructor;Sr!=zr&&"constructor"in o&&"constructor"in l&&!(typeof Sr=="function"&&Sr instanceof Sr&&typeof zr=="function"&&zr instanceof zr)&&(Ie=!1)}return O.delete(o),O.delete(l),Ie}function qi(o){return Dy(Gw(o,t,sE),o+"")}function Py(o){return Yd(o,Yt,qy)}function ky(o){return Yd(o,Pr,Ww)}var Ay=Ya?function(o){return Ya.get(o)}:Qy;function th(o){for(var l=o.name+"",d=gs[l],y=Qe.call(gs,l)?d.length:0;y--;){var _=d[y],O=_.func;if(O==null||O==o)return _.name}return l}function tl(o){var l=Qe.call(I,"placeholder")?I:o;return l.placeholder}function pe(){var o=I.iteratee||Ky;return o=o===Ky?b:o,arguments.length?o(arguments[0],arguments[1]):o}function rh(o,l){var d=o.__data__;return tT(l)?d[typeof l=="string"?"string":"hash"]:d.map}function Ty(o){for(var l=Yt(o),d=l.length;d--;){var y=l[d],_=o[y];l[d]=[y,_,zw(_)]}return l}function Oo(o,l){var d=ho(o,l);return De(d)?d:t}function zA(o){var l=Qe.call(o,Oi),d=o[Oi];try{o[Oi]=t;var y=!0}catch{}var _=Da.call(o);return y&&(l?o[Oi]=d:delete o[Oi]),_}var qy=Ha?function(o){return o==null?[]:(o=je(o),ii(Ha(o),function(l){return yo.call(o,l)}))}:Zy,Ww=Ha?function(o){for(var l=[];o;)si(l,qy(o)),o=ja(o);return l}:Zy,nr=Jt;($u&&nr(new $u(new ArrayBuffer(1)))!=Cn||_o&&nr(new _o)!=Ht||Mu&&nr(Mu.resolve())!=Gf||ms&&nr(new ms)!=fr||wo&&nr(new wo)!=Ft)&&(nr=function(o){var l=Jt(o),d=l==xn?o.constructor:t,y=d?Po(d):"";if(y)switch(y){case Bg:return Cn;case Hg:return Ht;case Vg:return Gf;case Wg:return fr;case Yg:return Ft}return l});function KA(o,l,d){for(var y=-1,_=d.length;++y<_;){var O=d[y],q=O.size;switch(O.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=Lt(l,o+q);break;case"takeRight":o=ht(o,l-q);break}}return{start:o,end:l}}function GA(o){var l=o.match(Rn);return l?l[1].split(rn):[]}function Yw(o,l,d){l=ws(l,o);for(var y=-1,_=l.length,O=!1;++y<_;){var q=Mn(l[y]);if(!(O=o!=null&&d(o,q)))break;o=o[q]}return O||++y!=_?O:(_=o==null?0:o.length,!!_&&uh(_)&&$i(q,_)&&(we(o)||ko(o)))}function QA(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&Qe.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function Jw(o){return typeof o.constructor=="function"&&!Yu(o)?ys(ja(o)):{}}function ZA(o,l,d){var y=o.constructor;switch(l){case wi:return Ry(o);case En:case Xr:return new y(+o);case Cn:return MA(o,d);case nt:case ga:case ya:case is:case ro:case ss:case ni:case os:case hu:return Pw(o,d);case Ht:return new y;case eo:case to:return new y(o);case Vt:return NA(o);case fr:return new y;case ma:return DA(o)}}function XA(o,l){var d=l.length;if(!d)return o;var y=d-1;return l[y]=(d>1?"& ":"")+l[y],l=l.join(d>2?", ":" "),o.replace(Wt,`{
|
|
2
2
|
/* [wrapped with `+l+`] */
|
|
3
|
-
`)}function VA(o){return Ee(o)||ko(o)||!!(Od&&o&&o[Od])}function Fi(o,l){var d=typeof o;return l=l??fe,!!l&&(d=="number"||d!="symbol"&&zm.test(o))&&o>-1&&o%1==0&&o<l}function mr(o,l,d){if(!St(d))return!1;var v=typeof l;return(v=="number"?Rr(d)&&Fi(l,d.length):v=="string"&&l in d)?$n(d[l],o):!1}function Ny(o,l){if(Ee(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Wr(o)?!0:_r.test(o)||!En.test(o)||l!=null&&o in Ae(l)}function WA(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function Dy(o){var l=Xd(o),d=I[l];if(typeof d!="function"||!(l in Ie.prototype))return!1;if(o===d)return!0;var v=qy(d);return!!v&&o===v[0]}function YA(o){return!!Cd&&Cd in o}var JA=ka?Li:ev;function Mu(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||Cs;return o===d}function zw(o){return o===o&&!St(o)}function Kw(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==t||o in Ae(d))}}function zA(o){var l=sh(o,function(v){return d.size===u&&d.clear(),v}),d=l.cache;return l}function KA(o,l){var d=o[1],v=l[1],w=d|v,O=w<(C|x|K),q=v==K&&d==T||v==K&&d==ee&&o[7].length<=l[8]||v==(K|ee)&&l[7].length<=l[8]&&d==T;if(!(O||q))return o;v&C&&(o[2]=l[2],w|=d&C?0:A);var M=l[3];if(M){var B=o[3];o[3]=B?Aw(B,M,l[4]):M,o[4]=B?Br(o[3],f):l[4]}return M=l[5],M&&(B=o[5],o[5]=B?Tw(B,M,l[6]):M,o[6]=B?Br(o[5],f):l[6]),M=l[7],M&&(o[7]=M),v&K&&(o[8]=o[8]==null?l[8]:vt(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=w,o}function GA(o){var l=[];if(o!=null)for(var d in Ae(o))l.push(d);return l}function QA(o){return Aa.call(o)}function Gw(o,l,d){return l=Et(l===t?o.length-1:l,0),function(){for(var v=arguments,w=-1,O=Et(v.length-l,0),q=H(O);++w<O;)q[w]=v[l+w];w=-1;for(var M=H(l+1);++w<l;)M[w]=v[w];return M[l]=d(q),Jt(o,this,M)}}function Qw(o,l){return l.length<2?o:Mi(o,an(l,0,-1))}function ZA(o,l){for(var d=o.length,v=vt(l.length,d),w=xr(o);v--;){var O=l[v];o[v]=Fi(O,d)?w[O]:t}return o}function Fy(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var Zw=eE(_w),Nu=jg||function(o,l){return Nt.setTimeout(o,l)},Ly=eE(_A);function Xw(o,l,d){var v=l+"";return Ly(o,HA(v,XA(jA(v),d)))}function eE(o){var l=0,d=0;return function(){var v=kd(),w=D-(v-d);if(d=v,w>0){if(++l>=N)return arguments[0]}else l=0;return o.apply(t,arguments)}}function th(o,l){var d=-1,v=o.length,w=v-1;for(l=l===t?v:l;++d<l;){var O=_y(d,w),q=o[O];o[O]=o[d],o[d]=q}return o.length=l,o}var tE=zA(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace($e,function(d,v,w,O){l.push(w?O.replace(jr,"$1"):v||d)}),l});function mi(o){if(typeof o=="string"||Wr(o))return o;var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function Po(o){if(o!=null){try{return yo.call(o)}catch{}try{return o+""}catch{}}return""}function XA(o,l){return wt(Mt,function(d){var v="_."+d[0];l&d[1]&&!Ia(o,v)&&o.push(v)}),o.sort()}function rE(o){if(o instanceof Ie)return o.clone();var l=new Er(o.__wrapped__,o.__chain__);return l.__actions__=xr(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function eT(o,l,d){(d?mr(o,l,d):l===t)?l=1:l=Et(Ce(l),0);var v=o==null?0:o.length;if(!v||l<1)return[];for(var w=0,O=0,q=H(Na(v/l));w<v;)q[O++]=an(o,w,w+=l);return q}function tT(o){for(var l=-1,d=o==null?0:o.length,v=0,w=[];++l<d;){var O=o[l];O&&(w[v++]=O)}return w}function rT(){var o=arguments.length;if(!o)return[];for(var l=H(o-1),d=arguments[0],v=o;v--;)l[v-1]=arguments[v];return Xr(Ee(d)?xr(d):[d],Ut(l,1))}var nT=Te(function(o,l){return At(o)?Ps(o,Ut(l,1,At,!0)):[]}),iT=Te(function(o,l){var d=ln(l);return At(d)&&(d=t),At(o)?Ps(o,Ut(l,1,At,!0),pe(d,2)):[]}),sT=Te(function(o,l){var d=ln(l);return At(d)&&(d=t),At(o)?Ps(o,Ut(l,1,At,!0),t,d):[]});function oT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:Ce(l),an(o,l<0?0:l,v)):[]}function aT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:Ce(l),l=v-l,an(o,0,l<0?0:l)):[]}function lT(o,l){return o&&o.length?Jd(o,pe(l,3),!0,!0):[]}function uT(o,l){return o&&o.length?Jd(o,pe(l,3),!0):[]}function cT(o,l,d,v){var w=o==null?0:o.length;return w?(d&&typeof d!="number"&&mr(o,l,d)&&(d=0,v=w),hy(o,l,d,v)):[]}function nE(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=d==null?0:Ce(d);return w<0&&(w=Et(v+w,0)),Oa(o,pe(l,3),w)}function iE(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=v-1;return d!==t&&(w=Ce(d),w=d<0?Et(v+w,0):vt(w,v-1)),Oa(o,pe(l,3),w,!0)}function sE(o){var l=o==null?0:o.length;return l?Ut(o,1):[]}function fT(o){var l=o==null?0:o.length;return l?Ut(o,ie):[]}function dT(o,l){var d=o==null?0:o.length;return d?(l=l===t?1:Ce(l),Ut(o,l)):[]}function hT(o){for(var l=-1,d=o==null?0:o.length,v={};++l<d;){var w=o[l];v[w[0]]=w[1]}return v}function oE(o){return o&&o.length?o[0]:t}function pT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=d==null?0:Ce(d);return w<0&&(w=Et(v+w,0)),_s(o,l,w)}function mT(o){var l=o==null?0:o.length;return l?an(o,0,-1):[]}var gT=Te(function(o){var l=et(o,Ry);return l.length&&l[0]===o[0]?Au(l):[]}),yT=Te(function(o){var l=ln(o),d=et(o,Ry);return l===ln(d)?l=t:d.pop(),d.length&&d[0]===o[0]?Au(d,pe(l,2)):[]}),vT=Te(function(o){var l=ln(o),d=et(o,Ry);return l=typeof l=="function"?l:t,l&&d.pop(),d.length&&d[0]===o[0]?Au(d,t,l):[]});function ST(o,l){return o==null?"":xs.call(o,l)}function ln(o){var l=o==null?0:o.length;return l?o[l-1]:t}function bT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=v;return d!==t&&(w=Ce(d),w=w<0?Et(v+w,0):vt(w,v-1)),l===l?Og(o,l,w):Oa(o,gd,w,!0)}function _T(o,l){return o&&o.length?on(o,Ce(l)):t}var wT=Te(aE);function aE(o,l){return o&&o.length&&l&&l.length?by(o,l):o}function ET(o,l,d){return o&&o.length&&l&&l.length?by(o,l,pe(d,2)):o}function CT(o,l,d){return o&&o.length&&l&&l.length?by(o,l,t,d):o}var xT=Di(function(o,l){var d=o==null?0:o.length,v=Wa(o,l);return bw(o,et(l,function(w){return Fi(w,d)?+w:w}).sort(kw)),v});function RT(o,l){var d=[];if(!(o&&o.length))return d;var v=-1,w=[],O=o.length;for(l=pe(l,3);++v<O;){var q=o[v];l(q,v,o)&&(d.push(q),w.push(v))}return bw(o,w),d}function jy(o){return o==null?o:Ug.call(o)}function IT(o,l,d){var v=o==null?0:o.length;return v?(d&&typeof d!="number"&&mr(o,l,d)?(l=0,d=v):(l=l==null?0:Ce(l),d=d===t?v:Ce(d)),an(o,l,d)):[]}function OT(o,l){return Yd(o,l)}function PT(o,l,d){return Ey(o,l,pe(d,2))}function kT(o,l){var d=o==null?0:o.length;if(d){var v=Yd(o,l);if(v<d&&$n(o[v],l))return v}return-1}function AT(o,l){return Yd(o,l,!0)}function TT(o,l,d){return Ey(o,l,pe(d,2),!0)}function qT(o,l){var d=o==null?0:o.length;if(d){var v=Yd(o,l,!0)-1;if($n(o[v],l))return v}return-1}function $T(o){return o&&o.length?ww(o):[]}function MT(o,l){return o&&o.length?ww(o,pe(l,2)):[]}function NT(o){var l=o==null?0:o.length;return l?an(o,1,l):[]}function DT(o,l,d){return o&&o.length?(l=d||l===t?1:Ce(l),an(o,0,l<0?0:l)):[]}function FT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:Ce(l),l=v-l,an(o,l<0?0:l,v)):[]}function LT(o,l){return o&&o.length?Jd(o,pe(l,3),!1,!0):[]}function jT(o,l){return o&&o.length?Jd(o,pe(l,3)):[]}var UT=Te(function(o){return ks(Ut(o,1,At,!0))}),BT=Te(function(o){var l=ln(o);return At(l)&&(l=t),ks(Ut(o,1,At,!0),pe(l,2))}),HT=Te(function(o){var l=ln(o);return l=typeof l=="function"?l:t,ks(Ut(o,1,At,!0),t,l)});function VT(o){return o&&o.length?ks(o):[]}function WT(o,l){return o&&o.length?ks(o,pe(l,2)):[]}function YT(o,l){return l=typeof l=="function"?l:t,o&&o.length?ks(o,t,l):[]}function Uy(o){if(!(o&&o.length))return[];var l=0;return o=ai(o,function(d){if(At(d))return l=Et(d.length,l),!0}),bu(l,function(d){return et(o,yu(d))})}function lE(o,l){if(!(o&&o.length))return[];var d=Uy(o);return l==null?d:et(d,function(v){return Jt(l,t,v)})}var JT=Te(function(o,l){return At(o)?Ps(o,l):[]}),zT=Te(function(o){return xy(ai(o,At))}),KT=Te(function(o){var l=ln(o);return At(l)&&(l=t),xy(ai(o,At),pe(l,2))}),GT=Te(function(o){var l=ln(o);return l=typeof l=="function"?l:t,xy(ai(o,At),t,l)}),QT=Te(Uy);function ZT(o,l){return Rw(o||[],l||[],xo)}function XT(o,l){return Rw(o||[],l||[],qu)}var eq=Te(function(o){var l=o.length,d=l>1?o[l-1]:t;return d=typeof d=="function"?(o.pop(),d):t,lE(o,d)});function uE(o){var l=I(o);return l.__chain__=!0,l}function tq(o,l){return l(o),o}function rh(o,l){return l(o)}var rq=Di(function(o){var l=o.length,d=l?o[0]:0,v=this.__wrapped__,w=function(O){return Wa(O,o)};return l>1||this.__actions__.length||!(v instanceof Ie)||!Fi(d)?this.thru(w):(v=v.slice(d,+d+(l?1:0)),v.__actions__.push({func:rh,args:[w],thisArg:t}),new Er(v,this.__chain__).thru(function(O){return l&&!O.length&&O.push(t),O}))});function nq(){return uE(this)}function iq(){return new Er(this.value(),this.__chain__)}function sq(){this.__values__===t&&(this.__values__=EE(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function oq(){return this}function aq(o){for(var l,d=this;d instanceof Ua;){var v=rE(d);v.__index__=0,v.__values__=t,l?w.__wrapped__=v:l=v;var w=v;d=d.__wrapped__}return w.__wrapped__=o,l}function lq(){var o=this.__wrapped__;if(o instanceof Ie){var l=o;return this.__actions__.length&&(l=new Ie(this)),l=l.reverse(),l.__actions__.push({func:rh,args:[jy],thisArg:t}),new Er(l,this.__chain__)}return this.thru(jy)}function uq(){return xw(this.__wrapped__,this.__actions__)}var cq=zd(function(o,l,d){ze.call(o,d)?++o[d]:An(o,d,1)});function fq(o,l,d){var v=Ee(o)?Ra:dy;return d&&mr(o,l,d)&&(l=t),v(o,pe(l,3))}function dq(o,l){var d=Ee(o)?ai:Bd;return d(o,pe(l,3))}var hq=Nw(nE),pq=Nw(iE);function mq(o,l){return Ut(nh(o,l),1)}function gq(o,l){return Ut(nh(o,l),ie)}function yq(o,l,d){return d=d===t?1:Ce(d),Ut(nh(o,l),d)}function cE(o,l){var d=Ee(o)?wt:di;return d(o,pe(l,3))}function fE(o,l){var d=Ee(o)?gg:Ud;return d(o,pe(l,3))}var vq=zd(function(o,l,d){ze.call(o,d)?o[d].push(l):An(o,d,[l])});function Sq(o,l,d,v){o=Rr(o)?o:Qa(o),d=d&&!v?Ce(d):0;var w=o.length;return d<0&&(d=Et(w+d,0)),lh(o)?d<=w&&o.indexOf(l,d)>-1:!!w&&_s(o,l,d)>-1}var bq=Te(function(o,l,d){var v=-1,w=typeof l=="function",O=Rr(o)?H(o.length):[];return di(o,function(q){O[++v]=w?Jt(l,q,d):sn(q,l,d)}),O}),_q=zd(function(o,l,d){An(o,d,l)});function nh(o,l){var d=Ee(o)?et:W;return d(o,pe(l,3))}function wq(o,l,d,v){return o==null?[]:(Ee(l)||(l=l==null?[]:[l]),d=v?t:d,Ee(d)||(d=d==null?[]:[d]),qn(o,l,d))}var Eq=zd(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function Cq(o,l,d){var v=Ee(o)?mu:yd,w=arguments.length<3;return v(o,pe(l,4),d,w,di)}function xq(o,l,d){var v=Ee(o)?yg:yd,w=arguments.length<3;return v(o,pe(l,4),d,w,Ud)}function Rq(o,l){var d=Ee(o)?ai:Bd;return d(o,oh(pe(l,3)))}function Iq(o){var l=Ee(o)?Ld:SA;return l(o)}function Oq(o,l,d){(d?mr(o,l,d):l===t)?l=1:l=Ce(l);var v=Ee(o)?ly:bA;return v(o,l)}function Pq(o){var l=Ee(o)?uy:wA;return l(o)}function kq(o){if(o==null)return 0;if(Rr(o))return lh(o)?li(o):o.length;var l=ir(o);return l==rr||l==gt?o.size:b(o).length}function Aq(o,l,d){var v=Ee(o)?gu:EA;return d&&mr(o,l,d)&&(l=t),v(o,pe(l,3))}var Tq=Te(function(o,l){if(o==null)return[];var d=l.length;return d>1&&mr(o,l[0],l[1])?l=[]:d>2&&mr(l[0],l[1],l[2])&&(l=[l[0]]),qn(o,Ut(l,1),[])}),ih=Lg||function(){return Nt.Date.now()};function qq(o,l){if(typeof l!="function")throw new wr(i);return o=Ce(o),function(){if(--o<1)return l.apply(this,arguments)}}function dE(o,l,d){return l=d?t:l,l=o&&l==null?o.length:l,Ni(o,K,t,t,t,t,l)}function hE(o,l){var d;if(typeof l!="function")throw new wr(i);return o=Ce(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=t),d}}var By=Te(function(o,l,d){var v=C;if(d.length){var w=Br(d,Ka(By));v|=Y}return Ni(o,v,l,d,w)}),pE=Te(function(o,l,d){var v=C|x;if(d.length){var w=Br(d,Ka(pE));v|=Y}return Ni(l,v,o,d,w)});function mE(o,l,d){l=d?t:l;var v=Ni(o,T,t,t,t,t,t,l);return v.placeholder=mE.placeholder,v}function gE(o,l,d){l=d?t:l;var v=Ni(o,j,t,t,t,t,t,l);return v.placeholder=gE.placeholder,v}function yE(o,l,d){var v,w,O,q,M,B,G=0,Q=!1,X=!1,re=!0;if(typeof o!="function")throw new wr(i);l=un(l)||0,St(d)&&(Q=!!d.leading,X="maxWait"in d,O=X?Et(un(d.maxWait)||0,l):O,re="trailing"in d?!!d.trailing:re);function ue(Tt){var Mn=v,Ui=w;return v=w=t,G=Tt,q=o.apply(Ui,Mn),q}function me(Tt){return G=Tt,M=Nu(De,l),Q?ue(Tt):q}function Pe(Tt){var Mn=Tt-B,Ui=Tt-G,NE=l-Mn;return X?vt(NE,O-Ui):NE}function ge(Tt){var Mn=Tt-B,Ui=Tt-G;return B===t||Mn>=l||Mn<0||X&&Ui>=O}function De(){var Tt=ih();if(ge(Tt))return je(Tt);M=Nu(De,Pe(Tt))}function je(Tt){return M=t,re&&v?ue(Tt):(v=w=t,q)}function Yr(){M!==t&&Iw(M),G=0,v=B=w=M=t}function gr(){return M===t?q:je(ih())}function Jr(){var Tt=ih(),Mn=ge(Tt);if(v=arguments,w=this,B=Tt,Mn){if(M===t)return me(B);if(X)return Iw(M),M=Nu(De,l),ue(B)}return M===t&&(M=Nu(De,l)),q}return Jr.cancel=Yr,Jr.flush=gr,Jr}var $q=Te(function(o,l){return tn(o,1,l)}),Mq=Te(function(o,l,d){return tn(o,un(l)||0,d)});function Nq(o){return Ni(o,k)}function sh(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new wr(i);var d=function(){var v=arguments,w=l?l.apply(this,v):v[0],O=d.cache;if(O.has(w))return O.get(w);var q=o.apply(this,v);return d.cache=O.set(w,q)||O,q};return d.cache=new(sh.Cache||kn),d}sh.Cache=kn;function oh(o){if(typeof o!="function")throw new wr(i);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function Dq(o){return hE(2,o)}var Fq=CA(function(o,l){l=l.length==1&&Ee(l[0])?et(l[0],nr(pe())):et(Ut(l,1),nr(pe()));var d=l.length;return Te(function(v){for(var w=-1,O=vt(v.length,d);++w<O;)v[w]=l[w].call(this,v[w]);return Jt(o,this,v)})}),Hy=Te(function(o,l){var d=Br(l,Ka(Hy));return Ni(o,Y,t,l,d)}),vE=Te(function(o,l){var d=Br(l,Ka(vE));return Ni(o,V,t,l,d)}),Lq=Di(function(o,l){return Ni(o,ee,t,t,t,l)});function jq(o,l){if(typeof o!="function")throw new wr(i);return l=l===t?l:Ce(l),Te(o,l)}function Uq(o,l){if(typeof o!="function")throw new wr(i);return l=l==null?0:Et(Ce(l),0),Te(function(d){var v=d[l],w=Ts(d,0,l);return v&&Xr(w,v),Jt(o,this,w)})}function Bq(o,l,d){var v=!0,w=!0;if(typeof o!="function")throw new wr(i);return St(d)&&(v="leading"in d?!!d.leading:v,w="trailing"in d?!!d.trailing:w),yE(o,l,{leading:v,maxWait:l,trailing:w})}function Hq(o){return dE(o,1)}function Vq(o,l){return Hy(Iy(l),o)}function Wq(){if(!arguments.length)return[];var o=arguments[0];return Ee(o)?o:[o]}function Yq(o){return pr(o,m)}function Jq(o,l){return l=typeof l=="function"?l:t,pr(o,m,l)}function zq(o){return pr(o,h|m)}function Kq(o,l){return l=typeof l=="function"?l:t,pr(o,h|m,l)}function Gq(o,l){return l==null||jd(o,l,Yt(l))}function $n(o,l){return o===l||o!==o&&l!==l}var Qq=Zd(ku),Zq=Zd(function(o,l){return o>=l}),ko=Wd(function(){return arguments}())?Wd:function(o){return Ct(o)&&ze.call(o,"callee")&&!Id.call(o,"callee")},Ee=H.isArray,Xq=cd?nr(cd):yy;function Rr(o){return o!=null&&ah(o.length)&&!Li(o)}function At(o){return Ct(o)&&Rr(o)}function e$(o){return o===!0||o===!1||Ct(o)&&zt(o)==ct}var qs=Pd||ev,t$=hu?nr(hu):vy;function r$(o){return Ct(o)&&o.nodeType===1&&!Du(o)}function n$(o){if(o==null)return!0;if(Rr(o)&&(Ee(o)||typeof o=="string"||typeof o.splice=="function"||qs(o)||Ga(o)||ko(o)))return!o.length;var l=ir(o);if(l==rr||l==gt)return!o.size;if(Mu(o))return!b(o).length;for(var d in o)if(ze.call(o,d))return!1;return!0}function i$(o,l){return Ro(o,l)}function s$(o,l,d){d=typeof d=="function"?d:t;var v=d?d(o,l):t;return v===t?Ro(o,l,t,d):!!v}function Vy(o){if(!Ct(o))return!1;var l=zt(o);return l==jt||l==as||typeof o.message=="string"&&typeof o.name=="string"&&!Du(o)}function o$(o){return typeof o=="number"&&bo(o)}function Li(o){if(!St(o))return!1;var l=zt(o);return l==ft||l==ti||l==su||l==jm}function SE(o){return typeof o=="number"&&o==Ce(o)}function ah(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=fe}function St(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Ct(o){return o!=null&&typeof o=="object"}var bE=fd?nr(fd):Tu;function a$(o,l){return o===l||hi(o,l,$y(l))}function l$(o,l,d){return d=typeof d=="function"?d:t,hi(o,l,$y(l),d)}function u$(o){return _E(o)&&o!=+o}function c$(o){if(JA(o))throw new ve(n);return Io(o)}function f$(o){return o===null}function d$(o){return o==null}function _E(o){return typeof o=="number"||Ct(o)&&zt(o)==Qr}function Du(o){if(!Ct(o)||zt(o)!=wn)return!1;var l=$a(o);if(l===null)return!0;var d=ze.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&yo.call(d)==Mg}var Wy=dd?nr(dd):Le;function h$(o){return SE(o)&&o>=-fe&&o<=fe}var wE=ho?nr(ho):c;function lh(o){return typeof o=="string"||!Ee(o)&&Ct(o)&&zt(o)==Ri}function Wr(o){return typeof o=="symbol"||Ct(o)&&zt(o)==ma}var Ga=Rn?nr(Rn):p;function p$(o){return o===t}function m$(o){return Ct(o)&&ir(o)==us}function g$(o){return Ct(o)&&zt(o)==dr}var y$=Zd($),v$=Zd(function(o,l){return o<=l});function EE(o){if(!o)return[];if(Rr(o))return lh(o)?hr(o):xr(o);if(vo&&o[vo])return Rg(o[vo]());var l=ir(o),d=l==rr?wu:l==gt?Es:Qa;return d(o)}function ji(o){if(!o)return o===0?o:0;if(o=un(o),o===ie||o===-ie){var l=o<0?-1:1;return l*bt}return o===o?o:0}function Ce(o){var l=ji(o),d=l%1;return l===l?d?l-d:l:0}function CE(o){return o?$i(Ce(o),0,he):0}function un(o){if(typeof o=="number")return o;if(Wr(o))return we;if(St(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=St(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=vd(o);var d=Jm.test(o);return d||Uf.test(o)?ld(o.slice(2),d?2:8):Ym.test(o)?we:+o}function xE(o){return pi(o,Ir(o))}function S$(o){return o?$i(Ce(o),-fe,fe):o===0?o:0}function Ge(o){return o==null?"":Vr(o)}var b$=Ja(function(o,l){if(Mu(l)||Rr(l)){pi(l,Yt(l),o);return}for(var d in l)ze.call(l,d)&&xo(o,d,l[d])}),RE=Ja(function(o,l){pi(l,Ir(l),o)}),uh=Ja(function(o,l,d,v){pi(l,Ir(l),o,v)}),_$=Ja(function(o,l,d,v){pi(l,Yt(l),o,v)}),w$=Di(Wa);function E$(o,l){var d=Os(o);return l==null?d:Ru(d,l)}var C$=Te(function(o,l){o=Ae(o);var d=-1,v=l.length,w=v>2?l[2]:t;for(w&&mr(l[0],l[1],w)&&(v=1);++d<v;)for(var O=l[d],q=Ir(O),M=-1,B=q.length;++M<B;){var G=q[M],Q=o[G];(Q===t||$n(Q,Cs[G])&&!ze.call(o,G))&&(o[G]=O[G])}return o}),x$=Te(function(o){return o.push(t,Hw),Jt(IE,t,o)});function R$(o,l){return pd(o,pe(l,3),rn)}function I$(o,l){return pd(o,pe(l,3),Pu)}function O$(o,l){return o==null?o:Ou(o,pe(l,3),Ir)}function P$(o,l){return o==null?o:Hd(o,pe(l,3),Ir)}function k$(o,l){return o&&rn(o,pe(l,3))}function A$(o,l){return o&&Pu(o,pe(l,3))}function T$(o){return o==null?[]:nn(o,Yt(o))}function q$(o){return o==null?[]:nn(o,Ir(o))}function Yy(o,l,d){var v=o==null?t:Mi(o,l);return v===t?d:v}function $$(o,l){return o!=null&&Yw(o,l,py)}function Jy(o,l){return o!=null&&Yw(o,l,my)}var M$=Fw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Aa.call(l)),o[l]=d},Ky(Or)),N$=Fw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Aa.call(l)),ze.call(o,l)?o[l].push(d):o[l]=[d]},pe),D$=Te(sn);function Yt(o){return Rr(o)?Va(o):b(o)}function Ir(o){return Rr(o)?Va(o,!0):R(o)}function F$(o,l){var d={};return l=pe(l,3),rn(o,function(v,w,O){An(d,l(v,w,O),v)}),d}function L$(o,l){var d={};return l=pe(l,3),rn(o,function(v,w,O){An(d,w,l(v,w,O))}),d}var j$=Ja(function(o,l,d){Oe(o,l,d)}),IE=Ja(function(o,l,d,v){Oe(o,l,d,v)}),U$=Di(function(o,l){var d={};if(o==null)return d;var v=!1;l=et(l,function(O){return O=As(O,o),v||(v=O.length>1),O}),pi(o,Ty(o),d),v&&(d=pr(d,h|g|m,MA));for(var w=l.length;w--;)Cy(d,l[w]);return d});function B$(o,l){return OE(o,oh(pe(l)))}var H$=Di(function(o,l){return o==null?{}:gA(o,l)});function OE(o,l){if(o==null)return{};var d=et(Ty(o),function(v){return[v]});return l=pe(l),Sw(o,d,function(v,w){return l(v,w[0])})}function V$(o,l,d){l=As(l,o);var v=-1,w=l.length;for(w||(w=1,o=t);++v<w;){var O=o==null?t:o[mi(l[v])];O===t&&(v=w,O=d),o=Li(O)?O.call(o):O}return o}function W$(o,l,d){return o==null?o:qu(o,l,d)}function Y$(o,l,d,v){return v=typeof v=="function"?v:t,o==null?o:qu(o,l,d,v)}var PE=Uw(Yt),kE=Uw(Ir);function J$(o,l,d){var v=Ee(o),w=v||qs(o)||Ga(o);if(l=pe(l,4),d==null){var O=o&&o.constructor;w?d=v?new O:[]:St(o)?d=Li(O)?Os($a(o)):{}:d={}}return(w?wt:rn)(o,function(q,M,B){return l(d,q,M,B)}),d}function z$(o,l){return o==null?!0:Cy(o,l)}function K$(o,l,d){return o==null?o:Cw(o,l,Iy(d))}function G$(o,l,d,v){return v=typeof v=="function"?v:t,o==null?o:Cw(o,l,Iy(d),v)}function Qa(o){return o==null?[]:_u(o,Yt(o))}function Q$(o){return o==null?[]:_u(o,Ir(o))}function Z$(o,l,d){return d===t&&(d=l,l=t),d!==t&&(d=un(d),d=d===d?d:0),l!==t&&(l=un(l),l=l===l?l:0),$i(un(o),l,d)}function X$(o,l,d){return l=ji(l),d===t?(d=l,l=0):d=ji(d),o=un(o),gy(o,l,d)}function eM(o,l,d){if(d&&typeof d!="boolean"&&mr(o,l,d)&&(l=d=t),d===t&&(typeof l=="boolean"?(d=l,l=t):typeof o=="boolean"&&(d=o,o=t)),o===t&&l===t?(o=0,l=1):(o=ji(o),l===t?(l=o,o=0):l=ji(l)),o>l){var v=o;o=l,l=v}if(d||o%1||l%1){var w=Td();return vt(o+w*(l-o+ad("1e-"+((w+"").length-1))),l)}return _y(o,l)}var tM=za(function(o,l,d){return l=l.toLowerCase(),o+(d?AE(l):l)});function AE(o){return zy(Ge(o).toLowerCase())}function TE(o){return o=Ge(o),o&&o.replace(gs,bd).replace(og,"")}function rM(o,l,d){o=Ge(o),l=Vr(l);var v=o.length;d=d===t?v:$i(Ce(d),0,v);var w=d;return d-=l.length,d>=0&&o.slice(d,w)==l}function nM(o){return o=Ge(o),o&&Sa.test(o)?o.replace(Ii,wg):o}function iM(o){return o=Ge(o),o&&Ke.test(o)?o.replace(co,"\\$&"):o}var sM=za(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),oM=za(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),aM=Mw("toLowerCase");function lM(o,l,d){o=Ge(o),l=Ce(l);var v=l?li(o):0;if(!l||v>=l)return o;var w=(l-v)/2;return Qd(So(w),d)+o+Qd(Na(w),d)}function uM(o,l,d){o=Ge(o),l=Ce(l);var v=l?li(o):0;return l&&v<l?o+Qd(l-v,d):o}function cM(o,l,d){o=Ge(o),l=Ce(l);var v=l?li(o):0;return l&&v<l?Qd(l-v,d)+o:o}function fM(o,l,d){return d||l==null?l=0:l&&(l=+l),Ad(Ge(o).replace(Oi,""),l||0)}function dM(o,l,d){return(d?mr(o,l,d):l===t)?l=1:l=Ce(l),wy(Ge(o),l)}function hM(){var o=arguments,l=Ge(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var pM=za(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function mM(o,l,d){return d&&typeof d!="number"&&mr(o,l,d)&&(l=d=t),d=d===t?he:d>>>0,d?(o=Ge(o),o&&(typeof l=="string"||l!=null&&!Wy(l))&&(l=Vr(l),!l&&en(o))?Ts(hr(o),0,d):o.split(l,d)):[]}var gM=za(function(o,l,d){return o+(d?" ":"")+zy(l)});function yM(o,l,d){return o=Ge(o),d=d==null?0:$i(Ce(d),0,o.length),l=Vr(l),o.slice(d,d+l.length)==l}function vM(o,l,d){var v=I.templateSettings;d&&mr(o,l,d)&&(l=t),o=Ge(o),l=uh({},l,v,Bw);var w=uh({},l.imports,v.imports,Bw),O=Yt(w),q=_u(w,O),M,B,G=0,Q=l.interpolate||si,X="__p += '",re=In((l.escape||si).source+"|"+Q.source+"|"+(Q===jf?xn:si).source+"|"+(l.evaluate||si).source+"|$","g"),ue="//# sourceURL="+(ze.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++fg+"]")+`
|
|
4
|
-
`;o.replace(re,function(
|
|
5
|
-
__e(`+
|
|
6
|
-
'`),
|
|
7
|
-
`+
|
|
8
|
-
__p += '`),
|
|
9
|
-
((__t = (`+
|
|
10
|
-
'`),G=
|
|
11
|
-
`;var me=
|
|
12
|
-
`+
|
|
3
|
+
`)}function eT(o){return we(o)||ko(o)||!!(Pd&&o&&o[Pd])}function $i(o,l){var d=typeof o;return l=l??rt,!!l&&(d=="number"||d!="symbol"&&as.test(o))&&o>-1&&o%1==0&&o<l}function vr(o,l,d){if(!St(d))return!1;var y=typeof l;return(y=="number"?Or(d)&&$i(l,d.length):y=="string"&&l in d)?Nn(d[l],o):!1}function $y(o,l){if(we(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Yr(o)?!0:Te.test(o)||!xr.test(o)||l!=null&&o in je(l)}function tT(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function My(o){var l=th(o),d=I[l];if(typeof d!="function"||!(l in qe.prototype))return!1;if(o===d)return!0;var y=Ay(d);return!!y&&o===y[0]}function rT(o){return!!Rd&&Rd in o}var nT=go?Mi:Xy;function Yu(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||ps;return o===d}function zw(o){return o===o&&!St(o)}function Kw(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==t||o in je(d))}}function iT(o){var l=ah(o,function(y){return d.size===f&&d.clear(),y}),d=l.cache;return l}function sT(o,l){var d=o[1],y=l[1],_=d|y,O=_<(C|A|X),q=y==X&&d==B||y==X&&d==k&&o[7].length<=l[8]||y==(X|k)&&l[7].length<=l[8]&&d==B;if(!(O||q))return o;y&C&&(o[2]=l[2],_|=d&C?0:T);var M=l[3];if(M){var U=o[3];o[3]=U?Aw(U,M,l[4]):M,o[4]=U?sn(o[3],h):l[4]}return M=l[5],M&&(U=o[5],o[5]=U?Tw(U,M,l[6]):M,o[6]=U?sn(o[5],h):l[6]),M=l[7],M&&(o[7]=M),y&X&&(o[8]=o[8]==null?l[8]:Lt(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=_,o}function oT(o){var l=[];if(o!=null)for(var d in je(o))l.push(d);return l}function aT(o){return Da.call(o)}function Gw(o,l,d){return l=ht(l===t?o.length-1:l,0),function(){for(var y=arguments,_=-1,O=ht(y.length-l,0),q=V(O);++_<O;)q[_]=y[l+_];_=-1;for(var M=V(l+1);++_<l;)M[_]=y[_];return M[l]=d(q),dr(o,this,M)}}function Qw(o,l){return l.length<2?o:Ai(o,un(l,0,-1))}function lT(o,l){for(var d=o.length,y=Lt(l.length,d),_=Ir(o);y--;){var O=l[y];o[y]=$i(O,d)?_[O]:t}return o}function Ny(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var Zw=eE(_w),Ju=Lg||function(o,l){return qt.setTimeout(o,l)},Dy=eE(AA);function Xw(o,l,d){var y=l+"";return Dy(o,XA(y,uT(GA(y),d)))}function eE(o){var l=0,d=0;return function(){var y=Ad(),_=L-(y-d);if(d=y,_>0){if(++l>=D)return arguments[0]}else l=0;return o.apply(t,arguments)}}function nh(o,l){var d=-1,y=o.length,_=y-1;for(l=l===t?y:l;++d<l;){var O=Sy(d,_),q=o[O];o[O]=o[d],o[d]=q}return o.length=l,o}var tE=iT(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(pu,function(d,y,_,O){l.push(_?O.replace(In,"$1"):y||d)}),l});function Mn(o){if(typeof o=="string"||Yr(o))return o;var l=o+"";return l=="0"&&1/o==-de?"-0":l}function Po(o){if(o!=null){try{return Na.call(o)}catch{}try{return o+""}catch{}}return""}function uT(o,l){return hr(le,function(d){var y="_."+d[0];l&d[1]&&!Pa(o,y)&&o.push(y)}),o.sort()}function rE(o){if(o instanceof qe)return o.clone();var l=new tr(o.__wrapped__,o.__chain__);return l.__actions__=Ir(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function cT(o,l,d){(d?vr(o,l,d):l===t)?l=1:l=ht(Ee(l),0);var y=o==null?0:o.length;if(!y||l<1)return[];for(var _=0,O=0,q=V(So(y/l));_<y;)q[O++]=un(o,_,_+=l);return q}function fT(o){for(var l=-1,d=o==null?0:o.length,y=0,_=[];++l<d;){var O=o[l];O&&(_[y++]=O)}return _}function dT(){var o=arguments.length;if(!o)return[];for(var l=V(o-1),d=arguments[0],y=o;y--;)l[y-1]=arguments[y];return si(we(d)?Ir(d):[d],jt(l,1))}var hT=Pe(function(o,l){return Ot(o)?Co(o,jt(l,1,Ot,!0)):[]}),pT=Pe(function(o,l){var d=cn(l);return Ot(d)&&(d=t),Ot(o)?Co(o,jt(l,1,Ot,!0),pe(d,2)):[]}),mT=Pe(function(o,l){var d=cn(l);return Ot(d)&&(d=t),Ot(o)?Co(o,jt(l,1,Ot,!0),t,d):[]});function gT(o,l,d){var y=o==null?0:o.length;return y?(l=d||l===t?1:Ee(l),un(o,l<0?0:l,y)):[]}function yT(o,l,d){var y=o==null?0:o.length;return y?(l=d||l===t?1:Ee(l),l=y-l,un(o,0,l<0?0:l)):[]}function vT(o,l){return o&&o.length?Kd(o,pe(l,3),!0,!0):[]}function ST(o,l){return o&&o.length?Kd(o,pe(l,3),!0):[]}function bT(o,l,d,y){var _=o==null?0:o.length;return _?(d&&typeof d!="number"&&vr(o,l,d)&&(d=0,y=_),dy(o,l,d,y)):[]}function nE(o,l,d){var y=o==null?0:o.length;if(!y)return-1;var _=d==null?0:Ee(d);return _<0&&(_=ht(y+_,0)),Aa(o,pe(l,3),_)}function iE(o,l,d){var y=o==null?0:o.length;if(!y)return-1;var _=y-1;return d!==t&&(_=Ee(d),_=d<0?ht(y+_,0):Lt(_,y-1)),Aa(o,pe(l,3),_,!0)}function sE(o){var l=o==null?0:o.length;return l?jt(o,1):[]}function _T(o){var l=o==null?0:o.length;return l?jt(o,de):[]}function wT(o,l){var d=o==null?0:o.length;return d?(l=l===t?1:Ee(l),jt(o,l)):[]}function ET(o){for(var l=-1,d=o==null?0:o.length,y={};++l<d;){var _=o[l];Hr(y,_[0],_[1])}return y}function oE(o){return o&&o.length?o[0]:t}function xT(o,l,d){var y=o==null?0:o.length;if(!y)return-1;var _=d==null?0:Ee(d);return _<0&&(_=ht(y+_,0)),Ri(o,l,_)}function CT(o){var l=o==null?0:o.length;return l?un(o,0,-1):[]}var RT=Pe(function(o){var l=ot(o,xy);return l.length&&l[0]===o[0]?Vr(l):[]}),IT=Pe(function(o){var l=cn(o),d=ot(o,xy);return l===cn(d)?l=t:d.pop(),d.length&&d[0]===o[0]?Vr(d,pe(l,2)):[]}),OT=Pe(function(o){var l=cn(o),d=ot(o,xy);return l=typeof l=="function"?l:t,l&&d.pop(),d.length&&d[0]===o[0]?Vr(d,t,l):[]});function PT(o,l){return o==null?"":Wa.call(o,l)}function cn(o){var l=o==null?0:o.length;return l?o[l-1]:t}function kT(o,l,d){var y=o==null?0:o.length;if(!y)return-1;var _=y;return d!==t&&(_=Ee(d),_=_<0?ht(y+_,0):Lt(_,y-1)),l===l?qu(o,l,_):Aa(o,Ii,_,!0)}function AT(o,l){return o&&o.length?$n(o,Ee(l)):t}var TT=Pe(aE);function aE(o,l){return o&&o.length&&l&&l.length?vy(o,l):o}function qT(o,l,d){return o&&o.length&&l&&l.length?vy(o,l,pe(d,2)):o}function $T(o,l,d){return o&&o.length&&l&&l.length?vy(o,l,t,d):o}var MT=qi(function(o,l){var d=o==null?0:o.length,y=Lu(o,l);return bw(o,ot(l,function(_){return $i(_,d)?+_:_}).sort(kw)),y});function NT(o,l){var d=[];if(!(o&&o.length))return d;var y=-1,_=[],O=o.length;for(l=pe(l,3);++y<O;){var q=o[y];l(q,y,o)&&(d.push(q),_.push(y))}return bw(o,_),d}function Fy(o){return o==null?o:Ug.call(o)}function DT(o,l,d){var y=o==null?0:o.length;return y?(d&&typeof d!="number"&&vr(o,l,d)?(l=0,d=y):(l=l==null?0:Ee(l),d=d===t?y:Ee(d)),un(o,l,d)):[]}function FT(o,l){return zd(o,l)}function LT(o,l,d){return _y(o,l,pe(d,2))}function jT(o,l){var d=o==null?0:o.length;if(d){var y=zd(o,l);if(y<d&&Nn(o[y],l))return y}return-1}function UT(o,l){return zd(o,l,!0)}function BT(o,l,d){return _y(o,l,pe(d,2),!0)}function HT(o,l){var d=o==null?0:o.length;if(d){var y=zd(o,l,!0)-1;if(Nn(o[y],l))return y}return-1}function VT(o){return o&&o.length?ww(o):[]}function WT(o,l){return o&&o.length?ww(o,pe(l,2)):[]}function YT(o){var l=o==null?0:o.length;return l?un(o,1,l):[]}function JT(o,l,d){return o&&o.length?(l=d||l===t?1:Ee(l),un(o,0,l<0?0:l)):[]}function zT(o,l,d){var y=o==null?0:o.length;return y?(l=d||l===t?1:Ee(l),l=y-l,un(o,l<0?0:l,y)):[]}function KT(o,l){return o&&o.length?Kd(o,pe(l,3),!1,!0):[]}function GT(o,l){return o&&o.length?Kd(o,pe(l,3)):[]}var QT=Pe(function(o){return _s(jt(o,1,Ot,!0))}),ZT=Pe(function(o){var l=cn(o);return Ot(l)&&(l=t),_s(jt(o,1,Ot,!0),pe(l,2))}),XT=Pe(function(o){var l=cn(o);return l=typeof l=="function"?l:t,_s(jt(o,1,Ot,!0),t,l)});function eq(o){return o&&o.length?_s(o):[]}function tq(o,l){return o&&o.length?_s(o,pe(l,2)):[]}function rq(o,l){return l=typeof l=="function"?l:t,o&&o.length?_s(o,t,l):[]}function Ly(o){if(!(o&&o.length))return[];var l=0;return o=ii(o,function(d){if(Ot(d))return l=ht(d.length,l),!0}),Au(l,function(d){return ot(o,fo(d))})}function lE(o,l){if(!(o&&o.length))return[];var d=Ly(o);return l==null?d:ot(d,function(y){return dr(l,t,y)})}var nq=Pe(function(o,l){return Ot(o)?Co(o,l):[]}),iq=Pe(function(o){return Ey(ii(o,Ot))}),sq=Pe(function(o){var l=cn(o);return Ot(l)&&(l=t),Ey(ii(o,Ot),pe(l,2))}),oq=Pe(function(o){var l=cn(o);return l=typeof l=="function"?l:t,Ey(ii(o,Ot),t,l)}),aq=Pe(Ly);function lq(o,l){return Rw(o||[],l||[],yr)}function uq(o,l){return Rw(o||[],l||[],Vu)}var cq=Pe(function(o){var l=o.length,d=l>1?o[l-1]:t;return d=typeof d=="function"?(o.pop(),d):t,lE(o,d)});function uE(o){var l=I(o);return l.__chain__=!0,l}function fq(o,l){return l(o),o}function ih(o,l){return l(o)}var dq=qi(function(o){var l=o.length,d=l?o[0]:0,y=this.__wrapped__,_=function(O){return Lu(O,o)};return l>1||this.__actions__.length||!(y instanceof qe)||!$i(d)?this.thru(_):(y=y.slice(d,+d+(l?1:0)),y.__actions__.push({func:ih,args:[_],thisArg:t}),new tr(y,this.__chain__).thru(function(O){return l&&!O.length&&O.push(t),O}))});function hq(){return uE(this)}function pq(){return new tr(this.value(),this.__chain__)}function mq(){this.__values__===t&&(this.__values__=EE(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function gq(){return this}function yq(o){for(var l,d=this;d instanceof za;){var y=rE(d);y.__index__=0,y.__values__=t,l?_.__wrapped__=y:l=y;var _=y;d=d.__wrapped__}return _.__wrapped__=o,l}function vq(){var o=this.__wrapped__;if(o instanceof qe){var l=o;return this.__actions__.length&&(l=new qe(this)),l=l.reverse(),l.__actions__.push({func:ih,args:[Fy],thisArg:t}),new tr(l,this.__chain__)}return this.thru(Fy)}function Sq(){return Cw(this.__wrapped__,this.__actions__)}var bq=Gd(function(o,l,d){Qe.call(o,d)?++o[d]:Hr(o,d,1)});function _q(o,l,d){var y=we(o)?vd:fy;return d&&vr(o,l,d)&&(l=t),y(o,pe(l,3))}function wq(o,l){var d=we(o)?ii:Vd;return d(o,pe(l,3))}var Eq=Nw(nE),xq=Nw(iE);function Cq(o,l){return jt(sh(o,l),1)}function Rq(o,l){return jt(sh(o,l),de)}function Iq(o,l,d){return d=d===t?1:Ee(d),jt(sh(o,l),d)}function cE(o,l){var d=we(o)?hr:fi;return d(o,pe(l,3))}function fE(o,l){var d=we(o)?Iu:Hd;return d(o,pe(l,3))}var Oq=Gd(function(o,l,d){Qe.call(o,d)?o[d].push(l):Hr(o,d,[l])});function Pq(o,l,d,y){o=Or(o)?o:nl(o),d=d&&!y?Ee(d):0;var _=o.length;return d<0&&(d=ht(_+d,0)),ch(o)?d<=_&&o.indexOf(l,d)>-1:!!_&&Ri(o,l,d)>-1}var kq=Pe(function(o,l,d){var y=-1,_=typeof l=="function",O=Or(o)?V(o.length):[];return fi(o,function(q){O[++y]=_?dr(l,q,d):Ro(q,l,d)}),O}),Aq=Gd(function(o,l,d){Hr(o,d,l)});function sh(o,l){var d=we(o)?ot:ie;return d(o,pe(l,3))}function Tq(o,l,d,y){return o==null?[]:(we(l)||(l=l==null?[]:[l]),d=y?t:d,we(d)||(d=d==null?[]:[d]),vw(o,l,d))}var qq=Gd(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function $q(o,l,d){var y=we(o)?Ou:Ta,_=arguments.length<3;return y(o,pe(l,4),d,_,fi)}function Mq(o,l,d){var y=we(o)?hg:Ta,_=arguments.length<3;return y(o,pe(l,4),d,_,Hd)}function Nq(o,l){var d=we(o)?ii:Vd;return d(o,lh(pe(l,3)))}function Dq(o){var l=we(o)?jd:PA;return l(o)}function Fq(o,l,d){(d?vr(o,l,d):l===t)?l=1:l=Ee(l);var y=we(o)?ay:kA;return y(o,l)}function Lq(o){var l=we(o)?ly:TA;return l(o)}function jq(o){if(o==null)return 0;if(Or(o))return ch(o)?oi(o):o.length;var l=nr(o);return l==Ht||l==fr?o.size:R(o).length}function Uq(o,l,d){var y=we(o)?ka:qA;return d&&vr(o,l,d)&&(l=t),y(o,pe(l,3))}var Bq=Pe(function(o,l){if(o==null)return[];var d=l.length;return d>1&&vr(o,l[0],l[1])?l=[]:d>2&&vr(l[0],l[1],l[2])&&(l=[l[0]]),vw(o,jt(l,1),[])}),oh=Fg||function(){return qt.Date.now()};function Hq(o,l){if(typeof l!="function")throw new gr(i);return o=Ee(o),function(){if(--o<1)return l.apply(this,arguments)}}function dE(o,l,d){return l=d?t:l,l=o&&l==null?o.length:l,Ti(o,X,t,t,t,t,l)}function hE(o,l){var d;if(typeof l!="function")throw new gr(i);return o=Ee(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=t),d}}var jy=Pe(function(o,l,d){var y=C;if(d.length){var _=sn(d,tl(jy));y|=H}return Ti(o,y,l,d,_)}),pE=Pe(function(o,l,d){var y=C|A;if(d.length){var _=sn(d,tl(pE));y|=H}return Ti(l,y,o,d,_)});function mE(o,l,d){l=d?t:l;var y=Ti(o,B,t,t,t,t,t,l);return y.placeholder=mE.placeholder,y}function gE(o,l,d){l=d?t:l;var y=Ti(o,Y,t,t,t,t,t,l);return y.placeholder=gE.placeholder,y}function yE(o,l,d){var y,_,O,q,M,U,G=0,Q=!1,ee=!1,re=!0;if(typeof o!="function")throw new gr(i);l=fn(l)||0,St(d)&&(Q=!!d.leading,ee="maxWait"in d,O=ee?ht(fn(d.maxWait)||0,l):O,re="trailing"in d?!!d.trailing:re);function ue(Pt){var Dn=y,Di=_;return y=_=t,G=Pt,q=o.apply(Di,Dn),q}function me(Pt){return G=Pt,M=Ju(Fe,l),Q?ue(Pt):q}function Ie(Pt){var Dn=Pt-U,Di=Pt-G,DE=l-Dn;return ee?Lt(DE,O-Di):DE}function he(Pt){var Dn=Pt-U,Di=Pt-G;return U===t||Dn>=l||Dn<0||ee&&Di>=O}function Fe(){var Pt=oh();if(he(Pt))return Ue(Pt);M=Ju(Fe,Ie(Pt))}function Ue(Pt){return M=t,re&&y?ue(Pt):(y=_=t,q)}function Jr(){M!==t&&Iw(M),G=0,y=U=_=M=t}function Sr(){return M===t?q:Ue(oh())}function zr(){var Pt=oh(),Dn=he(Pt);if(y=arguments,_=this,U=Pt,Dn){if(M===t)return me(U);if(ee)return Iw(M),M=Ju(Fe,l),ue(U)}return M===t&&(M=Ju(Fe,l)),q}return zr.cancel=Jr,zr.flush=Sr,zr}var Vq=Pe(function(o,l){return ju(o,1,l)}),Wq=Pe(function(o,l,d){return ju(o,fn(l)||0,d)});function Yq(o){return Ti(o,w)}function ah(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new gr(i);var d=function(){var y=arguments,_=l?l.apply(this,y):y[0],O=d.cache;if(O.has(_))return O.get(_);var q=o.apply(this,y);return d.cache=O.set(_,q)||O,q};return d.cache=new(ah.Cache||An),d}ah.Cache=An;function lh(o){if(typeof o!="function")throw new gr(i);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function Jq(o){return hE(2,o)}var zq=$A(function(o,l){l=l.length==1&&we(l[0])?ot(l[0],pr(pe())):ot(jt(l,1),pr(pe()));var d=l.length;return Pe(function(y){for(var _=-1,O=Lt(y.length,d);++_<O;)y[_]=l[_].call(this,y[_]);return dr(o,this,y)})}),Uy=Pe(function(o,l){var d=sn(l,tl(Uy));return Ti(o,H,t,l,d)}),vE=Pe(function(o,l){var d=sn(l,tl(vE));return Ti(o,K,t,l,d)}),Kq=qi(function(o,l){return Ti(o,k,t,t,t,l)});function Gq(o,l){if(typeof o!="function")throw new gr(i);return l=l===t?l:Ee(l),Pe(o,l)}function Qq(o,l){if(typeof o!="function")throw new gr(i);return l=l==null?0:ht(Ee(l),0),Pe(function(d){var y=d[l],_=Es(d,0,l);return y&&si(_,y),dr(o,this,_)})}function Zq(o,l,d){var y=!0,_=!0;if(typeof o!="function")throw new gr(i);return St(d)&&(y="leading"in d?!!d.leading:y,_="trailing"in d?!!d.trailing:_),yE(o,l,{leading:y,maxWait:l,trailing:_})}function Xq(o){return dE(o,1)}function e$(o,l){return Uy(Cy(l),o)}function t$(){if(!arguments.length)return[];var o=arguments[0];return we(o)?o:[o]}function r$(o){return rr(o,S)}function n$(o,l){return l=typeof l=="function"?l:t,rr(o,S,l)}function i$(o){return rr(o,g|S)}function s$(o,l){return l=typeof l=="function"?l:t,rr(o,g|S,l)}function o$(o,l){return l==null||an(o,l,Yt(l))}function Nn(o,l){return o===l||o!==o&&l!==l}var a$=eh(Bu),l$=eh(function(o,l){return o>=l}),ko=Jd((function(){return arguments})())?Jd:function(o){return wt(o)&&Qe.call(o,"callee")&&!yo.call(o,"callee")},we=V.isArray,u$=Ru?pr(Ru):gy;function Or(o){return o!=null&&uh(o.length)&&!Mi(o)}function Ot(o){return wt(o)&&Or(o)}function c$(o){return o===!0||o===!1||wt(o)&&Jt(o)==En}var xs=Va||Xy,f$=gd?pr(gd):yy;function d$(o){return wt(o)&&o.nodeType===1&&!zu(o)}function h$(o){if(o==null)return!0;if(Or(o)&&(we(o)||typeof o=="string"||typeof o.splice=="function"||xs(o)||rl(o)||ko(o)))return!o.length;var l=nr(o);if(l==Ht||l==fr)return!o.size;if(Yu(o))return!R(o).length;for(var d in o)if(Qe.call(o,d))return!1;return!0}function p$(o,l){return Io(o,l)}function m$(o,l,d){d=typeof d=="function"?d:t;var y=d?d(o,l):t;return y===t?Io(o,l,t,d):!!y}function By(o){if(!wt(o))return!1;var l=Jt(o);return l==dt||l==er||typeof o.message=="string"&&typeof o.name=="string"&&!zu(o)}function g$(o){return typeof o=="number"&&Pi(o)}function Mi(o){if(!St(o))return!1;var l=Jt(o);return l==en||l==Xs||l==_t||l==Qf}function SE(o){return typeof o=="number"&&o==Ee(o)}function uh(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=rt}function St(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function wt(o){return o!=null&&typeof o=="object"}var bE=yd?pr(yd):Ss;function y$(o,l){return o===l||bs(o,l,Ty(l))}function v$(o,l,d){return d=typeof d=="function"?d:t,bs(o,l,Ty(l),d)}function S$(o){return _E(o)&&o!=+o}function b$(o){if(nT(o))throw new ve(n);return De(o)}function _$(o){return o===null}function w$(o){return o==null}function _E(o){return typeof o=="number"||wt(o)&&Jt(o)==eo}function zu(o){if(!wt(o)||Jt(o)!=xn)return!1;var l=ja(o);if(l===null)return!0;var d=Qe.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Na.call(d)==$g}var Hy=co?pr(co):c;function E$(o){return SE(o)&&o>=-rt&&o<=rt}var wE=On?pr(On):p;function ch(o){return typeof o=="string"||!we(o)&&wt(o)&&Jt(o)==to}function Yr(o){return typeof o=="symbol"||wt(o)&&Jt(o)==ma}var rl=Oa?pr(Oa):v;function x$(o){return o===t}function C$(o){return wt(o)&&nr(o)==Ft}function R$(o){return wt(o)&&Jt(o)==Xf}var I$=eh(W),O$=eh(function(o,l){return o<=l});function EE(o){if(!o)return[];if(Or(o))return ch(o)?mr(o):Ir(o);if(vo&&o[vo])return xg(o[vo]());var l=nr(o),d=l==Ht?hs:l==fr?$a:nl;return d(o)}function Ni(o){if(!o)return o===0?o:0;if(o=fn(o),o===de||o===-de){var l=o<0?-1:1;return l*Re}return o===o?o:0}function Ee(o){var l=Ni(o),d=l%1;return l===l?d?l-d:l:0}function xE(o){return o?ci(Ee(o),0,Ae):0}function fn(o){if(typeof o=="number")return o;if(Yr(o))return ge;if(St(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=St(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=Tu(o);var d=so.test(o);return d||Hm.test(o)?fg(o.slice(2),d?2:8):Bm.test(o)?ge:+o}function CE(o){return di(o,Pr(o))}function P$(o){return o?ci(Ee(o),-rt,rt):o===0?o:0}function et(o){return o==null?"":Wr(o)}var k$=Xa(function(o,l){if(Yu(l)||Or(l)){di(l,Yt(l),o);return}for(var d in l)Qe.call(l,d)&&yr(o,d,l[d])}),RE=Xa(function(o,l){di(l,Pr(l),o)}),IE=Xa(function(o,l,d,y){di(l,Pr(l),o,y)}),Vy=Xa(function(o,l,d,y){di(l,Yt(l),o,y)}),A$=qi(Lu);function T$(o,l){var d=ys(o);return l==null?d:Bd(d,l)}var q$=Pe(function(o,l){o=je(o);var d=-1,y=l.length,_=y>2?l[2]:t;for(_&&vr(l[0],l[1],_)&&(y=1);++d<y;)for(var O=l[d],q=Pr(O),M=-1,U=q.length;++M<U;){var G=q[M],Q=o[G];(Q===t||Nn(Q,ps[G])&&!Qe.call(o,G))&&(o[G]=O[G])}return o}),$$=Pe(function(o){return o.push(t,Hw),dr(OE,t,o)});function M$(o,l){return Sd(o,pe(l,3),ln)}function N$(o,l){return Sd(o,pe(l,3),Tn)}function D$(o,l){return o==null?o:Uu(o,pe(l,3),Pr)}function F$(o,l){return o==null?o:Wd(o,pe(l,3),Pr)}function L$(o,l){return o&&ln(o,pe(l,3))}function j$(o,l){return o&&Tn(o,pe(l,3))}function U$(o){return o==null?[]:Za(o,Yt(o))}function B$(o){return o==null?[]:Za(o,Pr(o))}function Wy(o,l,d){var y=o==null?t:Ai(o,l);return y===t?d:y}function H$(o,l){return o!=null&&Yw(o,l,hy)}function Yy(o,l){return o!=null&&Yw(o,l,py)}var V$=Fw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Da.call(l)),o[l]=d},zy(kr)),W$=Fw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Da.call(l)),Qe.call(o,l)?o[l].push(d):o[l]=[d]},pe),Y$=Pe(Ro);function Yt(o){return Or(o)?Ld(o):R(o)}function Pr(o){return Or(o)?Ld(o,!0):$(o)}function J$(o,l){var d={};return l=pe(l,3),ln(o,function(y,_,O){Hr(d,l(y,_,O),y)}),d}function z$(o,l){var d={};return l=pe(l,3),ln(o,function(y,_,O){Hr(d,_,l(y,_,O))}),d}var K$=Xa(function(o,l,d){$t(o,l,d)}),OE=Xa(function(o,l,d,y){$t(o,l,d,y)}),G$=qi(function(o,l){var d={};if(o==null)return d;var y=!1;l=ot(l,function(O){return O=ws(O,o),y||(y=O.length>1),O}),di(o,ky(o),d),y&&(d=rr(d,g|m|S,WA));for(var _=l.length;_--;)wy(d,l[_]);return d});function Q$(o,l){return PE(o,lh(pe(l)))}var Z$=qi(function(o,l){return o==null?{}:RA(o,l)});function PE(o,l){if(o==null)return{};var d=ot(ky(o),function(y){return[y]});return l=pe(l),Sw(o,d,function(y,_){return l(y,_[0])})}function X$(o,l,d){l=ws(l,o);var y=-1,_=l.length;for(_||(_=1,o=t);++y<_;){var O=o==null?t:o[Mn(l[y])];O===t&&(y=_,O=d),o=Mi(O)?O.call(o):O}return o}function eM(o,l,d){return o==null?o:Vu(o,l,d)}function tM(o,l,d,y){return y=typeof y=="function"?y:t,o==null?o:Vu(o,l,d,y)}var kE=Uw(Yt),AE=Uw(Pr);function rM(o,l,d){var y=we(o),_=y||xs(o)||rl(o);if(l=pe(l,4),d==null){var O=o&&o.constructor;_?d=y?new O:[]:St(o)?d=Mi(O)?ys(ja(o)):{}:d={}}return(_?hr:ln)(o,function(q,M,U){return l(d,q,M,U)}),d}function nM(o,l){return o==null?!0:wy(o,l)}function iM(o,l,d){return o==null?o:xw(o,l,Cy(d))}function sM(o,l,d,y){return y=typeof y=="function"?y:t,o==null?o:xw(o,l,Cy(d),y)}function nl(o){return o==null?[]:qa(o,Yt(o))}function oM(o){return o==null?[]:qa(o,Pr(o))}function aM(o,l,d){return d===t&&(d=l,l=t),d!==t&&(d=fn(d),d=d===d?d:0),l!==t&&(l=fn(l),l=l===l?l:0),ci(fn(o),l,d)}function lM(o,l,d){return l=Ni(l),d===t?(d=l,l=0):d=Ni(d),o=fn(o),my(o,l,d)}function uM(o,l,d){if(d&&typeof d!="boolean"&&vr(o,l,d)&&(l=d=t),d===t&&(typeof l=="boolean"?(d=l,l=t):typeof o=="boolean"&&(d=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Ni(o),l===t?(l=o,o=0):l=Ni(l)),o>l){var y=o;o=l,l=y}if(d||o%1||l%1){var _=Td();return Lt(o+_*(l-o+pd("1e-"+((_+"").length-1))),l)}return Sy(o,l)}var cM=el(function(o,l,d){return l=l.toLowerCase(),o+(d?TE(l):l)});function TE(o){return Jy(et(o).toLowerCase())}function qE(o){return o=et(o),o&&o.replace(oo,bg).replace(ig,"")}function fM(o,l,d){o=et(o),l=Wr(l);var y=o.length;d=d===t?y:ci(Ee(d),0,y);var _=d;return d-=l.length,d>=0&&o.slice(d,_)==l}function dM(o){return o=et(o),o&&oe.test(o)?o.replace(Sa,_g):o}function hM(o){return o=et(o),o&&io.test(o)?o.replace(Ke,"\\$&"):o}var pM=el(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),mM=el(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),gM=Mw("toLowerCase");function yM(o,l,d){o=et(o),l=Ee(l);var y=l?oi(o):0;if(!l||y>=l)return o;var _=(l-y)/2;return Xd(bo(_),d)+o+Xd(So(_),d)}function vM(o,l,d){o=et(o),l=Ee(l);var y=l?oi(o):0;return l&&y<l?o+Xd(l-y,d):o}function SM(o,l,d){o=et(o),l=Ee(l);var y=l?oi(o):0;return l&&y<l?Xd(l-y,d)+o:o}function bM(o,l,d){return d||l==null?l=0:l&&(l=+l),jg(et(o).replace(mu,""),l||0)}function _M(o,l,d){return(d?vr(o,l,d):l===t)?l=1:l=Ee(l),by(et(o),l)}function wM(){var o=arguments,l=et(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var EM=el(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function xM(o,l,d){return d&&typeof d!="number"&&vr(o,l,d)&&(l=d=t),d=d===t?Ae:d>>>0,d?(o=et(o),o&&(typeof l=="string"||l!=null&&!Hy(l))&&(l=Wr(l),!l&&ds(o))?Es(mr(o),0,d):o.split(l,d)):[]}var CM=el(function(o,l,d){return o+(d?" ":"")+Jy(l)});function RM(o,l,d){return o=et(o),d=d==null?0:ci(Ee(d),0,o.length),l=Wr(l),o.slice(d,d+l.length)==l}function IM(o,l,d){var y=I.templateSettings;d&&vr(o,l,d)&&(l=t),o=et(o),l=Vy({},l,y,Bw);var _=Vy({},l.imports,y.imports,Bw),O=Yt(_),q=qa(_,O);hr(O,function(he){if(Cr.test(he))throw new ve(a)});var M,U,G=0,Q=l.interpolate||ao,ee="__p += '",re=Ma((l.escape||ao).source+"|"+Q.source+"|"+(Q===tn?xi:ao).source+"|"+(l.evaluate||ao).source+"|$","g"),ue="//# sourceURL="+(Qe.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ug+"]")+`
|
|
4
|
+
`;o.replace(re,function(he,Fe,Ue,Jr,Sr,zr){return Ue||(Ue=Jr),ee+=o.slice(G,zr).replace(Vm,wg),Fe&&(M=!0,ee+=`' +
|
|
5
|
+
__e(`+Fe+`) +
|
|
6
|
+
'`),Sr&&(U=!0,ee+=`';
|
|
7
|
+
`+Sr+`;
|
|
8
|
+
__p += '`),Ue&&(ee+=`' +
|
|
9
|
+
((__t = (`+Ue+`)) == null ? '' : __t) +
|
|
10
|
+
'`),G=zr+he.length,he}),ee+=`';
|
|
11
|
+
`;var me=Qe.call(l,"variable")&&l.variable;if(!me)ee=`with (obj) {
|
|
12
|
+
`+ee+`
|
|
13
13
|
}
|
|
14
|
-
`;else if(
|
|
14
|
+
`;else if(Cr.test(me))throw new ve(s);ee=(U?ee.replace(va,""):ee).replace(Lm,"$1").replace(no,"$1;"),ee="function("+(me||"obj")+`) {
|
|
15
15
|
`+(me?"":`obj || (obj = {});
|
|
16
|
-
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(
|
|
16
|
+
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(U?`, __j = Array.prototype.join;
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
|
-
`)+
|
|
20
|
-
}`;var Pe=$E(function(){return We(O,ue+"return "+X).apply(t,q)});if(Pe.source=X,Vy(Pe))throw Pe;return Pe}function SM(o){return Ge(o).toLowerCase()}function bM(o){return Ge(o).toUpperCase()}function _M(o,l,d){if(o=Ge(o),o&&(d||l===t))return vd(o);if(!o||!(l=Vr(l)))return o;var v=hr(o),w=hr(l),O=nt(v,w),q=Sd(v,w)+1;return Ts(v,O,q).join("")}function wM(o,l,d){if(o=Ge(o),o&&(d||l===t))return o.slice(0,Pa(o)+1);if(!o||!(l=Vr(l)))return o;var v=hr(o),w=Sd(v,hr(l))+1;return Ts(v,0,w).join("")}function EM(o,l,d){if(o=Ge(o),o&&(d||l===t))return o.replace(Oi,"");if(!o||!(l=Vr(l)))return o;var v=hr(o),w=nt(v,hr(l));return Ts(v,w).join("")}function CM(o,l){var d=E,v=P;if(St(l)){var w="separator"in l?l.separator:w;d="length"in l?Ce(l.length):d,v="omission"in l?Vr(l.omission):v}o=Ge(o);var O=o.length;if(en(o)){var q=hr(o);O=q.length}if(d>=O)return o;var M=d-li(v);if(M<1)return v;var B=q?Ts(q,0,M).join(""):o.slice(0,M);if(w===t)return B+v;if(q&&(M+=B.length-M),Wy(w)){if(o.slice(M).search(w)){var G,Q=B;for(w.global||(w=In(w.source,Ge(ii.exec(w))+"g")),w.lastIndex=0;G=w.exec(Q);)var X=G.index;B=B.slice(0,X===t?M:X)}}else if(o.indexOf(Vr(w),M)!=M){var re=B.lastIndexOf(w);re>-1&&(B=B.slice(0,re))}return B+v}function xM(o){return o=Ge(o),o&&ou.test(o)?o.replace(ms,Pg):o}var RM=za(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),zy=Mw("toUpperCase");function qE(o,l,d){return o=Ge(o),l=d?t:l,l===t?xg(o)?Tg(o):Sg(o):o.match(l)||[]}var $E=Te(function(o,l){try{return Jt(o,t,l)}catch(d){return Vy(d)?d:new ve(d)}}),IM=Di(function(o,l){return wt(l,function(d){d=mi(d),An(o,d,By(o[d],o))}),o});function OM(o){var l=o==null?0:o.length,d=pe();return o=l?et(o,function(v){if(typeof v[1]!="function")throw new wr(i);return[d(v[0]),v[1]]}):[],Te(function(v){for(var w=-1;++w<l;){var O=o[w];if(Jt(O[0],this,v))return Jt(O[1],this,v)}})}function PM(o){return Iu(pr(o,h))}function Ky(o){return function(){return o}}function kM(o,l){return o==null||o!==o?l:o}var AM=Dw(),TM=Dw(!0);function Or(o){return o}function Gy(o){return y(typeof o=="function"?o:pr(o,h))}function qM(o){return se(pr(o,h))}function $M(o,l){return ye(o,pr(l,h))}var MM=Te(function(o,l){return function(d){return sn(d,o,l)}}),NM=Te(function(o,l){return function(d){return sn(o,d,l)}});function Qy(o,l,d){var v=Yt(l),w=nn(l,v);d==null&&!(St(l)&&(w.length||!v.length))&&(d=l,l=o,o=this,w=nn(l,Yt(l)));var O=!(St(d)&&"chain"in d)||!!d.chain,q=Li(o);return wt(w,function(M){var B=l[M];o[M]=B,q&&(o.prototype[M]=function(){var G=this.__chain__;if(O||G){var Q=o(this.__wrapped__),X=Q.__actions__=xr(this.__actions__);return X.push({func:B,args:arguments,thisArg:o}),Q.__chain__=G,Q}return B.apply(o,Xr([this.value()],arguments))})}),o}function DM(){return Nt._===this&&(Nt._=Ng),this}function Zy(){}function FM(o){return o=Ce(o),Te(function(l){return on(l,o)})}var LM=Py(et),jM=Py(Ra),UM=Py(gu);function ME(o){return Ny(o)?yu(mi(o)):yA(o)}function BM(o){return function(l){return o==null?t:Mi(o,l)}}var HM=Lw(),VM=Lw(!0);function Xy(){return[]}function ev(){return!1}function WM(){return{}}function YM(){return""}function JM(){return!0}function zM(o,l){if(o=Ce(o),o<1||o>fe)return[];var d=he,v=vt(o,he);l=pe(l),o-=he;for(var w=bu(v,l);++d<o;)l(d);return w}function KM(o){return Ee(o)?et(o,mi):Wr(o)?[o]:xr(tE(Ge(o)))}function GM(o){var l=++$g;return Ge(o)+l}var QM=Gd(function(o,l){return o+l},0),ZM=ky("ceil"),XM=Gd(function(o,l){return o/l},1),eN=ky("floor");function tN(o){return o&&o.length?Ya(o,Or,ku):t}function rN(o,l){return o&&o.length?Ya(o,pe(l,2),ku):t}function nN(o){return ki(o,Or)}function iN(o,l){return ki(o,pe(l,2))}function sN(o){return o&&o.length?Ya(o,Or,$):t}function oN(o,l){return o&&o.length?Ya(o,pe(l,2),$):t}var aN=Gd(function(o,l){return o*l},1),lN=ky("round"),uN=Gd(function(o,l){return o-l},0);function cN(o){return o&&o.length?Su(o,Or):0}function fN(o,l){return o&&o.length?Su(o,pe(l,2)):0}return I.after=qq,I.ary=dE,I.assign=b$,I.assignIn=RE,I.assignInWith=uh,I.assignWith=_$,I.at=w$,I.before=hE,I.bind=By,I.bindAll=IM,I.bindKey=pE,I.castArray=Wq,I.chain=uE,I.chunk=eT,I.compact=tT,I.concat=rT,I.cond=OM,I.conforms=PM,I.constant=Ky,I.countBy=cq,I.create=E$,I.curry=mE,I.curryRight=gE,I.debounce=yE,I.defaults=C$,I.defaultsDeep=x$,I.defer=$q,I.delay=Mq,I.difference=nT,I.differenceBy=iT,I.differenceWith=sT,I.drop=oT,I.dropRight=aT,I.dropRightWhile=lT,I.dropWhile=uT,I.fill=cT,I.filter=dq,I.flatMap=mq,I.flatMapDeep=gq,I.flatMapDepth=yq,I.flatten=sE,I.flattenDeep=fT,I.flattenDepth=dT,I.flip=Nq,I.flow=AM,I.flowRight=TM,I.fromPairs=hT,I.functions=T$,I.functionsIn=q$,I.groupBy=vq,I.initial=mT,I.intersection=gT,I.intersectionBy=yT,I.intersectionWith=vT,I.invert=M$,I.invertBy=N$,I.invokeMap=bq,I.iteratee=Gy,I.keyBy=_q,I.keys=Yt,I.keysIn=Ir,I.map=nh,I.mapKeys=F$,I.mapValues=L$,I.matches=qM,I.matchesProperty=$M,I.memoize=sh,I.merge=j$,I.mergeWith=IE,I.method=MM,I.methodOf=NM,I.mixin=Qy,I.negate=oh,I.nthArg=FM,I.omit=U$,I.omitBy=B$,I.once=Dq,I.orderBy=wq,I.over=LM,I.overArgs=Fq,I.overEvery=jM,I.overSome=UM,I.partial=Hy,I.partialRight=vE,I.partition=Eq,I.pick=H$,I.pickBy=OE,I.property=ME,I.propertyOf=BM,I.pull=wT,I.pullAll=aE,I.pullAllBy=ET,I.pullAllWith=CT,I.pullAt=xT,I.range=HM,I.rangeRight=VM,I.rearg=Lq,I.reject=Rq,I.remove=RT,I.rest=jq,I.reverse=jy,I.sampleSize=Oq,I.set=W$,I.setWith=Y$,I.shuffle=Pq,I.slice=IT,I.sortBy=Tq,I.sortedUniq=$T,I.sortedUniqBy=MT,I.split=mM,I.spread=Uq,I.tail=NT,I.take=DT,I.takeRight=FT,I.takeRightWhile=LT,I.takeWhile=jT,I.tap=tq,I.throttle=Bq,I.thru=rh,I.toArray=EE,I.toPairs=PE,I.toPairsIn=kE,I.toPath=KM,I.toPlainObject=xE,I.transform=J$,I.unary=Hq,I.union=UT,I.unionBy=BT,I.unionWith=HT,I.uniq=VT,I.uniqBy=WT,I.uniqWith=YT,I.unset=z$,I.unzip=Uy,I.unzipWith=lE,I.update=K$,I.updateWith=G$,I.values=Qa,I.valuesIn=Q$,I.without=JT,I.words=qE,I.wrap=Vq,I.xor=zT,I.xorBy=KT,I.xorWith=GT,I.zip=QT,I.zipObject=ZT,I.zipObjectDeep=XT,I.zipWith=eq,I.entries=PE,I.entriesIn=kE,I.extend=RE,I.extendWith=uh,Qy(I,I),I.add=QM,I.attempt=$E,I.camelCase=tM,I.capitalize=AE,I.ceil=ZM,I.clamp=Z$,I.clone=Yq,I.cloneDeep=zq,I.cloneDeepWith=Kq,I.cloneWith=Jq,I.conformsTo=Gq,I.deburr=TE,I.defaultTo=kM,I.divide=XM,I.endsWith=rM,I.eq=$n,I.escape=nM,I.escapeRegExp=iM,I.every=fq,I.find=hq,I.findIndex=nE,I.findKey=R$,I.findLast=pq,I.findLastIndex=iE,I.findLastKey=I$,I.floor=eN,I.forEach=cE,I.forEachRight=fE,I.forIn=O$,I.forInRight=P$,I.forOwn=k$,I.forOwnRight=A$,I.get=Yy,I.gt=Qq,I.gte=Zq,I.has=$$,I.hasIn=Jy,I.head=oE,I.identity=Or,I.includes=Sq,I.indexOf=pT,I.inRange=X$,I.invoke=D$,I.isArguments=ko,I.isArray=Ee,I.isArrayBuffer=Xq,I.isArrayLike=Rr,I.isArrayLikeObject=At,I.isBoolean=e$,I.isBuffer=qs,I.isDate=t$,I.isElement=r$,I.isEmpty=n$,I.isEqual=i$,I.isEqualWith=s$,I.isError=Vy,I.isFinite=o$,I.isFunction=Li,I.isInteger=SE,I.isLength=ah,I.isMap=bE,I.isMatch=a$,I.isMatchWith=l$,I.isNaN=u$,I.isNative=c$,I.isNil=d$,I.isNull=f$,I.isNumber=_E,I.isObject=St,I.isObjectLike=Ct,I.isPlainObject=Du,I.isRegExp=Wy,I.isSafeInteger=h$,I.isSet=wE,I.isString=lh,I.isSymbol=Wr,I.isTypedArray=Ga,I.isUndefined=p$,I.isWeakMap=m$,I.isWeakSet=g$,I.join=ST,I.kebabCase=sM,I.last=ln,I.lastIndexOf=bT,I.lowerCase=oM,I.lowerFirst=aM,I.lt=y$,I.lte=v$,I.max=tN,I.maxBy=rN,I.mean=nN,I.meanBy=iN,I.min=sN,I.minBy=oN,I.stubArray=Xy,I.stubFalse=ev,I.stubObject=WM,I.stubString=YM,I.stubTrue=JM,I.multiply=aN,I.nth=_T,I.noConflict=DM,I.noop=Zy,I.now=ih,I.pad=lM,I.padEnd=uM,I.padStart=cM,I.parseInt=fM,I.random=eM,I.reduce=Cq,I.reduceRight=xq,I.repeat=dM,I.replace=hM,I.result=V$,I.round=lN,I.runInContext=U,I.sample=Iq,I.size=kq,I.snakeCase=pM,I.some=Aq,I.sortedIndex=OT,I.sortedIndexBy=PT,I.sortedIndexOf=kT,I.sortedLastIndex=AT,I.sortedLastIndexBy=TT,I.sortedLastIndexOf=qT,I.startCase=gM,I.startsWith=yM,I.subtract=uN,I.sum=cN,I.sumBy=fN,I.template=vM,I.times=zM,I.toFinite=ji,I.toInteger=Ce,I.toLength=CE,I.toLower=SM,I.toNumber=un,I.toSafeInteger=S$,I.toString=Ge,I.toUpper=bM,I.trim=_M,I.trimEnd=wM,I.trimStart=EM,I.truncate=CM,I.unescape=xM,I.uniqueId=GM,I.upperCase=RM,I.upperFirst=zy,I.each=cE,I.eachRight=fE,I.first=oE,Qy(I,function(){var o={};return rn(I,function(l,d){ze.call(I.prototype,d)||(o[d]=l)}),o}(),{chain:!1}),I.VERSION=e,wt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){I[o].placeholder=I}),wt(["drop","take"],function(o,l){Ie.prototype[o]=function(d){d=d===t?1:Et(Ce(d),0);var v=this.__filtered__&&!l?new Ie(this):this.clone();return v.__filtered__?v.__takeCount__=vt(d,v.__takeCount__):v.__views__.push({size:vt(d,he),type:o+(v.__dir__<0?"Right":"")}),v},Ie.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),wt(["filter","map","takeWhile"],function(o,l){var d=l+1,v=d==L||d==Z;Ie.prototype[o]=function(w){var O=this.clone();return O.__iteratees__.push({iteratee:pe(w,3),type:d}),O.__filtered__=O.__filtered__||v,O}}),wt(["head","last"],function(o,l){var d="take"+(l?"Right":"");Ie.prototype[o]=function(){return this[d](1).value()[0]}}),wt(["initial","tail"],function(o,l){var d="drop"+(l?"":"Right");Ie.prototype[o]=function(){return this.__filtered__?new Ie(this):this[d](1)}}),Ie.prototype.compact=function(){return this.filter(Or)},Ie.prototype.find=function(o){return this.filter(o).head()},Ie.prototype.findLast=function(o){return this.reverse().find(o)},Ie.prototype.invokeMap=Te(function(o,l){return typeof o=="function"?new Ie(this):this.map(function(d){return sn(d,o,l)})}),Ie.prototype.reject=function(o){return this.filter(oh(pe(o)))},Ie.prototype.slice=function(o,l){o=Ce(o);var d=this;return d.__filtered__&&(o>0||l<0)?new Ie(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),l!==t&&(l=Ce(l),d=l<0?d.dropRight(-l):d.take(l-o)),d)},Ie.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ie.prototype.toArray=function(){return this.take(he)},rn(Ie.prototype,function(o,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),v=/^(?:head|last)$/.test(l),w=I[v?"take"+(l=="last"?"Right":""):l],O=v||/^find/.test(l);w&&(I.prototype[l]=function(){var q=this.__wrapped__,M=v?[1]:arguments,B=q instanceof Ie,G=M[0],Q=B||Ee(q),X=function(De){var je=w.apply(I,Xr([De],M));return v&&re?je[0]:je};Q&&d&&typeof G=="function"&&G.length!=1&&(B=Q=!1);var re=this.__chain__,ue=!!this.__actions__.length,me=O&&!re,Pe=B&&!ue;if(!O&&Q){q=Pe?q:new Ie(this);var ge=o.apply(q,M);return ge.__actions__.push({func:rh,args:[X],thisArg:t}),new Er(ge,re)}return me&&Pe?o.apply(this,M):(ge=this.thru(X),me?v?ge.value()[0]:ge.value():ge)})}),wt(["pop","push","shift","sort","splice","unshift"],function(o){var l=go[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);I.prototype[o]=function(){var w=arguments;if(v&&!this.__chain__){var O=this.value();return l.apply(Ee(O)?O:[],w)}return this[d](function(q){return l.apply(Ee(q)?q:[],w)})}}),rn(Ie.prototype,function(o,l){var d=I[l];if(d){var v=d.name+"";ze.call(Is,v)||(Is[v]=[]),Is[v].push({name:l,func:d})}}),Is[Kd(t,x).name]=[{name:"wrapper",func:t}],Ie.prototype.clone=Jg,Ie.prototype.reverse=zg,Ie.prototype.value=Kg,I.prototype.at=rq,I.prototype.chain=nq,I.prototype.commit=iq,I.prototype.next=sq,I.prototype.plant=aq,I.prototype.reverse=lq,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=uq,I.prototype.first=I.prototype.head,vo&&(I.prototype[vo]=oq),I},ui=qg();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=ui,define(function(){return ui})):oi?((oi.exports=ui)._=ui,du._=ui):Nt._=ui}).call(el)});var XE=F((pv,tl)=>{(function(t,e){typeof pv=="object"&&typeof tl<"u"?tl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(pv,function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(c){t=c}function n(c){return c instanceof Array||Object.prototype.toString.call(c)==="[object Array]"}function i(c){return c!=null&&Object.prototype.toString.call(c)==="[object Object]"}function s(c,p){return Object.prototype.hasOwnProperty.call(c,p)}function a(c){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(c).length===0;var p;for(p in c)if(s(c,p))return!1;return!0}function u(c){return c===void 0}function f(c){return typeof c=="number"||Object.prototype.toString.call(c)==="[object Number]"}function h(c){return c instanceof Date||Object.prototype.toString.call(c)==="[object Date]"}function g(c,p){var y=[],b,R=c.length;for(b=0;b<R;++b)y.push(p(c[b],b));return y}function m(c,p){for(var y in p)s(p,y)&&(c[y]=p[y]);return s(p,"toString")&&(c.toString=p.toString),s(p,"valueOf")&&(c.valueOf=p.valueOf),c}function S(c,p,y,b){return ws(c,p,y,b,!0).utc()}function _(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function C(c){return c._pf==null&&(c._pf=_()),c._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(c){var p=Object(this),y=p.length>>>0,b;for(b=0;b<y;b++)if(b in p&&c.call(this,p[b],b,p))return!0;return!1};function A(c){var p=null,y=!1,b=c._d&&!isNaN(c._d.getTime());if(b&&(p=C(c),y=x.call(p.parsedDateParts,function(R){return R!=null}),b=p.overflow<0&&!p.empty&&!p.invalidEra&&!p.invalidMonth&&!p.invalidWeekday&&!p.weekdayMismatch&&!p.nullInput&&!p.invalidFormat&&!p.userInvalidated&&(!p.meridiem||p.meridiem&&y),c._strict&&(b=b&&p.charsLeftOver===0&&p.unusedTokens.length===0&&p.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(c))c._isValid=b;else return b;return c._isValid}function T(c){var p=S(NaN);return c!=null?m(C(p),c):C(p).userInvalidated=!0,p}var j=e.momentProperties=[],Y=!1;function V(c,p){var y,b,R,$=j.length;if(u(p._isAMomentObject)||(c._isAMomentObject=p._isAMomentObject),u(p._i)||(c._i=p._i),u(p._f)||(c._f=p._f),u(p._l)||(c._l=p._l),u(p._strict)||(c._strict=p._strict),u(p._tzm)||(c._tzm=p._tzm),u(p._isUTC)||(c._isUTC=p._isUTC),u(p._offset)||(c._offset=p._offset),u(p._pf)||(c._pf=C(p)),u(p._locale)||(c._locale=p._locale),$>0)for(y=0;y<$;y++)b=j[y],R=p[b],u(R)||(c[b]=R);return c}function K(c){V(this,c),this._d=new Date(c._d!=null?c._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Y===!1&&(Y=!0,e.updateOffset(this),Y=!1)}function ee(c){return c instanceof K||c!=null&&c._isAMomentObject!=null}function k(c){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+c)}function E(c,p){var y=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),y){var b=[],R,$,W,se=arguments.length;for($=0;$<se;$++){if(R="",typeof arguments[$]=="object"){R+=`
|
|
19
|
+
`)+ee+`return __p
|
|
20
|
+
}`;var Ie=ME(function(){return Je(O,ue+"return "+ee).apply(t,q)});if(Ie.source=ee,By(Ie))throw Ie;return Ie}function OM(o){return et(o).toLowerCase()}function PM(o){return et(o).toUpperCase()}function kM(o,l,d){if(o=et(o),o&&(d||l===t))return Tu(o);if(!o||!(l=Wr(l)))return o;var y=mr(o),_=mr(l),O=_d(y,_),q=wd(y,_)+1;return Es(y,O,q).join("")}function AM(o,l,d){if(o=et(o),o&&(d||l===t))return o.slice(0,Cd(o)+1);if(!o||!(l=Wr(l)))return o;var y=mr(o),_=wd(y,mr(l))+1;return Es(y,0,_).join("")}function TM(o,l,d){if(o=et(o),o&&(d||l===t))return o.replace(mu,"");if(!o||!(l=Wr(l)))return o;var y=mr(o),_=_d(y,mr(l));return Es(y,_).join("")}function qM(o,l){var d=P,y=N;if(St(l)){var _="separator"in l?l.separator:_;d="length"in l?Ee(l.length):d,y="omission"in l?Wr(l.omission):y}o=et(o);var O=o.length;if(ds(o)){var q=mr(o);O=q.length}if(d>=O)return o;var M=d-oi(y);if(M<1)return y;var U=q?Es(q,0,M).join(""):o.slice(0,M);if(_===t)return U+y;if(q&&(M+=U.length-M),Hy(_)){if(o.slice(M).search(_)){var G,Q=U;for(_.global||(_=Ma(_.source,et(ed.exec(_))+"g")),_.lastIndex=0;G=_.exec(Q);)var ee=G.index;U=U.slice(0,ee===t?M:ee)}}else if(o.indexOf(Wr(_),M)!=M){var re=U.lastIndexOf(_);re>-1&&(U=U.slice(0,re))}return U+y}function $M(o){return o=et(o),o&&ba.test(o)?o.replace(Ei,Rg):o}var MM=el(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),Jy=Mw("toUpperCase");function $E(o,l,d){return o=et(o),l=d?t:l,l===t?Eg(o)?Pg(o):gg(o):o.match(l)||[]}var ME=Pe(function(o,l){try{return dr(o,t,l)}catch(d){return By(d)?d:new ve(d)}}),NM=qi(function(o,l){return hr(l,function(d){d=Mn(d),Hr(o,d,jy(o[d],o))}),o});function DM(o){var l=o==null?0:o.length,d=pe();return o=l?ot(o,function(y){if(typeof y[1]!="function")throw new gr(i);return[d(y[0]),y[1]]}):[],Pe(function(y){for(var _=-1;++_<l;){var O=o[_];if(dr(O[0],this,y))return dr(O[1],this,y)}})}function FM(o){return cy(rr(o,g))}function zy(o){return function(){return o}}function LM(o,l){return o==null||o!==o?l:o}var jM=Dw(),UM=Dw(!0);function kr(o){return o}function Ky(o){return b(typeof o=="function"?o:rr(o,g))}function BM(o){return ye(rr(o,g))}function HM(o,l){return $e(o,rr(l,g))}var VM=Pe(function(o,l){return function(d){return Ro(d,o,l)}}),WM=Pe(function(o,l){return function(d){return Ro(o,d,l)}});function Gy(o,l,d){var y=Yt(l),_=Za(l,y);d==null&&!(St(l)&&(_.length||!y.length))&&(d=l,l=o,o=this,_=Za(l,Yt(l)));var O=!(St(d)&&"chain"in d)||!!d.chain,q=Mi(o);return hr(_,function(M){var U=l[M];o[M]=U,q&&(o.prototype[M]=function(){var G=this.__chain__;if(O||G){var Q=o(this.__wrapped__),ee=Q.__actions__=Ir(this.__actions__);return ee.push({func:U,args:arguments,thisArg:o}),Q.__chain__=G,Q}return U.apply(o,si([this.value()],arguments))})}),o}function YM(){return qt._===this&&(qt._=Mg),this}function Qy(){}function JM(o){return o=Ee(o),Pe(function(l){return $n(l,o)})}var zM=Iy(ot),KM=Iy(vd),GM=Iy(ka);function NE(o){return $y(o)?fo(Mn(o)):IA(o)}function QM(o){return function(l){return o==null?t:Ai(o,l)}}var ZM=Lw(),XM=Lw(!0);function Zy(){return[]}function Xy(){return!1}function eN(){return{}}function tN(){return""}function rN(){return!0}function nN(o,l){if(o=Ee(o),o<1||o>rt)return[];var d=Ae,y=Lt(o,Ae);l=pe(l),o-=Ae;for(var _=Au(y,l);++d<o;)l(d);return _}function iN(o){return we(o)?ot(o,Mn):Yr(o)?[o]:Ir(tE(et(o)))}function sN(o){var l=++qg;return et(o)+l}var oN=Zd(function(o,l){return o+l},0),aN=Oy("ceil"),lN=Zd(function(o,l){return o/l},1),uN=Oy("floor");function cN(o){return o&&o.length?Qa(o,kr,Bu):t}function fN(o,l){return o&&o.length?Qa(o,pe(l,2),Bu):t}function dN(o){return bd(o,kr)}function hN(o,l){return bd(o,pe(l,2))}function pN(o){return o&&o.length?Qa(o,kr,W):t}function mN(o,l){return o&&o.length?Qa(o,pe(l,2),W):t}var gN=Zd(function(o,l){return o*l},1),yN=Oy("round"),vN=Zd(function(o,l){return o-l},0);function SN(o){return o&&o.length?ku(o,kr):0}function bN(o,l){return o&&o.length?ku(o,pe(l,2)):0}return I.after=Hq,I.ary=dE,I.assign=k$,I.assignIn=RE,I.assignInWith=IE,I.assignWith=Vy,I.at=A$,I.before=hE,I.bind=jy,I.bindAll=NM,I.bindKey=pE,I.castArray=t$,I.chain=uE,I.chunk=cT,I.compact=fT,I.concat=dT,I.cond=DM,I.conforms=FM,I.constant=zy,I.countBy=bq,I.create=T$,I.curry=mE,I.curryRight=gE,I.debounce=yE,I.defaults=q$,I.defaultsDeep=$$,I.defer=Vq,I.delay=Wq,I.difference=hT,I.differenceBy=pT,I.differenceWith=mT,I.drop=gT,I.dropRight=yT,I.dropRightWhile=vT,I.dropWhile=ST,I.fill=bT,I.filter=wq,I.flatMap=Cq,I.flatMapDeep=Rq,I.flatMapDepth=Iq,I.flatten=sE,I.flattenDeep=_T,I.flattenDepth=wT,I.flip=Yq,I.flow=jM,I.flowRight=UM,I.fromPairs=ET,I.functions=U$,I.functionsIn=B$,I.groupBy=Oq,I.initial=CT,I.intersection=RT,I.intersectionBy=IT,I.intersectionWith=OT,I.invert=V$,I.invertBy=W$,I.invokeMap=kq,I.iteratee=Ky,I.keyBy=Aq,I.keys=Yt,I.keysIn=Pr,I.map=sh,I.mapKeys=J$,I.mapValues=z$,I.matches=BM,I.matchesProperty=HM,I.memoize=ah,I.merge=K$,I.mergeWith=OE,I.method=VM,I.methodOf=WM,I.mixin=Gy,I.negate=lh,I.nthArg=JM,I.omit=G$,I.omitBy=Q$,I.once=Jq,I.orderBy=Tq,I.over=zM,I.overArgs=zq,I.overEvery=KM,I.overSome=GM,I.partial=Uy,I.partialRight=vE,I.partition=qq,I.pick=Z$,I.pickBy=PE,I.property=NE,I.propertyOf=QM,I.pull=TT,I.pullAll=aE,I.pullAllBy=qT,I.pullAllWith=$T,I.pullAt=MT,I.range=ZM,I.rangeRight=XM,I.rearg=Kq,I.reject=Nq,I.remove=NT,I.rest=Gq,I.reverse=Fy,I.sampleSize=Fq,I.set=eM,I.setWith=tM,I.shuffle=Lq,I.slice=DT,I.sortBy=Bq,I.sortedUniq=VT,I.sortedUniqBy=WT,I.split=xM,I.spread=Qq,I.tail=YT,I.take=JT,I.takeRight=zT,I.takeRightWhile=KT,I.takeWhile=GT,I.tap=fq,I.throttle=Zq,I.thru=ih,I.toArray=EE,I.toPairs=kE,I.toPairsIn=AE,I.toPath=iN,I.toPlainObject=CE,I.transform=rM,I.unary=Xq,I.union=QT,I.unionBy=ZT,I.unionWith=XT,I.uniq=eq,I.uniqBy=tq,I.uniqWith=rq,I.unset=nM,I.unzip=Ly,I.unzipWith=lE,I.update=iM,I.updateWith=sM,I.values=nl,I.valuesIn=oM,I.without=nq,I.words=$E,I.wrap=e$,I.xor=iq,I.xorBy=sq,I.xorWith=oq,I.zip=aq,I.zipObject=lq,I.zipObjectDeep=uq,I.zipWith=cq,I.entries=kE,I.entriesIn=AE,I.extend=RE,I.extendWith=IE,Gy(I,I),I.add=oN,I.attempt=ME,I.camelCase=cM,I.capitalize=TE,I.ceil=aN,I.clamp=aM,I.clone=r$,I.cloneDeep=i$,I.cloneDeepWith=s$,I.cloneWith=n$,I.conformsTo=o$,I.deburr=qE,I.defaultTo=LM,I.divide=lN,I.endsWith=fM,I.eq=Nn,I.escape=dM,I.escapeRegExp=hM,I.every=_q,I.find=Eq,I.findIndex=nE,I.findKey=M$,I.findLast=xq,I.findLastIndex=iE,I.findLastKey=N$,I.floor=uN,I.forEach=cE,I.forEachRight=fE,I.forIn=D$,I.forInRight=F$,I.forOwn=L$,I.forOwnRight=j$,I.get=Wy,I.gt=a$,I.gte=l$,I.has=H$,I.hasIn=Yy,I.head=oE,I.identity=kr,I.includes=Pq,I.indexOf=xT,I.inRange=lM,I.invoke=Y$,I.isArguments=ko,I.isArray=we,I.isArrayBuffer=u$,I.isArrayLike=Or,I.isArrayLikeObject=Ot,I.isBoolean=c$,I.isBuffer=xs,I.isDate=f$,I.isElement=d$,I.isEmpty=h$,I.isEqual=p$,I.isEqualWith=m$,I.isError=By,I.isFinite=g$,I.isFunction=Mi,I.isInteger=SE,I.isLength=uh,I.isMap=bE,I.isMatch=y$,I.isMatchWith=v$,I.isNaN=S$,I.isNative=b$,I.isNil=w$,I.isNull=_$,I.isNumber=_E,I.isObject=St,I.isObjectLike=wt,I.isPlainObject=zu,I.isRegExp=Hy,I.isSafeInteger=E$,I.isSet=wE,I.isString=ch,I.isSymbol=Yr,I.isTypedArray=rl,I.isUndefined=x$,I.isWeakMap=C$,I.isWeakSet=R$,I.join=PT,I.kebabCase=pM,I.last=cn,I.lastIndexOf=kT,I.lowerCase=mM,I.lowerFirst=gM,I.lt=I$,I.lte=O$,I.max=cN,I.maxBy=fN,I.mean=dN,I.meanBy=hN,I.min=pN,I.minBy=mN,I.stubArray=Zy,I.stubFalse=Xy,I.stubObject=eN,I.stubString=tN,I.stubTrue=rN,I.multiply=gN,I.nth=AT,I.noConflict=YM,I.noop=Qy,I.now=oh,I.pad=yM,I.padEnd=vM,I.padStart=SM,I.parseInt=bM,I.random=uM,I.reduce=$q,I.reduceRight=Mq,I.repeat=_M,I.replace=wM,I.result=X$,I.round=yN,I.runInContext=j,I.sample=Dq,I.size=jq,I.snakeCase=EM,I.some=Uq,I.sortedIndex=FT,I.sortedIndexBy=LT,I.sortedIndexOf=jT,I.sortedLastIndex=UT,I.sortedLastIndexBy=BT,I.sortedLastIndexOf=HT,I.startCase=CM,I.startsWith=RM,I.subtract=vN,I.sum=SN,I.sumBy=bN,I.template=IM,I.times=nN,I.toFinite=Ni,I.toInteger=Ee,I.toLength=xE,I.toLower=OM,I.toNumber=fn,I.toSafeInteger=P$,I.toString=et,I.toUpper=PM,I.trim=kM,I.trimEnd=AM,I.trimStart=TM,I.truncate=qM,I.unescape=$M,I.uniqueId=sN,I.upperCase=MM,I.upperFirst=Jy,I.each=cE,I.eachRight=fE,I.first=oE,Gy(I,(function(){var o={};return ln(I,function(l,d){Qe.call(I.prototype,d)||(o[d]=l)}),o})(),{chain:!1}),I.VERSION=e,hr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){I[o].placeholder=I}),hr(["drop","take"],function(o,l){qe.prototype[o]=function(d){d=d===t?1:ht(Ee(d),0);var y=this.__filtered__&&!l?new qe(this):this.clone();return y.__filtered__?y.__takeCount__=Lt(d,y.__takeCount__):y.__views__.push({size:Lt(d,Ae),type:o+(y.__dir__<0?"Right":"")}),y},qe.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),hr(["filter","map","takeWhile"],function(o,l){var d=l+1,y=d==z||d==ae;qe.prototype[o]=function(_){var O=this.clone();return O.__iteratees__.push({iteratee:pe(_,3),type:d}),O.__filtered__=O.__filtered__||y,O}}),hr(["head","last"],function(o,l){var d="take"+(l?"Right":"");qe.prototype[o]=function(){return this[d](1).value()[0]}}),hr(["initial","tail"],function(o,l){var d="drop"+(l?"":"Right");qe.prototype[o]=function(){return this.__filtered__?new qe(this):this[d](1)}}),qe.prototype.compact=function(){return this.filter(kr)},qe.prototype.find=function(o){return this.filter(o).head()},qe.prototype.findLast=function(o){return this.reverse().find(o)},qe.prototype.invokeMap=Pe(function(o,l){return typeof o=="function"?new qe(this):this.map(function(d){return Ro(d,o,l)})}),qe.prototype.reject=function(o){return this.filter(lh(pe(o)))},qe.prototype.slice=function(o,l){o=Ee(o);var d=this;return d.__filtered__&&(o>0||l<0)?new qe(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),l!==t&&(l=Ee(l),d=l<0?d.dropRight(-l):d.take(l-o)),d)},qe.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},qe.prototype.toArray=function(){return this.take(Ae)},ln(qe.prototype,function(o,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),y=/^(?:head|last)$/.test(l),_=I[y?"take"+(l=="last"?"Right":""):l],O=y||/^find/.test(l);_&&(I.prototype[l]=function(){var q=this.__wrapped__,M=y?[1]:arguments,U=q instanceof qe,G=M[0],Q=U||we(q),ee=function(Fe){var Ue=_.apply(I,si([Fe],M));return y&&re?Ue[0]:Ue};Q&&d&&typeof G=="function"&&G.length!=1&&(U=Q=!1);var re=this.__chain__,ue=!!this.__actions__.length,me=O&&!re,Ie=U&&!ue;if(!O&&Q){q=Ie?q:new qe(this);var he=o.apply(q,M);return he.__actions__.push({func:ih,args:[ee],thisArg:t}),new tr(he,re)}return me&&Ie?o.apply(this,M):(he=this.thru(ee),me?y?he.value()[0]:he.value():he)})}),hr(["pop","push","shift","sort","splice","unshift"],function(o){var l=mo[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);I.prototype[o]=function(){var _=arguments;if(y&&!this.__chain__){var O=this.value();return l.apply(we(O)?O:[],_)}return this[d](function(q){return l.apply(we(q)?q:[],_)})}}),ln(qe.prototype,function(o,l){var d=I[l];if(d){var y=d.name+"";Qe.call(gs,y)||(gs[y]=[]),gs[y].push({name:l,func:d})}}),gs[Qd(t,A).name]=[{name:"wrapper",func:t}],qe.prototype.clone=Jg,qe.prototype.reverse=zg,qe.prototype.value=Nu,I.prototype.at=dq,I.prototype.chain=hq,I.prototype.commit=pq,I.prototype.next=mq,I.prototype.plant=yq,I.prototype.reverse=vq,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Sq,I.prototype.first=I.prototype.head,vo&&(I.prototype[vo]=gq),I}),ai=kg();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(qt._=ai,define(function(){return ai})):Ge?((Ge.exports=ai)._=ai,Ia._=ai):qt._=ai}).call(ol)});var ex=F((dv,al)=>{(function(t,e){typeof dv=="object"&&typeof al<"u"?al.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(dv,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(c){t=c}function n(c){return c instanceof Array||Object.prototype.toString.call(c)==="[object Array]"}function i(c){return c!=null&&Object.prototype.toString.call(c)==="[object Object]"}function s(c,p){return Object.prototype.hasOwnProperty.call(c,p)}function a(c){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(c).length===0;var p;for(p in c)if(s(c,p))return!1;return!0}function u(c){return c===void 0}function f(c){return typeof c=="number"||Object.prototype.toString.call(c)==="[object Number]"}function h(c){return c instanceof Date||Object.prototype.toString.call(c)==="[object Date]"}function g(c,p){var v=[],b,R=c.length;for(b=0;b<R;++b)v.push(p(c[b],b));return v}function m(c,p){for(var v in p)s(p,v)&&(c[v]=p[v]);return s(p,"toString")&&(c.toString=p.toString),s(p,"valueOf")&&(c.valueOf=p.valueOf),c}function S(c,p,v,b){return qa(c,p,v,b,!0).utc()}function E(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function x(c){return c._pf==null&&(c._pf=E()),c._pf}var C;Array.prototype.some?C=Array.prototype.some:C=function(c){var p=Object(this),v=p.length>>>0,b;for(b=0;b<v;b++)if(b in p&&c.call(this,p[b],b,p))return!0;return!1};function A(c){var p=null,v=!1,b=c._d&&!isNaN(c._d.getTime());if(b&&(p=x(c),v=C.call(p.parsedDateParts,function(R){return R!=null}),b=p.overflow<0&&!p.empty&&!p.invalidEra&&!p.invalidMonth&&!p.invalidWeekday&&!p.weekdayMismatch&&!p.nullInput&&!p.invalidFormat&&!p.userInvalidated&&(!p.meridiem||p.meridiem&&v),c._strict&&(b=b&&p.charsLeftOver===0&&p.unusedTokens.length===0&&p.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(c))c._isValid=b;else return b;return c._isValid}function T(c){var p=S(NaN);return c!=null?m(x(p),c):x(p).userInvalidated=!0,p}var B=e.momentProperties=[],Y=!1;function H(c,p){var v,b,R,$=B.length;if(u(p._isAMomentObject)||(c._isAMomentObject=p._isAMomentObject),u(p._i)||(c._i=p._i),u(p._f)||(c._f=p._f),u(p._l)||(c._l=p._l),u(p._strict)||(c._strict=p._strict),u(p._tzm)||(c._tzm=p._tzm),u(p._isUTC)||(c._isUTC=p._isUTC),u(p._offset)||(c._offset=p._offset),u(p._pf)||(c._pf=x(p)),u(p._locale)||(c._locale=p._locale),$>0)for(v=0;v<$;v++)b=B[v],R=p[b],u(R)||(c[b]=R);return c}function K(c){H(this,c),this._d=new Date(c._d!=null?c._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Y===!1&&(Y=!0,e.updateOffset(this),Y=!1)}function X(c){return c instanceof K||c!=null&&c._isAMomentObject!=null}function k(c){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+c)}function w(c,p){var v=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),v){var b=[],R,$,W,ie=arguments.length;for($=0;$<ie;$++){if(R="",typeof arguments[$]=="object"){R+=`
|
|
21
21
|
[`+$+"] ";for(W in arguments[0])s(arguments[0],W)&&(R+=W+": "+arguments[0][W]+", ");R=R.slice(0,-2)}else R=arguments[$];b.push(R)}k(c+`
|
|
22
22
|
Arguments: `+Array.prototype.slice.call(b).join("")+`
|
|
23
|
-
`+new Error().stack),y=!1}return p.apply(this,arguments)},p)}var P={};function N(c,p){e.deprecationHandler!=null&&e.deprecationHandler(c,p),P[c]||(k(p),P[c]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function D(c){return typeof Function<"u"&&c instanceof Function||Object.prototype.toString.call(c)==="[object Function]"}function L(c){var p,y;for(y in c)s(c,y)&&(p=c[y],D(p)?this[y]=p:this["_"+y]=p);this._config=c,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function z(c,p){var y=m({},c),b;for(b in p)s(p,b)&&(i(c[b])&&i(p[b])?(y[b]={},m(y[b],c[b]),m(y[b],p[b])):p[b]!=null?y[b]=p[b]:delete y[b]);for(b in c)s(c,b)&&!s(p,b)&&i(c[b])&&(y[b]=m({},y[b]));return y}function Z(c){c!=null&&this.set(c)}var ie;Object.keys?ie=Object.keys:ie=function(c){var p,y=[];for(p in c)s(c,p)&&y.push(p);return y};var fe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function bt(c,p,y){var b=this._calendar[c]||this._calendar.sameElse;return D(b)?b.call(p,y):b}function we(c,p,y){var b=""+Math.abs(c),R=p-b.length,$=c>=0;return($?y?"+":"":"-")+Math.pow(10,Math.max(0,R)).toString().substr(1)+b}var he=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ze=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,_t={},Mt={};function le(c,p,y,b){var R=b;typeof b=="string"&&(R=function(){return this[b]()}),c&&(Mt[c]=R),p&&(Mt[p[0]]=function(){return we(R.apply(this,arguments),p[1],p[2])}),y&&(Mt[y]=function(){return this.localeData().ordinal(R.apply(this,arguments),c)})}function ei(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function su(c){var p=c.match(he),y,b;for(y=0,b=p.length;y<b;y++)Mt[p[y]]?p[y]=Mt[p[y]]:p[y]=ei(p[y]);return function(R){var $="",W;for(W=0;W<b;W++)$+=D(p[W])?p[W].call(R,c):p[W];return $}}function ct(c,p){return c.isValid()?(p=_n(p,c.localeData()),_t[p]=_t[p]||su(p),_t[p](c)):c.localeData().invalidDate()}function _n(c,p){var y=5;function b(R){return p.longDateFormat(R)||R}for(Ze.lastIndex=0;y>=0&&Ze.test(c);)c=c.replace(Ze,b),Ze.lastIndex=0,y-=1;return c}var as={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function jt(c){var p=this._longDateFormat[c],y=this._longDateFormat[c.toUpperCase()];return p||!y?p:(this._longDateFormat[c]=y.match(he).map(function(b){return b==="MMMM"||b==="MM"||b==="DD"||b==="dddd"?b.slice(1):b}).join(""),this._longDateFormat[c])}var ft="Invalid date";function ti(){return this._invalidDate}var rr="%d",Qr=/\d{1,2}/;function Lm(c){return this._ordinal.replace("%d",c)}var wn={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Lf(c,p,y,b){var R=this._relativeTime[y];return D(R)?R(c,p,y,b):R.replace(/%d/i,c)}function jm(c,p){var y=this._relativeTime[c>0?"future":"past"];return D(y)?y(p):y.replace(/%s/i,p)}var ls={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function gt(c){return typeof c=="string"?ls[c]||ls[c.toLowerCase()]:void 0}function Ri(c){var p={},y,b;for(b in c)s(c,b)&&(y=gt(b),y&&(p[y]=c[b]));return p}var ma={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Um(c){var p=[],y;for(y in c)s(c,y)&&p.push({unit:y,priority:ma[y]});return p.sort(function(b,R){return b.priority-R.priority}),p}var us=/\d/,dr=/\d\d/,cs=/\d{3}/,ri=/\d{4}/,fs=/[+-]?\d{6}/,Xe=/\d\d?/,ga=/\d\d\d\d?/,ya=/\d\d\d\d\d\d?/,ds=/\d{1,3}/,uo=/\d{1,4}/,hs=/[+-]?\d{1,6}/,ni=/\d+/,ps=/[+-]?\d+/,Bm=/Z|[+-]\d\d:?\d\d/gi,va=/Z|[+-]\d\d(?::?\d\d)?/gi,Hm=/[+-]?\d+(\.\d{1,3})?/,ms=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ii=/^[1-9]\d?/,ou=/^([1-9]\d|\d)/,Sa;Sa={};function oe(c,p,y){Sa[c]=D(p)?p:function(b,R){return b&&y?y:p}}function Vm(c,p){return s(Sa,c)?Sa[c](p._strict,p._locale):new RegExp(jf(c))}function jf(c){return En(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(p,y,b,R,$){return y||b||R||$}))}function En(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function _r(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function $e(c){var p=+c,y=0;return p!==0&&isFinite(p)&&(y=_r(p)),y}var co={};function Ke(c,p){var y,b=p,R;for(typeof c=="string"&&(c=[c]),f(p)&&(b=function($,W){W[p]=$e($)}),R=c.length,y=0;y<R;y++)co[c[y]]=b}function Oi(c,p){Ke(c,function(y,b,R,$){R._w=R._w||{},p(y,R._w,R,$)})}function Wm(c,p,y){p!=null&&s(co,c)&&co[c](p,y._a,y,c)}function ba(c){return c%4===0&&c%100!==0||c%400===0}var Vt=0,Cn=1,Zr=2,Pt=3,jr=4,xn=5,ii=6,Ym=7,Jm=8;le("Y",0,0,function(){var c=this.year();return c<=9999?we(c,4):"+"+c}),le(0,["YY",2],0,function(){return this.year()%100}),le(0,["YYYY",4],0,"year"),le(0,["YYYYY",5],0,"year"),le(0,["YYYYYY",6,!0],0,"year"),oe("Y",ps),oe("YY",Xe,dr),oe("YYYY",uo,ri),oe("YYYYY",hs,fs),oe("YYYYYY",hs,fs),Ke(["YYYYY","YYYYYY"],Vt),Ke("YYYY",function(c,p){p[Vt]=c.length===2?e.parseTwoDigitYear(c):$e(c)}),Ke("YY",function(c,p){p[Vt]=e.parseTwoDigitYear(c)}),Ke("Y",function(c,p){p[Vt]=parseInt(c,10)});function fo(c){return ba(c)?366:365}e.parseTwoDigitYear=function(c){return $e(c)+($e(c)>68?1900:2e3)};var Uf=gs("FullYear",!0);function zm(){return ba(this.year())}function gs(c,p){return function(y){return y!=null?(Bf(this,c,y),e.updateOffset(this,p),this):si(this,c)}}function si(c,p){if(!c.isValid())return NaN;var y=c._d,b=c._isUTC;switch(p){case"Milliseconds":return b?y.getUTCMilliseconds():y.getMilliseconds();case"Seconds":return b?y.getUTCSeconds():y.getSeconds();case"Minutes":return b?y.getUTCMinutes():y.getMinutes();case"Hours":return b?y.getUTCHours():y.getHours();case"Date":return b?y.getUTCDate():y.getDate();case"Day":return b?y.getUTCDay():y.getDay();case"Month":return b?y.getUTCMonth():y.getMonth();case"FullYear":return b?y.getUTCFullYear():y.getFullYear();default:return NaN}}function Bf(c,p,y){var b,R,$,W,se;if(!(!c.isValid()||isNaN(y))){switch(b=c._d,R=c._isUTC,p){case"Milliseconds":return void(R?b.setUTCMilliseconds(y):b.setMilliseconds(y));case"Seconds":return void(R?b.setUTCSeconds(y):b.setSeconds(y));case"Minutes":return void(R?b.setUTCMinutes(y):b.setMinutes(y));case"Hours":return void(R?b.setUTCHours(y):b.setHours(y));case"Date":return void(R?b.setUTCDate(y):b.setDate(y));case"FullYear":break;default:return}$=y,W=c.month(),se=c.date(),se=se===29&&W===1&&!ba($)?28:se,R?b.setUTCFullYear($,W,se):b.setFullYear($,W,se)}}function _a(c){return c=gt(c),D(this[c])?this[c]():this}function Km(c,p){if(typeof c=="object"){c=Ri(c);var y=Um(c),b,R=y.length;for(b=0;b<R;b++)this[y[b].unit](c[y[b].unit])}else if(c=gt(c),D(this[c]))return this[c](p);return this}function Gm(c,p){return(c%p+p)%p}var yt;Array.prototype.indexOf?yt=Array.prototype.indexOf:yt=function(c){var p;for(p=0;p<this.length;++p)if(this[p]===c)return p;return-1};function wa(c,p){if(isNaN(c)||isNaN(p))return NaN;var y=Gm(p,12);return c+=(p-y)/12,y===1?ba(c)?29:28:31-y%7%2}le("M",["MM",2],"Mo",function(){return this.month()+1}),le("MMM",0,0,function(c){return this.localeData().monthsShort(this,c)}),le("MMMM",0,0,function(c){return this.localeData().months(this,c)}),oe("M",Xe,Ii),oe("MM",Xe,dr),oe("MMM",function(c,p){return p.monthsShortRegex(c)}),oe("MMMM",function(c,p){return p.monthsRegex(c)}),Ke(["M","MM"],function(c,p){p[Cn]=$e(c)-1}),Ke(["MMM","MMMM"],function(c,p,y,b){var R=y._locale.monthsParse(c,b,y._strict);R!=null?p[Cn]=R:C(y).invalidMonth=c});var Hf="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),au="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Vf=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Qm=ms,Zm=ms;function Xm(c,p){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||Vf).test(p)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function Wf(c,p){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[Vf.test(p)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Yf(c,p,y){var b,R,$,W=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)$=S([2e3,b]),this._shortMonthsParse[b]=this.monthsShort($,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months($,"").toLocaleLowerCase();return y?p==="MMM"?(R=yt.call(this._shortMonthsParse,W),R!==-1?R:null):(R=yt.call(this._longMonthsParse,W),R!==-1?R:null):p==="MMM"?(R=yt.call(this._shortMonthsParse,W),R!==-1?R:(R=yt.call(this._longMonthsParse,W),R!==-1?R:null)):(R=yt.call(this._longMonthsParse,W),R!==-1?R:(R=yt.call(this._shortMonthsParse,W),R!==-1?R:null))}function Jf(c,p,y){var b,R,$;if(this._monthsParseExact)return Yf.call(this,c,p,y);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),b=0;b<12;b++){if(R=S([2e3,b]),y&&!this._longMonthsParse[b]&&(this._longMonthsParse[b]=new RegExp("^"+this.months(R,"").replace(".","")+"$","i"),this._shortMonthsParse[b]=new RegExp("^"+this.monthsShort(R,"").replace(".","")+"$","i")),!y&&!this._monthsParse[b]&&($="^"+this.months(R,"")+"|^"+this.monthsShort(R,""),this._monthsParse[b]=new RegExp($.replace(".",""),"i")),y&&p==="MMMM"&&this._longMonthsParse[b].test(c))return b;if(y&&p==="MMM"&&this._shortMonthsParse[b].test(c))return b;if(!y&&this._monthsParse[b].test(c))return b}}function Ea(c,p){if(!c.isValid())return c;if(typeof p=="string"){if(/^\d+$/.test(p))p=$e(p);else if(p=c.localeData().monthsParse(p),!f(p))return c}var y=p,b=c.date();return b=b<29?b:Math.min(b,wa(c.year(),y)),c._isUTC?c._d.setUTCMonth(y,b):c._d.setMonth(y,b),c}function zf(c){return c!=null?(Ea(this,c),e.updateOffset(this,!0),this):si(this,"Month")}function Kf(){return wa(this.year(),this.month())}function Ca(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Qf.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Qm),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function Gf(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Qf.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Zm),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function Qf(){function c(ye,Oe){return Oe.length-ye.length}var p=[],y=[],b=[],R,$,W,se;for(R=0;R<12;R++)$=S([2e3,R]),W=En(this.monthsShort($,"")),se=En(this.months($,"")),p.push(W),y.push(se),b.push(se),b.push(W);p.sort(c),y.sort(c),b.sort(c),this._monthsRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+y.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+p.join("|")+")","i")}function Zf(c,p,y,b,R,$,W){var se;return c<100&&c>=0?(se=new Date(c+400,p,y,b,R,$,W),isFinite(se.getFullYear())&&se.setFullYear(c)):se=new Date(c,p,y,b,R,$,W),se}function ys(c){var p,y;return c<100&&c>=0?(y=Array.prototype.slice.call(arguments),y[0]=c+400,p=new Date(Date.UTC.apply(null,y)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(c)):p=new Date(Date.UTC.apply(null,arguments)),p}function vs(c,p,y){var b=7+p-y,R=(7+ys(c,0,b).getUTCDay()-p)%7;return-R+b-1}function Xf(c,p,y,b,R){var $=(7+y-b)%7,W=vs(c,b,R),se=1+7*(p-1)+$+W,ye,Oe;return se<=0?(ye=c-1,Oe=fo(ye)+se):se>fo(c)?(ye=c+1,Oe=se-fo(c)):(ye=c,Oe=se),{year:ye,dayOfYear:Oe}}function Ss(c,p,y){var b=vs(c.year(),p,y),R=Math.floor((c.dayOfYear()-b-1)/7)+1,$,W;return R<1?(W=c.year()-1,$=R+Ur(W,p,y)):R>Ur(c.year(),p,y)?($=R-Ur(c.year(),p,y),W=c.year()+1):(W=c.year(),$=R),{week:$,year:W}}function Ur(c,p,y){var b=vs(c,p,y),R=vs(c+1,p,y);return(fo(c)-b+R)/7}le("w",["ww",2],"wo","week"),le("W",["WW",2],"Wo","isoWeek"),oe("w",Xe,Ii),oe("ww",Xe,dr),oe("W",Xe,Ii),oe("WW",Xe,dr),Oi(["w","ww","W","WW"],function(c,p,y,b){p[b.substr(0,1)]=$e(c)});function lu(c){return Ss(c,this._week.dow,this._week.doy).week}var bs={dow:0,doy:6};function ed(){return this._week.dow}function td(){return this._week.doy}function eg(c){var p=this.localeData().week(this);return c==null?p:this.add((c-p)*7,"d")}function rd(c){var p=Ss(this,1,4).week;return c==null?p:this.add((c-p)*7,"d")}le("d",0,"do","day"),le("dd",0,0,function(c){return this.localeData().weekdaysMin(this,c)}),le("ddd",0,0,function(c){return this.localeData().weekdaysShort(this,c)}),le("dddd",0,0,function(c){return this.localeData().weekdays(this,c)}),le("e",0,0,"weekday"),le("E",0,0,"isoWeekday"),oe("d",Xe),oe("e",Xe),oe("E",Xe),oe("dd",function(c,p){return p.weekdaysMinRegex(c)}),oe("ddd",function(c,p){return p.weekdaysShortRegex(c)}),oe("dddd",function(c,p){return p.weekdaysRegex(c)}),Oi(["dd","ddd","dddd"],function(c,p,y,b){var R=y._locale.weekdaysParse(c,b,y._strict);R!=null?p.d=R:C(y).invalidWeekday=c}),Oi(["d","e","E"],function(c,p,y,b){p[b]=$e(c)});function nd(c,p){return typeof c!="string"?c:isNaN(c)?(c=p.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function id(c,p){return typeof c=="string"?p.weekdaysParse(c)%7||7:isNaN(c)?null:c}function xa(c,p){return c.slice(p,7).concat(c.slice(0,p))}var tg="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),sd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),rg="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),od=ms,ng=ms,ig=ms;function sg(c,p){var y=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return c===!0?xa(y,this._week.dow):c?y[c.day()]:y}function og(c){return c===!0?xa(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function uu(c){return c===!0?xa(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function ag(c,p,y){var b,R,$,W=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)$=S([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin($,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort($,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays($,"").toLocaleLowerCase();return y?p==="dddd"?(R=yt.call(this._weekdaysParse,W),R!==-1?R:null):p==="ddd"?(R=yt.call(this._shortWeekdaysParse,W),R!==-1?R:null):(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null):p==="dddd"?(R=yt.call(this._weekdaysParse,W),R!==-1||(R=yt.call(this._shortWeekdaysParse,W),R!==-1)?R:(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null)):p==="ddd"?(R=yt.call(this._shortWeekdaysParse,W),R!==-1||(R=yt.call(this._weekdaysParse,W),R!==-1)?R:(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null)):(R=yt.call(this._minWeekdaysParse,W),R!==-1||(R=yt.call(this._weekdaysParse,W),R!==-1)?R:(R=yt.call(this._shortWeekdaysParse,W),R!==-1?R:null))}function lg(c,p,y){var b,R,$;if(this._weekdaysParseExact)return ag.call(this,c,p,y);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),b=0;b<7;b++){if(R=S([2e3,1]).day(b),y&&!this._fullWeekdaysParse[b]&&(this._fullWeekdaysParse[b]=new RegExp("^"+this.weekdays(R,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[b]=new RegExp("^"+this.weekdaysShort(R,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[b]=new RegExp("^"+this.weekdaysMin(R,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[b]||($="^"+this.weekdays(R,"")+"|^"+this.weekdaysShort(R,"")+"|^"+this.weekdaysMin(R,""),this._weekdaysParse[b]=new RegExp($.replace(".",""),"i")),y&&p==="dddd"&&this._fullWeekdaysParse[b].test(c))return b;if(y&&p==="ddd"&&this._shortWeekdaysParse[b].test(c))return b;if(y&&p==="dd"&&this._minWeekdaysParse[b].test(c))return b;if(!y&&this._weekdaysParse[b].test(c))return b}}function ug(c){if(!this.isValid())return c!=null?this:NaN;var p=si(this,"Day");return c!=null?(c=nd(c,this.localeData()),this.add(c-p,"d")):p}function cg(c){if(!this.isValid())return c!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return c==null?p:this.add(c-p,"d")}function fg(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var p=id(c,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function st(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=od),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function rt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ng),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function dg(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ig),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function cu(){function c(Kt,on){return on.length-Kt.length}var p=[],y=[],b=[],R=[],$,W,se,ye,Oe;for($=0;$<7;$++)W=S([2e3,1]).day($),se=En(this.weekdaysMin(W,"")),ye=En(this.weekdaysShort(W,"")),Oe=En(this.weekdays(W,"")),p.push(se),y.push(ye),b.push(Oe),R.push(se),R.push(ye),R.push(Oe);p.sort(c),y.sort(c),b.sort(c),R.sort(c),this._weekdaysRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+y.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function fu(){return this.hours()%12||12}function hg(){return this.hours()||24}le("H",["HH",2],0,"hour"),le("h",["hh",2],0,fu),le("k",["kk",2],0,hg),le("hmm",0,0,function(){return""+fu.apply(this)+we(this.minutes(),2)}),le("hmmss",0,0,function(){return""+fu.apply(this)+we(this.minutes(),2)+we(this.seconds(),2)}),le("Hmm",0,0,function(){return""+this.hours()+we(this.minutes(),2)}),le("Hmmss",0,0,function(){return""+this.hours()+we(this.minutes(),2)+we(this.seconds(),2)});function ad(c,p){le(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}ad("a",!0),ad("A",!1);function ld(c,p){return p._meridiemParse}oe("a",ld),oe("A",ld),oe("H",Xe,ou),oe("h",Xe,Ii),oe("k",Xe,Ii),oe("HH",Xe,dr),oe("hh",Xe,dr),oe("kk",Xe,dr),oe("hmm",ga),oe("hmmss",ya),oe("Hmm",ga),oe("Hmmss",ya),Ke(["H","HH"],Pt),Ke(["k","kk"],function(c,p,y){var b=$e(c);p[Pt]=b===24?0:b}),Ke(["a","A"],function(c,p,y){y._isPm=y._locale.isPM(c),y._meridiem=c}),Ke(["h","hh"],function(c,p,y){p[Pt]=$e(c),C(y).bigHour=!0}),Ke("hmm",function(c,p,y){var b=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b)),C(y).bigHour=!0}),Ke("hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b,2)),p[xn]=$e(c.substr(R)),C(y).bigHour=!0}),Ke("Hmm",function(c,p,y){var b=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b))}),Ke("Hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b,2)),p[xn]=$e(c.substr(R))});function ud(c){return(c+"").toLowerCase().charAt(0)==="p"}var pg=/[ap]\.?m?\.?/i,Nt=gs("Hours",!0);function du(c,p,y){return c>11?y?"pm":"PM":y?"am":"AM"}var oi={calendar:fe,longDateFormat:as,invalidDate:ft,ordinal:rr,dayOfMonthOrdinalParse:Qr,relativeTime:wn,months:Hf,monthsShort:au,week:bs,weekdays:tg,weekdaysMin:rg,weekdaysShort:sd,meridiemParse:pg},ot={},Pi={},Wt;function cd(c,p){var y,b=Math.min(c.length,p.length);for(y=0;y<b;y+=1)if(c[y]!==p[y])return y;return b}function hu(c){return c&&c.toLowerCase().replace("_","-")}function fd(c){for(var p=0,y,b,R,$;p<c.length;){for($=hu(c[p]).split("-"),y=$.length,b=hu(c[p+1]),b=b?b.split("-"):null;y>0;){if(R=ho($.slice(0,y).join("-")),R)return R;if(b&&b.length>=y&&cd($,b)>=y-1)break;y--}p++}return Wt}function dd(c){return!!(c&&c.match("^[^/\\\\]*$"))}function ho(c){var p=null,y;if(ot[c]===void 0&&typeof tl<"u"&&tl&&tl.exports&&dd(c))try{p=Wt._abbr,y=qt,y("./locale/"+c),Rn(p)}catch{ot[c]=null}return ot[c]}function Rn(c,p){var y;return c&&(u(p)?y=wt(c):y=Jt(c,p),y?Wt=y:typeof console<"u"&&console.warn&&console.warn("Locale "+c+" not found. Did you forget to load it?")),Wt._abbr}function Jt(c,p){if(p!==null){var y,b=oi;if(p.abbr=c,ot[c]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),b=ot[c]._config;else if(p.parentLocale!=null)if(ot[p.parentLocale]!=null)b=ot[p.parentLocale]._config;else if(y=ho(p.parentLocale),y!=null)b=y._config;else return Pi[p.parentLocale]||(Pi[p.parentLocale]=[]),Pi[p.parentLocale].push({name:c,config:p}),null;return ot[c]=new Z(z(b,p)),Pi[c]&&Pi[c].forEach(function(R){Jt(R.name,R.config)}),Rn(c),ot[c]}else return delete ot[c],null}function mg(c,p){if(p!=null){var y,b,R=oi;ot[c]!=null&&ot[c].parentLocale!=null?ot[c].set(z(ot[c]._config,p)):(b=ho(c),b!=null&&(R=b._config),p=z(R,p),b==null&&(p.abbr=c),y=new Z(p),y.parentLocale=ot[c],ot[c]=y),Rn(c)}else ot[c]!=null&&(ot[c].parentLocale!=null?(ot[c]=ot[c].parentLocale,c===Rn()&&Rn(c)):ot[c]!=null&&delete ot[c]);return ot[c]}function wt(c){var p;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Wt;if(!n(c)){if(p=ho(c),p)return p;c=[c]}return fd(c)}function gg(){return ie(ot)}function Ra(c){var p,y=c._a;return y&&C(c).overflow===-2&&(p=y[Cn]<0||y[Cn]>11?Cn:y[Zr]<1||y[Zr]>wa(y[Vt],y[Cn])?Zr:y[Pt]<0||y[Pt]>24||y[Pt]===24&&(y[jr]!==0||y[xn]!==0||y[ii]!==0)?Pt:y[jr]<0||y[jr]>59?jr:y[xn]<0||y[xn]>59?xn:y[ii]<0||y[ii]>999?ii:-1,C(c)._overflowDayOfYear&&(p<Vt||p>Zr)&&(p=Zr),C(c)._overflowWeeks&&p===-1&&(p=Ym),C(c)._overflowWeekday&&p===-1&&(p=Jm),C(c).overflow=p),c}var ai=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ia=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pu=/Z|[+-]\d\d(?::?\d\d)?/,et=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Xr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mu=/^\/?Date\((-?\d+)/i,yg=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,gu={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function hd(c){var p,y,b=c._i,R=ai.exec(b)||Ia.exec(b),$,W,se,ye,Oe=et.length,Kt=Xr.length;if(R){for(C(c).iso=!0,p=0,y=Oe;p<y;p++)if(et[p][1].exec(R[1])){W=et[p][0],$=et[p][2]!==!1;break}if(W==null){c._isValid=!1;return}if(R[3]){for(p=0,y=Kt;p<y;p++)if(Xr[p][1].exec(R[3])){se=(R[2]||" ")+Xr[p][0];break}if(se==null){c._isValid=!1;return}}if(!$&&se!=null){c._isValid=!1;return}if(R[4])if(pu.exec(R[4]))ye="Z";else{c._isValid=!1;return}c._f=W+(se||"")+(ye||""),vu(c)}else c._isValid=!1}function vg(c,p,y,b,R,$){var W=[Sg(c),au.indexOf(p),parseInt(y,10),parseInt(b,10),parseInt(R,10)];return $&&W.push(parseInt($,10)),W}function Sg(c){var p=parseInt(c,10);return p<=49?2e3+p:p<=999?1900+p:p}function pd(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Oa(c,p,y){if(c){var b=sd.indexOf(c),R=new Date(p[0],p[1],p[2]).getDay();if(b!==R)return C(y).weekdayMismatch=!0,y._isValid=!1,!1}return!0}function _s(c,p,y){if(c)return gu[c];if(p)return 0;var b=parseInt(y,10),R=b%100,$=(b-R)/100;return $*60+R}function md(c){var p=yg.exec(pd(c._i)),y;if(p){if(y=vg(p[4],p[3],p[2],p[5],p[6],p[7]),!Oa(p[1],y,c))return;c._a=y,c._tzm=_s(p[8],p[9],p[10]),c._d=ys.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),C(c).rfc2822=!0}else c._isValid=!1}function gd(c){var p=mu.exec(c._i);if(p!==null){c._d=new Date(+p[1]);return}if(hd(c),c._isValid===!1)delete c._isValid;else return;if(md(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=E("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(c){c._d=new Date(c._i+(c._useUTC?" UTC":""))});function ki(c,p,y){return c??p??y}function yu(c){var p=new Date(e.now());return c._useUTC?[p.getUTCFullYear(),p.getUTCMonth(),p.getUTCDate()]:[p.getFullYear(),p.getMonth(),p.getDate()]}function po(c){var p,y,b=[],R,$,W;if(!c._d){for(R=yu(c),c._w&&c._a[Zr]==null&&c._a[Cn]==null&&yd(c),c._dayOfYear!=null&&(W=ki(c._a[Vt],R[Vt]),(c._dayOfYear>fo(W)||c._dayOfYear===0)&&(C(c)._overflowDayOfYear=!0),y=ys(W,0,c._dayOfYear),c._a[Cn]=y.getUTCMonth(),c._a[Zr]=y.getUTCDate()),p=0;p<3&&c._a[p]==null;++p)c._a[p]=b[p]=R[p];for(;p<7;p++)c._a[p]=b[p]=c._a[p]==null?p===2?1:0:c._a[p];c._a[Pt]===24&&c._a[jr]===0&&c._a[xn]===0&&c._a[ii]===0&&(c._nextDay=!0,c._a[Pt]=0),c._d=(c._useUTC?ys:Zf).apply(null,b),$=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[Pt]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==$&&(C(c).weekdayMismatch=!0)}}function yd(c){var p,y,b,R,$,W,se,ye,Oe;p=c._w,p.GG!=null||p.W!=null||p.E!=null?($=1,W=4,y=ki(p.GG,c._a[Vt],Ss(nt(),1,4).year),b=ki(p.W,1),R=ki(p.E,1),(R<1||R>7)&&(ye=!0)):($=c._locale._week.dow,W=c._locale._week.doy,Oe=Ss(nt(),$,W),y=ki(p.gg,c._a[Vt],Oe.year),b=ki(p.w,Oe.week),p.d!=null?(R=p.d,(R<0||R>6)&&(ye=!0)):p.e!=null?(R=p.e+$,(p.e<0||p.e>6)&&(ye=!0)):R=$),b<1||b>Ur(y,$,W)?C(c)._overflowWeeks=!0:ye!=null?C(c)._overflowWeekday=!0:(se=Xf(y,b,R,$,W),c._a[Vt]=se.year,c._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function vu(c){if(c._f===e.ISO_8601){hd(c);return}if(c._f===e.RFC_2822){md(c);return}c._a=[],C(c).empty=!0;var p=""+c._i,y,b,R,$,W,se=p.length,ye=0,Oe,Kt;for(R=_n(c._f,c._locale).match(he)||[],Kt=R.length,y=0;y<Kt;y++)$=R[y],b=(p.match(Vm($,c))||[])[0],b&&(W=p.substr(0,p.indexOf(b)),W.length>0&&C(c).unusedInput.push(W),p=p.slice(p.indexOf(b)+b.length),ye+=b.length),Mt[$]?(b?C(c).empty=!1:C(c).unusedTokens.push($),Wm($,b,c)):c._strict&&!b&&C(c).unusedTokens.push($);C(c).charsLeftOver=se-ye,p.length>0&&C(c).unusedInput.push(p),c._a[Pt]<=12&&C(c).bigHour===!0&&c._a[Pt]>0&&(C(c).bigHour=void 0),C(c).parsedDateParts=c._a.slice(0),C(c).meridiem=c._meridiem,c._a[Pt]=Su(c._locale,c._a[Pt],c._meridiem),Oe=C(c).era,Oe!==null&&(c._a[Vt]=c._locale.erasConvertYear(Oe,c._a[Vt])),po(c),Ra(c)}function Su(c,p,y){var b;return y==null?p:c.meridiemHour!=null?c.meridiemHour(p,y):(c.isPM!=null&&(b=c.isPM(y),b&&p<12&&(p+=12),!b&&p===12&&(p=0)),p)}function bu(c){var p,y,b,R,$,W,se=!1,ye=c._f.length;if(ye===0){C(c).invalidFormat=!0,c._d=new Date(NaN);return}for(R=0;R<ye;R++)$=0,W=!1,p=V({},c),c._useUTC!=null&&(p._useUTC=c._useUTC),p._f=c._f[R],vu(p),A(p)&&(W=!0),$+=C(p).charsLeftOver,$+=C(p).unusedTokens.length*10,C(p).score=$,se?$<b&&(b=$,y=p):(b==null||$<b||W)&&(b=$,y=p,W&&(se=!0));m(c,y||p)}function bg(c){if(!c._d){var p=Ri(c._i),y=p.day===void 0?p.date:p.day;c._a=g([p.year,p.month,y,p.hour,p.minute,p.second,p.millisecond],function(b){return b&&parseInt(b,10)}),po(c)}}function vd(c){var p=new K(Ra(nr(c)));return p._nextDay&&(p.add(1,"d"),p._nextDay=void 0),p}function nr(c){var p=c._i,y=c._f;return c._locale=c._locale||wt(c._l),p===null||y===void 0&&p===""?T({nullInput:!0}):(typeof p=="string"&&(c._i=p=c._locale.preparse(p)),ee(p)?new K(Ra(p)):(h(p)?c._d=p:n(y)?bu(c):y?vu(c):_u(c),A(c)||(c._d=null),c))}function _u(c){var p=c._i;u(p)?c._d=new Date(e.now()):h(p)?c._d=new Date(p.valueOf()):typeof p=="string"?gd(c):n(p)?(c._a=g(p.slice(0),function(y){return parseInt(y,10)}),po(c)):i(p)?bg(c):f(p)?c._d=new Date(p):e.createFromInputFallback(c)}function ws(c,p,y,b,R){var $={};return(p===!0||p===!1)&&(b=p,p=void 0),(y===!0||y===!1)&&(b=y,y=void 0),(i(c)&&a(c)||n(c)&&c.length===0)&&(c=void 0),$._isAMomentObject=!0,$._useUTC=$._isUTC=R,$._l=y,$._i=c,$._f=p,$._strict=b,vd($)}function nt(c,p,y,b){return ws(c,p,y,b,!1)}var Sd=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=nt.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:T()}),_g=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=nt.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:T()});function bd(c,p){var y,b;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return nt();for(y=p[0],b=1;b<p.length;++b)(!p[b].isValid()||p[b][c](y))&&(y=p[b]);return y}function wg(){var c=[].slice.call(arguments,0);return bd("isBefore",c)}function Eg(){var c=[].slice.call(arguments,0);return bd("isAfter",c)}var Cg=function(){return Date.now?Date.now():+new Date},en=["year","quarter","month","week","day","hour","minute","second","millisecond"];function xg(c){var p,y=!1,b,R=en.length;for(p in c)if(s(c,p)&&!(yt.call(en,p)!==-1&&(c[p]==null||!isNaN(c[p]))))return!1;for(b=0;b<R;++b)if(c[en[b]]){if(y)return!1;parseFloat(c[en[b]])!==$e(c[en[b]])&&(y=!0)}return!0}function Rg(){return this._isValid}function wu(){return Ae(NaN)}function mo(c){var p=Ri(c),y=p.year||0,b=p.quarter||0,R=p.month||0,$=p.week||p.isoWeek||0,W=p.day||0,se=p.hour||0,ye=p.minute||0,Oe=p.second||0,Kt=p.millisecond||0;this._isValid=xg(p),this._milliseconds=+Kt+Oe*1e3+ye*6e4+se*1e3*60*60,this._days=+W+$*7,this._months=+R+b*3+y*12,this._data={},this._locale=wt(),this._bubble()}function Br(c){return c instanceof mo}function Es(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function Ig(c,p,y){var b=Math.min(c.length,p.length),R=Math.abs(c.length-p.length),$=0,W;for(W=0;W<b;W++)(y&&c[W]!==p[W]||!y&&$e(c[W])!==$e(p[W]))&&$++;return $+R}function _d(c,p){le(c,0,0,function(){var y=this.utcOffset(),b="+";return y<0&&(y=-y,b="-"),b+we(~~(y/60),2)+p+we(~~y%60,2)})}_d("Z",":"),_d("ZZ",""),oe("Z",va),oe("ZZ",va),Ke(["Z","ZZ"],function(c,p,y){y._useUTC=!0,y._tzm=li(va,c)});var Og=/([\+\-]|\d\d)/gi;function li(c,p){var y=(p||"").match(c),b,R,$;return y===null?null:(b=y[y.length-1]||[],R=(b+"").match(Og)||["-",0,0],$=+(R[1]*60)+$e(R[2]),$===0?0:R[0]==="+"?$:-$)}function hr(c,p){var y,b;return p._isUTC?(y=p.clone(),b=(ee(c)||h(c)?c.valueOf():nt(c).valueOf())-y.valueOf(),y._d.setTime(y._d.valueOf()+b),e.updateOffset(y,!1),y):nt(c).local()}function Pa(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function Pg(c,p,y){var b=this._offset||0,R;if(!this.isValid())return c!=null?this:NaN;if(c!=null){if(typeof c=="string"){if(c=li(va,c),c===null)return this}else Math.abs(c)<16&&!y&&(c=c*60);return!this._isUTC&&p&&(R=Pa(this)),this._offset=c,this._isUTC=!0,R!=null&&this.add(R,"m"),b!==c&&(!p||this._changeInProgress?Ed(this,Ae(c-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:Pa(this)}function kg(c,p){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,p),this):-this.utcOffset()}function Ag(c){return this.utcOffset(0,c)}function Tg(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(Pa(this),"m")),this}function qg(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=li(Bm,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function ui(c){return this.isValid()?(c=c?nt(c).utcOffset():0,(this.utcOffset()-c)%60===0):!1}function U(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function J(){if(!u(this._isDSTShifted))return this._isDSTShifted;var c={},p;return V(c,this),c=nr(c),c._a?(p=c._isUTC?S(c._a):nt(c._a),this._isDSTShifted=this.isValid()&&Ig(c._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function H(){return this.isValid()?!this._isUTC:!1}function ae(){return this.isValid()?this._isUTC:!1}function ve(){return this.isValid()?this._isUTC&&this._offset===0:!1}var We=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,kt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ae(c,p){var y=c,b=null,R,$,W;return Br(c)?y={ms:c._milliseconds,d:c._days,M:c._months}:f(c)||!isNaN(+c)?(y={},p?y[p]=+c:y.milliseconds=+c):(b=We.exec(c))?(R=b[1]==="-"?-1:1,y={y:0,d:$e(b[Zr])*R,h:$e(b[Pt])*R,m:$e(b[jr])*R,s:$e(b[xn])*R,ms:$e(Es(b[ii]*1e3))*R}):(b=kt.exec(c))?(R=b[1]==="-"?-1:1,y={y:In(b[2],R),M:In(b[3],R),w:In(b[4],R),d:In(b[5],R),h:In(b[6],R),m:In(b[7],R),s:In(b[8],R)}):y==null?y={}:typeof y=="object"&&("from"in y||"to"in y)&&(W=wr(nt(y.from),nt(y.to)),y={},y.ms=W.milliseconds,y.M=W.months),$=new mo(y),Br(c)&&s(c,"_locale")&&($._locale=c._locale),Br(c)&&s(c,"_isValid")&&($._isValid=c._isValid),$}Ae.fn=mo.prototype,Ae.invalid=wu;function In(c,p){var y=c&&parseFloat(c.replace(",","."));return(isNaN(y)?0:y)*p}function wd(c,p){var y={};return y.months=p.month()-c.month()+(p.year()-c.year())*12,c.clone().add(y.months,"M").isAfter(p)&&--y.months,y.milliseconds=+p-+c.clone().add(y.months,"M"),y}function wr(c,p){var y;return c.isValid()&&p.isValid()?(p=hr(p,c),c.isBefore(p)?y=wd(c,p):(y=wd(p,c),y.milliseconds=-y.milliseconds,y.months=-y.months),y):{milliseconds:0,months:0}}function go(c,p){return function(y,b){var R,$;return b!==null&&!isNaN(+b)&&(N(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),$=y,y=b,b=$),R=Ae(y,b),Ed(this,R,c),this}}function Ed(c,p,y,b){var R=p._milliseconds,$=Es(p._days),W=Es(p._months);c.isValid()&&(b=b??!0,W&&Ea(c,si(c,"Month")+W*y),$&&Bf(c,"Date",si(c,"Date")+$*y),R&&c._d.setTime(c._d.valueOf()+R*y),b&&e.updateOffset(c,$||W))}var Cs=go(1,"add"),ka=go(-1,"subtract");function yo(c){return typeof c=="string"||c instanceof String}function ze(c){return ee(c)||h(c)||yo(c)||f(c)||Cd(c)||$g(c)||c===null||c===void 0}function $g(c){var p=i(c)&&!a(c),y=!1,b=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],R,$,W=b.length;for(R=0;R<W;R+=1)$=b[R],y=y||s(c,$);return p&&y}function Cd(c){var p=n(c),y=!1;return p&&(y=c.filter(function(b){return!f(b)&&yo(c)}).length===0),p&&y}function Aa(c){var p=i(c)&&!a(c),y=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],R,$;for(R=0;R<b.length;R+=1)$=b[R],y=y||s(c,$);return p&&y}function Mg(c,p){var y=c.diff(p,"days",!0);return y<-6?"sameElse":y<-1?"lastWeek":y<0?"lastDay":y<1?"sameDay":y<2?"nextDay":y<7?"nextWeek":"sameElse"}function Ng(c,p){arguments.length===1&&(arguments[0]?ze(arguments[0])?(c=arguments[0],p=void 0):Aa(arguments[0])&&(p=arguments[0],c=void 0):(c=void 0,p=void 0));var y=c||nt(),b=hr(y,this).startOf("day"),R=e.calendarFormat(this,b)||"sameElse",$=p&&(D(p[R])?p[R].call(this,y):p[R]);return this.format($||this.localeData().calendar(R,this,nt(y)))}function Dg(){return new K(this)}function Ta(c,p){var y=ee(c)?c:nt(c);return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()>y.valueOf():y.valueOf()<this.clone().startOf(p).valueOf()):!1}function ci(c,p){var y=ee(c)?c:nt(c);return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()<y.valueOf():this.clone().endOf(p).valueOf()<y.valueOf()):!1}function qa(c,p,y,b){var R=ee(c)?c:nt(c),$=ee(p)?p:nt(p);return this.isValid()&&R.isValid()&&$.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(R,y):!this.isBefore(R,y))&&(b[1]===")"?this.isBefore($,y):!this.isAfter($,y))):!1}function xd(c,p){var y=ee(c)?c:nt(c),b;return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()===y.valueOf():(b=y.valueOf(),this.clone().startOf(p).valueOf()<=b&&b<=this.clone().endOf(p).valueOf())):!1}function $a(c,p){return this.isSame(c,p)||this.isAfter(c,p)}function Rd(c,p){return this.isSame(c,p)||this.isBefore(c,p)}function Id(c,p,y){var b,R,$;if(!this.isValid())return NaN;if(b=hr(c,this),!b.isValid())return NaN;switch(R=(b.utcOffset()-this.utcOffset())*6e4,p=gt(p),p){case"year":$=Ai(this,b)/12;break;case"month":$=Ai(this,b);break;case"quarter":$=Ai(this,b)/3;break;case"second":$=(this-b)/1e3;break;case"minute":$=(this-b)/6e4;break;case"hour":$=(this-b)/36e5;break;case"day":$=(this-b-R)/864e5;break;case"week":$=(this-b-R)/6048e5;break;default:$=this-b}return y?$:_r($)}function Ai(c,p){if(c.date()<p.date())return-Ai(p,c);var y=(p.year()-c.year())*12+(p.month()-c.month()),b=c.clone().add(y,"months"),R,$;return p-b<0?(R=c.clone().add(y-1,"months"),$=(p-b)/(b-R)):(R=c.clone().add(y+1,"months"),$=(p-b)/(R-b)),-(y+$)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Od(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function vo(c){if(!this.isValid())return null;var p=c!==!0,y=p?this.clone().utc():this;return y.year()<0||y.year()>9999?ct(y,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ct(y,"Z")):ct(y,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",p="",y,b,R,$;return this.isLocal()||(c=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),y="["+c+'("]',b=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",R="-MM-DD[T]HH:mm:ss.SSS",$=p+'[")]',this.format(y+b+R+$)}function Ma(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var p=ct(this,c);return this.localeData().postformat(p)}function Fg(c,p){return this.isValid()&&(ee(c)&&c.isValid()||nt(c).isValid())?Ae({to:this,from:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Lg(c){return this.from(nt(),c)}function jg(c,p){return this.isValid()&&(ee(c)&&c.isValid()||nt(c).isValid())?Ae({from:this,to:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Na(c){return this.to(nt(),c)}function So(c){var p;return c===void 0?this._locale._abbr:(p=wt(c),p!=null&&(this._locale=p),this)}var Da=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(c){return c===void 0?this.localeData():this.locale(c)});function Pd(){return this._locale}var bo=1e3,xs=60*bo,Fa=60*xs,Et=(365*400+97)*24*Fa;function vt(c,p){return(c%p+p)%p}function kd(c,p,y){return c<100&&c>=0?new Date(c+400,p,y)-Et:new Date(c,p,y).valueOf()}function Ad(c,p,y){return c<100&&c>=0?Date.UTC(c+400,p,y)-Et:Date.UTC(c,p,y)}function Td(c){var p,y;if(c=gt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Ad:kd,c){case"year":p=y(this.year(),0,1);break;case"quarter":p=y(this.year(),this.month()-this.month()%3,1);break;case"month":p=y(this.year(),this.month(),1);break;case"week":p=y(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=y(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=y(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=vt(p+(this._isUTC?0:this.utcOffset()*xs),Fa);break;case"minute":p=this._d.valueOf(),p-=vt(p,xs);break;case"second":p=this._d.valueOf(),p-=vt(p,bo);break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Ug(c){var p,y;if(c=gt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Ad:kd,c){case"year":p=y(this.year()+1,0,1)-1;break;case"quarter":p=y(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=y(this.year(),this.month()+1,1)-1;break;case"week":p=y(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=y(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=y(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=Fa-vt(p+(this._isUTC?0:this.utcOffset()*xs),Fa)-1;break;case"minute":p=this._d.valueOf(),p+=xs-vt(p,xs)-1;break;case"second":p=this._d.valueOf(),p+=bo-vt(p,bo)-1;break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Eu(){return this._d.valueOf()-(this._offset||0)*6e4}function _o(){return Math.floor(this.valueOf()/1e3)}function Cu(){return new Date(this.valueOf())}function Rs(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function wo(){var c=this;return{years:c.year(),months:c.month(),date:c.date(),hours:c.hours(),minutes:c.minutes(),seconds:c.seconds(),milliseconds:c.milliseconds()}}function Eo(){return this.isValid()?this.toISOString():null}function La(){return A(this)}function Is(){return m({},C(this))}function Bg(){return C(this).overflow}function Hg(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}le("N",0,0,"eraAbbr"),le("NN",0,0,"eraAbbr"),le("NNN",0,0,"eraAbbr"),le("NNNN",0,0,"eraName"),le("NNNNN",0,0,"eraNarrow"),le("y",["y",1],"yo","eraYear"),le("y",["yy",2],0,"eraYear"),le("y",["yyy",3],0,"eraYear"),le("y",["yyyy",4],0,"eraYear"),oe("N",Ie),oe("NN",Ie),oe("NNN",Ie),oe("NNNN",Jg),oe("NNNNN",zg),Ke(["N","NN","NNN","NNNN","NNNNN"],function(c,p,y,b){var R=y._locale.erasParse(c,b,y._strict);R?C(y).era=R:C(y).invalidEra=c}),oe("y",ni),oe("yy",ni),oe("yyy",ni),oe("yyyy",ni),oe("yo",Kg),Ke(["y","yy","yyy","yyyy"],Vt),Ke(["yo"],function(c,p,y,b){var R;y._locale._eraYearOrdinalRegex&&(R=c.match(y._locale._eraYearOrdinalRegex)),y._locale.eraYearOrdinalParse?p[Vt]=y._locale.eraYearOrdinalParse(c,R):p[Vt]=parseInt(c,10)});function Vg(c,p){var y,b,R,$=this._eras||wt("en")._eras;for(y=0,b=$.length;y<b;++y){switch(typeof $[y].since){case"string":R=e($[y].since).startOf("day"),$[y].since=R.valueOf();break}switch(typeof $[y].until){case"undefined":$[y].until=1/0;break;case"string":R=e($[y].until).startOf("day").valueOf(),$[y].until=R.valueOf();break}}return $}function Wg(c,p,y){var b,R,$=this.eras(),W,se,ye;for(c=c.toUpperCase(),b=0,R=$.length;b<R;++b)if(W=$[b].name.toUpperCase(),se=$[b].abbr.toUpperCase(),ye=$[b].narrow.toUpperCase(),y)switch(p){case"N":case"NN":case"NNN":if(se===c)return $[b];break;case"NNNN":if(W===c)return $[b];break;case"NNNNN":if(ye===c)return $[b];break}else if([W,se,ye].indexOf(c)>=0)return $[b]}function Yg(c,p){var y=c.since<=c.until?1:-1;return p===void 0?e(c.since).year():e(c.since).year()+(p-c.offset)*y}function ja(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].name;return""}function Co(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].narrow;return""}function qd(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].abbr;return""}function I(){var c,p,y,b,R=this.localeData().eras();for(c=0,p=R.length;c<p;++c)if(y=R[c].since<=R[c].until?1:-1,b=this.clone().startOf("day").valueOf(),R[c].since<=b&&b<=R[c].until||R[c].until<=b&&b<=R[c].since)return(this.year()-e(R[c].since).year())*y+R[c].offset;return this.year()}function Os(c){return s(this,"_erasNameRegex")||On.call(this),c?this._erasNameRegex:this._erasRegex}function Ua(c){return s(this,"_erasAbbrRegex")||On.call(this),c?this._erasAbbrRegex:this._erasRegex}function Er(c){return s(this,"_erasNarrowRegex")||On.call(this),c?this._erasNarrowRegex:this._erasRegex}function Ie(c,p){return p.erasAbbrRegex(c)}function Jg(c,p){return p.erasNameRegex(c)}function zg(c,p){return p.erasNarrowRegex(c)}function Kg(c,p){return p._eraYearOrdinalRegex||ni}function On(){var c=[],p=[],y=[],b=[],R,$,W,se,ye,Oe=this.eras();for(R=0,$=Oe.length;R<$;++R)W=En(Oe[R].name),se=En(Oe[R].abbr),ye=En(Oe[R].narrow),p.push(W),c.push(se),y.push(ye),b.push(W),b.push(se),b.push(ye);this._erasRegex=new RegExp("^("+b.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+p.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+y.join("|")+")","i")}le(0,["gg",2],0,function(){return this.weekYear()%100}),le(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ba(c,p){le(0,[c,c.length],0,p)}Ba("gggg","weekYear"),Ba("ggggg","weekYear"),Ba("GGGG","isoWeekYear"),Ba("GGGGG","isoWeekYear"),oe("G",ps),oe("g",ps),oe("GG",Xe,dr),oe("gg",Xe,dr),oe("GGGG",uo,ri),oe("gggg",uo,ri),oe("GGGGG",hs,fs),oe("ggggg",hs,fs),Oi(["gggg","ggggg","GGGG","GGGGG"],function(c,p,y,b){p[b.substr(0,2)]=$e(c)}),Oi(["gg","GG"],function(c,p,y,b){p[b]=e.parseTwoDigitYear(c)});function Gg(c){return $d.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Qg(c){return $d.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function Zg(){return Ur(this.year(),1,4)}function Xg(){return Ur(this.isoWeekYear(),1,4)}function Pn(){var c=this.localeData()._week;return Ur(this.year(),c.dow,c.doy)}function ey(){var c=this.localeData()._week;return Ur(this.weekYear(),c.dow,c.doy)}function $d(c,p,y,b,R){var $;return c==null?Ss(this,b,R).year:($=Ur(c,b,R),p>$&&(p=$),ty.call(this,c,p,y,b,R))}function ty(c,p,y,b,R){var $=Xf(c,p,y,b,R),W=ys($.year,0,$.dayOfYear);return this.year(W.getUTCFullYear()),this.month(W.getUTCMonth()),this.date(W.getUTCDate()),this}le("Q",0,"Qo","quarter"),oe("Q",us),Ke("Q",function(c,p){p[Cn]=($e(c)-1)*3});function ry(c){return c==null?Math.ceil((this.month()+1)/3):this.month((c-1)*3+this.month()%3)}le("D",["DD",2],"Do","date"),oe("D",Xe,Ii),oe("DD",Xe,dr),oe("Do",function(c,p){return c?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],Zr),Ke("Do",function(c,p){p[Zr]=$e(c.match(Xe)[0])});var Md=gs("Date",!0);le("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("DDD",ds),oe("DDDD",cs),Ke(["DDD","DDDD"],function(c,p,y){y._dayOfYear=$e(c)});function kn(c){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return c==null?p:this.add(c-p,"d")}le("m",["mm",2],0,"minute"),oe("m",Xe,ou),oe("mm",Xe,dr),Ke(["m","mm"],jr);var ny=gs("Minutes",!1);le("s",["ss",2],0,"second"),oe("s",Xe,ou),oe("ss",Xe,dr),Ke(["s","ss"],xn);var iy=gs("Seconds",!1);le("S",0,0,function(){return~~(this.millisecond()/100)}),le(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),le(0,["SSS",3],0,"millisecond"),le(0,["SSSS",4],0,function(){return this.millisecond()*10}),le(0,["SSSSS",5],0,function(){return this.millisecond()*100}),le(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),le(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),le(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),le(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),oe("S",ds,us),oe("SS",ds,dr),oe("SSS",ds,cs);var fi,Nd;for(fi="SSSS";fi.length<=9;fi+="S")oe(fi,ni);function sy(c,p){p[ii]=$e(("0."+c)*1e3)}for(fi="S";fi.length<=9;fi+="S")Ke(fi,sy);Nd=gs("Milliseconds",!1),le("z",0,0,"zoneAbbr"),le("zz",0,0,"zoneName");function qi(){return this._isUTC?"UTC":""}function oy(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Cs,te.calendar=Ng,te.clone=Dg,te.diff=Id,te.endOf=Ug,te.format=Ma,te.from=Fg,te.fromNow=Lg,te.to=jg,te.toNow=Na,te.get=_a,te.invalidAt=Bg,te.isAfter=Ta,te.isBefore=ci,te.isBetween=qa,te.isSame=xd,te.isSameOrAfter=$a,te.isSameOrBefore=Rd,te.isValid=La,te.lang=Da,te.locale=So,te.localeData=Pd,te.max=_g,te.min=Sd,te.parsingFlags=Is,te.set=Km,te.startOf=Td,te.subtract=ka,te.toArray=Rs,te.toObject=wo,te.toDate=Cu,te.toISOString=vo,te.inspect=Ti,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=Eo,te.toString=Od,te.unix=_o,te.valueOf=Eu,te.creationData=Hg,te.eraName=ja,te.eraNarrow=Co,te.eraAbbr=qd,te.eraYear=I,te.year=Uf,te.isLeapYear=zm,te.weekYear=Gg,te.isoWeekYear=Qg,te.quarter=te.quarters=ry,te.month=zf,te.daysInMonth=Kf,te.week=te.weeks=eg,te.isoWeek=te.isoWeeks=rd,te.weeksInYear=Pn,te.weeksInWeekYear=ey,te.isoWeeksInYear=Zg,te.isoWeeksInISOWeekYear=Xg,te.date=Md,te.day=te.days=ug,te.weekday=cg,te.isoWeekday=fg,te.dayOfYear=kn,te.hour=te.hours=Nt,te.minute=te.minutes=ny,te.second=te.seconds=iy,te.millisecond=te.milliseconds=Nd,te.utcOffset=Pg,te.utc=Ag,te.local=Tg,te.parseZone=qg,te.hasAlignedHourOffset=ui,te.isDST=U,te.isLocal=H,te.isUtcOffset=ae,te.isUtc=ve,te.isUTC=ve,te.zoneAbbr=qi,te.zoneName=oy,te.dates=E("dates accessor is deprecated. Use date instead.",Md),te.months=E("months accessor is deprecated. Use month instead",zf),te.years=E("years accessor is deprecated. Use year instead",Uf),te.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",kg),te.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",J);function Hr(c){return nt(c*1e3)}function ay(){return nt.apply(null,arguments).parseZone()}function Dd(c){return c}var Be=Z.prototype;Be.calendar=bt,Be.longDateFormat=jt,Be.invalidDate=ti,Be.ordinal=Lm,Be.preparse=Dd,Be.postformat=Dd,Be.relativeTime=Lf,Be.pastFuture=jm,Be.set=L,Be.eras=Vg,Be.erasParse=Wg,Be.erasConvertYear=Yg,Be.erasAbbrRegex=Ua,Be.erasNameRegex=Os,Be.erasNarrowRegex=Er,Be.months=Xm,Be.monthsShort=Wf,Be.monthsParse=Jf,Be.monthsRegex=Gf,Be.monthsShortRegex=Ca,Be.week=lu,Be.firstDayOfYear=td,Be.firstDayOfWeek=ed,Be.weekdays=sg,Be.weekdaysMin=uu,Be.weekdaysShort=og,Be.weekdaysParse=lg,Be.weekdaysRegex=st,Be.weekdaysShortRegex=rt,Be.weekdaysMinRegex=dg,Be.isPM=ud,Be.meridiem=du;function Ha(c,p,y,b){var R=wt(),$=S().set(b,p);return R[y]($,c)}function Fd(c,p,y){if(f(c)&&(p=c,c=void 0),c=c||"",p!=null)return Ha(c,p,y,"month");var b,R=[];for(b=0;b<12;b++)R[b]=Ha(c,b,y,"month");return R}function Va(c,p,y,b){typeof c=="boolean"?(f(p)&&(y=p,p=void 0),p=p||""):(p=c,y=p,c=!1,f(p)&&(y=p,p=void 0),p=p||"");var R=wt(),$=c?R._week.dow:0,W,se=[];if(y!=null)return Ha(p,(y+$)%7,b,"day");for(W=0;W<7;W++)se[W]=Ha(p,(W+$)%7,b,"day");return se}function Ld(c,p){return Fd(c,p,"months")}function ly(c,p){return Fd(c,p,"monthsShort")}function uy(c,p,y){return Va(c,p,y,"weekdays")}function xu(c,p,y){return Va(c,p,y,"weekdaysShort")}function xo(c,p,y){return Va(c,p,y,"weekdaysMin")}Rn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(c){var p=c%10,y=$e(c%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return c+y}}),e.lang=E("moment.lang is deprecated. Use moment.locale instead.",Rn),e.langData=E("moment.langData is deprecated. Use moment.localeData instead.",wt);var Cr=Math.abs;function cy(){var c=this._data;return this._milliseconds=Cr(this._milliseconds),this._days=Cr(this._days),this._months=Cr(this._months),c.milliseconds=Cr(c.milliseconds),c.seconds=Cr(c.seconds),c.minutes=Cr(c.minutes),c.hours=Cr(c.hours),c.months=Cr(c.months),c.years=Cr(c.years),this}function Ru(c,p,y,b){var R=Ae(p,y);return c._milliseconds+=b*R._milliseconds,c._days+=b*R._days,c._months+=b*R._months,c._bubble()}function fy(c,p){return Ru(this,c,p,1)}function An(c,p){return Ru(this,c,p,-1)}function Wa(c){return c<0?Math.floor(c):Math.ceil(c)}function $i(){var c=this._milliseconds,p=this._days,y=this._months,b=this._data,R,$,W,se,ye;return c>=0&&p>=0&&y>=0||c<=0&&p<=0&&y<=0||(c+=Wa(Iu(y)+p)*864e5,p=0,y=0),b.milliseconds=c%1e3,R=_r(c/1e3),b.seconds=R%60,$=_r(R/60),b.minutes=$%60,W=_r($/60),b.hours=W%24,p+=_r(W/24),ye=_r(pr(p)),y+=ye,p-=Wa(Iu(ye)),se=_r(y/12),y%=12,b.days=p,b.months=y,b.years=se,this}function pr(c){return c*4800/146097}function Iu(c){return c*146097/4800}function jd(c){if(!this.isValid())return NaN;var p,y,b=this._milliseconds;if(c=gt(c),c==="month"||c==="quarter"||c==="year")switch(p=this._days+b/864e5,y=this._months+pr(p),c){case"month":return y;case"quarter":return y/3;case"year":return y/12}else switch(p=this._days+Math.round(Iu(this._months)),c){case"week":return p/7+b/6048e5;case"day":return p+b/864e5;case"hour":return p*24+b/36e5;case"minute":return p*1440+b/6e4;case"second":return p*86400+b/1e3;case"millisecond":return Math.floor(p*864e5)+b;default:throw new Error("Unknown unit "+c)}}function tn(c){return function(){return this.as(c)}}var Ps=tn("ms"),di=tn("s"),Ud=tn("m"),dy=tn("h"),Ya=tn("d"),hy=tn("w"),Bd=tn("M"),Ut=tn("Q"),Ou=tn("y"),Hd=Ps;function rn(){return Ae(this)}function Pu(c){return c=gt(c),this.isValid()?this[c+"s"]():NaN}function nn(c){return function(){return this.isValid()?this._data[c]:NaN}}var Mi=nn("milliseconds"),Vd=nn("seconds"),zt=nn("minutes"),ku=nn("hours"),py=nn("days"),my=nn("months"),gy=nn("years");function Au(){return _r(this.days()/7)}var Tn=Math.round,sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Wd(c,p,y,b,R){return R.relativeTime(p||1,!!y,c,b)}function yy(c,p,y,b){var R=Ae(c).abs(),$=Tn(R.as("s")),W=Tn(R.as("m")),se=Tn(R.as("h")),ye=Tn(R.as("d")),Oe=Tn(R.as("M")),Kt=Tn(R.as("w")),on=Tn(R.as("y")),qn=$<=y.ss&&["s",$]||$<y.s&&["ss",$]||W<=1&&["m"]||W<y.m&&["mm",W]||se<=1&&["h"]||se<y.h&&["hh",se]||ye<=1&&["d"]||ye<y.d&&["dd",ye];return y.w!=null&&(qn=qn||Kt<=1&&["w"]||Kt<y.w&&["ww",Kt]),qn=qn||Oe<=1&&["M"]||Oe<y.M&&["MM",Oe]||on<=1&&["y"]||["yy",on],qn[2]=p,qn[3]=+c>0,qn[4]=b,Wd.apply(null,qn)}function vy(c){return c===void 0?Tn:typeof c=="function"?(Tn=c,!0):!1}function Ro(c,p){return sn[c]===void 0?!1:p===void 0?sn[c]:(sn[c]=p,c==="s"&&(sn.ss=p-1),!0)}function Sy(c,p){if(!this.isValid())return this.localeData().invalidDate();var y=!1,b=sn,R,$;return typeof c=="object"&&(p=c,c=!1),typeof c=="boolean"&&(y=c),typeof p=="object"&&(b=Object.assign({},sn,p),p.s!=null&&p.ss==null&&(b.ss=p.s-1)),R=this.localeData(),$=yy(this,!y,b,R),y&&($=R.pastFuture(+this,$)),R.postformat($)}var Tu=Math.abs;function hi(c){return(c>0)-(c<0)||+c}function Io(){if(!this.isValid())return this.localeData().invalidDate();var c=Tu(this._milliseconds)/1e3,p=Tu(this._days),y=Tu(this._months),b,R,$,W,se=this.asSeconds(),ye,Oe,Kt,on;return se?(b=_r(c/60),R=_r(b/60),c%=60,b%=60,$=_r(y/12),y%=12,W=c?c.toFixed(3).replace(/\.?0+$/,""):"",ye=se<0?"-":"",Oe=hi(this._months)!==hi(se)?"-":"",Kt=hi(this._days)!==hi(se)?"-":"",on=hi(this._milliseconds)!==hi(se)?"-":"",ye+"P"+($?Oe+$+"Y":"")+(y?Oe+y+"M":"")+(p?Kt+p+"D":"")+(R||b||c?"T":"")+(R?on+R+"H":"")+(b?on+b+"M":"")+(c?on+W+"S":"")):"P0D"}var Le=mo.prototype;Le.isValid=Rg,Le.abs=cy,Le.add=fy,Le.subtract=An,Le.as=jd,Le.asMilliseconds=Ps,Le.asSeconds=di,Le.asMinutes=Ud,Le.asHours=dy,Le.asDays=Ya,Le.asWeeks=hy,Le.asMonths=Bd,Le.asQuarters=Ut,Le.asYears=Ou,Le.valueOf=Hd,Le._bubble=$i,Le.clone=rn,Le.get=Pu,Le.milliseconds=Mi,Le.seconds=Vd,Le.minutes=zt,Le.hours=ku,Le.days=py,Le.weeks=Au,Le.months=my,Le.years=gy,Le.humanize=Sy,Le.toISOString=Io,Le.toString=Io,Le.toJSON=Io,Le.locale=So,Le.localeData=Pd,Le.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Io),Le.lang=Da,le("X",0,0,"unix"),le("x",0,0,"valueOf"),oe("x",ps),oe("X",Hm),Ke("X",function(c,p,y){y._d=new Date(parseFloat(c)*1e3)}),Ke("x",function(c,p,y){y._d=new Date($e(c))});return e.version="2.30.1",r(nt),e.fn=te,e.min=wg,e.max=Eg,e.now=Cg,e.utc=S,e.unix=Hr,e.months=Ld,e.isDate=h,e.locale=Rn,e.invalid=T,e.duration=Ae,e.isMoment=ee,e.weekdays=uy,e.parseZone=ay,e.localeData=wt,e.isDuration=Br,e.monthsShort=ly,e.weekdaysMin=xo,e.defineLocale=Jt,e.updateLocale=mg,e.locales=gg,e.weekdaysShort=xu,e.normalizeUnits=gt,e.relativeTimeRounding=vy,e.relativeTimeThreshold=Ro,e.calendarFormat=Mg,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var tC=F((eC,bh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof bh<"u"&&bh.exports?bh.exports=e():t.tv4=e()})(eC,function(){Object.keys||(Object.keys=function(){var k=Object.prototype.hasOwnProperty,E=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=P.length;return function(D){if(typeof D!="object"&&typeof D!="function"||D===null)throw new TypeError("Object.keys called on non-object");var L=[];for(var z in D)k.call(D,z)&&L.push(z);if(E)for(var Z=0;Z<N;Z++)k.call(D,P[Z])&&L.push(P[Z]);return L}}()),Object.create||(Object.create=function(){function k(){}return function(E){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=E,new k}}()),Array.isArray||(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(k){if(this===null)throw new TypeError;var E=Object(this),P=E.length>>>0;if(P===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=P)return-1;for(var D=N>=0?N:Math.max(P-Math.abs(N),0);D<P;D++)if(D in E&&E[D]===k)return D;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var E="tv4_test_frozen_key";k.hasOwnProperty(E);)E+=Math.random();try{return k[E]=!0,delete k[E],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(E){return"%"+E.substring(3)})}function n(k){var E="";t[k.charAt(0)]&&(E=k.charAt(0),k=k.substring(1));var P="",N="",D=!0,L=!1,z=!1;E==="+"?D=!1:E==="."?(N=".",P="."):E==="/"?(N="/",P="/"):E==="#"?(N="#",D=!1):E===";"?(N=";",P=";",L=!0,z=!0):E==="?"?(N="?",P="&",L=!0):E==="&"&&(N="&",P="&",L=!0);for(var Z=[],ie=k.split(","),fe=[],bt={},we=0;we<ie.length;we++){var he=ie[we],Ze=null;if(he.indexOf(":")!==-1){var _t=he.split(":");he=_t[0],Ze=parseInt(_t[1],10)}for(var Mt={};e[he.charAt(he.length-1)];)Mt[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var le={truncate:Ze,name:he,suffices:Mt};fe.push(le),bt[he]=le,Z.push(he)}var ei=function(su){for(var ct="",_n=0,as=0;as<fe.length;as++){var jt=fe[as],ft=su(jt.name);if(ft==null||Array.isArray(ft)&&ft.length===0||typeof ft=="object"&&Object.keys(ft).length===0){_n++;continue}if(as===_n?ct+=N:ct+=P||",",Array.isArray(ft)){L&&(ct+=jt.name+"=");for(var ti=0;ti<ft.length;ti++)ti>0&&(ct+=jt.suffices["*"]&&P||",",jt.suffices["*"]&&L&&(ct+=jt.name+"=")),ct+=D?encodeURIComponent(ft[ti]).replace(/!/g,"%21"):r(ft[ti])}else if(typeof ft=="object"){L&&!jt.suffices["*"]&&(ct+=jt.name+"=");var rr=!0;for(var Qr in ft)rr||(ct+=jt.suffices["*"]&&P||","),rr=!1,ct+=D?encodeURIComponent(Qr).replace(/!/g,"%21"):r(Qr),ct+=jt.suffices["*"]?"=":",",ct+=D?encodeURIComponent(ft[Qr]).replace(/!/g,"%21"):r(ft[Qr])}else L&&(ct+=jt.name,(!z||ft!=="")&&(ct+="=")),jt.truncate!=null&&(ft=ft.substring(0,jt.truncate)),ct+=D?encodeURIComponent(ft).replace(/!/g,"%21"):r(ft)}return ct};return ei.varNames=Z,{prefix:N,substitution:ei}}function i(k){if(!(this instanceof i))return new i(k);for(var E=k.split("{"),P=[E.shift()],N=[],D=[],L=[];E.length>0;){var z=E.shift(),Z=z.split("}")[0],ie=z.substring(Z.length+1),fe=n(Z);D.push(fe.substitution),N.push(fe.prefix),P.push(ie),L=L.concat(fe.substitution.varNames)}this.fill=function(bt){for(var we=P[0],he=0;he<D.length;he++){var Ze=D[he];we+=Ze(bt),we+=P[he+1]}return we},this.varNames=L,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(E){return k[E]})}};var s=function(E,P,N,D,L){if(this.missing=[],this.missingMap={},this.formatValidators=E?Object.create(E.formatValidators):{},this.schemas=E?Object.create(E.schemas):{},this.collectMultiple=P,this.errors=[],this.handleError=P?this.collectError:this.returnError,D&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),L&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||_("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},E)for(var z in E.definedKeywords)this.definedKeywords[z]=E.definedKeywords[z].slice(0)};s.prototype.defineKeyword=function(k,E){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(E)},s.prototype.createError=function(k,E,P,N,D,L,z){var Z=new j(k,E,P,N,D);return Z.message=this.errorReporter(Z,L,z),Z},s.prototype.returnError=function(k){return k},s.prototype.collectError=function(k){return k&&this.errors.push(k),null},s.prototype.prefixErrors=function(k,E,P){for(var N=k;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(E,P);return this},s.prototype.banUnknownProperties=function(k,E){for(var P in this.unknownPropertyPaths){var N=this.createError(C.UNKNOWN_PROPERTY,{path:P},P,"",null,k,E),D=this.handleError(N);if(D)return D}return null},s.prototype.addFormat=function(k,E){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=E},s.prototype.resolveRefs=function(k,E){if(k.$ref!==void 0){if(E=E||{},E[k.$ref])return this.createError(C.CIRCULAR_REFERENCE,{urls:Object.keys(E).join(", ")},"","",null,void 0,k);E[k.$ref]=!0,k=this.getSchema(k.$ref,E)}return k},s.prototype.getSchema=function(k,E){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,E);var N=k,D="";if(k.indexOf("#")!==-1&&(D=k.substring(k.indexOf("#")+1),N=k.substring(0,k.indexOf("#"))),typeof this.schemas[N]=="object"){P=this.schemas[N];var L=decodeURIComponent(D);if(L==="")return this.resolveRefs(P,E);if(L.charAt(0)!=="/")return;for(var z=L.split("/").slice(1),Z=0;Z<z.length;Z++){var ie=z[Z].replace(/~1/g,"/").replace(/~0/g,"~");if(P[ie]===void 0){P=void 0;break}P=P[ie]}if(P!==void 0)return this.resolveRefs(P,E)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(k,E){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],E);else if(k&&typeof k=="object"){typeof k.id=="string"&&Y(E,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var N in k)if(N!=="enum"){if(typeof k[N]=="object")this.searchSchemas(k[N],E);else if(N==="$ref"){var D=m(k[N]);D&&this.schemas[D]===void 0&&this.missingMap[D]===void 0&&(this.missingMap[D]=D)}}}},s.prototype.addSchema=function(k,E){if(typeof k!="string"||typeof E>"u")if(typeof k=="object"&&typeof k.id=="string")E=k,k=E.id;else return;k===m(k)+"#"&&(k=m(k)),this.schemas[k]=E,delete this.missingMap[k],S(E,k),this.searchSchemas(E,k)},s.prototype.getSchemaMap=function(){var k={};for(var E in this.schemas)k[E]=this.schemas[E];return k},s.prototype.getSchemaUris=function(k){var E=[];for(var P in this.schemas)(!k||k.test(P))&&E.push(P);return E},s.prototype.getMissingUris=function(k){var E=[];for(var P in this.missingMap)(!k||k.test(P))&&E.push(P);return E},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,E,P,N,D){var L;if(E=this.resolveRefs(E),E){if(E instanceof j)return this.errors.push(E),E}else return null;var z=this.errors.length,Z,ie=null,fe=null;if(this.checkRecursive&&k&&typeof k=="object"){if(L=!this.scanned.length,k[this.validatedSchemasKey]){var bt=k[this.validatedSchemasKey].indexOf(E);if(bt!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][bt]),null}if(Object.isFrozen(k)&&(Z=this.scannedFrozen.indexOf(k),Z!==-1)){var we=this.scannedFrozenSchemas[Z].indexOf(E);if(we!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Z][we]),null}if(this.scanned.push(k),Object.isFrozen(k))Z===-1&&(Z=this.scannedFrozen.length,this.scannedFrozen.push(k),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[Z].length,this.scannedFrozenSchemas[Z][ie]=E,this.scannedFrozenValidationErrors[Z][ie]=[];else{if(!k[this.validatedSchemasKey])try{Object.defineProperty(k,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(k,this.validationErrorsKey,{value:[],configurable:!0})}catch{k[this.validatedSchemasKey]=[],k[this.validationErrorsKey]=[]}fe=k[this.validatedSchemasKey].length,k[this.validatedSchemasKey][fe]=E,k[this.validationErrorsKey][fe]=[]}}var he=this.errors.length,Ze=this.validateBasic(k,E,D)||this.validateNumeric(k,E,D)||this.validateString(k,E,D)||this.validateArray(k,E,D)||this.validateObject(k,E,D)||this.validateCombinations(k,E,D)||this.validateHypermedia(k,E,D)||this.validateFormat(k,E,D)||this.validateDefinedKeywords(k,E,D)||null;if(L){for(;this.scanned.length;){var _t=this.scanned.pop();delete _t[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ze||he!==this.errors.length)for(;P&&P.length||N&&N.length;){var Mt=P&&P.length?""+P.pop():null,le=N&&N.length?""+N.pop():null;Ze&&(Ze=Ze.prefixWith(Mt,le)),this.prefixErrors(he,Mt,le)}return ie!==null?this.scannedFrozenValidationErrors[Z][ie]=this.errors.slice(z):fe!==null&&(k[this.validationErrorsKey][fe]=this.errors.slice(z)),this.handleError(Ze)},s.prototype.validateFormat=function(k,E){if(typeof E.format!="string"||!this.formatValidators[E.format])return null;var P=this.formatValidators[E.format].call(null,k,E);return typeof P=="string"||typeof P=="number"?this.createError(C.FORMAT_CUSTOM,{message:P},"","/format",null,k,E):P&&typeof P=="object"?this.createError(C.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,E):null},s.prototype.validateDefinedKeywords=function(k,E,P){for(var N in this.definedKeywords)if(!(typeof E[N]>"u"))for(var D=this.definedKeywords[N],L=0;L<D.length;L++){var z=D[L],Z=z(k,E[N],E,P);if(typeof Z=="string"||typeof Z=="number")return this.createError(C.KEYWORD_CUSTOM,{key:N,message:Z},"","",null,k,E).prefixWith(null,N);if(Z&&typeof Z=="object"){var ie=Z.code;if(typeof ie=="string"){if(!C[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=C[ie]}else typeof ie!="number"&&(ie=C.KEYWORD_CUSTOM);var fe=typeof Z.message=="object"?Z.message:{key:N,message:Z.message||"?"},bt=Z.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,fe,Z.dataPath||null,bt,null,k,E)}}return null};function a(k,E){if(k===E)return!0;if(k&&E&&typeof k=="object"&&typeof E=="object"){if(Array.isArray(k)!==Array.isArray(E))return!1;if(Array.isArray(k)){if(k.length!==E.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],E[P]))return!1}else{var N;for(N in k)if(E[N]===void 0&&k[N]!==void 0)return!1;for(N in E)if(k[N]===void 0&&E[N]!==void 0)return!1;for(N in k)if(!a(k[N],E[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(E,P,N){var D;return(D=this.validateType(E,P,N))||(D=this.validateEnum(E,P,N))?D.prefixWith(null,"type"):null},s.prototype.validateType=function(E,P){if(P.type===void 0)return null;var N=typeof E;E===null?N="null":Array.isArray(E)&&(N="array");var D=P.type;Array.isArray(D)||(D=[D]);for(var L=0;L<D.length;L++){var z=D[L];if(z===N||z==="integer"&&N==="number"&&E%1===0)return null}return this.createError(C.INVALID_TYPE,{type:N,expected:D.join("/")},"","",null,E,P)},s.prototype.validateEnum=function(E,P){if(P.enum===void 0)return null;for(var N=0;N<P.enum.length;N++){var D=P.enum[N];if(a(E,D))return null}return this.createError(C.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(E):E},"","",null,E,P)},s.prototype.validateNumeric=function(E,P,N){return this.validateMultipleOf(E,P,N)||this.validateMinMax(E,P,N)||this.validateNaN(E,P,N)||null};var u=Math.pow(2,-51),f=1-u;s.prototype.validateMultipleOf=function(E,P){var N=P.multipleOf||P.divisibleBy;if(N===void 0)return null;if(typeof E=="number"){var D=E/N%1;if(D>=u&&D<f)return this.createError(C.NUMBER_MULTIPLE_OF,{value:E,multipleOf:N},"","",null,E,P)}return null},s.prototype.validateMinMax=function(E,P){if(typeof E!="number")return null;if(P.minimum!==void 0){if(E<P.minimum)return this.createError(C.NUMBER_MINIMUM,{value:E,minimum:P.minimum},"","/minimum",null,E,P);if(P.exclusiveMinimum&&E===P.minimum)return this.createError(C.NUMBER_MINIMUM_EXCLUSIVE,{value:E,minimum:P.minimum},"","/exclusiveMinimum",null,E,P)}if(P.maximum!==void 0){if(E>P.maximum)return this.createError(C.NUMBER_MAXIMUM,{value:E,maximum:P.maximum},"","/maximum",null,E,P);if(P.exclusiveMaximum&&E===P.maximum)return this.createError(C.NUMBER_MAXIMUM_EXCLUSIVE,{value:E,maximum:P.maximum},"","/exclusiveMaximum",null,E,P)}return null},s.prototype.validateNaN=function(E,P){return typeof E!="number"?null:isNaN(E)===!0||E===1/0||E===-1/0?this.createError(C.NUMBER_NOT_A_NUMBER,{value:E},"","/type",null,E,P):null},s.prototype.validateString=function(E,P,N){return this.validateStringLength(E,P,N)||this.validateStringPattern(E,P,N)||null},s.prototype.validateStringLength=function(E,P){return typeof E!="string"?null:P.minLength!==void 0&&E.length<P.minLength?this.createError(C.STRING_LENGTH_SHORT,{length:E.length,minimum:P.minLength},"","/minLength",null,E,P):P.maxLength!==void 0&&E.length>P.maxLength?this.createError(C.STRING_LENGTH_LONG,{length:E.length,maximum:P.maxLength},"","/maxLength",null,E,P):null},s.prototype.validateStringPattern=function(E,P){if(typeof E!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var N;if(P.pattern instanceof RegExp)N=P.pattern;else{var D,L="",z=P.pattern.match(/^\/(.+)\/([img]*)$/);z?(D=z[1],L=z[2]):D=P.pattern,N=new RegExp(D,L)}return N.test(E)?null:this.createError(C.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,E,P)},s.prototype.validateArray=function(E,P,N){return Array.isArray(E)&&(this.validateArrayLength(E,P,N)||this.validateArrayUniqueItems(E,P,N)||this.validateArrayItems(E,P,N))||null},s.prototype.validateArrayLength=function(E,P){var N;return P.minItems!==void 0&&E.length<P.minItems&&(N=this.createError(C.ARRAY_LENGTH_SHORT,{length:E.length,minimum:P.minItems},"","/minItems",null,E,P),this.handleError(N))||P.maxItems!==void 0&&E.length>P.maxItems&&(N=this.createError(C.ARRAY_LENGTH_LONG,{length:E.length,maximum:P.maxItems},"","/maxItems",null,E,P),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(E,P){if(P.uniqueItems){for(var N=0;N<E.length;N++)for(var D=N+1;D<E.length;D++)if(a(E[N],E[D])){var L=this.createError(C.ARRAY_UNIQUE,{match1:N,match2:D},"","/uniqueItems",null,E,P);if(this.handleError(L))return L}}return null},s.prototype.validateArrayItems=function(E,P,N){if(P.items===void 0)return null;var D,L;if(Array.isArray(P.items)){for(L=0;L<E.length;L++)if(L<P.items.length){if(D=this.validateAll(E[L],P.items[L],[L],["items",L],N+"/"+L))return D}else if(P.additionalItems!==void 0){if(typeof P.additionalItems=="boolean"){if(!P.additionalItems&&(D=this.createError(C.ARRAY_ADDITIONAL_ITEMS,{},"/"+L,"/additionalItems",null,E,P),this.handleError(D)))return D}else if(D=this.validateAll(E[L],P.additionalItems,[L],["additionalItems"],N+"/"+L))return D}}else for(L=0;L<E.length;L++)if(D=this.validateAll(E[L],P.items,[L],["items"],N+"/"+L))return D;return null},s.prototype.validateObject=function(E,P,N){return typeof E!="object"||E===null||Array.isArray(E)?null:this.validateObjectMinMaxProperties(E,P,N)||this.validateObjectRequiredProperties(E,P,N)||this.validateObjectProperties(E,P,N)||this.validateObjectDependencies(E,P,N)||null},s.prototype.validateObjectMinMaxProperties=function(E,P){var N=Object.keys(E),D;return P.minProperties!==void 0&&N.length<P.minProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:P.minProperties},"","/minProperties",null,E,P),this.handleError(D))||P.maxProperties!==void 0&&N.length>P.maxProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:P.maxProperties},"","/maxProperties",null,E,P),this.handleError(D))?D:null},s.prototype.validateObjectRequiredProperties=function(E,P){if(P.required!==void 0)for(var N=0;N<P.required.length;N++){var D=P.required[N];if(E[D]===void 0){var L=this.createError(C.OBJECT_REQUIRED,{key:D},"","/required/"+N,null,E,P);if(this.handleError(L))return L}}return null},s.prototype.validateObjectProperties=function(E,P,N){var D;for(var L in E){var z=N+"/"+L.replace(/~/g,"~0").replace(/\//g,"~1"),Z=!1;if(P.properties!==void 0&&P.properties[L]!==void 0&&(Z=!0,D=this.validateAll(E[L],P.properties[L],[L],["properties",L],z)))return D;if(P.patternProperties!==void 0)for(var ie in P.patternProperties){var fe=new RegExp(ie);if(fe.test(L)&&(Z=!0,D=this.validateAll(E[L],P.patternProperties[ie],[L],["patternProperties",ie],z)))return D}if(Z)this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]);else if(P.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]),typeof P.additionalProperties=="boolean"){if(!P.additionalProperties&&(D=this.createError(C.OBJECT_ADDITIONAL_PROPERTIES,{key:L},"","/additionalProperties",null,E,P).prefixWith(L,null),this.handleError(D)))return D}else if(D=this.validateAll(E[L],P.additionalProperties,[L],["additionalProperties"],z))return D}else this.trackUnknownProperties&&!this.knownPropertyPaths[z]&&(this.unknownPropertyPaths[z]=!0)}return null},s.prototype.validateObjectDependencies=function(E,P,N){var D;if(P.dependencies!==void 0){for(var L in P.dependencies)if(E[L]!==void 0){var z=P.dependencies[L];if(typeof z=="string"){if(E[z]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:z},"","",null,E,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(Array.isArray(z))for(var Z=0;Z<z.length;Z++){var ie=z[Z];if(E[ie]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:ie},"","/"+Z,null,E,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(D=this.validateAll(E,z,[],["dependencies",L],N))return D}}return null},s.prototype.validateCombinations=function(E,P,N){return this.validateAllOf(E,P,N)||this.validateAnyOf(E,P,N)||this.validateOneOf(E,P,N)||this.validateNot(E,P,N)||null},s.prototype.validateAllOf=function(E,P,N){if(P.allOf===void 0)return null;for(var D,L=0;L<P.allOf.length;L++){var z=P.allOf[L];if(D=this.validateAll(E,z,[],["allOf",L],N))return D}return null},s.prototype.validateAnyOf=function(E,P,N){if(P.anyOf===void 0)return null;var D=[],L=this.errors.length,z,Z;this.trackUnknownProperties&&(z=this.unknownPropertyPaths,Z=this.knownPropertyPaths);for(var ie=!0,fe=0;fe<P.anyOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var bt=P.anyOf[fe],we=this.errors.length,he=this.validateAll(E,bt,[],["anyOf",fe],N);if(he===null&&we===this.errors.length){if(this.errors=this.errors.slice(0,L),this.trackUnknownProperties){for(var Ze in this.knownPropertyPaths)Z[Ze]=!0,delete z[Ze];for(var _t in this.unknownPropertyPaths)Z[_t]||(z[_t]=!0);ie=!1;continue}return null}he&&D.push(he.prefixWith(null,""+fe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=z,this.knownPropertyPaths=Z),ie)return D=D.concat(this.errors.slice(L)),this.errors=this.errors.slice(0,L),this.createError(C.ANY_OF_MISSING,{},"","/anyOf",D,E,P)},s.prototype.validateOneOf=function(E,P,N){if(P.oneOf===void 0)return null;var D=null,L=[],z=this.errors.length,Z,ie;this.trackUnknownProperties&&(Z=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var fe=0;fe<P.oneOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var bt=P.oneOf[fe],we=this.errors.length,he=this.validateAll(E,bt,[],["oneOf",fe],N);if(he===null&&we===this.errors.length){if(D===null)D=fe;else return this.errors=this.errors.slice(0,z),this.createError(C.ONE_OF_MULTIPLE,{index1:D,index2:fe},"","/oneOf",null,E,P);if(this.trackUnknownProperties){for(var Ze in this.knownPropertyPaths)ie[Ze]=!0,delete Z[Ze];for(var _t in this.unknownPropertyPaths)ie[_t]||(Z[_t]=!0)}}else he&&L.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Z,this.knownPropertyPaths=ie),D===null?(L=L.concat(this.errors.slice(z)),this.errors=this.errors.slice(0,z),this.createError(C.ONE_OF_MISSING,{},"","/oneOf",L,E,P)):(this.errors=this.errors.slice(0,z),null)},s.prototype.validateNot=function(E,P,N){if(P.not===void 0)return null;var D=this.errors.length,L,z;this.trackUnknownProperties&&(L=this.unknownPropertyPaths,z=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Z=this.validateAll(E,P.not,null,null,N),ie=this.errors.slice(D);return this.errors=this.errors.slice(0,D),this.trackUnknownProperties&&(this.unknownPropertyPaths=L,this.knownPropertyPaths=z),Z===null&&ie.length===0?this.createError(C.NOT_PASSED,{},"","/not",null,E,P):null},s.prototype.validateHypermedia=function(E,P,N){if(!P.links)return null;for(var D,L=0;L<P.links.length;L++){var z=P.links[L];if(z.rel==="describedby"){for(var Z=new i(z.href),ie=!0,fe=0;fe<Z.varNames.length;fe++)if(!(Z.varNames[fe]in E)){ie=!1;break}if(ie){var bt=Z.fillFromObject(E),we={$ref:bt};if(D=this.validateAll(E,we,[],["links",L],N))return D}}}};function h(k){var E=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return E?{href:E[0]||"",protocol:E[1]||"",authority:E[2]||"",host:E[3]||"",hostname:E[4]||"",port:E[5]||"",pathname:E[6]||"",search:E[7]||"",hash:E[8]||""}:null}function g(k,E){function P(N){var D=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(L){L==="/.."?D.pop():D.push(L)}),D.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return E=h(E||""),k=h(k||""),!E||!k?null:(E.protocol||k.protocol)+(E.protocol||E.authority?E.authority:k.authority)+P(E.protocol||E.authority||E.pathname.charAt(0)==="/"?E.pathname:E.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+E.pathname:k.pathname)+(E.protocol||E.authority||E.pathname?E.search:E.search||k.search)+E.hash}function m(k){return k.split("#")[0]}function S(k,E){if(k&&typeof k=="object")if(E===void 0?E=k.id:typeof k.id=="string"&&(E=g(E,k.id),k.id=E),Array.isArray(k))for(var P=0;P<k.length;P++)S(k[P],E);else{typeof k.$ref=="string"&&(k.$ref=g(E,k.$ref));for(var N in k)N!=="enum"&&S(k[N],E)}}function _(k){k=k||"en";var E=V[k];return function(P){var N=E[P.code]||T[P.code];if(typeof N!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var D=P.params;return N.replace(/\{([^{}]*)\}/g,function(L,z){var Z=D[z];return typeof Z=="string"||typeof Z=="number"?Z:L})}}var C={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},x={};for(var A in C)x[C[A]]=A;var T={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function j(k,E,P,N,D){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=E,this.code=k,this.dataPath=P||"",this.schemaPath=N||"",this.subErrors=D||null;var L=new Error(this.message);if(this.stack=L.stack||L.stacktrace,!this.stack)try{throw L}catch(z){this.stack=z.stack||z.stacktrace}}j.prototype=Object.create(Error.prototype),j.prototype.constructor=j,j.prototype.name="ValidationError",j.prototype.prefixWith=function(k,E){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),E!==null&&(E=E.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+E+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,E);return this};function Y(k,E){if(E.substring(0,k.length)===k){var P=E.substring(k.length);if(E.length>0&&E.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var V={};function K(k){var E=new s,P,N,D={setErrorReporter:function(L){return typeof L=="string"?this.language(L):(N=L,!0)},addFormat:function(){E.addFormat.apply(E,arguments)},language:function(L){return L?(V[L]||(L=L.split("-")[0]),V[L]?(P=L,L):!1):P},addLanguage:function(L,z){var Z;for(Z in C)z[Z]&&!z[C[Z]]&&(z[C[Z]]=z[Z]);var ie=L.split("-")[0];if(!V[ie])V[L]=z,V[ie]=z;else{V[L]=Object.create(V[ie]);for(Z in z)typeof V[ie][Z]>"u"&&(V[ie][Z]=z[Z]),V[L][Z]=z[Z]}return this},freshApi:function(L){var z=K();return L&&z.language(L),z},validate:function(L,z,Z,ie){var fe=_(P),bt=N?function(Ze,_t,Mt){return N(Ze,_t,Mt)||fe(Ze,_t,Mt)}:fe,we=new s(E,!1,bt,Z,ie);typeof z=="string"&&(z={$ref:z}),we.addSchema("",z);var he=we.validateAll(L,z,null,null,"");return!he&&ie&&(he=we.banUnknownProperties(L,z)),this.error=he,this.missing=we.missing,this.valid=he===null,this.valid},validateResult:function(){var L={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(L,arguments),L},validateMultiple:function(L,z,Z,ie){var fe=_(P),bt=N?function(Ze,_t,Mt){return N(Ze,_t,Mt)||fe(Ze,_t,Mt)}:fe,we=new s(E,!0,bt,Z,ie);typeof z=="string"&&(z={$ref:z}),we.addSchema("",z),we.validateAll(L,z,null,null,""),ie&&we.banUnknownProperties(L,z);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=we.errors,he.missing=we.missing,he.valid=he.errors.length===0,he},addSchema:function(){return E.addSchema.apply(E,arguments)},getSchema:function(){return E.getSchema.apply(E,arguments)},getSchemaMap:function(){return E.getSchemaMap.apply(E,arguments)},getSchemaUris:function(){return E.getSchemaUris.apply(E,arguments)},getMissingUris:function(){return E.getMissingUris.apply(E,arguments)},dropSchemas:function(){E.dropSchemas.apply(E,arguments)},defineKeyword:function(){E.defineKeyword.apply(E,arguments)},defineError:function(L,z,Z){if(typeof L!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(L))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof z!="number"||z%1!==0||z<1e4)throw new Error("Code number must be an integer > 10000");if(typeof C[L]<"u")throw new Error("Error already defined: "+L+" as "+C[L]);if(typeof x[z]<"u")throw new Error("Error code already used: "+x[z]+" as "+z);C[L]=z,x[z]=L,T[L]=T[z]=Z;for(var ie in V){var fe=V[ie];fe[L]&&(fe[z]=fe[z]||fe[L])}},reset:function(){E.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:S,resolveUrl:g,getDocumentUri:m,errorCodes:C};return D.language(k||"en"),D}var ee=K();return ee.addLanguage("en-gb",T),ee.tv4=ee,ee})});var Qu=F(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.regexpCode=Ye.getEsmExportName=Ye.getProperty=Ye.safeStringify=Ye.stringify=Ye.strConcat=Ye.addCodeArg=Ye.str=Ye._=Ye.nil=Ye._Code=Ye.Name=Ye.IDENTIFIER=Ye._CodeOrName=void 0;var Ku=class{};Ye._CodeOrName=Ku;Ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Fo=class extends Ku{constructor(e){if(super(),!Ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ye.Name=Fo;var fn=class extends Ku{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Fo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ye._Code=fn;Ye.nil=new fn("");function rC(t,...e){let r=[t[0]],n=0;for(;n<e.length;)gv(r,e[n]),r.push(t[++n]);return new fn(r)}Ye._=rC;var mv=new fn("+");function nC(t,...e){let r=[Gu(t[0])],n=0;for(;n<e.length;)r.push(mv),gv(r,e[n]),r.push(mv,Gu(t[++n]));return eD(r),new fn(r)}Ye.str=nC;function gv(t,e){e instanceof fn?t.push(...e._items):e instanceof Fo?t.push(e):t.push(nD(e))}Ye.addCodeArg=gv;function eD(t){let e=1;for(;e<t.length-1;){if(t[e]===mv){let r=tD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function tD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Fo||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Fo))return`"${t}${e.slice(1)}`}function rD(t,e){return e.emptyStr()?t:t.emptyStr()?e:nC`${t}${e}`}Ye.strConcat=rD;function nD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Gu(Array.isArray(t)?t.join(","):t)}function iD(t){return new fn(Gu(t))}Ye.stringify=iD;function Gu(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ye.safeStringify=Gu;function sD(t){return typeof t=="string"&&Ye.IDENTIFIER.test(t)?new fn(`.${t}`):rC`[${t}]`}Ye.getProperty=sD;function oD(t){if(typeof t=="string"&&Ye.IDENTIFIER.test(t))return new fn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ye.getEsmExportName=oD;function aD(t){return new fn(t.toString())}Ye.regexpCode=aD});var Sv=F(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.ValueScope=kr.ValueScopeName=kr.Scope=kr.varKinds=kr.UsedValueState=void 0;var Pr=Qu(),yv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},_h;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(_h||(kr.UsedValueState=_h={}));kr.varKinds={const:new Pr.Name("const"),let:new Pr.Name("let"),var:new Pr.Name("var")};var wh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Pr.Name?e:this.name(e)}name(e){return new Pr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};kr.Scope=wh;var Eh=class extends Pr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Pr._)`.${new Pr.Name(r)}[${n}]`}};kr.ValueScopeName=Eh;var lD=(0,Pr._)`\n`,vv=class extends wh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?lD:Pr.nil}}get(){return this._scope}name(e){return new Eh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,u=this._values[s];if(u){let g=u.get(a);if(g)return g}else u=this._values[s]=new Map;u.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),h=f.length;return f[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Pr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Pr.nil;for(let a in e){let u=e[a];if(!u)continue;let f=n[a]=n[a]||new Map;u.forEach(h=>{if(f.has(h))return;f.set(h,_h.Started);let g=r(h);if(g){let m=this.opts.es5?kr.varKinds.var:kr.varKinds.const;s=(0,Pr._)`${s}${m} ${h} = ${g};${this.opts._n}`}else if(g=i?.(h))s=(0,Pr._)`${s}${g}${this.opts._n}`;else throw new yv(h);f.set(h,_h.Completed)})}return s}};kr.ValueScope=vv});var Me=F(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.or=qe.and=qe.not=qe.CodeGen=qe.operators=qe.varKinds=qe.ValueScopeName=qe.ValueScope=qe.Scope=qe.Name=qe.regexpCode=qe.stringify=qe.getProperty=qe.nil=qe.strConcat=qe.str=qe._=void 0;var Ue=Qu(),Ln=Sv(),Ds=Qu();Object.defineProperty(qe,"_",{enumerable:!0,get:function(){return Ds._}});Object.defineProperty(qe,"str",{enumerable:!0,get:function(){return Ds.str}});Object.defineProperty(qe,"strConcat",{enumerable:!0,get:function(){return Ds.strConcat}});Object.defineProperty(qe,"nil",{enumerable:!0,get:function(){return Ds.nil}});Object.defineProperty(qe,"getProperty",{enumerable:!0,get:function(){return Ds.getProperty}});Object.defineProperty(qe,"stringify",{enumerable:!0,get:function(){return Ds.stringify}});Object.defineProperty(qe,"regexpCode",{enumerable:!0,get:function(){return Ds.regexpCode}});Object.defineProperty(qe,"Name",{enumerable:!0,get:function(){return Ds.Name}});var Ih=Sv();Object.defineProperty(qe,"Scope",{enumerable:!0,get:function(){return Ih.Scope}});Object.defineProperty(qe,"ValueScope",{enumerable:!0,get:function(){return Ih.ValueScope}});Object.defineProperty(qe,"ValueScopeName",{enumerable:!0,get:function(){return Ih.ValueScopeName}});Object.defineProperty(qe,"varKinds",{enumerable:!0,get:function(){return Ih.varKinds}});qe.operators={GT:new Ue._Code(">"),GTE:new Ue._Code(">="),LT:new Ue._Code("<"),LTE:new Ue._Code("<="),EQ:new Ue._Code("==="),NEQ:new Ue._Code("!=="),NOT:new Ue._Code("!"),OR:new Ue._Code("||"),AND:new Ue._Code("&&"),ADD:new Ue._Code("+")};var Ji=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},bv=class extends Ji{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ln.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=nl(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ue._CodeOrName?this.rhs.names:{}}},Ch=class extends Ji{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ue.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=nl(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ue.Name?{}:{...this.lhs.names};return Rh(e,this.rhs)}},_v=class extends Ch{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},wv=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Ev=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Cv=class extends Ji{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},xv=class extends Ji{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=nl(this.code,e,r),this}get names(){return this.code instanceof Ue._CodeOrName?this.code.names:{}}},Zu=class extends Ji{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(uD(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Uo(e,r.names),{})}},zi=class extends Zu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Rv=class extends Zu{},rl=class extends zi{};rl.kind="else";var Lo=class t extends zi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new rl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(iC(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=nl(this.condition,e,r),this}get names(){let e=super.names;return Rh(e,this.condition),this.else&&Uo(e,this.else.names),e}};Lo.kind="if";var jo=class extends zi{};jo.kind="for";var Iv=class extends jo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=nl(this.iteration,e,r),this}get names(){return Uo(super.names,this.iteration.names)}},Ov=class extends jo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Ln.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Rh(super.names,this.from);return Rh(e,this.to)}},xh=class extends jo{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=nl(this.iterable,e,r),this}get names(){return Uo(super.names,this.iterable.names)}},Xu=class extends zi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Xu.kind="func";var ec=class extends Zu{render(e){return"return "+super.render(e)}};ec.kind="return";var Pv=class extends zi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Uo(e,this.catch.names),this.finally&&Uo(e,this.finally.names),e}},tc=class extends zi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};tc.kind="catch";var rc=class extends zi{render(e){return"finally"+super.render(e)}};rc.kind="finally";var kv=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
-
`:""},this._extScope=e,this._scope=new Ln.Scope({parent:e}),this._nodes=[new Rv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new bv(e,s,n)),s}const(e,r,n){return this._def(Ln.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ln.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ln.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ch(e,r,n))}add(e,r){return this._leafNode(new _v(e,qe.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ue.nil&&this._leafNode(new xv(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Ue.addCodeArg)(r,i));return r.push("}"),new Ue._Code(r)}if(e,r,n){if(this._blockNode(new Lo(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Lo(e))}else(){return this._elseNode(new rl)}endIf(){return this._endBlockNode(Lo,rl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Iv(e),r)}forRange(e,r,n,i,s=this.opts.es5?Ln.varKinds.var:Ln.varKinds.let){let a=this._scope.toName(e);return this._for(new Ov(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Ln.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Ue.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ue._)`${a}.length`,u=>{this.var(s,(0,Ue._)`${a}[${u}]`),n(s)})}return this._for(new xh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Ln.varKinds.var:Ln.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ue._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new xh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(jo)}label(e){return this._leafNode(new wv(e))}break(e){return this._leafNode(new Ev(e))}return(e){let r=new ec;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ec)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Pv;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new tc(s),r(s)}return n&&(this._currNode=i.finally=new rc,this.code(n)),this._endBlockNode(tc,rc)}throw(e){return this._leafNode(new Cv(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ue.nil,n,i){return this._blockNode(new Xu(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Xu)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Lo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};qe.CodeGen=kv;function Uo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Rh(t,e){return e instanceof Ue._CodeOrName?Uo(t,e.names):t}function nl(t,e,r){if(t instanceof Ue.Name)return n(t);if(!i(t))return t;return new Ue._Code(t._items.reduce((s,a)=>(a instanceof Ue.Name&&(a=n(a)),a instanceof Ue._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Ue._Code&&s._items.some(a=>a instanceof Ue.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function uD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function iC(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ue._)`!${Av(t)}`}qe.not=iC;var cD=sC(qe.operators.AND);function fD(...t){return t.reduce(cD)}qe.and=fD;var dD=sC(qe.operators.OR);function hD(...t){return t.reduce(dD)}qe.or=hD;function sC(t){return(e,r)=>e===Ue.nil?r:r===Ue.nil?e:(0,Ue._)`${Av(e)} ${t} ${Av(r)}`}function Av(t){return t instanceof Ue.Name?t:(0,Ue._)`(${t})`}});var Je=F(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.checkStrictMode=Ne.getErrorPath=Ne.Type=Ne.useFunc=Ne.setEvaluated=Ne.evaluatedPropsToName=Ne.mergeEvaluated=Ne.eachItem=Ne.unescapeJsonPointer=Ne.escapeJsonPointer=Ne.escapeFragment=Ne.unescapeFragment=Ne.schemaRefOrVal=Ne.schemaHasRulesButRef=Ne.schemaHasRules=Ne.checkUnknownRules=Ne.alwaysValidSchema=Ne.toHash=void 0;var ut=Me(),pD=Qu();function mD(t){let e={};for(let r of t)e[r]=!0;return e}Ne.toHash=mD;function gD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(lC(t,e),!uC(e,t.self.RULES.all))}Ne.alwaysValidSchema=gD;function lC(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||dC(t,`unknown keyword: "${s}"`)}Ne.checkUnknownRules=lC;function uC(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ne.schemaHasRules=uC;function yD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ne.schemaHasRulesButRef=yD;function vD({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ut._)`${r}`}return(0,ut._)`${t}${e}${(0,ut.getProperty)(n)}`}Ne.schemaRefOrVal=vD;function SD(t){return cC(decodeURIComponent(t))}Ne.unescapeFragment=SD;function bD(t){return encodeURIComponent(qv(t))}Ne.escapeFragment=bD;function qv(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ne.escapeJsonPointer=qv;function cC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ne.unescapeJsonPointer=cC;function _D(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ne.eachItem=_D;function oC({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{let f=a===void 0?s:a instanceof ut.Name?(s instanceof ut.Name?t(i,s,a):e(i,s,a),a):s instanceof ut.Name?(e(i,a,s),s):r(s,a);return u===ut.Name&&!(f instanceof ut.Name)?n(i,f):f}}Ne.mergeEvaluated={props:oC({mergeNames:(t,e,r)=>t.if((0,ut._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ut._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ut._)`${r} || {}`).code((0,ut._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ut._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ut._)`${r} || {}`),$v(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:fC}),items:oC({mergeNames:(t,e,r)=>t.if((0,ut._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ut._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ut._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ut._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function fC(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ut._)`{}`);return e!==void 0&&$v(t,r,e),r}Ne.evaluatedPropsToName=fC;function $v(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ut._)`${e}${(0,ut.getProperty)(n)}`,!0))}Ne.setEvaluated=$v;var aC={};function wD(t,e){return t.scopeValue("func",{ref:e,code:aC[e.code]||(aC[e.code]=new pD._Code(e.code))})}Ne.useFunc=wD;var Tv;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Tv||(Ne.Type=Tv={}));function ED(t,e,r){if(t instanceof ut.Name){let n=e===Tv.Num;return r?n?(0,ut._)`"[" + ${t} + "]"`:(0,ut._)`"['" + ${t} + "']"`:n?(0,ut._)`"/" + ${t}`:(0,ut._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ut.getProperty)(t).toString():"/"+qv(t)}Ne.getErrorPath=ED;function dC(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ne.checkStrictMode=dC});var Ki=F(Mv=>{"use strict";Object.defineProperty(Mv,"__esModule",{value:!0});var sr=Me(),CD={data:new sr.Name("data"),valCxt:new sr.Name("valCxt"),instancePath:new sr.Name("instancePath"),parentData:new sr.Name("parentData"),parentDataProperty:new sr.Name("parentDataProperty"),rootData:new sr.Name("rootData"),dynamicAnchors:new sr.Name("dynamicAnchors"),vErrors:new sr.Name("vErrors"),errors:new sr.Name("errors"),this:new sr.Name("this"),self:new sr.Name("self"),scope:new sr.Name("scope"),json:new sr.Name("json"),jsonPos:new sr.Name("jsonPos"),jsonLen:new sr.Name("jsonLen"),jsonPart:new sr.Name("jsonPart")};Mv.default=CD});var nc=F(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.extendErrors=or.resetErrorsCount=or.reportExtraError=or.reportError=or.keyword$DataError=or.keywordError=void 0;var He=Me(),Oh=Je(),vr=Ki();or.keywordError={message:({keyword:t})=>(0,He.str)`must pass "${t}" keyword validation`};or.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,He.str)`"${t}" keyword must be ${e} ($data)`:(0,He.str)`"${t}" keyword is invalid ($data)`};function xD(t,e=or.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:u}=i,f=mC(t,e,r);n??(a||u)?hC(s,f):pC(i,(0,He._)`[${f}]`)}or.reportError=xD;function RD(t,e=or.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,u=mC(t,e,r);hC(i,u),s||a||pC(n,vr.default.vErrors)}or.reportExtraError=RD;function ID(t,e){t.assign(vr.default.errors,e),t.if((0,He._)`${vr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,He._)`${vr.default.vErrors}.length`,e),()=>t.assign(vr.default.vErrors,null)))}or.resetErrorsCount=ID;function OD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,vr.default.errors,u=>{t.const(a,(0,He._)`${vr.default.vErrors}[${u}]`),t.if((0,He._)`${a}.instancePath === undefined`,()=>t.assign((0,He._)`${a}.instancePath`,(0,He.strConcat)(vr.default.instancePath,s.errorPath))),t.assign((0,He._)`${a}.schemaPath`,(0,He.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,He._)`${a}.schema`,r),t.assign((0,He._)`${a}.data`,n))})}or.extendErrors=OD;function hC(t,e){let r=t.const("err",e);t.if((0,He._)`${vr.default.vErrors} === null`,()=>t.assign(vr.default.vErrors,(0,He._)`[${r}]`),(0,He._)`${vr.default.vErrors}.push(${r})`),t.code((0,He._)`${vr.default.errors}++`)}function pC(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,He._)`new ${t.ValidationError}(${e})`):(r.assign((0,He._)`${n}.errors`,e),r.return(!1))}var Bo={keyword:new He.Name("keyword"),schemaPath:new He.Name("schemaPath"),params:new He.Name("params"),propertyName:new He.Name("propertyName"),message:new He.Name("message"),schema:new He.Name("schema"),parentSchema:new He.Name("parentSchema")};function mC(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,He._)`{}`:PD(t,e,r)}function PD(t,e,r={}){let{gen:n,it:i}=t,s=[kD(i,r),AD(t,r)];return TD(t,e,s),n.object(...s)}function kD({errorPath:t},{instancePath:e}){let r=e?(0,He.str)`${t}${(0,Oh.getErrorPath)(e,Oh.Type.Str)}`:t;return[vr.default.instancePath,(0,He.strConcat)(vr.default.instancePath,r)]}function AD({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,He.str)`${e}/${t}`;return r&&(i=(0,He.str)`${i}${(0,Oh.getErrorPath)(r,Oh.Type.Str)}`),[Bo.schemaPath,i]}function TD(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:u}=t,{opts:f,propertyName:h,topSchemaRef:g,schemaPath:m}=u;n.push([Bo.keyword,i],[Bo.params,typeof e=="function"?e(t):e||(0,He._)`{}`]),f.messages&&n.push([Bo.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Bo.schema,a],[Bo.parentSchema,(0,He._)`${g}${m}`],[vr.default.data,s]),h&&n.push([Bo.propertyName,h])}});var yC=F(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.boolOrEmptySchema=il.topBoolOrEmptySchema=void 0;var qD=nc(),$D=Me(),MD=Ki(),ND={message:"boolean schema is false"};function DD(t){let{gen:e,schema:r,validateName:n}=t;r===!1?gC(t,!1):typeof r=="object"&&r.$async===!0?e.return(MD.default.data):(e.assign((0,$D._)`${n}.errors`,null),e.return(!0))}il.topBoolOrEmptySchema=DD;function FD(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),gC(t)):r.var(e,!0)}il.boolOrEmptySchema=FD;function gC(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,qD.reportError)(i,ND,void 0,e)}});var Nv=F(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.getRules=sl.isJSONType=void 0;var LD=["string","number","integer","boolean","null","object","array"],jD=new Set(LD);function UD(t){return typeof t=="string"&&jD.has(t)}sl.isJSONType=UD;function BD(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}sl.getRules=BD});var Dv=F(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.shouldUseRule=Fs.shouldUseGroup=Fs.schemaHasRulesForType=void 0;function HD({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&vC(t,n)}Fs.schemaHasRulesForType=HD;function vC(t,e){return e.rules.some(r=>SC(t,r))}Fs.shouldUseGroup=vC;function SC(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Fs.shouldUseRule=SC});var ic=F(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.reportTypeError=ar.checkDataTypes=ar.checkDataType=ar.coerceAndCheckDataType=ar.getJSONTypes=ar.getSchemaTypes=ar.DataType=void 0;var VD=Nv(),WD=Dv(),YD=nc(),Re=Me(),bC=Je(),ol;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ol||(ar.DataType=ol={}));function JD(t){let e=_C(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}ar.getSchemaTypes=JD;function _C(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(VD.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ar.getJSONTypes=_C;function zD(t,e){let{gen:r,data:n,opts:i}=t,s=KD(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,WD.schemaHasRulesForType)(t,e[0]));if(a){let u=Lv(e,n,i.strictNumbers,ol.Wrong);r.if(u,()=>{s.length?GD(t,e,s):jv(t)})}return a}ar.coerceAndCheckDataType=zD;var wC=new Set(["string","number","integer","boolean","null"]);function KD(t,e){return e?t.filter(r=>wC.has(r)||e==="array"&&r==="array"):[]}function GD(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Re._)`typeof ${i}`),u=n.let("coerced",(0,Re._)`undefined`);s.coerceTypes==="array"&&n.if((0,Re._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Re._)`${i}[0]`).assign(a,(0,Re._)`typeof ${i}`).if(Lv(e,i,s.strictNumbers),()=>n.assign(u,i))),n.if((0,Re._)`${u} !== undefined`);for(let h of r)(wC.has(h)||h==="array"&&s.coerceTypes==="array")&&f(h);n.else(),jv(t),n.endIf(),n.if((0,Re._)`${u} !== undefined`,()=>{n.assign(i,u),QD(t,u)});function f(h){switch(h){case"string":n.elseIf((0,Re._)`${a} == "number" || ${a} == "boolean"`).assign(u,(0,Re._)`"" + ${i}`).elseIf((0,Re._)`${i} === null`).assign(u,(0,Re._)`""`);return;case"number":n.elseIf((0,Re._)`${a} == "boolean" || ${i} === null
|
|
25
|
-
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,
|
|
26
|
-
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,
|
|
27
|
-
|| ${a} === "boolean" || ${i} === null`).assign(u,(0,Re._)`[${i}]`)}}}function QD({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Re._)`${e} !== undefined`,()=>t.assign((0,Re._)`${e}[${r}]`,n))}function Fv(t,e,r,n=ol.Correct){let i=n===ol.Correct?Re.operators.EQ:Re.operators.NEQ,s;switch(t){case"null":return(0,Re._)`${e} ${i} null`;case"array":s=(0,Re._)`Array.isArray(${e})`;break;case"object":s=(0,Re._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Re._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Re._)`typeof ${e} ${i} ${t}`}return n===ol.Correct?s:(0,Re.not)(s);function a(u=Re.nil){return(0,Re.and)((0,Re._)`typeof ${e} == "number"`,u,r?(0,Re._)`isFinite(${e})`:Re.nil)}}ar.checkDataType=Fv;function Lv(t,e,r,n){if(t.length===1)return Fv(t[0],e,r,n);let i,s=(0,bC.toHash)(t);if(s.array&&s.object){let a=(0,Re._)`typeof ${e} != "object"`;i=s.null?a:(0,Re._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Re.nil;s.number&&delete s.integer;for(let a in s)i=(0,Re.and)(i,Fv(a,e,r,n));return i}ar.checkDataTypes=Lv;var ZD={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Re._)`{type: ${t}}`:(0,Re._)`{type: ${e}}`};function jv(t){let e=XD(t);(0,YD.reportError)(e,ZD)}ar.reportTypeError=jv;function XD(t){let{gen:e,data:r,schema:n}=t,i=(0,bC.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var CC=F(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.assignDefaults=void 0;var al=Me(),eF=Je();function tF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)EC(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>EC(t,s,i.default))}Ph.assignDefaults=tF;function EC(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let u=(0,al._)`${s}${(0,al.getProperty)(e)}`;if(i){(0,eF.checkStrictMode)(t,`default is ignored for: ${u}`);return}let f=(0,al._)`${u} === undefined`;a.useDefaults==="empty"&&(f=(0,al._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,al._)`${u} = ${(0,al.stringify)(r)}`)}});var dn=F(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.validateUnion=it.validateArray=it.usePattern=it.callValidateCode=it.schemaProperties=it.allSchemaProperties=it.noPropertyInData=it.propertyInData=it.isOwnProperty=it.hasPropFunc=it.reportMissingProp=it.checkMissingProp=it.checkReportMissingProp=void 0;var dt=Me(),Uv=Je(),Ls=Ki(),rF=Je();function nF(t,e){let{gen:r,data:n,it:i}=t;r.if(Hv(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,dt._)`${e}`},!0),t.error()})}it.checkReportMissingProp=nF;function iF({gen:t,data:e,it:{opts:r}},n,i){return(0,dt.or)(...n.map(s=>(0,dt.and)(Hv(t,e,s,r.ownProperties),(0,dt._)`${i} = ${s}`)))}it.checkMissingProp=iF;function sF(t,e){t.setParams({missingProperty:e},!0),t.error()}it.reportMissingProp=sF;function xC(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,dt._)`Object.prototype.hasOwnProperty`})}it.hasPropFunc=xC;function Bv(t,e,r){return(0,dt._)`${xC(t)}.call(${e}, ${r})`}it.isOwnProperty=Bv;function oF(t,e,r,n){let i=(0,dt._)`${e}${(0,dt.getProperty)(r)} !== undefined`;return n?(0,dt._)`${i} && ${Bv(t,e,r)}`:i}it.propertyInData=oF;function Hv(t,e,r,n){let i=(0,dt._)`${e}${(0,dt.getProperty)(r)} === undefined`;return n?(0,dt.or)(i,(0,dt.not)(Bv(t,e,r))):i}it.noPropertyInData=Hv;function RC(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}it.allSchemaProperties=RC;function aF(t,e){return RC(e).filter(r=>!(0,Uv.alwaysValidSchema)(t,e[r]))}it.schemaProperties=aF;function lF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,f,h){let g=h?(0,dt._)`${t}, ${e}, ${n}${i}`:e,m=[[Ls.default.instancePath,(0,dt.strConcat)(Ls.default.instancePath,s)],[Ls.default.parentData,a.parentData],[Ls.default.parentDataProperty,a.parentDataProperty],[Ls.default.rootData,Ls.default.rootData]];a.opts.dynamicRef&&m.push([Ls.default.dynamicAnchors,Ls.default.dynamicAnchors]);let S=(0,dt._)`${g}, ${r.object(...m)}`;return f!==dt.nil?(0,dt._)`${u}.call(${f}, ${S})`:(0,dt._)`${u}(${S})`}it.callValidateCode=lF;var uF=(0,dt._)`new RegExp`;function cF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,dt._)`${i.code==="new RegExp"?uF:(0,rF.useFunc)(t,i)}(${r}, ${n})`})}it.usePattern=cF;function fF(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let u=e.let("valid",!0);return a(()=>e.assign(u,!1)),u}return e.var(s,!0),a(()=>e.break()),s;function a(u){let f=e.const("len",(0,dt._)`${r}.length`);e.forRange("i",0,f,h=>{t.subschema({keyword:n,dataProp:h,dataPropType:Uv.Type.Num},s),e.if((0,dt.not)(s),u)})}}it.validateArray=fF;function dF(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,Uv.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),u=e.name("_valid");e.block(()=>r.forEach((f,h)=>{let g=t.subschema({keyword:n,schemaProp:h,compositeRule:!0},u);e.assign(a,(0,dt._)`${a} || ${u}`),t.mergeValidEvaluated(g,u)||e.if((0,dt.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}it.validateUnion=dF});var PC=F(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.validateKeywordUsage=gi.validSchemaType=gi.funcKeywordCode=gi.macroKeywordCode=void 0;var Sr=Me(),Ho=Ki(),hF=dn(),pF=nc();function mF(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,u=e.macro.call(a.self,i,s,a),f=OC(r,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let h=r.name("valid");t.subschema({schema:u,schemaPath:Sr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},h),t.pass(h,()=>t.error(!0))}gi.macroKeywordCode=mF;function gF(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:f}=t;vF(f,e);let h=!u&&e.compile?e.compile.call(f.self,s,a,f):e.validate,g=OC(n,i,h),m=n.let("valid");t.block$data(m,S),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function S(){if(e.errors===!1)x(),e.modifying&&IC(t),A(()=>t.error());else{let T=e.async?_():C();e.modifying&&IC(t),A(()=>yF(t,T))}}function _(){let T=n.let("ruleErrs",null);return n.try(()=>x((0,Sr._)`await `),j=>n.assign(m,!1).if((0,Sr._)`${j} instanceof ${f.ValidationError}`,()=>n.assign(T,(0,Sr._)`${j}.errors`),()=>n.throw(j))),T}function C(){let T=(0,Sr._)`${g}.errors`;return n.assign(T,null),x(Sr.nil),T}function x(T=e.async?(0,Sr._)`await `:Sr.nil){let j=f.opts.passContext?Ho.default.this:Ho.default.self,Y=!("compile"in e&&!u||e.schema===!1);n.assign(m,(0,Sr._)`${T}${(0,hF.callValidateCode)(t,g,j,Y)}`,e.modifying)}function A(T){var j;n.if((0,Sr.not)((j=e.valid)!==null&&j!==void 0?j:m),T)}}gi.funcKeywordCode=gF;function IC(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Sr._)`${n.parentData}[${n.parentDataProperty}]`))}function yF(t,e){let{gen:r}=t;r.if((0,Sr._)`Array.isArray(${e})`,()=>{r.assign(Ho.default.vErrors,(0,Sr._)`${Ho.default.vErrors} === null ? ${e} : ${Ho.default.vErrors}.concat(${e})`).assign(Ho.default.errors,(0,Sr._)`${Ho.default.vErrors}.length`),(0,pF.extendErrors)(t)},()=>t.error())}function vF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function OC(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Sr.stringify)(r)})}function SF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}gi.validSchemaType=SF;function bF({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(u=>!Object.prototype.hasOwnProperty.call(t,u)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}gi.validateKeywordUsage=bF});var AC=F(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.extendSubschemaMode=js.extendSubschemaData=js.getSubschema=void 0;var yi=Me(),kC=Je();function _F(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let u=t.schema[e];return r===void 0?{schema:u,schemaPath:(0,yi._)`${t.schemaPath}${(0,yi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:u[r],schemaPath:(0,yi._)`${t.schemaPath}${(0,yi.getProperty)(e)}${(0,yi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,kC.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}js.getSubschema=_F;function wF(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=e;if(r!==void 0){let{errorPath:h,dataPathArr:g,opts:m}=e,S=u.let("data",(0,yi._)`${e.data}${(0,yi.getProperty)(r)}`,!0);f(S),t.errorPath=(0,yi.str)`${h}${(0,kC.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,yi._)`${r}`,t.dataPathArr=[...g,t.parentDataProperty]}if(i!==void 0){let h=i instanceof yi.Name?i:u.let("data",i,!0);f(h),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(h){t.data=h,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,h]}}js.extendSubschemaData=wF;function EF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}js.extendSubschemaMode=EF});var Vv=F((W3,TC)=>{"use strict";TC.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var $C=F((Y3,qC)=>{"use strict";var Us=qC.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};kh(e,n,i,t,"",t)};Us.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Us.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Us.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Us.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function kh(t,e,r,n,i,s,a,u,f,h){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,u,f,h);for(var g in n){var m=n[g];if(Array.isArray(m)){if(g in Us.arrayKeywords)for(var S=0;S<m.length;S++)kh(t,e,r,m[S],i+"/"+g+"/"+S,s,i,g,n,S)}else if(g in Us.propsKeywords){if(m&&typeof m=="object")for(var _ in m)kh(t,e,r,m[_],i+"/"+g+"/"+CF(_),s,i,g,n,_)}else(g in Us.keywords||t.allKeys&&!(g in Us.skipKeywords))&&kh(t,e,r,m,i+"/"+g,s,i,g,n)}r(n,i,s,a,u,f,h)}}function CF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var sc=F(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.getSchemaRefs=Ar.resolveUrl=Ar.normalizeId=Ar._getFullPath=Ar.getFullPath=Ar.inlineRef=void 0;var xF=Je(),RF=Vv(),IF=$C(),OF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function PF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Wv(t):e?MC(t)<=e:!1}Ar.inlineRef=PF;var kF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Wv(t){for(let e in t){if(kF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Wv)||typeof r=="object"&&Wv(r))return!0}return!1}function MC(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!OF.has(r)&&(typeof t[r]=="object"&&(0,xF.eachItem)(t[r],n=>e+=MC(n)),e===1/0))return 1/0}return e}function NC(t,e="",r){r!==!1&&(e=ll(e));let n=t.parse(e);return DC(t,n)}Ar.getFullPath=NC;function DC(t,e){return t.serialize(e).split("#")[0]+"#"}Ar._getFullPath=DC;var AF=/#\/?$/;function ll(t){return t?t.replace(AF,""):""}Ar.normalizeId=ll;function TF(t,e,r){return r=ll(r),t.resolve(e,r)}Ar.resolveUrl=TF;var qF=/^[a-z_][-a-z0-9._]*$/i;function $F(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=ll(t[r]||e),s={"":i},a=NC(n,i,!1),u={},f=new Set;return IF(t,{allKeys:!0},(m,S,_,C)=>{if(C===void 0)return;let x=a+S,A=s[C];typeof m[r]=="string"&&(A=T.call(this,m[r])),j.call(this,m.$anchor),j.call(this,m.$dynamicAnchor),s[S]=A;function T(Y){let V=this.opts.uriResolver.resolve;if(Y=ll(A?V(A,Y):Y),f.has(Y))throw g(Y);f.add(Y);let K=this.refs[Y];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?h(m,K.schema,Y):Y!==ll(x)&&(Y[0]==="#"?(h(m,u[Y],Y),u[Y]=m):this.refs[Y]=x),Y}function j(Y){if(typeof Y=="string"){if(!qF.test(Y))throw new Error(`invalid anchor "${Y}"`);T.call(this,`#${Y}`)}}}),u;function h(m,S,_){if(S!==void 0&&!RF(m,S))throw g(_)}function g(m){return new Error(`reference "${m}" resolves to more than one schema`)}}Ar.getSchemaRefs=$F});var lc=F(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.getData=Bs.KeywordCxt=Bs.validateFunctionCode=void 0;var BC=yC(),FC=ic(),Jv=Dv(),Ah=ic(),MF=CC(),ac=PC(),Yv=AC(),ce=Me(),be=Ki(),NF=sc(),Gi=Je(),oc=nc();function DF(t){if(WC(t)&&(YC(t),VC(t))){jF(t);return}HC(t,()=>(0,BC.topBoolOrEmptySchema)(t))}Bs.validateFunctionCode=DF;function HC({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ce._)`${be.default.data}, ${be.default.valCxt}`,n.$async,()=>{t.code((0,ce._)`"use strict"; ${LC(r,i)}`),LF(t,i),t.code(s)}):t.func(e,(0,ce._)`${be.default.data}, ${FF(i)}`,n.$async,()=>t.code(LC(r,i)).code(s))}function FF(t){return(0,ce._)`{${be.default.instancePath}="", ${be.default.parentData}, ${be.default.parentDataProperty}, ${be.default.rootData}=${be.default.data}${t.dynamicRef?(0,ce._)`, ${be.default.dynamicAnchors}={}`:ce.nil}}={}`}function LF(t,e){t.if(be.default.valCxt,()=>{t.var(be.default.instancePath,(0,ce._)`${be.default.valCxt}.${be.default.instancePath}`),t.var(be.default.parentData,(0,ce._)`${be.default.valCxt}.${be.default.parentData}`),t.var(be.default.parentDataProperty,(0,ce._)`${be.default.valCxt}.${be.default.parentDataProperty}`),t.var(be.default.rootData,(0,ce._)`${be.default.valCxt}.${be.default.rootData}`),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,ce._)`${be.default.valCxt}.${be.default.dynamicAnchors}`)},()=>{t.var(be.default.instancePath,(0,ce._)`""`),t.var(be.default.parentData,(0,ce._)`undefined`),t.var(be.default.parentDataProperty,(0,ce._)`undefined`),t.var(be.default.rootData,be.default.data),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,ce._)`{}`)})}function jF(t){let{schema:e,opts:r,gen:n}=t;HC(t,()=>{r.$comment&&e.$comment&&zC(t),WF(t),n.let(be.default.vErrors,null),n.let(be.default.errors,0),r.unevaluated&&UF(t),JC(t),zF(t)})}function UF(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ce._)`${r}.evaluated`),e.if((0,ce._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ce._)`${t.evaluated}.props`,(0,ce._)`undefined`)),e.if((0,ce._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ce._)`${t.evaluated}.items`,(0,ce._)`undefined`))}function LC(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ce._)`/*# sourceURL=${r} */`:ce.nil}function BF(t,e){if(WC(t)&&(YC(t),VC(t))){HF(t,e);return}(0,BC.boolOrEmptySchema)(t,e)}function VC({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function WC(t){return typeof t.schema!="boolean"}function HF(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&zC(t),YF(t),JF(t);let s=n.const("_errs",be.default.errors);JC(t,s),n.var(e,(0,ce._)`${s} === ${be.default.errors}`)}function YC(t){(0,Gi.checkUnknownRules)(t),VF(t)}function JC(t,e){if(t.opts.jtd)return jC(t,[],!1,e);let r=(0,FC.getSchemaTypes)(t.schema),n=(0,FC.coerceAndCheckDataType)(t,r);jC(t,r,!n,e)}function VF(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Gi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function WF(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Gi.checkStrictMode)(t,"default is ignored in the schema root")}function YF(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,NF.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function JF(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function zC({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ce._)`${be.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,ce.str)`${n}/$comment`,u=t.scopeValue("root",{ref:e.root});t.code((0,ce._)`${be.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}function zF(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ce._)`${be.default.errors} === 0`,()=>e.return(be.default.data),()=>e.throw((0,ce._)`new ${i}(${be.default.vErrors})`)):(e.assign((0,ce._)`${n}.errors`,be.default.vErrors),s.unevaluated&&KF(t),e.return((0,ce._)`${be.default.errors} === 0`))}function KF({gen:t,evaluated:e,props:r,items:n}){r instanceof ce.Name&&t.assign((0,ce._)`${e}.props`,r),n instanceof ce.Name&&t.assign((0,ce._)`${e}.items`,n)}function jC(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:u,opts:f,self:h}=t,{RULES:g}=h;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Gi.schemaHasRulesButRef)(s,g))){i.block(()=>GC(t,"$ref",g.all.$ref.definition));return}f.jtd||GF(t,e),i.block(()=>{for(let S of g.rules)m(S);m(g.post)});function m(S){(0,Jv.shouldUseGroup)(s,S)&&(S.type?(i.if((0,Ah.checkDataType)(S.type,a,f.strictNumbers)),UC(t,S),e.length===1&&e[0]===S.type&&r&&(i.else(),(0,Ah.reportTypeError)(t)),i.endIf()):UC(t,S),u||i.if((0,ce._)`${be.default.errors} === ${n||0}`))}}function UC(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,MF.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Jv.shouldUseRule)(n,s)&&GC(t,s.keyword,s.definition,e.type)})}function GF(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(QF(t,e),t.opts.allowUnionTypes||ZF(t,e),XF(t,t.dataTypes))}function QF(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{KC(t.dataTypes,r)||zv(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),tL(t,e)}}function ZF(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&zv(t,"use allowUnionTypes to allow union type keyword")}function XF(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Jv.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>eL(e,a))&&zv(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function eL(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function KC(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function tL(t,e){let r=[];for(let n of t.dataTypes)KC(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function zv(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Gi.checkStrictMode)(t,e,t.opts.strictTypes)}var Th=class{constructor(e,r,n){if((0,ac.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Gi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",QC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ac.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",be.default.errors))}result(e,r,n){this.failResult((0,ce.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ce.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ce._)`${r} !== undefined && (${(0,ce.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?oc.reportExtraError:oc.reportError)(this,this.def.error,r)}$dataError(){(0,oc.reportError)(this,this.def.$dataError||oc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,oc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ce.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ce.nil,r=ce.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,ce.or)((0,ce._)`${i} === undefined`,r)),e!==ce.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ce.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ce.or)(a(),u());function a(){if(n.length){if(!(r instanceof ce.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ce._)`${(0,Ah.checkDataTypes)(f,r,s.opts.strictNumbers,Ah.DataType.Wrong)}`}return ce.nil}function u(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ce._)`!${f}(${r})`}return ce.nil}}subschema(e,r){let n=(0,Yv.getSubschema)(this.it,e);(0,Yv.extendSubschemaData)(n,this.it,e),(0,Yv.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return BF(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Gi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Gi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,ce.Name)),!0}};Bs.KeywordCxt=Th;function GC(t,e,r,n){let i=new Th(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ac.funcKeywordCode)(i,r):"macro"in r?(0,ac.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ac.funcKeywordCode)(i,r)}var rL=/^\/(?:[^~]|~0|~1)*$/,nL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function QC(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return be.default.rootData;if(t[0]==="/"){if(!rL.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=be.default.rootData}else{let h=nL.exec(t);if(!h)throw new Error(`Invalid JSON-pointer: ${t}`);let g=+h[1];if(i=h[2],i==="#"){if(g>=e)throw new Error(f("property/index",g));return n[e-g]}if(g>e)throw new Error(f("data",g));if(s=r[e-g],!i)return s}let a=s,u=i.split("/");for(let h of u)h&&(s=(0,ce._)`${s}${(0,ce.getProperty)((0,Gi.unescapeJsonPointer)(h))}`,a=(0,ce._)`${a} && ${s}`);return a;function f(h,g){return`Cannot access ${h} ${g} levels up, current level is ${e}`}}Bs.getData=QC});var qh=F(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var Kv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Gv.default=Kv});var uc=F(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var Qv=sc(),Zv=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Qv.resolveUrl)(e,r,n),this.missingSchema=(0,Qv.normalizeId)((0,Qv.getFullPath)(e,this.missingRef))}};Xv.default=Zv});var Mh=F(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.resolveSchema=hn.getCompilingSchema=hn.resolveRef=hn.compileSchema=hn.SchemaEnv=void 0;var jn=Me(),iL=qh(),Vo=Ki(),Un=sc(),ZC=Je(),sL=lc(),ul=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Un.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};hn.SchemaEnv=ul;function tS(t){let e=XC.call(this,t);if(e)return e;let r=(0,Un.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;t.$async&&(u=a.scopeValue("Error",{ref:iL.default,code:(0,jn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let h={gen:a,allErrors:this.opts.allErrors,data:Vo.default.data,parentData:Vo.default.parentData,parentDataProperty:Vo.default.parentDataProperty,dataNames:[Vo.default.data],dataPathArr:[jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,jn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,jn._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(t),(0,sL.validateFunctionCode)(h),a.optimize(this.opts.code.optimize);let m=a.toString();g=`${a.scopeRefs(Vo.default.scope)}return ${m}`,this.opts.code.process&&(g=this.opts.code.process(g,t));let _=new Function(`${Vo.default.self}`,`${Vo.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:_}),_.errors=null,_.schema=t.schema,_.schemaEnv=t,t.$async&&(_.$async=!0),this.opts.code.source===!0&&(_.source={validateName:f,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:C,items:x}=h;_.evaluated={props:C instanceof jn.Name?void 0:C,items:x instanceof jn.Name?void 0:x,dynamicProps:C instanceof jn.Name,dynamicItems:x instanceof jn.Name},_.source&&(_.source.evaluated=(0,jn.stringify)(_.evaluated))}return t.validate=_,t}catch(m){throw delete t.validate,delete t.validateName,g&&this.logger.error("Error compiling schema, function code:",g),m}finally{this._compilations.delete(t)}}hn.compileSchema=tS;function oL(t,e,r){var n;r=(0,Un.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=uL.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;a&&(s=new ul({schema:a,schemaId:u,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=aL.call(this,s)}hn.resolveRef=oL;function aL(t){return(0,Un.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:tS.call(this,t)}function XC(t){for(let e of this._compilations)if(lL(e,t))return e}hn.getCompilingSchema=XC;function lL(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function uL(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||$h.call(this,t,e)}function $h(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Un._getFullPath)(this.opts.uriResolver,r),i=(0,Un.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return eS.call(this,r,t);let s=(0,Un.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=$h.call(this,t,a);return typeof u?.schema!="object"?void 0:eS.call(this,r,u)}if(typeof a?.schema=="object"){if(a.validate||tS.call(this,a),s===(0,Un.normalizeId)(e)){let{schema:u}=a,{schemaId:f}=this.opts,h=u[f];return h&&(i=(0,Un.resolveUrl)(this.opts.uriResolver,i,h)),new ul({schema:u,schemaId:f,root:t,baseId:i})}return eS.call(this,r,a)}}hn.resolveSchema=$h;var cL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function eS(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let u of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,ZC.unescapeFragment)(u)];if(f===void 0)return;r=f;let h=typeof r=="object"&&r[this.opts.schemaId];!cL.has(u)&&h&&(e=(0,Un.resolveUrl)(this.opts.uriResolver,e,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,ZC.schemaHasRulesButRef)(r,this.RULES)){let u=(0,Un.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=$h.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new ul({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var ex=F((Z3,fL)=>{fL.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var nS=F((X3,ix)=>{"use strict";var dL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),rx=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function rS(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var hL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function tx(t){return t.length=0,!0}function pL(t,e,r){if(t.length){let n=rS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function mL(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=pL;for(let f=0;f<t.length;f++){let h=t[f];if(!(h==="["||h==="]"))if(h===":"){if(s===!0&&(a=!0),!u(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(h==="%"){if(!u(i,n,r))break;u=tx}else{i.push(h);continue}}return i.length&&(u===tx?r.zone=i.join(""):a?n.push(i.join("")):n.push(rS(i))),r.address=n.join(""),r}function nx(t){if(gL(t,":")<2)return{host:t,isIPV6:!1};let e=mL(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function gL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function yL(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function vL(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function SL(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!rx(r)){let n=nx(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}ix.exports={nonSimpleDomain:hL,recomposeAuthority:SL,normalizeComponentEncoding:vL,removeDotSegments:yL,isIPv4:rx,isUUID:dL,normalizeIPv6:nx,stringArrayToHexStripped:rS}});var ux=F((e6,lx)=>{"use strict";var{isUUID:bL}=nS(),_L=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,wL=["http","https","ws","wss","urn","urn:uuid"];function EL(t){return wL.indexOf(t)!==-1}function iS(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function sx(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ox(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function CL(t){return t.secure=iS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function xL(t){if((t.port===(iS(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function RL(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(_L);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=sS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function IL(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=sS(i);s&&(t=s.serialize(t,e));let a=t,u=t.nss;return a.path=`${n||e.nid}:${u}`,e.skipEscape=!0,a}function OL(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!bL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function PL(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var ax={scheme:"http",domainHost:!0,parse:sx,serialize:ox},kL={scheme:"https",domainHost:ax.domainHost,parse:sx,serialize:ox},Nh={scheme:"ws",domainHost:!0,parse:CL,serialize:xL},AL={scheme:"wss",domainHost:Nh.domainHost,parse:Nh.parse,serialize:Nh.serialize},TL={scheme:"urn",parse:RL,serialize:IL,skipNormalize:!0},qL={scheme:"urn:uuid",parse:OL,serialize:PL,skipNormalize:!0},Dh={http:ax,https:kL,ws:Nh,wss:AL,urn:TL,"urn:uuid":qL};Object.setPrototypeOf(Dh,null);function sS(t){return t&&(Dh[t]||Dh[t.toLowerCase()])||void 0}lx.exports={wsIsSecure:iS,SCHEMES:Dh,isValidSchemeName:EL,getSchemeHandler:sS}});var dx=F((t6,Lh)=>{"use strict";var{normalizeIPv6:$L,removeDotSegments:cc,recomposeAuthority:ML,normalizeComponentEncoding:Fh,isIPv4:NL,nonSimpleDomain:DL}=nS(),{SCHEMES:FL,getSchemeHandler:cx}=ux();function LL(t,e){return typeof t=="string"?t=vi(Qi(t,e),e):typeof t=="object"&&(t=Qi(vi(t,e),e)),t}function jL(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=fx(Qi(t,n),Qi(e,n),n,!0);return n.skipEscape=!0,vi(i,n)}function fx(t,e,r,n){let i={};return n||(t=Qi(vi(t,r),r),e=Qi(vi(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=cc(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=cc(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=cc(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=cc(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function UL(t,e,r){return typeof t=="string"?(t=unescape(t),t=vi(Fh(Qi(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=vi(Fh(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=vi(Fh(Qi(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=vi(Fh(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function vi(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=cx(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=ML(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let u=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(u=cc(u)),a===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),i.push(u)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var BL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Qi(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(BL);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host)if(NL(n.host)===!1){let f=$L(n.host);n.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=cx(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&DL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!a||a&&!a.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var oS={SCHEMES:FL,normalize:LL,resolve:jL,resolveComponent:fx,equal:UL,serialize:vi,parse:Qi};Lh.exports=oS;Lh.exports.default=oS;Lh.exports.fastUri=oS});var px=F(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});var hx=dx();hx.code='require("ajv/dist/runtime/uri").default';aS.default=hx});var wx=F(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.CodeGen=Qt.Name=Qt.nil=Qt.stringify=Qt.str=Qt._=Qt.KeywordCxt=void 0;var HL=lc();Object.defineProperty(Qt,"KeywordCxt",{enumerable:!0,get:function(){return HL.KeywordCxt}});var cl=Me();Object.defineProperty(Qt,"_",{enumerable:!0,get:function(){return cl._}});Object.defineProperty(Qt,"str",{enumerable:!0,get:function(){return cl.str}});Object.defineProperty(Qt,"stringify",{enumerable:!0,get:function(){return cl.stringify}});Object.defineProperty(Qt,"nil",{enumerable:!0,get:function(){return cl.nil}});Object.defineProperty(Qt,"Name",{enumerable:!0,get:function(){return cl.Name}});Object.defineProperty(Qt,"CodeGen",{enumerable:!0,get:function(){return cl.CodeGen}});var VL=qh(),Sx=uc(),WL=Nv(),fc=Mh(),YL=Me(),dc=sc(),jh=ic(),uS=Je(),mx=ex(),JL=px(),bx=(t,e)=>new RegExp(t,e);bx.code="new RegExp";var zL=["removeAdditional","useDefaults","coerceTypes"],KL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),GL={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},QL={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},gx=200;function ZL(t){var e,r,n,i,s,a,u,f,h,g,m,S,_,C,x,A,T,j,Y,V,K,ee,k,E,P;let N=t.strict,D=(e=t.code)===null||e===void 0?void 0:e.optimize,L=D===!0||D===void 0?1:D||0,z=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:bx,Z=(i=t.uriResolver)!==null&&i!==void 0?i:JL.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(u=t.strictNumbers)!==null&&u!==void 0?u:N)!==null&&f!==void 0?f:!0,strictTypes:(g=(h=t.strictTypes)!==null&&h!==void 0?h:N)!==null&&g!==void 0?g:"log",strictTuples:(S=(m=t.strictTuples)!==null&&m!==void 0?m:N)!==null&&S!==void 0?S:"log",strictRequired:(C=(_=t.strictRequired)!==null&&_!==void 0?_:N)!==null&&C!==void 0?C:!1,code:t.code?{...t.code,optimize:L,regExp:z}:{optimize:L,regExp:z},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:gx,loopEnum:(A=t.loopEnum)!==null&&A!==void 0?A:gx,meta:(T=t.meta)!==null&&T!==void 0?T:!0,messages:(j=t.messages)!==null&&j!==void 0?j:!0,inlineRefs:(Y=t.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(V=t.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(K=t.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(ee=t.validateSchema)!==null&&ee!==void 0?ee:!0,validateFormats:(k=t.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(E=t.unicodeRegExp)!==null&&E!==void 0?E:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:Z}}var hc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...ZL(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new YL.ValueScope({scope:{},prefixes:KL,es5:r,lines:n}),this.logger=ij(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,WL.getRules)(),yx.call(this,GL,e,"NOT SUPPORTED"),yx.call(this,QL,e,"DEPRECATED","warn"),this._metaOpts=rj.call(this),e.formats&&ej.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&tj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),XL.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=mx;n==="id"&&(i={...mx},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(g,m){await s.call(this,g.$schema);let S=this._addSchema(g,m);return S.validate||a.call(this,S)}async function s(g){g&&!this.getSchema(g)&&await i.call(this,{$ref:g},!0)}async function a(g){try{return this._compileSchemaEnv(g)}catch(m){if(!(m instanceof Sx.default))throw m;return u.call(this,m),await f.call(this,m.missingSchema),a.call(this,g)}}function u({missingSchema:g,missingRef:m}){if(this.refs[g])throw new Error(`AnySchema ${g} is loaded but ${m} cannot be resolved`)}async function f(g){let m=await h.call(this,g);this.refs[g]||await s.call(this,m.$schema),this.refs[g]||this.addSchema(m,g,r)}async function h(g){let m=this._loading[g];if(m)return m;try{return await(this._loading[g]=n(g))}finally{delete this._loading[g]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,dc.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=vx.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new fc.SchemaEnv({schema:{},schemaId:n});if(r=fc.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=vx.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,dc.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(oj.call(this,n,r),!r)return(0,uS.eachItem)(n,s=>lS.call(this,s)),this;lj.call(this,r);let i={...r,type:(0,jh.getJSONTypes)(r.type),schemaType:(0,jh.getJSONTypes)(r.schemaType)};return(0,uS.eachItem)(n,i.type.length===0?s=>lS.call(this,s,i):s=>i.type.forEach(a=>lS.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let u of s)a=a[u];for(let u in n){let f=n[u];if(typeof f!="object")continue;let{$data:h}=f.definition,g=a[u];h&&g&&(a[u]=_x(g))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:u}=this.opts;if(typeof e=="object")a=e[u];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,dc.normalizeId)(a||n);let h=dc.getSchemaRefs.call(this,e,n);return f=new fc.SchemaEnv({schema:e,schemaId:u,meta:r,baseId:n,localRefs:h}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):fc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{fc.compileSchema.call(this,e)}finally{this.opts=r}}};hc.ValidationError=VL.default;hc.MissingRefError=Sx.default;Qt.default=hc;function yx(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function vx(t){return t=(0,dc.normalizeId)(t),this.schemas[t]||this.refs[t]}function XL(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function ej(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function tj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function rj(){let t={...this.opts};for(let e of zL)delete t[e];return t}var nj={log(){},warn(){},error(){}};function ij(t){if(t===!1)return nj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var sj=/^[a-z_$][a-z0-9_$:-]*$/i;function oj(t,e){let{RULES:r}=this;if((0,uS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!sj.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function lS(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let u={keyword:t,definition:{...e,type:(0,jh.getJSONTypes)(e.type),schemaType:(0,jh.getJSONTypes)(e.schemaType)}};e.before?aj.call(this,a,u,e.before):a.rules.push(u),s.all[t]=u,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function aj(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function lj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=_x(e)),t.validateSchema=this.compile(e,!0))}var uj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _x(t){return{anyOf:[t,uj]}}});var Ex=F(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var cj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cS.default=cj});var Ix=F(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.callRef=Wo.getValidate=void 0;var fj=uc(),Cx=dn(),Tr=Me(),fl=Ki(),xx=Mh(),Uh=Je(),dj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:u,self:f}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return m();let g=xx.resolveRef.call(f,h,i,r);if(g===void 0)throw new fj.default(n.opts.uriResolver,i,r);if(g instanceof xx.SchemaEnv)return S(g);return _(g);function m(){if(s===h)return Bh(t,a,s,s.$async);let C=e.scopeValue("root",{ref:h});return Bh(t,(0,Tr._)`${C}.validate`,h,h.$async)}function S(C){let x=Rx(t,C);Bh(t,x,C,C.$async)}function _(C){let x=e.scopeValue("schema",u.code.source===!0?{ref:C,code:(0,Tr.stringify)(C)}:{ref:C}),A=e.name("valid"),T=t.subschema({schema:C,dataTypes:[],schemaPath:Tr.nil,topSchemaRef:x,errSchemaPath:r},A);t.mergeEvaluated(T),t.ok(A)}}};function Rx(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Tr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Wo.getValidate=Rx;function Bh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:u,opts:f}=s,h=f.passContext?fl.default.this:Tr.nil;n?g():m();function g(){if(!u.$async)throw new Error("async schema referenced by sync schema");let C=i.let("valid");i.try(()=>{i.code((0,Tr._)`await ${(0,Cx.callValidateCode)(t,e,h)}`),_(e),a||i.assign(C,!0)},x=>{i.if((0,Tr._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),S(x),a||i.assign(C,!1)}),t.ok(C)}function m(){t.result((0,Cx.callValidateCode)(t,e,h),()=>_(e),()=>S(e))}function S(C){let x=(0,Tr._)`${C}.errors`;i.assign(fl.default.vErrors,(0,Tr._)`${fl.default.vErrors} === null ? ${x} : ${fl.default.vErrors}.concat(${x})`),i.assign(fl.default.errors,(0,Tr._)`${fl.default.vErrors}.length`)}function _(C){var x;if(!s.opts.unevaluated)return;let A=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(s.props=Uh.mergeEvaluated.props(i,A.props,s.props));else{let T=i.var("props",(0,Tr._)`${C}.evaluated.props`);s.props=Uh.mergeEvaluated.props(i,T,s.props,Tr.Name)}if(s.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(s.items=Uh.mergeEvaluated.items(i,A.items,s.items));else{let T=i.var("items",(0,Tr._)`${C}.evaluated.items`);s.items=Uh.mergeEvaluated.items(i,T,s.items,Tr.Name)}}}Wo.callRef=Bh;Wo.default=dj});var Ox=F(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});var hj=Ex(),pj=Ix(),mj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",hj.default,pj.default];fS.default=mj});var Px=F(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});var Hh=Me(),Hs=Hh.operators,Vh={maximum:{okStr:"<=",ok:Hs.LTE,fail:Hs.GT},minimum:{okStr:">=",ok:Hs.GTE,fail:Hs.LT},exclusiveMaximum:{okStr:"<",ok:Hs.LT,fail:Hs.GTE},exclusiveMinimum:{okStr:">",ok:Hs.GT,fail:Hs.LTE}},gj={message:({keyword:t,schemaCode:e})=>(0,Hh.str)`must be ${Vh[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Hh._)`{comparison: ${Vh[t].okStr}, limit: ${e}}`},yj={keyword:Object.keys(Vh),type:"number",schemaType:"number",$data:!0,error:gj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Hh._)`${r} ${Vh[e].fail} ${n} || isNaN(${r})`)}};dS.default=yj});var kx=F(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var pc=Me(),vj={message:({schemaCode:t})=>(0,pc.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,pc._)`{multipleOf: ${t}}`},Sj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:vj,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),u=s?(0,pc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,pc._)`${a} !== parseInt(${a})`;t.fail$data((0,pc._)`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};hS.default=Sj});var Tx=F(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});function Ax(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}pS.default=Ax;Ax.code='require("ajv/dist/runtime/ucs2length").default'});var qx=F(mS=>{"use strict";Object.defineProperty(mS,"__esModule",{value:!0});var Yo=Me(),bj=Je(),_j=Tx(),wj={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Yo.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Yo._)`{limit: ${t}}`},Ej={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wj,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Yo.operators.GT:Yo.operators.LT,a=i.opts.unicode===!1?(0,Yo._)`${r}.length`:(0,Yo._)`${(0,bj.useFunc)(t.gen,_j.default)}(${r})`;t.fail$data((0,Yo._)`${a} ${s} ${n}`)}};mS.default=Ej});var $x=F(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});var Cj=dn(),Wh=Me(),xj={message:({schemaCode:t})=>(0,Wh.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Wh._)`{pattern: ${t}}`},Rj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:xj,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,a=s.opts.unicodeRegExp?"u":"",u=r?(0,Wh._)`(new RegExp(${i}, ${a}))`:(0,Cj.usePattern)(t,n);t.fail$data((0,Wh._)`!${u}.test(${e})`)}};gS.default=Rj});var Mx=F(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});var mc=Me(),Ij={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,mc.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,mc._)`{limit: ${t}}`},Oj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Ij,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?mc.operators.GT:mc.operators.LT;t.fail$data((0,mc._)`Object.keys(${r}).length ${i} ${n}`)}};yS.default=Oj});var Nx=F(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var gc=dn(),yc=Me(),Pj=Je(),kj={message:({params:{missingProperty:t}})=>(0,yc.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,yc._)`{missingProperty: ${t}}`},Aj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:kj,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:u}=a;if(!s&&r.length===0)return;let f=r.length>=u.loopRequired;if(a.allErrors?h():g(),u.strictRequired){let _=t.parentSchema.properties,{definedProperties:C}=t.it;for(let x of r)if(_?.[x]===void 0&&!C.has(x)){let A=a.schemaEnv.baseId+a.errSchemaPath,T=`required property "${x}" is not defined at "${A}" (strictRequired)`;(0,Pj.checkStrictMode)(a,T,a.opts.strictRequired)}}function h(){if(f||s)t.block$data(yc.nil,m);else for(let _ of r)(0,gc.checkReportMissingProp)(t,_)}function g(){let _=e.let("missing");if(f||s){let C=e.let("valid",!0);t.block$data(C,()=>S(_,C)),t.ok(C)}else e.if((0,gc.checkMissingProp)(t,r,_)),(0,gc.reportMissingProp)(t,_),e.else()}function m(){e.forOf("prop",n,_=>{t.setParams({missingProperty:_}),e.if((0,gc.noPropertyInData)(e,i,_,u.ownProperties),()=>t.error())})}function S(_,C){t.setParams({missingProperty:_}),e.forOf(_,n,()=>{e.assign(C,(0,gc.propertyInData)(e,i,_,u.ownProperties)),e.if((0,yc.not)(C),()=>{t.error(),e.break()})},yc.nil)}}};vS.default=Aj});var Dx=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var vc=Me(),Tj={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vc.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,vc._)`{limit: ${t}}`},qj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Tj,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?vc.operators.GT:vc.operators.LT;t.fail$data((0,vc._)`${r}.length ${i} ${n}`)}};SS.default=qj});var Yh=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});var Fx=Vv();Fx.code='require("ajv/dist/runtime/equal").default';bS.default=Fx});var Lx=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var _S=ic(),Zt=Me(),$j=Je(),Mj=Yh(),Nj={message:({params:{i:t,j:e}})=>(0,Zt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Zt._)`{i: ${t}, j: ${e}}`},Dj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Nj,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=t;if(!n&&!i)return;let f=e.let("valid"),h=s.items?(0,_S.getSchemaTypes)(s.items):[];t.block$data(f,g,(0,Zt._)`${a} === false`),t.ok(f);function g(){let C=e.let("i",(0,Zt._)`${r}.length`),x=e.let("j");t.setParams({i:C,j:x}),e.assign(f,!0),e.if((0,Zt._)`${C} > 1`,()=>(m()?S:_)(C,x))}function m(){return h.length>0&&!h.some(C=>C==="object"||C==="array")}function S(C,x){let A=e.name("item"),T=(0,_S.checkDataTypes)(h,A,u.opts.strictNumbers,_S.DataType.Wrong),j=e.const("indices",(0,Zt._)`{}`);e.for((0,Zt._)`;${C}--;`,()=>{e.let(A,(0,Zt._)`${r}[${C}]`),e.if(T,(0,Zt._)`continue`),h.length>1&&e.if((0,Zt._)`typeof ${A} == "string"`,(0,Zt._)`${A} += "_"`),e.if((0,Zt._)`typeof ${j}[${A}] == "number"`,()=>{e.assign(x,(0,Zt._)`${j}[${A}]`),t.error(),e.assign(f,!1).break()}).code((0,Zt._)`${j}[${A}] = ${C}`)})}function _(C,x){let A=(0,$j.useFunc)(e,Mj.default),T=e.name("outer");e.label(T).for((0,Zt._)`;${C}--;`,()=>e.for((0,Zt._)`${x} = ${C}; ${x}--;`,()=>e.if((0,Zt._)`${A}(${r}[${C}], ${r}[${x}])`,()=>{t.error(),e.assign(f,!1).break(T)})))}}};wS.default=Dj});var jx=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var ES=Me(),Fj=Je(),Lj=Yh(),jj={message:"must be equal to constant",params:({schemaCode:t})=>(0,ES._)`{allowedValue: ${t}}`},Uj={keyword:"const",$data:!0,error:jj,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,ES._)`!${(0,Fj.useFunc)(e,Lj.default)}(${r}, ${i})`):t.fail((0,ES._)`${s} !== ${r}`)}};CS.default=Uj});var Ux=F(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var Sc=Me(),Bj=Je(),Hj=Yh(),Vj={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Sc._)`{allowedValues: ${t}}`},Wj={keyword:"enum",schemaType:"array",$data:!0,error:Vj,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let u=i.length>=a.opts.loopEnum,f,h=()=>f??(f=(0,Bj.useFunc)(e,Hj.default)),g;if(u||n)g=e.let("valid"),t.block$data(g,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let _=e.const("vSchema",s);g=(0,Sc.or)(...i.map((C,x)=>S(_,x)))}t.pass(g);function m(){e.assign(g,!1),e.forOf("v",s,_=>e.if((0,Sc._)`${h()}(${r}, ${_})`,()=>e.assign(g,!0).break()))}function S(_,C){let x=i[C];return typeof x=="object"&&x!==null?(0,Sc._)`${h()}(${r}, ${_}[${C}])`:(0,Sc._)`${r} === ${x}`}}};xS.default=Wj});var Bx=F(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var Yj=Px(),Jj=kx(),zj=qx(),Kj=$x(),Gj=Mx(),Qj=Nx(),Zj=Dx(),Xj=Lx(),e2=jx(),t2=Ux(),r2=[Yj.default,Jj.default,zj.default,Kj.default,Gj.default,Qj.default,Zj.default,Xj.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},e2.default,t2.default];RS.default=r2});var OS=F(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.validateAdditionalItems=void 0;var Jo=Me(),IS=Je(),n2={message:({params:{len:t}})=>(0,Jo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Jo._)`{limit: ${t}}`},i2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,IS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Hx(t,n)}};function Hx(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let u=r.const("len",(0,Jo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Jo._)`${u} <= ${e.length}`);else if(typeof n=="object"&&!(0,IS.alwaysValidSchema)(a,n)){let h=r.var("valid",(0,Jo._)`${u} <= ${e.length}`);r.if((0,Jo.not)(h),()=>f(h)),t.ok(h)}function f(h){r.forRange("i",e.length,u,g=>{t.subschema({keyword:s,dataProp:g,dataPropType:IS.Type.Num},h),a.allErrors||r.if((0,Jo.not)(h),()=>r.break())})}}bc.validateAdditionalItems=Hx;bc.default=i2});var PS=F(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.validateTuple=void 0;var Vx=Me(),Jh=Je(),s2=dn(),o2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Wx(t,"additionalItems",e);r.items=!0,!(0,Jh.alwaysValidSchema)(r,e)&&t.ok((0,s2.validateArray)(t))}};function Wx(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:u}=t;g(i),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=Jh.mergeEvaluated.items(n,r.length,u.items));let f=n.name("valid"),h=n.const("len",(0,Vx._)`${s}.length`);r.forEach((m,S)=>{(0,Jh.alwaysValidSchema)(u,m)||(n.if((0,Vx._)`${h} > ${S}`,()=>t.subschema({keyword:a,schemaProp:S,dataProp:S},f)),t.ok(f))});function g(m){let{opts:S,errSchemaPath:_}=u,C=r.length,x=C===m.minItems&&(C===m.maxItems||m[e]===!1);if(S.strictTuples&&!x){let A=`"${a}" is ${C}-tuple, but minItems or maxItems/${e} are not specified or different at path "${_}"`;(0,Jh.checkStrictMode)(u,A,S.strictTuples)}}}_c.validateTuple=Wx;_c.default=o2});var Yx=F(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var a2=PS(),l2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,a2.validateTuple)(t,"items")};kS.default=l2});var zx=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var Jx=Me(),u2=Je(),c2=dn(),f2=OS(),d2={message:({params:{len:t}})=>(0,Jx.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Jx._)`{limit: ${t}}`},h2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:d2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,u2.alwaysValidSchema)(n,e)&&(i?(0,f2.validateAdditionalItems)(t,i):t.ok((0,c2.validateArray)(t)))}};AS.default=h2});var Kx=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var pn=Me(),zh=Je(),p2={message:({params:{min:t,max:e}})=>e===void 0?(0,pn.str)`must contain at least ${t} valid item(s)`:(0,pn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,pn._)`{minContains: ${t}}`:(0,pn._)`{minContains: ${t}, maxContains: ${e}}`},m2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:p2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,u,{minContains:f,maxContains:h}=n;s.opts.next?(a=f===void 0?1:f,u=h):a=1;let g=e.const("len",(0,pn._)`${i}.length`);if(t.setParams({min:a,max:u}),u===void 0&&a===0){(0,zh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,zh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,zh.alwaysValidSchema)(s,r)){let x=(0,pn._)`${g} >= ${a}`;u!==void 0&&(x=(0,pn._)`${x} && ${g} <= ${u}`),t.pass(x);return}s.items=!0;let m=e.name("valid");u===void 0&&a===1?_(m,()=>e.if(m,()=>e.break())):a===0?(e.let(m,!0),u!==void 0&&e.if((0,pn._)`${i}.length > 0`,S)):(e.let(m,!1),S()),t.result(m,()=>t.reset());function S(){let x=e.name("_valid"),A=e.let("count",0);_(x,()=>e.if(x,()=>C(A)))}function _(x,A){e.forRange("i",0,g,T=>{t.subschema({keyword:"contains",dataProp:T,dataPropType:zh.Type.Num,compositeRule:!0},x),A()})}function C(x){e.code((0,pn._)`${x}++`),u===void 0?e.if((0,pn._)`${x} >= ${a}`,()=>e.assign(m,!0).break()):(e.if((0,pn._)`${x} > ${u}`,()=>e.assign(m,!1).break()),a===1?e.assign(m,!0):e.if((0,pn._)`${x} >= ${a}`,()=>e.assign(m,!0)))}}};TS.default=m2});var Zx=F(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.validateSchemaDeps=Si.validatePropertyDeps=Si.error=void 0;var qS=Me(),g2=Je(),wc=dn();Si.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,qS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,qS._)`{property: ${t},
|
|
23
|
+
`+new Error().stack),v=!1}return p.apply(this,arguments)},p)}var P={};function N(c,p){e.deprecationHandler!=null&&e.deprecationHandler(c,p),P[c]||(k(p),P[c]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function D(c){return typeof Function<"u"&&c instanceof Function||Object.prototype.toString.call(c)==="[object Function]"}function L(c){var p,v;for(v in c)s(c,v)&&(p=c[v],D(p)?this[v]=p:this["_"+v]=p);this._config=c,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function z(c,p){var v=m({},c),b;for(b in p)s(p,b)&&(i(c[b])&&i(p[b])?(v[b]={},m(v[b],c[b]),m(v[b],p[b])):p[b]!=null?v[b]=p[b]:delete v[b]);for(b in c)s(c,b)&&!s(p,b)&&i(c[b])&&(v[b]=m({},v[b]));return v}function Z(c){c!=null&&this.set(c)}var ae;Object.keys?ae=Object.keys:ae=function(c){var p,v=[];for(p in c)s(c,p)&&v.push(p);return v};var de={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function rt(c,p,v){var b=this._calendar[c]||this._calendar.sameElse;return D(b)?b.call(p,v):b}function Re(c,p,v){var b=""+Math.abs(c),R=p-b.length,$=c>=0;return($?v?"+":"":"-")+Math.pow(10,Math.max(0,R)).toString().substr(1)+b}var ge=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ae=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bt={},Tt={};function le(c,p,v,b){var R=b;typeof b=="string"&&(R=function(){return this[b]()}),c&&(Tt[c]=R),p&&(Tt[p[0]]=function(){return Re(R.apply(this,arguments),p[1],p[2])}),v&&(Tt[v]=function(){return this.localeData().ordinal(R.apply(this,arguments),c)})}function Zr(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function ns(c){var p=c.match(ge),v,b;for(v=0,b=p.length;v<b;v++)Tt[p[v]]?p[v]=Tt[p[v]]:p[v]=Zr(p[v]);return function(R){var $="",W;for(W=0;W<b;W++)$+=D(p[W])?p[W].call(R,c):p[W];return $}}function _t(c,p){return c.isValid()?(p=En(p,c.localeData()),bt[p]=bt[p]||ns(p),bt[p](c)):c.localeData().invalidDate()}function En(c,p){var v=5;function b(R){return p.longDateFormat(R)||R}for(Ae.lastIndex=0;v>=0&&Ae.test(c);)c=c.replace(Ae,b),Ae.lastIndex=0,v-=1;return c}var Xr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function er(c){var p=this._longDateFormat[c],v=this._longDateFormat[c.toUpperCase()];return p||!v?p:(this._longDateFormat[c]=v.match(ge).map(function(b){return b==="MMMM"||b==="MM"||b==="DD"||b==="dddd"?b.slice(1):b}).join(""),this._longDateFormat[c])}var dt="Invalid date";function en(){return this._invalidDate}var Xs="%d",Ht=/\d{1,2}/;function eo(c){return this._ordinal.replace("%d",c)}var Fm={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function xn(c,p,v,b){var R=this._relativeTime[v];return D(R)?R(c,p,v,b):R.replace(/%d/i,c)}function Gf(c,p){var v=this._relativeTime[c>0?"future":"past"];return D(v)?v(p):v.replace(/%s/i,p)}var Qf={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Vt(c){return typeof c=="string"?Qf[c]||Qf[c.toLowerCase()]:void 0}function fr(c){var p={},v,b;for(b in c)s(c,b)&&(v=Vt(b),v&&(p[v]=c[b]));return p}var to={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ma(c){var p=[],v;for(v in c)s(c,v)&&p.push({unit:v,priority:to[v]});return p.sort(function(b,R){return b.priority-R.priority}),p}var Zf=/\d/,Ft=/\d\d/,Xf=/\d{3}/,wi=/\d{4}/,Cn=/[+-]?\d{6}/,nt=/\d\d?/,ga=/\d\d\d\d?/,ya=/\d\d\d\d\d\d?/,is=/\d{1,3}/,ro=/\d{1,4}/,ss=/[+-]?\d{1,6}/,ni=/\d+/,os=/[+-]?\d+/,hu=/Z|[+-]\d\d:?\d\d/gi,va=/Z|[+-]\d\d(?::?\d\d)?/gi,Lm=/[+-]?\d+(\.\d{1,3})?/,no=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ei=/^[1-9]\d?/,Sa=/^([1-9]\d|\d)/,ba;ba={};function oe(c,p,v){ba[c]=D(p)?p:function(b,R){return b&&v?v:p}}function jm(c,p){return s(ba,c)?ba[c](p._strict,p._locale):new RegExp(Um(c))}function Um(c){return tn(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(p,v,b,R,$){return v||b||R||$}))}function tn(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function xr(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function Te(c){var p=+c,v=0;return p!==0&&isFinite(p)&&(v=xr(p)),v}var pu={};function Ke(c,p){var v,b=p,R;for(typeof c=="string"&&(c=[c]),f(p)&&(b=function($,W){W[p]=Te($)}),R=c.length,v=0;v<R;v++)pu[c[v]]=b}function io(c,p){Ke(c,function(v,b,R,$){R._w=R._w||{},p(v,R._w,R,$)})}function mu(c,p,v){p!=null&&s(pu,c)&&pu[c](p,v._a,v,c)}function _a(c){return c%4===0&&c%100!==0||c%400===0}var Wt=0,Rn=1,rn=2,It=3,Cr=4,In=5,xi=6,ed=7,Bm=8;le("Y",0,0,function(){var c=this.year();return c<=9999?Re(c,4):"+"+c}),le(0,["YY",2],0,function(){return this.year()%100}),le(0,["YYYY",4],0,"year"),le(0,["YYYYY",5],0,"year"),le(0,["YYYYYY",6,!0],0,"year"),oe("Y",os),oe("YY",nt,Ft),oe("YYYY",ro,wi),oe("YYYYY",ss,Cn),oe("YYYYYY",ss,Cn),Ke(["YYYYY","YYYYYY"],Wt),Ke("YYYY",function(c,p){p[Wt]=c.length===2?e.parseTwoDigitYear(c):Te(c)}),Ke("YY",function(c,p){p[Wt]=e.parseTwoDigitYear(c)}),Ke("Y",function(c,p){p[Wt]=parseInt(c,10)});function so(c){return _a(c)?366:365}e.parseTwoDigitYear=function(c){return Te(c)+(Te(c)>68?1900:2e3)};var td=as("FullYear",!0);function Hm(){return _a(this.year())}function as(c,p){return function(v){return v!=null?(ao(this,c,v),e.updateOffset(this,p),this):oo(this,c)}}function oo(c,p){if(!c.isValid())return NaN;var v=c._d,b=c._isUTC;switch(p){case"Milliseconds":return b?v.getUTCMilliseconds():v.getMilliseconds();case"Seconds":return b?v.getUTCSeconds():v.getSeconds();case"Minutes":return b?v.getUTCMinutes():v.getMinutes();case"Hours":return b?v.getUTCHours():v.getHours();case"Date":return b?v.getUTCDate():v.getDate();case"Day":return b?v.getUTCDay():v.getDay();case"Month":return b?v.getUTCMonth():v.getMonth();case"FullYear":return b?v.getUTCFullYear():v.getFullYear();default:return NaN}}function ao(c,p,v){var b,R,$,W,ie;if(!(!c.isValid()||isNaN(v))){switch(b=c._d,R=c._isUTC,p){case"Milliseconds":return void(R?b.setUTCMilliseconds(v):b.setMilliseconds(v));case"Seconds":return void(R?b.setUTCSeconds(v):b.setSeconds(v));case"Minutes":return void(R?b.setUTCMinutes(v):b.setMinutes(v));case"Hours":return void(R?b.setUTCHours(v):b.setHours(v));case"Date":return void(R?b.setUTCDate(v):b.setDate(v));case"FullYear":break;default:return}$=v,W=c.month(),ie=c.date(),ie=ie===29&&W===1&&!_a($)?28:ie,R?b.setUTCFullYear($,W,ie):b.setFullYear($,W,ie)}}function Vm(c){return c=Vt(c),D(this[c])?this[c]():this}function wa(c,p){if(typeof c=="object"){c=fr(c);var v=ma(c),b,R=v.length;for(b=0;b<R;b++)this[v[b].unit](c[v[b].unit])}else if(c=Vt(c),D(this[c]))return this[c](p);return this}function Wm(c,p){return(c%p+p)%p}var vt;Array.prototype.indexOf?vt=Array.prototype.indexOf:vt=function(c){var p;for(p=0;p<this.length;++p)if(this[p]===c)return p;return-1};function gu(c,p){if(isNaN(c)||isNaN(p))return NaN;var v=Wm(p,12);return c+=(p-v)/12,v===1?_a(c)?29:28:31-v%7%2}le("M",["MM",2],"Mo",function(){return this.month()+1}),le("MMM",0,0,function(c){return this.localeData().monthsShort(this,c)}),le("MMMM",0,0,function(c){return this.localeData().months(this,c)}),oe("M",nt,Ei),oe("MM",nt,Ft),oe("MMM",function(c,p){return p.monthsShortRegex(c)}),oe("MMMM",function(c,p){return p.monthsRegex(c)}),Ke(["M","MM"],function(c,p){p[Rn]=Te(c)-1}),Ke(["MMM","MMMM"],function(c,p,v,b){var R=v._locale.monthsParse(c,b,v._strict);R!=null?p[Rn]=R:x(v).invalidMonth=c});var rd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),yu="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),vu=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ym=no,Jm=no;function zm(c,p){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||vu).test(p)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function Km(c,p){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[vu.test(p)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function nd(c,p,v){var b,R,$,W=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)$=S([2e3,b]),this._shortMonthsParse[b]=this.monthsShort($,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months($,"").toLocaleLowerCase();return v?p==="MMM"?(R=vt.call(this._shortMonthsParse,W),R!==-1?R:null):(R=vt.call(this._longMonthsParse,W),R!==-1?R:null):p==="MMM"?(R=vt.call(this._shortMonthsParse,W),R!==-1?R:(R=vt.call(this._longMonthsParse,W),R!==-1?R:null)):(R=vt.call(this._longMonthsParse,W),R!==-1?R:(R=vt.call(this._shortMonthsParse,W),R!==-1?R:null))}function id(c,p,v){var b,R,$;if(this._monthsParseExact)return nd.call(this,c,p,v);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),b=0;b<12;b++){if(R=S([2e3,b]),v&&!this._longMonthsParse[b]&&(this._longMonthsParse[b]=new RegExp("^"+this.months(R,"").replace(".","")+"$","i"),this._shortMonthsParse[b]=new RegExp("^"+this.monthsShort(R,"").replace(".","")+"$","i")),!v&&!this._monthsParse[b]&&($="^"+this.months(R,"")+"|^"+this.monthsShort(R,""),this._monthsParse[b]=new RegExp($.replace(".",""),"i")),v&&p==="MMMM"&&this._longMonthsParse[b].test(c))return b;if(v&&p==="MMM"&&this._shortMonthsParse[b].test(c))return b;if(!v&&this._monthsParse[b].test(c))return b}}function Su(c,p){if(!c.isValid())return c;if(typeof p=="string"){if(/^\d+$/.test(p))p=Te(p);else if(p=c.localeData().monthsParse(p),!f(p))return c}var v=p,b=c.date();return b=b<29?b:Math.min(b,gu(c.year(),v)),c._isUTC?c._d.setUTCMonth(v,b):c._d.setMonth(v,b),c}function Ea(c){return c!=null?(Su(this,c),e.updateOffset(this,!0),this):oo(this,"Month")}function Gm(){return gu(this.year(),this.month())}function sd(c){return this._monthsParseExact?(s(this,"_monthsRegex")||bu.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Ym),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function xa(c){return this._monthsParseExact?(s(this,"_monthsRegex")||bu.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Jm),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function bu(){function c(ye,$e){return $e.length-ye.length}var p=[],v=[],b=[],R,$,W,ie;for(R=0;R<12;R++)$=S([2e3,R]),W=tn(this.monthsShort($,"")),ie=tn(this.months($,"")),p.push(W),v.push(ie),b.push(ie),b.push(W);p.sort(c),v.sort(c),b.sort(c),this._monthsRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+v.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+p.join("|")+")","i")}function Qm(c,p,v,b,R,$,W){var ie;return c<100&&c>=0?(ie=new Date(c+400,p,v,b,R,$,W),isFinite(ie.getFullYear())&&ie.setFullYear(c)):ie=new Date(c,p,v,b,R,$,W),ie}function ls(c){var p,v;return c<100&&c>=0?(v=Array.prototype.slice.call(arguments),v[0]=c+400,p=new Date(Date.UTC.apply(null,v)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(c)):p=new Date(Date.UTC.apply(null,arguments)),p}function lo(c,p,v){var b=7+p-v,R=(7+ls(c,0,b).getUTCDay()-p)%7;return-R+b-1}function Ca(c,p,v,b,R){var $=(7+v-b)%7,W=lo(c,b,R),ie=1+7*(p-1)+$+W,ye,$e;return ie<=0?(ye=c-1,$e=so(ye)+ie):ie>so(c)?(ye=c+1,$e=ie-so(c)):(ye=c,$e=ie),{year:ye,dayOfYear:$e}}function uo(c,p,v){var b=lo(c.year(),p,v),R=Math.floor((c.dayOfYear()-b-1)/7)+1,$,W;return R<1?(W=c.year()-1,$=R+nn(W,p,v)):R>nn(c.year(),p,v)?($=R-nn(c.year(),p,v),W=c.year()+1):(W=c.year(),$=R),{week:$,year:W}}function nn(c,p,v){var b=lo(c,p,v),R=lo(c+1,p,v);return(so(c)-b+R)/7}le("w",["ww",2],"wo","week"),le("W",["WW",2],"Wo","isoWeek"),oe("w",nt,Ei),oe("ww",nt,Ft),oe("W",nt,Ei),oe("WW",nt,Ft),io(["w","ww","W","WW"],function(c,p,v,b){p[b.substr(0,1)]=Te(c)});function _u(c){return uo(c,this._week.dow,this._week.doy).week}var wu={dow:0,doy:6};function us(){return this._week.dow}function od(){return this._week.doy}function ad(c){var p=this.localeData().week(this);return c==null?p:this.add((c-p)*7,"d")}function Zm(c){var p=uo(this,1,4).week;return c==null?p:this.add((c-p)*7,"d")}le("d",0,"do","day"),le("dd",0,0,function(c){return this.localeData().weekdaysMin(this,c)}),le("ddd",0,0,function(c){return this.localeData().weekdaysShort(this,c)}),le("dddd",0,0,function(c){return this.localeData().weekdays(this,c)}),le("e",0,0,"weekday"),le("E",0,0,"isoWeekday"),oe("d",nt),oe("e",nt),oe("E",nt),oe("dd",function(c,p){return p.weekdaysMinRegex(c)}),oe("ddd",function(c,p){return p.weekdaysShortRegex(c)}),oe("dddd",function(c,p){return p.weekdaysRegex(c)}),io(["dd","ddd","dddd"],function(c,p,v,b){var R=v._locale.weekdaysParse(c,b,v._strict);R!=null?p.d=R:x(v).invalidWeekday=c}),io(["d","e","E"],function(c,p,v,b){p[b]=Te(c)});function ld(c,p){return typeof c!="string"?c:isNaN(c)?(c=p.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function ud(c,p){return typeof c=="string"?p.weekdaysParse(c)%7||7:isNaN(c)?null:c}function Ra(c,p){return c.slice(p,7).concat(c.slice(0,p))}var cd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),fd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xm="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),eg=no,dd=no,tg=no;function rg(c,p){var v=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return c===!0?Ra(v,this._week.dow):c?v[c.day()]:v}function ng(c){return c===!0?Ra(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function ig(c){return c===!0?Ra(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function Eu(c,p,v){var b,R,$,W=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)$=S([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin($,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort($,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays($,"").toLocaleLowerCase();return v?p==="dddd"?(R=vt.call(this._weekdaysParse,W),R!==-1?R:null):p==="ddd"?(R=vt.call(this._shortWeekdaysParse,W),R!==-1?R:null):(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null):p==="dddd"?(R=vt.call(this._weekdaysParse,W),R!==-1||(R=vt.call(this._shortWeekdaysParse,W),R!==-1)?R:(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null)):p==="ddd"?(R=vt.call(this._shortWeekdaysParse,W),R!==-1||(R=vt.call(this._weekdaysParse,W),R!==-1)?R:(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null)):(R=vt.call(this._minWeekdaysParse,W),R!==-1||(R=vt.call(this._weekdaysParse,W),R!==-1)?R:(R=vt.call(this._shortWeekdaysParse,W),R!==-1?R:null))}function sg(c,p,v){var b,R,$;if(this._weekdaysParseExact)return Eu.call(this,c,p,v);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),b=0;b<7;b++){if(R=S([2e3,1]).day(b),v&&!this._fullWeekdaysParse[b]&&(this._fullWeekdaysParse[b]=new RegExp("^"+this.weekdays(R,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[b]=new RegExp("^"+this.weekdaysShort(R,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[b]=new RegExp("^"+this.weekdaysMin(R,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[b]||($="^"+this.weekdays(R,"")+"|^"+this.weekdaysShort(R,"")+"|^"+this.weekdaysMin(R,""),this._weekdaysParse[b]=new RegExp($.replace(".",""),"i")),v&&p==="dddd"&&this._fullWeekdaysParse[b].test(c))return b;if(v&&p==="ddd"&&this._shortWeekdaysParse[b].test(c))return b;if(v&&p==="dd"&&this._minWeekdaysParse[b].test(c))return b;if(!v&&this._weekdaysParse[b].test(c))return b}}function og(c){if(!this.isValid())return c!=null?this:NaN;var p=oo(this,"Day");return c!=null?(c=ld(c,this.localeData()),this.add(c-p,"d")):p}function ag(c){if(!this.isValid())return c!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return c==null?p:this.add(c-p,"d")}function lg(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var p=ud(c,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function ug(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||xu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=eg),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function lt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||xu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=dd),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function st(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||xu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tg),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function xu(){function c($t,qn){return qn.length-$t.length}var p=[],v=[],b=[],R=[],$,W,ie,ye,$e;for($=0;$<7;$++)W=S([2e3,1]).day($),ie=tn(this.weekdaysMin(W,"")),ye=tn(this.weekdaysShort(W,"")),$e=tn(this.weekdays(W,"")),p.push(ie),v.push(ye),b.push($e),R.push(ie),R.push(ye),R.push($e);p.sort(c),v.sort(c),b.sort(c),R.sort(c),this._weekdaysRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+v.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function Cu(){return this.hours()%12||12}function cg(){return this.hours()||24}le("H",["HH",2],0,"hour"),le("h",["hh",2],0,Cu),le("k",["kk",2],0,cg),le("hmm",0,0,function(){return""+Cu.apply(this)+Re(this.minutes(),2)}),le("hmmss",0,0,function(){return""+Cu.apply(this)+Re(this.minutes(),2)+Re(this.seconds(),2)}),le("Hmm",0,0,function(){return""+this.hours()+Re(this.minutes(),2)}),le("Hmmss",0,0,function(){return""+this.hours()+Re(this.minutes(),2)+Re(this.seconds(),2)});function hd(c,p){le(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}hd("a",!0),hd("A",!1);function pd(c,p){return p._meridiemParse}oe("a",pd),oe("A",pd),oe("H",nt,Sa),oe("h",nt,Ei),oe("k",nt,Ei),oe("HH",nt,Ft),oe("hh",nt,Ft),oe("kk",nt,Ft),oe("hmm",ga),oe("hmmss",ya),oe("Hmm",ga),oe("Hmmss",ya),Ke(["H","HH"],It),Ke(["k","kk"],function(c,p,v){var b=Te(c);p[It]=b===24?0:b}),Ke(["a","A"],function(c,p,v){v._isPm=v._locale.isPM(c),v._meridiem=c}),Ke(["h","hh"],function(c,p,v){p[It]=Te(c),x(v).bigHour=!0}),Ke("hmm",function(c,p,v){var b=c.length-2;p[It]=Te(c.substr(0,b)),p[Cr]=Te(c.substr(b)),x(v).bigHour=!0}),Ke("hmmss",function(c,p,v){var b=c.length-4,R=c.length-2;p[It]=Te(c.substr(0,b)),p[Cr]=Te(c.substr(b,2)),p[In]=Te(c.substr(R)),x(v).bigHour=!0}),Ke("Hmm",function(c,p,v){var b=c.length-2;p[It]=Te(c.substr(0,b)),p[Cr]=Te(c.substr(b))}),Ke("Hmmss",function(c,p,v){var b=c.length-4,R=c.length-2;p[It]=Te(c.substr(0,b)),p[Cr]=Te(c.substr(b,2)),p[In]=Te(c.substr(R))});function fg(c){return(c+"").toLowerCase().charAt(0)==="p"}var md=/[ap]\.?m?\.?/i,dg=as("Hours",!0);function qt(c,p,v){return c>11?v?"pm":"PM":v?"am":"AM"}var Ia={calendar:de,longDateFormat:Xr,invalidDate:dt,ordinal:Xs,dayOfMonthOrdinalParse:Ht,relativeTime:Fm,months:rd,monthsShort:yu,week:wu,weekdays:cd,weekdaysMin:Xm,weekdaysShort:fd,meridiemParse:md},Ge={},cs={},Ci;function Rr(c,p){var v,b=Math.min(c.length,p.length);for(v=0;v<b;v+=1)if(c[v]!==p[v])return v;return b}function Ru(c){return c&&c.toLowerCase().replace("_","-")}function gd(c){for(var p=0,v,b,R,$;p<c.length;){for($=Ru(c[p]).split("-"),v=$.length,b=Ru(c[p+1]),b=b?b.split("-"):null;v>0;){if(R=co($.slice(0,v).join("-")),R)return R;if(b&&b.length>=v&&Rr($,b)>=v-1)break;v--}p++}return Ci}function yd(c){return!!(c&&c.match("^[^/\\\\]*$"))}function co(c){var p=null,v;if(Ge[c]===void 0&&typeof al<"u"&&al&&al.exports&&yd(c))try{p=Ci._abbr,v=kt,v("./locale/"+c),On(p)}catch{Ge[c]=null}return Ge[c]}function On(c,p){var v;return c&&(u(p)?v=Pn(c):v=Oa(c,p),v?Ci=v:typeof console<"u"&&console.warn&&console.warn("Locale "+c+" not found. Did you forget to load it?")),Ci._abbr}function Oa(c,p){if(p!==null){var v,b=Ia;if(p.abbr=c,Ge[c]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),b=Ge[c]._config;else if(p.parentLocale!=null)if(Ge[p.parentLocale]!=null)b=Ge[p.parentLocale]._config;else if(v=co(p.parentLocale),v!=null)b=v._config;else return cs[p.parentLocale]||(cs[p.parentLocale]=[]),cs[p.parentLocale].push({name:c,config:p}),null;return Ge[c]=new Z(z(b,p)),cs[c]&&cs[c].forEach(function(R){Oa(R.name,R.config)}),On(c),Ge[c]}else return delete Ge[c],null}function dr(c,p){if(p!=null){var v,b,R=Ia;Ge[c]!=null&&Ge[c].parentLocale!=null?Ge[c].set(z(Ge[c]._config,p)):(b=co(c),b!=null&&(R=b._config),p=z(R,p),b==null&&(p.abbr=c),v=new Z(p),v.parentLocale=Ge[c],Ge[c]=v),On(c)}else Ge[c]!=null&&(Ge[c].parentLocale!=null?(Ge[c]=Ge[c].parentLocale,c===On()&&On(c)):Ge[c]!=null&&delete Ge[c]);return Ge[c]}function Pn(c){var p;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Ci;if(!n(c)){if(p=co(c),p)return p;c=[c]}return gd(c)}function hr(){return ae(Ge)}function Iu(c){var p,v=c._a;return v&&x(c).overflow===-2&&(p=v[Rn]<0||v[Rn]>11?Rn:v[rn]<1||v[rn]>gu(v[Wt],v[Rn])?rn:v[It]<0||v[It]>24||v[It]===24&&(v[Cr]!==0||v[In]!==0||v[xi]!==0)?It:v[Cr]<0||v[Cr]>59?Cr:v[In]<0||v[In]>59?In:v[xi]<0||v[xi]>999?xi:-1,x(c)._overflowDayOfYear&&(p<Wt||p>rn)&&(p=rn),x(c)._overflowWeeks&&p===-1&&(p=ed),x(c)._overflowWeekday&&p===-1&&(p=Bm),x(c).overflow=p),c}var vd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ii=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Pa=/Z|[+-]\d\d(?::?\d\d)?/,fs=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ot=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],si=/^\/?Date\((-?\d+)/i,Ou=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,hg={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ka(c){var p,v,b=c._i,R=vd.exec(b)||ii.exec(b),$,W,ie,ye,$e=fs.length,$t=ot.length;if(R){for(x(c).iso=!0,p=0,v=$e;p<v;p++)if(fs[p][1].exec(R[1])){W=fs[p][0],$=fs[p][2]!==!1;break}if(W==null){c._isValid=!1;return}if(R[3]){for(p=0,v=$t;p<v;p++)if(ot[p][1].exec(R[3])){ie=(R[2]||" ")+ot[p][0];break}if(ie==null){c._isValid=!1;return}}if(!$&&ie!=null){c._isValid=!1;return}if(R[4])if(Pa.exec(R[4]))ye="Z";else{c._isValid=!1;return}c._f=W+(ie||"")+(ye||""),Ta(c)}else c._isValid=!1}function pg(c,p,v,b,R,$){var W=[mg(c),yu.indexOf(p),parseInt(v,10),parseInt(b,10),parseInt(R,10)];return $&&W.push(parseInt($,10)),W}function mg(c){var p=parseInt(c,10);return p<=49?2e3+p:p<=999?1900+p:p}function gg(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Sd(c,p,v){if(c){var b=fd.indexOf(c),R=new Date(p[0],p[1],p[2]).getDay();if(b!==R)return x(v).weekdayMismatch=!0,v._isValid=!1,!1}return!0}function Aa(c,p,v){if(c)return hg[c];if(p)return 0;var b=parseInt(v,10),R=b%100,$=(b-R)/100;return $*60+R}function Ri(c){var p=Ou.exec(gg(c._i)),v;if(p){if(v=pg(p[4],p[3],p[2],p[5],p[6],p[7]),!Sd(p[1],v,c))return;c._a=v,c._tzm=Aa(p[8],p[9],p[10]),c._d=ls.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),x(c).rfc2822=!0}else c._isValid=!1}function yg(c){var p=si.exec(c._i);if(p!==null){c._d=new Date(+p[1]);return}if(ka(c),c._isValid===!1)delete c._isValid;else return;if(Ri(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=w("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(c){c._d=new Date(c._i+(c._useUTC?" UTC":""))});function Ii(c,p,v){return c??p??v}function bd(c){var p=new Date(e.now());return c._useUTC?[p.getUTCFullYear(),p.getUTCMonth(),p.getUTCDate()]:[p.getFullYear(),p.getMonth(),p.getDate()]}function fo(c){var p,v,b=[],R,$,W;if(!c._d){for(R=bd(c),c._w&&c._a[rn]==null&&c._a[Rn]==null&&Pu(c),c._dayOfYear!=null&&(W=Ii(c._a[Wt],R[Wt]),(c._dayOfYear>so(W)||c._dayOfYear===0)&&(x(c)._overflowDayOfYear=!0),v=ls(W,0,c._dayOfYear),c._a[Rn]=v.getUTCMonth(),c._a[rn]=v.getUTCDate()),p=0;p<3&&c._a[p]==null;++p)c._a[p]=b[p]=R[p];for(;p<7;p++)c._a[p]=b[p]=c._a[p]==null?p===2?1:0:c._a[p];c._a[It]===24&&c._a[Cr]===0&&c._a[In]===0&&c._a[xi]===0&&(c._nextDay=!0,c._a[It]=0),c._d=(c._useUTC?ls:Qm).apply(null,b),$=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[It]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==$&&(x(c).weekdayMismatch=!0)}}function Pu(c){var p,v,b,R,$,W,ie,ye,$e;p=c._w,p.GG!=null||p.W!=null||p.E!=null?($=1,W=4,v=Ii(p.GG,c._a[Wt],uo(Ze(),1,4).year),b=Ii(p.W,1),R=Ii(p.E,1),(R<1||R>7)&&(ye=!0)):($=c._locale._week.dow,W=c._locale._week.doy,$e=uo(Ze(),$,W),v=Ii(p.gg,c._a[Wt],$e.year),b=Ii(p.w,$e.week),p.d!=null?(R=p.d,(R<0||R>6)&&(ye=!0)):p.e!=null?(R=p.e+$,(p.e<0||p.e>6)&&(ye=!0)):R=$),b<1||b>nn(v,$,W)?x(c)._overflowWeeks=!0:ye!=null?x(c)._overflowWeekday=!0:(ie=Ca(v,b,R,$,W),c._a[Wt]=ie.year,c._dayOfYear=ie.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Ta(c){if(c._f===e.ISO_8601){ka(c);return}if(c._f===e.RFC_2822){Ri(c);return}c._a=[],x(c).empty=!0;var p=""+c._i,v,b,R,$,W,ie=p.length,ye=0,$e,$t;for(R=En(c._f,c._locale).match(ge)||[],$t=R.length,v=0;v<$t;v++)$=R[v],b=(p.match(jm($,c))||[])[0],b&&(W=p.substr(0,p.indexOf(b)),W.length>0&&x(c).unusedInput.push(W),p=p.slice(p.indexOf(b)+b.length),ye+=b.length),Tt[$]?(b?x(c).empty=!1:x(c).unusedTokens.push($),mu($,b,c)):c._strict&&!b&&x(c).unusedTokens.push($);x(c).charsLeftOver=ie-ye,p.length>0&&x(c).unusedInput.push(p),c._a[It]<=12&&x(c).bigHour===!0&&c._a[It]>0&&(x(c).bigHour=void 0),x(c).parsedDateParts=c._a.slice(0),x(c).meridiem=c._meridiem,c._a[It]=vg(c._locale,c._a[It],c._meridiem),$e=x(c).era,$e!==null&&(c._a[Wt]=c._locale.erasConvertYear($e,c._a[Wt])),fo(c),Iu(c)}function vg(c,p,v){var b;return v==null?p:c.meridiemHour!=null?c.meridiemHour(p,v):(c.isPM!=null&&(b=c.isPM(v),b&&p<12&&(p+=12),!b&&p===12&&(p=0)),p)}function ku(c){var p,v,b,R,$,W,ie=!1,ye=c._f.length;if(ye===0){x(c).invalidFormat=!0,c._d=new Date(NaN);return}for(R=0;R<ye;R++)$=0,W=!1,p=H({},c),c._useUTC!=null&&(p._useUTC=c._useUTC),p._f=c._f[R],Ta(p),A(p)&&(W=!0),$+=x(p).charsLeftOver,$+=x(p).unusedTokens.length*10,x(p).score=$,ie?$<b&&(b=$,v=p):(b==null||$<b||W)&&(b=$,v=p,W&&(ie=!0));m(c,v||p)}function Au(c){if(!c._d){var p=fr(c._i),v=p.day===void 0?p.date:p.day;c._a=g([p.year,p.month,v,p.hour,p.minute,p.second,p.millisecond],function(b){return b&&parseInt(b,10)}),fo(c)}}function Sg(c){var p=new K(Iu(Tu(c)));return p._nextDay&&(p.add(1,"d"),p._nextDay=void 0),p}function Tu(c){var p=c._i,v=c._f;return c._locale=c._locale||Pn(c._l),p===null||v===void 0&&p===""?T({nullInput:!0}):(typeof p=="string"&&(c._i=p=c._locale.preparse(p)),X(p)?new K(Iu(p)):(h(p)?c._d=p:n(v)?ku(c):v?Ta(c):pr(c),A(c)||(c._d=null),c))}function pr(c){var p=c._i;u(p)?c._d=new Date(e.now()):h(p)?c._d=new Date(p.valueOf()):typeof p=="string"?yg(c):n(p)?(c._a=g(p.slice(0),function(v){return parseInt(v,10)}),fo(c)):i(p)?Au(c):f(p)?c._d=new Date(p):e.createFromInputFallback(c)}function qa(c,p,v,b,R){var $={};return(p===!0||p===!1)&&(b=p,p=void 0),(v===!0||v===!1)&&(b=v,v=void 0),(i(c)&&a(c)||n(c)&&c.length===0)&&(c=void 0),$._isAMomentObject=!0,$._useUTC=$._isUTC=R,$._l=v,$._i=c,$._f=p,$._strict=b,Sg($)}function Ze(c,p,v,b){return qa(c,p,v,b,!1)}var _d=w("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=Ze.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:T()}),wd=w("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=Ze.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:T()});function Ed(c,p){var v,b;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return Ze();for(v=p[0],b=1;b<p.length;++b)(!p[b].isValid()||p[b][c](v))&&(v=p[b]);return v}function bg(){var c=[].slice.call(arguments,0);return Ed("isBefore",c)}function _g(){var c=[].slice.call(arguments,0);return Ed("isAfter",c)}var wg=function(){return Date.now?Date.now():+new Date},ho=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ds(c){var p,v=!1,b,R=ho.length;for(p in c)if(s(c,p)&&!(vt.call(ho,p)!==-1&&(c[p]==null||!isNaN(c[p]))))return!1;for(b=0;b<R;++b)if(c[ho[b]]){if(v)return!1;parseFloat(c[ho[b]])!==Te(c[ho[b]])&&(v=!0)}return!0}function Eg(){return this._isValid}function xg(){return Xe(NaN)}function hs(c){var p=fr(c),v=p.year||0,b=p.quarter||0,R=p.month||0,$=p.week||p.isoWeek||0,W=p.day||0,ie=p.hour||0,ye=p.minute||0,$e=p.second||0,$t=p.millisecond||0;this._isValid=ds(p),this._milliseconds=+$t+$e*1e3+ye*6e4+ie*1e3*60*60,this._days=+W+$*7,this._months=+R+b*3+v*12,this._data={},this._locale=Pn(),this._bubble()}function po(c){return c instanceof hs}function sn(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function $a(c,p,v){var b=Math.min(c.length,p.length),R=Math.abs(c.length-p.length),$=0,W;for(W=0;W<b;W++)(v&&c[W]!==p[W]||!v&&Te(c[W])!==Te(p[W]))&&$++;return $+R}function xd(c,p){le(c,0,0,function(){var v=this.utcOffset(),b="+";return v<0&&(v=-v,b="-"),b+Re(~~(v/60),2)+p+Re(~~v%60,2)})}xd("Z",":"),xd("ZZ",""),oe("Z",va),oe("ZZ",va),Ke(["Z","ZZ"],function(c,p,v){v._useUTC=!0,v._tzm=qu(va,c)});var Cg=/([\+\-]|\d\d)/gi;function qu(c,p){var v=(p||"").match(c),b,R,$;return v===null?null:(b=v[v.length-1]||[],R=(b+"").match(Cg)||["-",0,0],$=+(R[1]*60)+Te(R[2]),$===0?0:R[0]==="+"?$:-$)}function oi(c,p){var v,b;return p._isUTC?(v=p.clone(),b=(X(c)||h(c)?c.valueOf():Ze(c).valueOf())-v.valueOf(),v._d.setTime(v._d.valueOf()+b),e.updateOffset(v,!1),v):Ze(c).local()}function mr(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function Cd(c,p,v){var b=this._offset||0,R;if(!this.isValid())return c!=null?this:NaN;if(c!=null){if(typeof c=="string"){if(c=qu(va,c),c===null)return this}else Math.abs(c)<16&&!v&&(c=c*60);return!this._isUTC&&p&&(R=mr(this)),this._offset=c,this._isUTC=!0,R!=null&&this.add(R,"m"),b!==c&&(!p||this._changeInProgress?mo(this,Xe(c-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:mr(this)}function Rg(c,p){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,p),this):-this.utcOffset()}function Ig(c){return this.utcOffset(0,c)}function Og(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(mr(this),"m")),this}function Pg(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=qu(hu,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function kg(c){return this.isValid()?(c=c?Ze(c).utcOffset():0,(this.utcOffset()-c)%60===0):!1}function ai(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function j(){if(!u(this._isDSTShifted))return this._isDSTShifted;var c={},p;return H(c,this),c=Tu(c),c._a?(p=c._isUTC?S(c._a):Ze(c._a),this._isDSTShifted=this.isValid()&&$a(c._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function J(){return this.isValid()?!this._isUTC:!1}function V(){return this.isValid()?this._isUTC:!1}function se(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ve=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Je=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Xe(c,p){var v=c,b=null,R,$,W;return po(c)?v={ms:c._milliseconds,d:c._days,M:c._months}:f(c)||!isNaN(+c)?(v={},p?v[p]=+c:v.milliseconds=+c):(b=ve.exec(c))?(R=b[1]==="-"?-1:1,v={y:0,d:Te(b[rn])*R,h:Te(b[It])*R,m:Te(b[Cr])*R,s:Te(b[In])*R,ms:Te(sn(b[xi]*1e3))*R}):(b=Je.exec(c))?(R=b[1]==="-"?-1:1,v={y:je(b[2],R),M:je(b[3],R),w:je(b[4],R),d:je(b[5],R),h:je(b[6],R),m:je(b[7],R),s:je(b[8],R)}):v==null?v={}:typeof v=="object"&&("from"in v||"to"in v)&&(W=Ag(Ze(v.from),Ze(v.to)),v={},v.ms=W.milliseconds,v.M=W.months),$=new hs(v),po(c)&&s(c,"_locale")&&($._locale=c._locale),po(c)&&s(c,"_isValid")&&($._isValid=c._isValid),$}Xe.fn=hs.prototype,Xe.invalid=xg;function je(c,p){var v=c&&parseFloat(c.replace(",","."));return(isNaN(v)?0:v)*p}function Ma(c,p){var v={};return v.months=p.month()-c.month()+(p.year()-c.year())*12,c.clone().add(v.months,"M").isAfter(p)&&--v.months,v.milliseconds=+p-+c.clone().add(v.months,"M"),v}function Ag(c,p){var v;return c.isValid()&&p.isValid()?(p=oi(p,c),c.isBefore(p)?v=Ma(c,p):(v=Ma(p,c),v.milliseconds=-v.milliseconds,v.months=-v.months),v):{milliseconds:0,months:0}}function gr(c,p){return function(v,b){var R,$;return b!==null&&!isNaN(+b)&&(N(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),$=v,v=b,b=$),R=Xe(v,b),mo(this,R,c),this}}function mo(c,p,v,b){var R=p._milliseconds,$=sn(p._days),W=sn(p._months);c.isValid()&&(b=b??!0,W&&Su(c,oo(c,"Month")+W*v),$&&ao(c,"Date",oo(c,"Date")+$*v),R&&c._d.setTime(c._d.valueOf()+R*v),b&&e.updateOffset(c,$||W))}var Tg=gr(1,"add"),ps=gr(-1,"subtract");function go(c){return typeof c=="string"||c instanceof String}function Na(c){return X(c)||h(c)||go(c)||f(c)||qg(c)||Qe(c)||c===null||c===void 0}function Qe(c){var p=i(c)&&!a(c),v=!1,b=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],R,$,W=b.length;for(R=0;R<W;R+=1)$=b[R],v=v||s(c,$);return p&&v}function qg(c){var p=n(c),v=!1;return p&&(v=c.filter(function(b){return!f(b)&&go(c)}).length===0),p&&v}function Rd(c){var p=i(c)&&!a(c),v=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],R,$;for(R=0;R<b.length;R+=1)$=b[R],v=v||s(c,$);return p&&v}function Da(c,p){var v=c.diff(p,"days",!0);return v<-6?"sameElse":v<-1?"lastWeek":v<0?"lastDay":v<1?"sameDay":v<2?"nextDay":v<7?"nextWeek":"sameElse"}function $g(c,p){arguments.length===1&&(arguments[0]?Na(arguments[0])?(c=arguments[0],p=void 0):Rd(arguments[0])&&(p=arguments[0],c=void 0):(c=void 0,p=void 0));var v=c||Ze(),b=oi(v,this).startOf("day"),R=e.calendarFormat(this,b)||"sameElse",$=p&&(D(p[R])?p[R].call(this,v):p[R]);return this.format($||this.localeData().calendar(R,this,Ze(v)))}function Mg(){return new K(this)}function Ng(c,p){var v=X(c)?c:Ze(c);return this.isValid()&&v.isValid()?(p=Vt(p)||"millisecond",p==="millisecond"?this.valueOf()>v.valueOf():v.valueOf()<this.clone().startOf(p).valueOf()):!1}function Fa(c,p){var v=X(c)?c:Ze(c);return this.isValid()&&v.isValid()?(p=Vt(p)||"millisecond",p==="millisecond"?this.valueOf()<v.valueOf():this.clone().endOf(p).valueOf()<v.valueOf()):!1}function li(c,p,v,b){var R=X(c)?c:Ze(c),$=X(p)?p:Ze(p);return this.isValid()&&R.isValid()&&$.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(R,v):!this.isBefore(R,v))&&(b[1]===")"?this.isBefore($,v):!this.isAfter($,v))):!1}function La(c,p){var v=X(c)?c:Ze(c),b;return this.isValid()&&v.isValid()?(p=Vt(p)||"millisecond",p==="millisecond"?this.valueOf()===v.valueOf():(b=v.valueOf(),this.clone().startOf(p).valueOf()<=b&&b<=this.clone().endOf(p).valueOf())):!1}function Id(c,p){return this.isSame(c,p)||this.isAfter(c,p)}function ja(c,p){return this.isSame(c,p)||this.isBefore(c,p)}function Od(c,p,v){var b,R,$;if(!this.isValid())return NaN;if(b=oi(c,this),!b.isValid())return NaN;switch(R=(b.utcOffset()-this.utcOffset())*6e4,p=Vt(p),p){case"year":$=yo(this,b)/12;break;case"month":$=yo(this,b);break;case"quarter":$=yo(this,b)/3;break;case"second":$=(this-b)/1e3;break;case"minute":$=(this-b)/6e4;break;case"hour":$=(this-b)/36e5;break;case"day":$=(this-b-R)/864e5;break;case"week":$=(this-b-R)/6048e5;break;default:$=this-b}return v?$:xr($)}function yo(c,p){if(c.date()<p.date())return-yo(p,c);var v=(p.year()-c.year())*12+(p.month()-c.month()),b=c.clone().add(v,"months"),R,$;return p-b<0?(R=c.clone().add(v-1,"months"),$=(p-b)/(b-R)):(R=c.clone().add(v+1,"months"),$=(p-b)/(R-b)),-(v+$)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Ua(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Pd(c){if(!this.isValid())return null;var p=c!==!0,v=p?this.clone().utc():this;return v.year()<0||v.year()>9999?_t(v,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",_t(v,"Z")):_t(v,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function vo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",p="",v,b,R,$;return this.isLocal()||(c=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),v="["+c+'("]',b=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",R="-MM-DD[T]HH:mm:ss.SSS",$=p+'[")]',this.format(v+b+R+$)}function Oi(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var p=_t(this,c);return this.localeData().postformat(p)}function Ba(c,p){return this.isValid()&&(X(c)&&c.isValid()||Ze(c).isValid())?Xe({to:this,from:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Dg(c){return this.from(Ze(),c)}function Fg(c,p){return this.isValid()&&(X(c)&&c.isValid()||Ze(c).isValid())?Xe({from:this,to:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Lg(c){return this.to(Ze(),c)}function So(c){var p;return c===void 0?this._locale._abbr:(p=Pn(c),p!=null&&(this._locale=p),this)}var bo=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(c){return c===void 0?this.localeData():this.locale(c)});function Ha(){return this._locale}var Va=1e3,Pi=60*Va,Wa=60*Pi,kd=(365*400+97)*24*Wa;function ht(c,p){return(c%p+p)%p}function Lt(c,p,v){return c<100&&c>=0?new Date(c+400,p,v)-kd:new Date(c,p,v).valueOf()}function Ad(c,p,v){return c<100&&c>=0?Date.UTC(c+400,p,v)-kd:Date.UTC(c,p,v)}function jg(c){var p,v;if(c=Vt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(v=this._isUTC?Ad:Lt,c){case"year":p=v(this.year(),0,1);break;case"quarter":p=v(this.year(),this.month()-this.month()%3,1);break;case"month":p=v(this.year(),this.month(),1);break;case"week":p=v(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=v(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=v(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=ht(p+(this._isUTC?0:this.utcOffset()*Pi),Wa);break;case"minute":p=this._d.valueOf(),p-=ht(p,Pi);break;case"second":p=this._d.valueOf(),p-=ht(p,Va);break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Td(c){var p,v;if(c=Vt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(v=this._isUTC?Ad:Lt,c){case"year":p=v(this.year()+1,0,1)-1;break;case"quarter":p=v(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=v(this.year(),this.month()+1,1)-1;break;case"week":p=v(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=v(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=v(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=Wa-ht(p+(this._isUTC?0:this.utcOffset()*Pi),Wa)-1;break;case"minute":p=this._d.valueOf(),p+=Pi-ht(p,Pi)-1;break;case"second":p=this._d.valueOf(),p+=Va-ht(p,Va)-1;break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Ug(){return this._d.valueOf()-(this._offset||0)*6e4}function $u(){return Math.floor(this.valueOf()/1e3)}function _o(){return new Date(this.valueOf())}function Mu(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function ms(){var c=this;return{years:c.year(),months:c.month(),date:c.date(),hours:c.hours(),minutes:c.minutes(),seconds:c.seconds(),milliseconds:c.milliseconds()}}function wo(){return this.isValid()?this.toISOString():null}function Eo(){return A(this)}function Ya(){return m({},x(this))}function gs(){return x(this).overflow}function Bg(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}le("N",0,0,"eraAbbr"),le("NN",0,0,"eraAbbr"),le("NNN",0,0,"eraAbbr"),le("NNNN",0,0,"eraName"),le("NNNNN",0,0,"eraNarrow"),le("y",["y",1],"yo","eraYear"),le("y",["yy",2],0,"eraYear"),le("y",["yyy",3],0,"eraYear"),le("y",["yyyy",4],0,"eraYear"),oe("N",tr),oe("NN",tr),oe("NNN",tr),oe("NNNN",qe),oe("NNNNN",Jg),Ke(["N","NN","NNN","NNNN","NNNNN"],function(c,p,v,b){var R=v._locale.erasParse(c,b,v._strict);R?x(v).era=R:x(v).invalidEra=c}),oe("y",ni),oe("yy",ni),oe("yyy",ni),oe("yyyy",ni),oe("yo",zg),Ke(["y","yy","yyy","yyyy"],Wt),Ke(["yo"],function(c,p,v,b){var R;v._locale._eraYearOrdinalRegex&&(R=c.match(v._locale._eraYearOrdinalRegex)),v._locale.eraYearOrdinalParse?p[Wt]=v._locale.eraYearOrdinalParse(c,R):p[Wt]=parseInt(c,10)});function Hg(c,p){var v,b,R,$=this._eras||Pn("en")._eras;for(v=0,b=$.length;v<b;++v)switch(typeof $[v].since==="string"&&(R=e($[v].since).startOf("day"),$[v].since=R.valueOf()),typeof $[v].until){case"undefined":$[v].until=1/0;break;case"string":R=e($[v].until).startOf("day").valueOf(),$[v].until=R.valueOf();break}return $}function Vg(c,p,v){var b,R,$=this.eras(),W,ie,ye;for(c=c.toUpperCase(),b=0,R=$.length;b<R;++b)if(W=$[b].name.toUpperCase(),ie=$[b].abbr.toUpperCase(),ye=$[b].narrow.toUpperCase(),v)switch(p){case"N":case"NN":case"NNN":if(ie===c)return $[b];break;case"NNNN":if(W===c)return $[b];break;case"NNNNN":if(ye===c)return $[b];break}else if([W,ie,ye].indexOf(c)>=0)return $[b]}function Wg(c,p){var v=c.since<=c.until?1:-1;return p===void 0?e(c.since).year():e(c.since).year()+(p-c.offset)*v}function Yg(){var c,p,v,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(v=this.clone().startOf("day").valueOf(),b[c].since<=v&&v<=b[c].until||b[c].until<=v&&v<=b[c].since)return b[c].name;return""}function Ja(){var c,p,v,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(v=this.clone().startOf("day").valueOf(),b[c].since<=v&&v<=b[c].until||b[c].until<=v&&v<=b[c].since)return b[c].narrow;return""}function xo(){var c,p,v,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(v=this.clone().startOf("day").valueOf(),b[c].since<=v&&v<=b[c].until||b[c].until<=v&&v<=b[c].since)return b[c].abbr;return""}function qd(){var c,p,v,b,R=this.localeData().eras();for(c=0,p=R.length;c<p;++c)if(v=R[c].since<=R[c].until?1:-1,b=this.clone().startOf("day").valueOf(),R[c].since<=b&&b<=R[c].until||R[c].until<=b&&b<=R[c].since)return(this.year()-e(R[c].since).year())*v+R[c].offset;return this.year()}function I(c){return s(this,"_erasNameRegex")||Nu.call(this),c?this._erasNameRegex:this._erasRegex}function ys(c){return s(this,"_erasAbbrRegex")||Nu.call(this),c?this._erasAbbrRegex:this._erasRegex}function za(c){return s(this,"_erasNarrowRegex")||Nu.call(this),c?this._erasNarrowRegex:this._erasRegex}function tr(c,p){return p.erasAbbrRegex(c)}function qe(c,p){return p.erasNameRegex(c)}function Jg(c,p){return p.erasNarrowRegex(c)}function zg(c,p){return p._eraYearOrdinalRegex||ni}function Nu(){var c=[],p=[],v=[],b=[],R,$,W,ie,ye,$e=this.eras();for(R=0,$=$e.length;R<$;++R)W=tn($e[R].name),ie=tn($e[R].abbr),ye=tn($e[R].narrow),p.push(W),c.push(ie),v.push(ye),b.push(W),b.push(ie),b.push(ye);this._erasRegex=new RegExp("^("+b.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+p.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+v.join("|")+")","i")}le(0,["gg",2],0,function(){return this.weekYear()%100}),le(0,["GG",2],0,function(){return this.isoWeekYear()%100});function on(c,p){le(0,[c,c.length],0,p)}on("gggg","weekYear"),on("ggggg","weekYear"),on("GGGG","isoWeekYear"),on("GGGGG","isoWeekYear"),oe("G",os),oe("g",os),oe("GG",nt,Ft),oe("gg",nt,Ft),oe("GGGG",ro,wi),oe("gggg",ro,wi),oe("GGGGG",ss,Cn),oe("ggggg",ss,Cn),io(["gggg","ggggg","GGGG","GGGGG"],function(c,p,v,b){p[b.substr(0,2)]=Te(c)}),io(["gg","GG"],function(c,p,v,b){p[b]=e.parseTwoDigitYear(c)});function Kg(c){return $d.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Gg(c){return $d.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function Qg(){return nn(this.year(),1,4)}function Zg(){return nn(this.isoWeekYear(),1,4)}function Xg(){var c=this.localeData()._week;return nn(this.year(),c.dow,c.doy)}function kn(){var c=this.localeData()._week;return nn(this.weekYear(),c.dow,c.doy)}function $d(c,p,v,b,R){var $;return c==null?uo(this,b,R).year:($=nn(c,b,R),p>$&&(p=$),ey.call(this,c,p,v,b,R))}function ey(c,p,v,b,R){var $=Ca(c,p,v,b,R),W=ls($.year,0,$.dayOfYear);return this.year(W.getUTCFullYear()),this.month(W.getUTCMonth()),this.date(W.getUTCDate()),this}le("Q",0,"Qo","quarter"),oe("Q",Zf),Ke("Q",function(c,p){p[Rn]=(Te(c)-1)*3});function ty(c){return c==null?Math.ceil((this.month()+1)/3):this.month((c-1)*3+this.month()%3)}le("D",["DD",2],"Do","date"),oe("D",nt,Ei),oe("DD",nt,Ft),oe("Do",function(c,p){return c?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],rn),Ke("Do",function(c,p){p[rn]=Te(c.match(nt)[0])});var Md=as("Date",!0);le("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("DDD",is),oe("DDDD",Xf),Ke(["DDD","DDDD"],function(c,p,v){v._dayOfYear=Te(c)});function ry(c){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return c==null?p:this.add(c-p,"d")}le("m",["mm",2],0,"minute"),oe("m",nt,Sa),oe("mm",nt,Ft),Ke(["m","mm"],Cr);var An=as("Minutes",!1);le("s",["ss",2],0,"second"),oe("s",nt,Sa),oe("ss",nt,Ft),Ke(["s","ss"],In);var ny=as("Seconds",!1);le("S",0,0,function(){return~~(this.millisecond()/100)}),le(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),le(0,["SSS",3],0,"millisecond"),le(0,["SSSS",4],0,function(){return this.millisecond()*10}),le(0,["SSSSS",5],0,function(){return this.millisecond()*100}),le(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),le(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),le(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),le(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),oe("S",is,Zf),oe("SS",is,Ft),oe("SSS",is,Xf);var ui,Nd;for(ui="SSSS";ui.length<=9;ui+="S")oe(ui,ni);function iy(c,p){p[xi]=Te(("0."+c)*1e3)}for(ui="S";ui.length<=9;ui+="S")Ke(ui,iy);Nd=as("Milliseconds",!1),le("z",0,0,"zoneAbbr"),le("zz",0,0,"zoneName");function sy(){return this._isUTC?"UTC":""}function ki(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Tg,te.calendar=$g,te.clone=Mg,te.diff=Od,te.endOf=Td,te.format=Oi,te.from=Ba,te.fromNow=Dg,te.to=Fg,te.toNow=Lg,te.get=Vm,te.invalidAt=gs,te.isAfter=Ng,te.isBefore=Fa,te.isBetween=li,te.isSame=La,te.isSameOrAfter=Id,te.isSameOrBefore=ja,te.isValid=Eo,te.lang=bo,te.locale=So,te.localeData=Ha,te.max=wd,te.min=_d,te.parsingFlags=Ya,te.set=wa,te.startOf=jg,te.subtract=ps,te.toArray=Mu,te.toObject=ms,te.toDate=_o,te.toISOString=Pd,te.inspect=vo,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=wo,te.toString=Ua,te.unix=$u,te.valueOf=Ug,te.creationData=Bg,te.eraName=Yg,te.eraNarrow=Ja,te.eraAbbr=xo,te.eraYear=qd,te.year=td,te.isLeapYear=Hm,te.weekYear=Kg,te.isoWeekYear=Gg,te.quarter=te.quarters=ty,te.month=Ea,te.daysInMonth=Gm,te.week=te.weeks=ad,te.isoWeek=te.isoWeeks=Zm,te.weeksInYear=Xg,te.weeksInWeekYear=kn,te.isoWeeksInYear=Qg,te.isoWeeksInISOWeekYear=Zg,te.date=Md,te.day=te.days=og,te.weekday=ag,te.isoWeekday=lg,te.dayOfYear=ry,te.hour=te.hours=dg,te.minute=te.minutes=An,te.second=te.seconds=ny,te.millisecond=te.milliseconds=Nd,te.utcOffset=Cd,te.utc=Ig,te.local=Og,te.parseZone=Pg,te.hasAlignedHourOffset=kg,te.isDST=ai,te.isLocal=J,te.isUtcOffset=V,te.isUtc=se,te.isUTC=se,te.zoneAbbr=sy,te.zoneName=ki,te.dates=w("dates accessor is deprecated. Use date instead.",Md),te.months=w("months accessor is deprecated. Use month instead",Ea),te.years=w("years accessor is deprecated. Use year instead",td),te.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Rg),te.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",j);function oy(c){return Ze(c*1e3)}function Br(){return Ze.apply(null,arguments).parseZone()}function Dd(c){return c}var He=Z.prototype;He.calendar=rt,He.longDateFormat=er,He.invalidDate=en,He.ordinal=eo,He.preparse=Dd,He.postformat=Dd,He.relativeTime=xn,He.pastFuture=Gf,He.set=L,He.eras=Hg,He.erasParse=Vg,He.erasConvertYear=Wg,He.erasAbbrRegex=ys,He.erasNameRegex=I,He.erasNarrowRegex=za,He.months=zm,He.monthsShort=Km,He.monthsParse=id,He.monthsRegex=xa,He.monthsShortRegex=sd,He.week=_u,He.firstDayOfYear=od,He.firstDayOfWeek=us,He.weekdays=rg,He.weekdaysMin=ig,He.weekdaysShort=ng,He.weekdaysParse=sg,He.weekdaysRegex=ug,He.weekdaysShortRegex=lt,He.weekdaysMinRegex=st,He.isPM=fg,He.meridiem=qt;function Ka(c,p,v,b){var R=Pn(),$=S().set(b,p);return R[v]($,c)}function Fd(c,p,v){if(f(c)&&(p=c,c=void 0),c=c||"",p!=null)return Ka(c,p,v,"month");var b,R=[];for(b=0;b<12;b++)R[b]=Ka(c,b,v,"month");return R}function Du(c,p,v,b){typeof c=="boolean"?(f(p)&&(v=p,p=void 0),p=p||""):(p=c,v=p,c=!1,f(p)&&(v=p,p=void 0),p=p||"");var R=Pn(),$=c?R._week.dow:0,W,ie=[];if(v!=null)return Ka(p,(v+$)%7,b,"day");for(W=0;W<7;W++)ie[W]=Ka(p,(W+$)%7,b,"day");return ie}function Ld(c,p){return Fd(c,p,"months")}function jd(c,p){return Fd(c,p,"monthsShort")}function ay(c,p,v){return Du(c,p,v,"weekdays")}function ly(c,p,v){return Du(c,p,v,"weekdaysShort")}function Fu(c,p,v){return Du(c,p,v,"weekdaysMin")}On("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(c){var p=c%10,v=Te(c%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return c+v}}),e.lang=w("moment.lang is deprecated. Use moment.locale instead.",On),e.langData=w("moment.langData is deprecated. Use moment.localeData instead.",Pn);var yr=Math.abs;function Ga(){var c=this._data;return this._milliseconds=yr(this._milliseconds),this._days=yr(this._days),this._months=yr(this._months),c.milliseconds=yr(c.milliseconds),c.seconds=yr(c.seconds),c.minutes=yr(c.minutes),c.hours=yr(c.hours),c.months=yr(c.months),c.years=yr(c.years),this}function Ud(c,p,v,b){var R=Xe(p,v);return c._milliseconds+=b*R._milliseconds,c._days+=b*R._days,c._months+=b*R._months,c._bubble()}function Bd(c,p){return Ud(this,c,p,1)}function uy(c,p){return Ud(this,c,p,-1)}function Hr(c){return c<0?Math.floor(c):Math.ceil(c)}function Lu(){var c=this._milliseconds,p=this._days,v=this._months,b=this._data,R,$,W,ie,ye;return c>=0&&p>=0&&v>=0||c<=0&&p<=0&&v<=0||(c+=Hr(rr(v)+p)*864e5,p=0,v=0),b.milliseconds=c%1e3,R=xr(c/1e3),b.seconds=R%60,$=xr(R/60),b.minutes=$%60,W=xr($/60),b.hours=W%24,p+=xr(W/24),ye=xr(ci(p)),v+=ye,p-=Hr(rr(ye)),ie=xr(v/12),v%=12,b.days=p,b.months=v,b.years=ie,this}function ci(c){return c*4800/146097}function rr(c){return c*146097/4800}function cy(c){if(!this.isValid())return NaN;var p,v,b=this._milliseconds;if(c=Vt(c),c==="month"||c==="quarter"||c==="year")switch(p=this._days+b/864e5,v=this._months+ci(p),c){case"month":return v;case"quarter":return v/3;case"year":return v/12}else switch(p=this._days+Math.round(rr(this._months)),c){case"week":return p/7+b/6048e5;case"day":return p+b/864e5;case"hour":return p*24+b/36e5;case"minute":return p*1440+b/6e4;case"second":return p*86400+b/1e3;case"millisecond":return Math.floor(p*864e5)+b;default:throw new Error("Unknown unit "+c)}}function an(c){return function(){return this.as(c)}}var ju=an("ms"),Co=an("s"),fi=an("m"),Hd=an("h"),fy=an("d"),Qa=an("w"),dy=an("M"),Vd=an("Q"),jt=an("y"),Uu=ju;function Wd(){return Xe(this)}function ln(c){return c=Vt(c),this.isValid()?this[c+"s"]():NaN}function Tn(c){return function(){return this.isValid()?this._data[c]:NaN}}var Za=Tn("milliseconds"),Ai=Tn("seconds"),Yd=Tn("minutes"),Jt=Tn("hours"),Bu=Tn("days"),hy=Tn("months"),py=Tn("years");function my(){return xr(this.days()/7)}var Vr=Math.round,vs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Ro(c,p,v,b,R){return R.relativeTime(p||1,!!v,c,b)}function Jd(c,p,v,b){var R=Xe(c).abs(),$=Vr(R.as("s")),W=Vr(R.as("m")),ie=Vr(R.as("h")),ye=Vr(R.as("d")),$e=Vr(R.as("M")),$t=Vr(R.as("w")),qn=Vr(R.as("y")),$n=$<=v.ss&&["s",$]||$<v.s&&["ss",$]||W<=1&&["m"]||W<v.m&&["mm",W]||ie<=1&&["h"]||ie<v.h&&["hh",ie]||ye<=1&&["d"]||ye<v.d&&["dd",ye];return v.w!=null&&($n=$n||$t<=1&&["w"]||$t<v.w&&["ww",$t]),$n=$n||$e<=1&&["M"]||$e<v.M&&["MM",$e]||qn<=1&&["y"]||["yy",qn],$n[2]=p,$n[3]=+c>0,$n[4]=b,Ro.apply(null,$n)}function gy(c){return c===void 0?Vr:typeof c=="function"?(Vr=c,!0):!1}function yy(c,p){return vs[c]===void 0?!1:p===void 0?vs[c]:(vs[c]=p,c==="s"&&(vs.ss=p-1),!0)}function Io(c,p){if(!this.isValid())return this.localeData().invalidDate();var v=!1,b=vs,R,$;return typeof c=="object"&&(p=c,c=!1),typeof c=="boolean"&&(v=c),typeof p=="object"&&(b=Object.assign({},vs,p),p.s!=null&&p.ss==null&&(b.ss=p.s-1)),R=this.localeData(),$=Jd(this,!v,b,R),v&&($=R.pastFuture(+this,$)),R.postformat($)}var Hu=Math.abs;function Ss(c){return(c>0)-(c<0)||+c}function bs(){if(!this.isValid())return this.localeData().invalidDate();var c=Hu(this._milliseconds)/1e3,p=Hu(this._days),v=Hu(this._months),b,R,$,W,ie=this.asSeconds(),ye,$e,$t,qn;return ie?(b=xr(c/60),R=xr(b/60),c%=60,b%=60,$=xr(v/12),v%=12,W=c?c.toFixed(3).replace(/\.?0+$/,""):"",ye=ie<0?"-":"",$e=Ss(this._months)!==Ss(ie)?"-":"",$t=Ss(this._days)!==Ss(ie)?"-":"",qn=Ss(this._milliseconds)!==Ss(ie)?"-":"",ye+"P"+($?$e+$+"Y":"")+(v?$e+v+"M":"")+(p?$t+p+"D":"")+(R||b||c?"T":"")+(R?qn+R+"H":"")+(b?qn+b+"M":"")+(c?qn+W+"S":"")):"P0D"}var De=hs.prototype;De.isValid=Eg,De.abs=Ga,De.add=Bd,De.subtract=uy,De.as=cy,De.asMilliseconds=ju,De.asSeconds=Co,De.asMinutes=fi,De.asHours=Hd,De.asDays=fy,De.asWeeks=Qa,De.asMonths=dy,De.asQuarters=Vd,De.asYears=jt,De.valueOf=Uu,De._bubble=Lu,De.clone=Wd,De.get=ln,De.milliseconds=Za,De.seconds=Ai,De.minutes=Yd,De.hours=Jt,De.days=Bu,De.weeks=my,De.months=hy,De.years=py,De.humanize=Io,De.toISOString=bs,De.toString=bs,De.toJSON=bs,De.locale=So,De.localeData=Ha,De.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",bs),De.lang=bo,le("X",0,0,"unix"),le("x",0,0,"valueOf"),oe("x",os),oe("X",Lm),Ke("X",function(c,p,v){v._d=new Date(parseFloat(c)*1e3)}),Ke("x",function(c,p,v){v._d=new Date(Te(c))});return e.version="2.30.1",r(Ze),e.fn=te,e.min=bg,e.max=_g,e.now=wg,e.utc=S,e.unix=oy,e.months=Ld,e.isDate=h,e.locale=On,e.invalid=T,e.duration=Xe,e.isMoment=X,e.weekdays=ay,e.parseZone=Br,e.localeData=Pn,e.isDuration=po,e.monthsShort=jd,e.weekdaysMin=Fu,e.defineLocale=Oa,e.updateLocale=dr,e.locales=hr,e.weekdaysShort=ly,e.normalizeUnits=Vt,e.relativeTimeRounding=gy,e.relativeTimeThreshold=yy,e.calendarFormat=Da,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var rx=F((tx,Sh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Sh<"u"&&Sh.exports?Sh.exports=e():t.tv4=e()})(tx,function(){Object.keys||(Object.keys=(function(){var k=Object.prototype.hasOwnProperty,w=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=P.length;return function(D){if(typeof D!="object"&&typeof D!="function"||D===null)throw new TypeError("Object.keys called on non-object");var L=[];for(var z in D)k.call(D,z)&&L.push(z);if(w)for(var Z=0;Z<N;Z++)k.call(D,P[Z])&&L.push(P[Z]);return L}})()),Object.create||(Object.create=(function(){function k(){}return function(w){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=w,new k}})()),Array.isArray||(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(k){if(this===null)throw new TypeError;var w=Object(this),P=w.length>>>0;if(P===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=P)return-1;for(var D=N>=0?N:Math.max(P-Math.abs(N),0);D<P;D++)if(D in w&&w[D]===k)return D;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var w="tv4_test_frozen_key";k.hasOwnProperty(w);)w+=Math.random();try{return k[w]=!0,delete k[w],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(w){return"%"+w.substring(3)})}function n(k){var w="";t[k.charAt(0)]&&(w=k.charAt(0),k=k.substring(1));var P="",N="",D=!0,L=!1,z=!1;w==="+"?D=!1:w==="."?(N=".",P="."):w==="/"?(N="/",P="/"):w==="#"?(N="#",D=!1):w===";"?(N=";",P=";",L=!0,z=!0):w==="?"?(N="?",P="&",L=!0):w==="&"&&(N="&",P="&",L=!0);for(var Z=[],ae=k.split(","),de=[],rt={},Re=0;Re<ae.length;Re++){var ge=ae[Re],Ae=null;if(ge.indexOf(":")!==-1){var bt=ge.split(":");ge=bt[0],Ae=parseInt(bt[1],10)}for(var Tt={};e[ge.charAt(ge.length-1)];)Tt[ge.charAt(ge.length-1)]=!0,ge=ge.substring(0,ge.length-1);var le={truncate:Ae,name:ge,suffices:Tt};de.push(le),rt[ge]=le,Z.push(ge)}var Zr=function(ns){for(var _t="",En=0,Xr=0;Xr<de.length;Xr++){var er=de[Xr],dt=ns(er.name);if(dt==null||Array.isArray(dt)&&dt.length===0||typeof dt=="object"&&Object.keys(dt).length===0){En++;continue}if(Xr===En?_t+=N:_t+=P||",",Array.isArray(dt)){L&&(_t+=er.name+"=");for(var en=0;en<dt.length;en++)en>0&&(_t+=er.suffices["*"]&&P||",",er.suffices["*"]&&L&&(_t+=er.name+"=")),_t+=D?encodeURIComponent(dt[en]).replace(/!/g,"%21"):r(dt[en])}else if(typeof dt=="object"){L&&!er.suffices["*"]&&(_t+=er.name+"=");var Xs=!0;for(var Ht in dt)Xs||(_t+=er.suffices["*"]&&P||","),Xs=!1,_t+=D?encodeURIComponent(Ht).replace(/!/g,"%21"):r(Ht),_t+=er.suffices["*"]?"=":",",_t+=D?encodeURIComponent(dt[Ht]).replace(/!/g,"%21"):r(dt[Ht])}else L&&(_t+=er.name,(!z||dt!=="")&&(_t+="=")),er.truncate!=null&&(dt=dt.substring(0,er.truncate)),_t+=D?encodeURIComponent(dt).replace(/!/g,"%21"):r(dt)}return _t};return Zr.varNames=Z,{prefix:N,substitution:Zr}}function i(k){if(!(this instanceof i))return new i(k);for(var w=k.split("{"),P=[w.shift()],N=[],D=[],L=[];w.length>0;){var z=w.shift(),Z=z.split("}")[0],ae=z.substring(Z.length+1),de=n(Z);D.push(de.substitution),N.push(de.prefix),P.push(ae),L=L.concat(de.substitution.varNames)}this.fill=function(rt){for(var Re=P[0],ge=0;ge<D.length;ge++){var Ae=D[ge];Re+=Ae(rt),Re+=P[ge+1]}return Re},this.varNames=L,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(w){return k[w]})}};var s=function(w,P,N,D,L){if(this.missing=[],this.missingMap={},this.formatValidators=w?Object.create(w.formatValidators):{},this.schemas=w?Object.create(w.schemas):{},this.collectMultiple=P,this.errors=[],this.handleError=P?this.collectError:this.returnError,D&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),L&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||E("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},w)for(var z in w.definedKeywords)this.definedKeywords[z]=w.definedKeywords[z].slice(0)};s.prototype.defineKeyword=function(k,w){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(w)},s.prototype.createError=function(k,w,P,N,D,L,z){var Z=new B(k,w,P,N,D);return Z.message=this.errorReporter(Z,L,z),Z},s.prototype.returnError=function(k){return k},s.prototype.collectError=function(k){return k&&this.errors.push(k),null},s.prototype.prefixErrors=function(k,w,P){for(var N=k;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(w,P);return this},s.prototype.banUnknownProperties=function(k,w){for(var P in this.unknownPropertyPaths){var N=this.createError(x.UNKNOWN_PROPERTY,{path:P},P,"",null,k,w),D=this.handleError(N);if(D)return D}return null},s.prototype.addFormat=function(k,w){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=w},s.prototype.resolveRefs=function(k,w){if(k.$ref!==void 0){if(w=w||{},w[k.$ref])return this.createError(x.CIRCULAR_REFERENCE,{urls:Object.keys(w).join(", ")},"","",null,void 0,k);w[k.$ref]=!0,k=this.getSchema(k.$ref,w)}return k},s.prototype.getSchema=function(k,w){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,w);var N=k,D="";if(k.indexOf("#")!==-1&&(D=k.substring(k.indexOf("#")+1),N=k.substring(0,k.indexOf("#"))),typeof this.schemas[N]=="object"){P=this.schemas[N];var L=decodeURIComponent(D);if(L==="")return this.resolveRefs(P,w);if(L.charAt(0)!=="/")return;for(var z=L.split("/").slice(1),Z=0;Z<z.length;Z++){var ae=z[Z].replace(/~1/g,"/").replace(/~0/g,"~");if(P[ae]===void 0){P=void 0;break}P=P[ae]}if(P!==void 0)return this.resolveRefs(P,w)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(k,w){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],w);else if(k&&typeof k=="object"){typeof k.id=="string"&&Y(w,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var N in k)if(N!=="enum"){if(typeof k[N]=="object")this.searchSchemas(k[N],w);else if(N==="$ref"){var D=m(k[N]);D&&this.schemas[D]===void 0&&this.missingMap[D]===void 0&&(this.missingMap[D]=D)}}}},s.prototype.addSchema=function(k,w){if(typeof k!="string"||typeof w>"u")if(typeof k=="object"&&typeof k.id=="string")w=k,k=w.id;else return;k===m(k)+"#"&&(k=m(k)),this.schemas[k]=w,delete this.missingMap[k],S(w,k),this.searchSchemas(w,k)},s.prototype.getSchemaMap=function(){var k={};for(var w in this.schemas)k[w]=this.schemas[w];return k},s.prototype.getSchemaUris=function(k){var w=[];for(var P in this.schemas)(!k||k.test(P))&&w.push(P);return w},s.prototype.getMissingUris=function(k){var w=[];for(var P in this.missingMap)(!k||k.test(P))&&w.push(P);return w},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,w,P,N,D){var L;if(w=this.resolveRefs(w),w){if(w instanceof B)return this.errors.push(w),w}else return null;var z=this.errors.length,Z,ae=null,de=null;if(this.checkRecursive&&k&&typeof k=="object"){if(L=!this.scanned.length,k[this.validatedSchemasKey]){var rt=k[this.validatedSchemasKey].indexOf(w);if(rt!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][rt]),null}if(Object.isFrozen(k)&&(Z=this.scannedFrozen.indexOf(k),Z!==-1)){var Re=this.scannedFrozenSchemas[Z].indexOf(w);if(Re!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Z][Re]),null}if(this.scanned.push(k),Object.isFrozen(k))Z===-1&&(Z=this.scannedFrozen.length,this.scannedFrozen.push(k),this.scannedFrozenSchemas.push([])),ae=this.scannedFrozenSchemas[Z].length,this.scannedFrozenSchemas[Z][ae]=w,this.scannedFrozenValidationErrors[Z][ae]=[];else{if(!k[this.validatedSchemasKey])try{Object.defineProperty(k,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(k,this.validationErrorsKey,{value:[],configurable:!0})}catch{k[this.validatedSchemasKey]=[],k[this.validationErrorsKey]=[]}de=k[this.validatedSchemasKey].length,k[this.validatedSchemasKey][de]=w,k[this.validationErrorsKey][de]=[]}}var ge=this.errors.length,Ae=this.validateBasic(k,w,D)||this.validateNumeric(k,w,D)||this.validateString(k,w,D)||this.validateArray(k,w,D)||this.validateObject(k,w,D)||this.validateCombinations(k,w,D)||this.validateHypermedia(k,w,D)||this.validateFormat(k,w,D)||this.validateDefinedKeywords(k,w,D)||null;if(L){for(;this.scanned.length;){var bt=this.scanned.pop();delete bt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ae||ge!==this.errors.length)for(;P&&P.length||N&&N.length;){var Tt=P&&P.length?""+P.pop():null,le=N&&N.length?""+N.pop():null;Ae&&(Ae=Ae.prefixWith(Tt,le)),this.prefixErrors(ge,Tt,le)}return ae!==null?this.scannedFrozenValidationErrors[Z][ae]=this.errors.slice(z):de!==null&&(k[this.validationErrorsKey][de]=this.errors.slice(z)),this.handleError(Ae)},s.prototype.validateFormat=function(k,w){if(typeof w.format!="string"||!this.formatValidators[w.format])return null;var P=this.formatValidators[w.format].call(null,k,w);return typeof P=="string"||typeof P=="number"?this.createError(x.FORMAT_CUSTOM,{message:P},"","/format",null,k,w):P&&typeof P=="object"?this.createError(x.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,w):null},s.prototype.validateDefinedKeywords=function(k,w,P){for(var N in this.definedKeywords)if(!(typeof w[N]>"u"))for(var D=this.definedKeywords[N],L=0;L<D.length;L++){var z=D[L],Z=z(k,w[N],w,P);if(typeof Z=="string"||typeof Z=="number")return this.createError(x.KEYWORD_CUSTOM,{key:N,message:Z},"","",null,k,w).prefixWith(null,N);if(Z&&typeof Z=="object"){var ae=Z.code;if(typeof ae=="string"){if(!x[ae])throw new Error("Undefined error code (use defineError): "+ae);ae=x[ae]}else typeof ae!="number"&&(ae=x.KEYWORD_CUSTOM);var de=typeof Z.message=="object"?Z.message:{key:N,message:Z.message||"?"},rt=Z.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ae,de,Z.dataPath||null,rt,null,k,w)}}return null};function a(k,w){if(k===w)return!0;if(k&&w&&typeof k=="object"&&typeof w=="object"){if(Array.isArray(k)!==Array.isArray(w))return!1;if(Array.isArray(k)){if(k.length!==w.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],w[P]))return!1}else{var N;for(N in k)if(w[N]===void 0&&k[N]!==void 0)return!1;for(N in w)if(k[N]===void 0&&w[N]!==void 0)return!1;for(N in k)if(!a(k[N],w[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(w,P,N){var D;return(D=this.validateType(w,P,N))||(D=this.validateEnum(w,P,N))?D.prefixWith(null,"type"):null},s.prototype.validateType=function(w,P){if(P.type===void 0)return null;var N=typeof w;w===null?N="null":Array.isArray(w)&&(N="array");var D=P.type;Array.isArray(D)||(D=[D]);for(var L=0;L<D.length;L++){var z=D[L];if(z===N||z==="integer"&&N==="number"&&w%1===0)return null}return this.createError(x.INVALID_TYPE,{type:N,expected:D.join("/")},"","",null,w,P)},s.prototype.validateEnum=function(w,P){if(P.enum===void 0)return null;for(var N=0;N<P.enum.length;N++){var D=P.enum[N];if(a(w,D))return null}return this.createError(x.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(w):w},"","",null,w,P)},s.prototype.validateNumeric=function(w,P,N){return this.validateMultipleOf(w,P,N)||this.validateMinMax(w,P,N)||this.validateNaN(w,P,N)||null};var u=Math.pow(2,-51),f=1-u;s.prototype.validateMultipleOf=function(w,P){var N=P.multipleOf||P.divisibleBy;if(N===void 0)return null;if(typeof w=="number"){var D=w/N%1;if(D>=u&&D<f)return this.createError(x.NUMBER_MULTIPLE_OF,{value:w,multipleOf:N},"","",null,w,P)}return null},s.prototype.validateMinMax=function(w,P){if(typeof w!="number")return null;if(P.minimum!==void 0){if(w<P.minimum)return this.createError(x.NUMBER_MINIMUM,{value:w,minimum:P.minimum},"","/minimum",null,w,P);if(P.exclusiveMinimum&&w===P.minimum)return this.createError(x.NUMBER_MINIMUM_EXCLUSIVE,{value:w,minimum:P.minimum},"","/exclusiveMinimum",null,w,P)}if(P.maximum!==void 0){if(w>P.maximum)return this.createError(x.NUMBER_MAXIMUM,{value:w,maximum:P.maximum},"","/maximum",null,w,P);if(P.exclusiveMaximum&&w===P.maximum)return this.createError(x.NUMBER_MAXIMUM_EXCLUSIVE,{value:w,maximum:P.maximum},"","/exclusiveMaximum",null,w,P)}return null},s.prototype.validateNaN=function(w,P){return typeof w!="number"?null:isNaN(w)===!0||w===1/0||w===-1/0?this.createError(x.NUMBER_NOT_A_NUMBER,{value:w},"","/type",null,w,P):null},s.prototype.validateString=function(w,P,N){return this.validateStringLength(w,P,N)||this.validateStringPattern(w,P,N)||null},s.prototype.validateStringLength=function(w,P){return typeof w!="string"?null:P.minLength!==void 0&&w.length<P.minLength?this.createError(x.STRING_LENGTH_SHORT,{length:w.length,minimum:P.minLength},"","/minLength",null,w,P):P.maxLength!==void 0&&w.length>P.maxLength?this.createError(x.STRING_LENGTH_LONG,{length:w.length,maximum:P.maxLength},"","/maxLength",null,w,P):null},s.prototype.validateStringPattern=function(w,P){if(typeof w!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var N;if(P.pattern instanceof RegExp)N=P.pattern;else{var D,L="",z=P.pattern.match(/^\/(.+)\/([img]*)$/);z?(D=z[1],L=z[2]):D=P.pattern,N=new RegExp(D,L)}return N.test(w)?null:this.createError(x.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,w,P)},s.prototype.validateArray=function(w,P,N){return Array.isArray(w)&&(this.validateArrayLength(w,P,N)||this.validateArrayUniqueItems(w,P,N)||this.validateArrayItems(w,P,N))||null},s.prototype.validateArrayLength=function(w,P){var N;return P.minItems!==void 0&&w.length<P.minItems&&(N=this.createError(x.ARRAY_LENGTH_SHORT,{length:w.length,minimum:P.minItems},"","/minItems",null,w,P),this.handleError(N))||P.maxItems!==void 0&&w.length>P.maxItems&&(N=this.createError(x.ARRAY_LENGTH_LONG,{length:w.length,maximum:P.maxItems},"","/maxItems",null,w,P),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(w,P){if(P.uniqueItems){for(var N=0;N<w.length;N++)for(var D=N+1;D<w.length;D++)if(a(w[N],w[D])){var L=this.createError(x.ARRAY_UNIQUE,{match1:N,match2:D},"","/uniqueItems",null,w,P);if(this.handleError(L))return L}}return null},s.prototype.validateArrayItems=function(w,P,N){if(P.items===void 0)return null;var D,L;if(Array.isArray(P.items)){for(L=0;L<w.length;L++)if(L<P.items.length){if(D=this.validateAll(w[L],P.items[L],[L],["items",L],N+"/"+L))return D}else if(P.additionalItems!==void 0){if(typeof P.additionalItems=="boolean"){if(!P.additionalItems&&(D=this.createError(x.ARRAY_ADDITIONAL_ITEMS,{},"/"+L,"/additionalItems",null,w,P),this.handleError(D)))return D}else if(D=this.validateAll(w[L],P.additionalItems,[L],["additionalItems"],N+"/"+L))return D}}else for(L=0;L<w.length;L++)if(D=this.validateAll(w[L],P.items,[L],["items"],N+"/"+L))return D;return null},s.prototype.validateObject=function(w,P,N){return typeof w!="object"||w===null||Array.isArray(w)?null:this.validateObjectMinMaxProperties(w,P,N)||this.validateObjectRequiredProperties(w,P,N)||this.validateObjectProperties(w,P,N)||this.validateObjectDependencies(w,P,N)||null},s.prototype.validateObjectMinMaxProperties=function(w,P){var N=Object.keys(w),D;return P.minProperties!==void 0&&N.length<P.minProperties&&(D=this.createError(x.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:P.minProperties},"","/minProperties",null,w,P),this.handleError(D))||P.maxProperties!==void 0&&N.length>P.maxProperties&&(D=this.createError(x.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:P.maxProperties},"","/maxProperties",null,w,P),this.handleError(D))?D:null},s.prototype.validateObjectRequiredProperties=function(w,P){if(P.required!==void 0)for(var N=0;N<P.required.length;N++){var D=P.required[N];if(w[D]===void 0){var L=this.createError(x.OBJECT_REQUIRED,{key:D},"","/required/"+N,null,w,P);if(this.handleError(L))return L}}return null},s.prototype.validateObjectProperties=function(w,P,N){var D;for(var L in w){var z=N+"/"+L.replace(/~/g,"~0").replace(/\//g,"~1"),Z=!1;if(P.properties!==void 0&&P.properties[L]!==void 0&&(Z=!0,D=this.validateAll(w[L],P.properties[L],[L],["properties",L],z)))return D;if(P.patternProperties!==void 0)for(var ae in P.patternProperties){var de=new RegExp(ae);if(de.test(L)&&(Z=!0,D=this.validateAll(w[L],P.patternProperties[ae],[L],["patternProperties",ae],z)))return D}if(Z)this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]);else if(P.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]),typeof P.additionalProperties=="boolean"){if(!P.additionalProperties&&(D=this.createError(x.OBJECT_ADDITIONAL_PROPERTIES,{key:L},"","/additionalProperties",null,w,P).prefixWith(L,null),this.handleError(D)))return D}else if(D=this.validateAll(w[L],P.additionalProperties,[L],["additionalProperties"],z))return D}else this.trackUnknownProperties&&!this.knownPropertyPaths[z]&&(this.unknownPropertyPaths[z]=!0)}return null},s.prototype.validateObjectDependencies=function(w,P,N){var D;if(P.dependencies!==void 0){for(var L in P.dependencies)if(w[L]!==void 0){var z=P.dependencies[L];if(typeof z=="string"){if(w[z]===void 0&&(D=this.createError(x.OBJECT_DEPENDENCY_KEY,{key:L,missing:z},"","",null,w,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(Array.isArray(z))for(var Z=0;Z<z.length;Z++){var ae=z[Z];if(w[ae]===void 0&&(D=this.createError(x.OBJECT_DEPENDENCY_KEY,{key:L,missing:ae},"","/"+Z,null,w,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(D=this.validateAll(w,z,[],["dependencies",L],N))return D}}return null},s.prototype.validateCombinations=function(w,P,N){return this.validateAllOf(w,P,N)||this.validateAnyOf(w,P,N)||this.validateOneOf(w,P,N)||this.validateNot(w,P,N)||null},s.prototype.validateAllOf=function(w,P,N){if(P.allOf===void 0)return null;for(var D,L=0;L<P.allOf.length;L++){var z=P.allOf[L];if(D=this.validateAll(w,z,[],["allOf",L],N))return D}return null},s.prototype.validateAnyOf=function(w,P,N){if(P.anyOf===void 0)return null;var D=[],L=this.errors.length,z,Z;this.trackUnknownProperties&&(z=this.unknownPropertyPaths,Z=this.knownPropertyPaths);for(var ae=!0,de=0;de<P.anyOf.length;de++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var rt=P.anyOf[de],Re=this.errors.length,ge=this.validateAll(w,rt,[],["anyOf",de],N);if(ge===null&&Re===this.errors.length){if(this.errors=this.errors.slice(0,L),this.trackUnknownProperties){for(var Ae in this.knownPropertyPaths)Z[Ae]=!0,delete z[Ae];for(var bt in this.unknownPropertyPaths)Z[bt]||(z[bt]=!0);ae=!1;continue}return null}ge&&D.push(ge.prefixWith(null,""+de).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=z,this.knownPropertyPaths=Z),ae)return D=D.concat(this.errors.slice(L)),this.errors=this.errors.slice(0,L),this.createError(x.ANY_OF_MISSING,{},"","/anyOf",D,w,P)},s.prototype.validateOneOf=function(w,P,N){if(P.oneOf===void 0)return null;var D=null,L=[],z=this.errors.length,Z,ae;this.trackUnknownProperties&&(Z=this.unknownPropertyPaths,ae=this.knownPropertyPaths);for(var de=0;de<P.oneOf.length;de++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var rt=P.oneOf[de],Re=this.errors.length,ge=this.validateAll(w,rt,[],["oneOf",de],N);if(ge===null&&Re===this.errors.length){if(D===null)D=de;else return this.errors=this.errors.slice(0,z),this.createError(x.ONE_OF_MULTIPLE,{index1:D,index2:de},"","/oneOf",null,w,P);if(this.trackUnknownProperties){for(var Ae in this.knownPropertyPaths)ae[Ae]=!0,delete Z[Ae];for(var bt in this.unknownPropertyPaths)ae[bt]||(Z[bt]=!0)}}else ge&&L.push(ge)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Z,this.knownPropertyPaths=ae),D===null?(L=L.concat(this.errors.slice(z)),this.errors=this.errors.slice(0,z),this.createError(x.ONE_OF_MISSING,{},"","/oneOf",L,w,P)):(this.errors=this.errors.slice(0,z),null)},s.prototype.validateNot=function(w,P,N){if(P.not===void 0)return null;var D=this.errors.length,L,z;this.trackUnknownProperties&&(L=this.unknownPropertyPaths,z=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Z=this.validateAll(w,P.not,null,null,N),ae=this.errors.slice(D);return this.errors=this.errors.slice(0,D),this.trackUnknownProperties&&(this.unknownPropertyPaths=L,this.knownPropertyPaths=z),Z===null&&ae.length===0?this.createError(x.NOT_PASSED,{},"","/not",null,w,P):null},s.prototype.validateHypermedia=function(w,P,N){if(!P.links)return null;for(var D,L=0;L<P.links.length;L++){var z=P.links[L];if(z.rel==="describedby"){for(var Z=new i(z.href),ae=!0,de=0;de<Z.varNames.length;de++)if(!(Z.varNames[de]in w)){ae=!1;break}if(ae){var rt=Z.fillFromObject(w),Re={$ref:rt};if(D=this.validateAll(w,Re,[],["links",L],N))return D}}}};function h(k){var w=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return w?{href:w[0]||"",protocol:w[1]||"",authority:w[2]||"",host:w[3]||"",hostname:w[4]||"",port:w[5]||"",pathname:w[6]||"",search:w[7]||"",hash:w[8]||""}:null}function g(k,w){function P(N){var D=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(L){L==="/.."?D.pop():D.push(L)}),D.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return w=h(w||""),k=h(k||""),!w||!k?null:(w.protocol||k.protocol)+(w.protocol||w.authority?w.authority:k.authority)+P(w.protocol||w.authority||w.pathname.charAt(0)==="/"?w.pathname:w.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+w.pathname:k.pathname)+(w.protocol||w.authority||w.pathname?w.search:w.search||k.search)+w.hash}function m(k){return k.split("#")[0]}function S(k,w){if(k&&typeof k=="object")if(w===void 0?w=k.id:typeof k.id=="string"&&(w=g(w,k.id),k.id=w),Array.isArray(k))for(var P=0;P<k.length;P++)S(k[P],w);else{typeof k.$ref=="string"&&(k.$ref=g(w,k.$ref));for(var N in k)N!=="enum"&&S(k[N],w)}}function E(k){k=k||"en";var w=H[k];return function(P){var N=w[P.code]||T[P.code];if(typeof N!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var D=P.params;return N.replace(/\{([^{}]*)\}/g,function(L,z){var Z=D[z];return typeof Z=="string"||typeof Z=="number"?Z:L})}}var x={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},C={};for(var A in x)C[x[A]]=A;var T={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function B(k,w,P,N,D){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=w,this.code=k,this.dataPath=P||"",this.schemaPath=N||"",this.subErrors=D||null;var L=new Error(this.message);if(this.stack=L.stack||L.stacktrace,!this.stack)try{throw L}catch(z){this.stack=z.stack||z.stacktrace}}B.prototype=Object.create(Error.prototype),B.prototype.constructor=B,B.prototype.name="ValidationError",B.prototype.prefixWith=function(k,w){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),w!==null&&(w=w.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+w+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,w);return this};function Y(k,w){if(w.substring(0,k.length)===k){var P=w.substring(k.length);if(w.length>0&&w.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var H={};function K(k){var w=new s,P,N,D={setErrorReporter:function(L){return typeof L=="string"?this.language(L):(N=L,!0)},addFormat:function(){w.addFormat.apply(w,arguments)},language:function(L){return L?(H[L]||(L=L.split("-")[0]),H[L]?(P=L,L):!1):P},addLanguage:function(L,z){var Z;for(Z in x)z[Z]&&!z[x[Z]]&&(z[x[Z]]=z[Z]);var ae=L.split("-")[0];if(!H[ae])H[L]=z,H[ae]=z;else{H[L]=Object.create(H[ae]);for(Z in z)typeof H[ae][Z]>"u"&&(H[ae][Z]=z[Z]),H[L][Z]=z[Z]}return this},freshApi:function(L){var z=K();return L&&z.language(L),z},validate:function(L,z,Z,ae){var de=E(P),rt=N?function(Ae,bt,Tt){return N(Ae,bt,Tt)||de(Ae,bt,Tt)}:de,Re=new s(w,!1,rt,Z,ae);typeof z=="string"&&(z={$ref:z}),Re.addSchema("",z);var ge=Re.validateAll(L,z,null,null,"");return!ge&&ae&&(ge=Re.banUnknownProperties(L,z)),this.error=ge,this.missing=Re.missing,this.valid=ge===null,this.valid},validateResult:function(){var L={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(L,arguments),L},validateMultiple:function(L,z,Z,ae){var de=E(P),rt=N?function(Ae,bt,Tt){return N(Ae,bt,Tt)||de(Ae,bt,Tt)}:de,Re=new s(w,!0,rt,Z,ae);typeof z=="string"&&(z={$ref:z}),Re.addSchema("",z),Re.validateAll(L,z,null,null,""),ae&&Re.banUnknownProperties(L,z);var ge={toString:function(){return this.valid?"valid":this.error.message}};return ge.errors=Re.errors,ge.missing=Re.missing,ge.valid=ge.errors.length===0,ge},addSchema:function(){return w.addSchema.apply(w,arguments)},getSchema:function(){return w.getSchema.apply(w,arguments)},getSchemaMap:function(){return w.getSchemaMap.apply(w,arguments)},getSchemaUris:function(){return w.getSchemaUris.apply(w,arguments)},getMissingUris:function(){return w.getMissingUris.apply(w,arguments)},dropSchemas:function(){w.dropSchemas.apply(w,arguments)},defineKeyword:function(){w.defineKeyword.apply(w,arguments)},defineError:function(L,z,Z){if(typeof L!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(L))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof z!="number"||z%1!==0||z<1e4)throw new Error("Code number must be an integer > 10000");if(typeof x[L]<"u")throw new Error("Error already defined: "+L+" as "+x[L]);if(typeof C[z]<"u")throw new Error("Error code already used: "+C[z]+" as "+z);x[L]=z,C[z]=L,T[L]=T[z]=Z;for(var ae in H){var de=H[ae];de[L]&&(de[z]=de[z]||de[L])}},reset:function(){w.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:S,resolveUrl:g,getDocumentUri:m,errorCodes:x};return D.language(k||"en"),D}var X=K();return X.addLanguage("en-gb",T),X.tv4=X,X})});var lc=F(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.regexpCode=ze.getEsmExportName=ze.getProperty=ze.safeStringify=ze.stringify=ze.strConcat=ze.addCodeArg=ze.str=ze._=ze.nil=ze._Code=ze.Name=ze.IDENTIFIER=ze._CodeOrName=void 0;var oc=class{};ze._CodeOrName=oc;ze.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Fo=class extends oc{constructor(e){if(super(),!ze.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ze.Name=Fo;var hn=class extends oc{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Fo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ze._Code=hn;ze.nil=new hn("");function nx(t,...e){let r=[t[0]],n=0;for(;n<e.length;)pv(r,e[n]),r.push(t[++n]);return new hn(r)}ze._=nx;var hv=new hn("+");function ix(t,...e){let r=[ac(t[0])],n=0;for(;n<e.length;)r.push(hv),pv(r,e[n]),r.push(hv,ac(t[++n]));return cD(r),new hn(r)}ze.str=ix;function pv(t,e){e instanceof hn?t.push(...e._items):e instanceof Fo?t.push(e):t.push(hD(e))}ze.addCodeArg=pv;function cD(t){let e=1;for(;e<t.length-1;){if(t[e]===hv){let r=fD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function fD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Fo||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Fo))return`"${t}${e.slice(1)}`}function dD(t,e){return e.emptyStr()?t:t.emptyStr()?e:ix`${t}${e}`}ze.strConcat=dD;function hD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:ac(Array.isArray(t)?t.join(","):t)}function pD(t){return new hn(ac(t))}ze.stringify=pD;function ac(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ze.safeStringify=ac;function mD(t){return typeof t=="string"&&ze.IDENTIFIER.test(t)?new hn(`.${t}`):nx`[${t}]`}ze.getProperty=mD;function gD(t){if(typeof t=="string"&&ze.IDENTIFIER.test(t))return new hn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ze.getEsmExportName=gD;function yD(t){return new hn(t.toString())}ze.regexpCode=yD});var yv=F(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.ValueScope=Tr.ValueScopeName=Tr.Scope=Tr.varKinds=Tr.UsedValueState=void 0;var Ar=lc(),mv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},bh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(bh||(Tr.UsedValueState=bh={}));Tr.varKinds={const:new Ar.Name("const"),let:new Ar.Name("let"),var:new Ar.Name("var")};var _h=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ar.Name?e:this.name(e)}name(e){return new Ar.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Tr.Scope=_h;var wh=class extends Ar.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ar._)`.${new Ar.Name(r)}[${n}]`}};Tr.ValueScopeName=wh;var vD=(0,Ar._)`\n`,gv=class extends _h{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?vD:Ar.nil}}get(){return this._scope}name(e){return new wh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,u=this._values[s];if(u){let g=u.get(a);if(g)return g}else u=this._values[s]=new Map;u.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),h=f.length;return f[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ar._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Ar.nil;for(let a in e){let u=e[a];if(!u)continue;let f=n[a]=n[a]||new Map;u.forEach(h=>{if(f.has(h))return;f.set(h,bh.Started);let g=r(h);if(g){let m=this.opts.es5?Tr.varKinds.var:Tr.varKinds.const;s=(0,Ar._)`${s}${m} ${h} = ${g};${this.opts._n}`}else if(g=i?.(h))s=(0,Ar._)`${s}${g}${this.opts._n}`;else throw new mv(h);f.set(h,bh.Completed)})}return s}};Tr.ValueScope=gv});var Me=F(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.or=ke.and=ke.not=ke.CodeGen=ke.operators=ke.varKinds=ke.ValueScopeName=ke.ValueScope=ke.Scope=ke.Name=ke.regexpCode=ke.stringify=ke.getProperty=ke.nil=ke.strConcat=ke.str=ke._=void 0;var Be=lc(),Un=yv(),Os=lc();Object.defineProperty(ke,"_",{enumerable:!0,get:function(){return Os._}});Object.defineProperty(ke,"str",{enumerable:!0,get:function(){return Os.str}});Object.defineProperty(ke,"strConcat",{enumerable:!0,get:function(){return Os.strConcat}});Object.defineProperty(ke,"nil",{enumerable:!0,get:function(){return Os.nil}});Object.defineProperty(ke,"getProperty",{enumerable:!0,get:function(){return Os.getProperty}});Object.defineProperty(ke,"stringify",{enumerable:!0,get:function(){return Os.stringify}});Object.defineProperty(ke,"regexpCode",{enumerable:!0,get:function(){return Os.regexpCode}});Object.defineProperty(ke,"Name",{enumerable:!0,get:function(){return Os.Name}});var Rh=yv();Object.defineProperty(ke,"Scope",{enumerable:!0,get:function(){return Rh.Scope}});Object.defineProperty(ke,"ValueScope",{enumerable:!0,get:function(){return Rh.ValueScope}});Object.defineProperty(ke,"ValueScopeName",{enumerable:!0,get:function(){return Rh.ValueScopeName}});Object.defineProperty(ke,"varKinds",{enumerable:!0,get:function(){return Rh.varKinds}});ke.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Hi=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},vv=class extends Hi{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Un.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ul(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},Eh=class extends Hi{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ul(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return Ch(e,this.rhs)}},Sv=class extends Eh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},bv=class extends Hi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},_v=class extends Hi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},wv=class extends Hi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Ev=class extends Hi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ul(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},uc=class extends Hi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(SD(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Uo(e,r.names),{})}},Vi=class extends uc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},xv=class extends uc{},ll=class extends Vi{};ll.kind="else";var Lo=class t extends Vi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ll(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(sx(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ul(this.condition,e,r),this}get names(){let e=super.names;return Ch(e,this.condition),this.else&&Uo(e,this.else.names),e}};Lo.kind="if";var jo=class extends Vi{};jo.kind="for";var Cv=class extends jo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ul(this.iteration,e,r),this}get names(){return Uo(super.names,this.iteration.names)}},Rv=class extends jo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Un.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Ch(super.names,this.from);return Ch(e,this.to)}},xh=class extends jo{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ul(this.iterable,e,r),this}get names(){return Uo(super.names,this.iterable.names)}},cc=class extends Vi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};cc.kind="func";var fc=class extends uc{render(e){return"return "+super.render(e)}};fc.kind="return";var Iv=class extends Vi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Uo(e,this.catch.names),this.finally&&Uo(e,this.finally.names),e}},dc=class extends Vi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};dc.kind="catch";var hc=class extends Vi{render(e){return"finally"+super.render(e)}};hc.kind="finally";var Ov=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
+
`:""},this._extScope=e,this._scope=new Un.Scope({parent:e}),this._nodes=[new xv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new vv(e,s,n)),s}const(e,r,n){return this._def(Un.varKinds.const,e,r,n)}let(e,r,n){return this._def(Un.varKinds.let,e,r,n)}var(e,r,n){return this._def(Un.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Eh(e,r,n))}add(e,r){return this._leafNode(new Sv(e,ke.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Ev(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Be.addCodeArg)(r,i));return r.push("}"),new Be._Code(r)}if(e,r,n){if(this._blockNode(new Lo(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Lo(e))}else(){return this._elseNode(new ll)}endIf(){return this._endBlockNode(Lo,ll)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Cv(e),r)}forRange(e,r,n,i,s=this.opts.es5?Un.varKinds.var:Un.varKinds.let){let a=this._scope.toName(e);return this._for(new Rv(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Un.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Be.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Be._)`${a}.length`,u=>{this.var(s,(0,Be._)`${a}[${u}]`),n(s)})}return this._for(new xh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Un.varKinds.var:Un.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new xh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(jo)}label(e){return this._leafNode(new bv(e))}break(e){return this._leafNode(new _v(e))}return(e){let r=new fc;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(fc)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Iv;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new dc(s),r(s)}return n&&(this._currNode=i.finally=new hc,this.code(n)),this._endBlockNode(dc,hc)}throw(e){return this._leafNode(new wv(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Be.nil,n,i){return this._blockNode(new cc(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(cc)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Lo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};ke.CodeGen=Ov;function Uo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Ch(t,e){return e instanceof Be._CodeOrName?Uo(t,e.names):t}function ul(t,e,r){if(t instanceof Be.Name)return n(t);if(!i(t))return t;return new Be._Code(t._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function SD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function sx(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${Pv(t)}`}ke.not=sx;var bD=ox(ke.operators.AND);function _D(...t){return t.reduce(bD)}ke.and=_D;var wD=ox(ke.operators.OR);function ED(...t){return t.reduce(wD)}ke.or=ED;function ox(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${Pv(e)} ${t} ${Pv(r)}`}function Pv(t){return t instanceof Be.Name?t:(0,Be._)`(${t})`}});var Ve=F(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.checkStrictMode=Ne.getErrorPath=Ne.Type=Ne.useFunc=Ne.setEvaluated=Ne.evaluatedPropsToName=Ne.mergeEvaluated=Ne.eachItem=Ne.unescapeJsonPointer=Ne.escapeJsonPointer=Ne.escapeFragment=Ne.unescapeFragment=Ne.schemaRefOrVal=Ne.schemaHasRulesButRef=Ne.schemaHasRules=Ne.checkUnknownRules=Ne.alwaysValidSchema=Ne.toHash=void 0;var ft=Me(),xD=lc();function CD(t){let e={};for(let r of t)e[r]=!0;return e}Ne.toHash=CD;function RD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(ux(t,e),!cx(e,t.self.RULES.all))}Ne.alwaysValidSchema=RD;function ux(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||hx(t,`unknown keyword: "${s}"`)}Ne.checkUnknownRules=ux;function cx(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ne.schemaHasRules=cx;function ID(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ne.schemaHasRulesButRef=ID;function OD({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ft._)`${r}`}return(0,ft._)`${t}${e}${(0,ft.getProperty)(n)}`}Ne.schemaRefOrVal=OD;function PD(t){return fx(decodeURIComponent(t))}Ne.unescapeFragment=PD;function kD(t){return encodeURIComponent(Av(t))}Ne.escapeFragment=kD;function Av(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ne.escapeJsonPointer=Av;function fx(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ne.unescapeJsonPointer=fx;function AD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ne.eachItem=AD;function ax({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{let f=a===void 0?s:a instanceof ft.Name?(s instanceof ft.Name?t(i,s,a):e(i,s,a),a):s instanceof ft.Name?(e(i,a,s),s):r(s,a);return u===ft.Name&&!(f instanceof ft.Name)?n(i,f):f}}Ne.mergeEvaluated={props:ax({mergeNames:(t,e,r)=>t.if((0,ft._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ft._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ft._)`${r} || {}`).code((0,ft._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ft._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ft._)`${r} || {}`),Tv(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:dx}),items:ax({mergeNames:(t,e,r)=>t.if((0,ft._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ft._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ft._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ft._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function dx(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ft._)`{}`);return e!==void 0&&Tv(t,r,e),r}Ne.evaluatedPropsToName=dx;function Tv(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ft._)`${e}${(0,ft.getProperty)(n)}`,!0))}Ne.setEvaluated=Tv;var lx={};function TD(t,e){return t.scopeValue("func",{ref:e,code:lx[e.code]||(lx[e.code]=new xD._Code(e.code))})}Ne.useFunc=TD;var kv;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(kv||(Ne.Type=kv={}));function qD(t,e,r){if(t instanceof ft.Name){let n=e===kv.Num;return r?n?(0,ft._)`"[" + ${t} + "]"`:(0,ft._)`"['" + ${t} + "']"`:n?(0,ft._)`"/" + ${t}`:(0,ft._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ft.getProperty)(t).toString():"/"+Av(t)}Ne.getErrorPath=qD;function hx(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ne.checkStrictMode=hx});var Wi=F(qv=>{"use strict";Object.defineProperty(qv,"__esModule",{value:!0});var ir=Me(),$D={data:new ir.Name("data"),valCxt:new ir.Name("valCxt"),instancePath:new ir.Name("instancePath"),parentData:new ir.Name("parentData"),parentDataProperty:new ir.Name("parentDataProperty"),rootData:new ir.Name("rootData"),dynamicAnchors:new ir.Name("dynamicAnchors"),vErrors:new ir.Name("vErrors"),errors:new ir.Name("errors"),this:new ir.Name("this"),self:new ir.Name("self"),scope:new ir.Name("scope"),json:new ir.Name("json"),jsonPos:new ir.Name("jsonPos"),jsonLen:new ir.Name("jsonLen"),jsonPart:new ir.Name("jsonPart")};qv.default=$D});var pc=F(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.extendErrors=sr.resetErrorsCount=sr.reportExtraError=sr.reportError=sr.keyword$DataError=sr.keywordError=void 0;var We=Me(),Ih=Ve(),_r=Wi();sr.keywordError={message:({keyword:t})=>(0,We.str)`must pass "${t}" keyword validation`};sr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,We.str)`"${t}" keyword must be ${e} ($data)`:(0,We.str)`"${t}" keyword is invalid ($data)`};function MD(t,e=sr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:u}=i,f=gx(t,e,r);n??(a||u)?px(s,f):mx(i,(0,We._)`[${f}]`)}sr.reportError=MD;function ND(t,e=sr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,u=gx(t,e,r);px(i,u),s||a||mx(n,_r.default.vErrors)}sr.reportExtraError=ND;function DD(t,e){t.assign(_r.default.errors,e),t.if((0,We._)`${_r.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,We._)`${_r.default.vErrors}.length`,e),()=>t.assign(_r.default.vErrors,null)))}sr.resetErrorsCount=DD;function FD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,_r.default.errors,u=>{t.const(a,(0,We._)`${_r.default.vErrors}[${u}]`),t.if((0,We._)`${a}.instancePath === undefined`,()=>t.assign((0,We._)`${a}.instancePath`,(0,We.strConcat)(_r.default.instancePath,s.errorPath))),t.assign((0,We._)`${a}.schemaPath`,(0,We.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,We._)`${a}.schema`,r),t.assign((0,We._)`${a}.data`,n))})}sr.extendErrors=FD;function px(t,e){let r=t.const("err",e);t.if((0,We._)`${_r.default.vErrors} === null`,()=>t.assign(_r.default.vErrors,(0,We._)`[${r}]`),(0,We._)`${_r.default.vErrors}.push(${r})`),t.code((0,We._)`${_r.default.errors}++`)}function mx(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,We._)`new ${t.ValidationError}(${e})`):(r.assign((0,We._)`${n}.errors`,e),r.return(!1))}var Bo={keyword:new We.Name("keyword"),schemaPath:new We.Name("schemaPath"),params:new We.Name("params"),propertyName:new We.Name("propertyName"),message:new We.Name("message"),schema:new We.Name("schema"),parentSchema:new We.Name("parentSchema")};function gx(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,We._)`{}`:LD(t,e,r)}function LD(t,e,r={}){let{gen:n,it:i}=t,s=[jD(i,r),UD(t,r)];return BD(t,e,s),n.object(...s)}function jD({errorPath:t},{instancePath:e}){let r=e?(0,We.str)`${t}${(0,Ih.getErrorPath)(e,Ih.Type.Str)}`:t;return[_r.default.instancePath,(0,We.strConcat)(_r.default.instancePath,r)]}function UD({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,We.str)`${e}/${t}`;return r&&(i=(0,We.str)`${i}${(0,Ih.getErrorPath)(r,Ih.Type.Str)}`),[Bo.schemaPath,i]}function BD(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:u}=t,{opts:f,propertyName:h,topSchemaRef:g,schemaPath:m}=u;n.push([Bo.keyword,i],[Bo.params,typeof e=="function"?e(t):e||(0,We._)`{}`]),f.messages&&n.push([Bo.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Bo.schema,a],[Bo.parentSchema,(0,We._)`${g}${m}`],[_r.default.data,s]),h&&n.push([Bo.propertyName,h])}});var vx=F(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.boolOrEmptySchema=cl.topBoolOrEmptySchema=void 0;var HD=pc(),VD=Me(),WD=Wi(),YD={message:"boolean schema is false"};function JD(t){let{gen:e,schema:r,validateName:n}=t;r===!1?yx(t,!1):typeof r=="object"&&r.$async===!0?e.return(WD.default.data):(e.assign((0,VD._)`${n}.errors`,null),e.return(!0))}cl.topBoolOrEmptySchema=JD;function zD(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),yx(t)):r.var(e,!0)}cl.boolOrEmptySchema=zD;function yx(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,HD.reportError)(i,YD,void 0,e)}});var $v=F(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.getRules=fl.isJSONType=void 0;var KD=["string","number","integer","boolean","null","object","array"],GD=new Set(KD);function QD(t){return typeof t=="string"&&GD.has(t)}fl.isJSONType=QD;function ZD(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}fl.getRules=ZD});var Mv=F(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.shouldUseRule=Ps.shouldUseGroup=Ps.schemaHasRulesForType=void 0;function XD({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Sx(t,n)}Ps.schemaHasRulesForType=XD;function Sx(t,e){return e.rules.some(r=>bx(t,r))}Ps.shouldUseGroup=Sx;function bx(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ps.shouldUseRule=bx});var mc=F(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.reportTypeError=or.checkDataTypes=or.checkDataType=or.coerceAndCheckDataType=or.getJSONTypes=or.getSchemaTypes=or.DataType=void 0;var eF=$v(),tF=Mv(),rF=pc(),Ce=Me(),_x=Ve(),dl;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(dl||(or.DataType=dl={}));function nF(t){let e=wx(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}or.getSchemaTypes=nF;function wx(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(eF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}or.getJSONTypes=wx;function iF(t,e){let{gen:r,data:n,opts:i}=t,s=sF(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,tF.schemaHasRulesForType)(t,e[0]));if(a){let u=Dv(e,n,i.strictNumbers,dl.Wrong);r.if(u,()=>{s.length?oF(t,e,s):Fv(t)})}return a}or.coerceAndCheckDataType=iF;var Ex=new Set(["string","number","integer","boolean","null"]);function sF(t,e){return e?t.filter(r=>Ex.has(r)||e==="array"&&r==="array"):[]}function oF(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Ce._)`typeof ${i}`),u=n.let("coerced",(0,Ce._)`undefined`);s.coerceTypes==="array"&&n.if((0,Ce._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ce._)`${i}[0]`).assign(a,(0,Ce._)`typeof ${i}`).if(Dv(e,i,s.strictNumbers),()=>n.assign(u,i))),n.if((0,Ce._)`${u} !== undefined`);for(let h of r)(Ex.has(h)||h==="array"&&s.coerceTypes==="array")&&f(h);n.else(),Fv(t),n.endIf(),n.if((0,Ce._)`${u} !== undefined`,()=>{n.assign(i,u),aF(t,u)});function f(h){switch(h){case"string":n.elseIf((0,Ce._)`${a} == "number" || ${a} == "boolean"`).assign(u,(0,Ce._)`"" + ${i}`).elseIf((0,Ce._)`${i} === null`).assign(u,(0,Ce._)`""`);return;case"number":n.elseIf((0,Ce._)`${a} == "boolean" || ${i} === null
|
|
25
|
+
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,Ce._)`+${i}`);return;case"integer":n.elseIf((0,Ce._)`${a} === "boolean" || ${i} === null
|
|
26
|
+
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,Ce._)`+${i}`);return;case"boolean":n.elseIf((0,Ce._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(u,!1).elseIf((0,Ce._)`${i} === "true" || ${i} === 1`).assign(u,!0);return;case"null":n.elseIf((0,Ce._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(u,null);return;case"array":n.elseIf((0,Ce._)`${a} === "string" || ${a} === "number"
|
|
27
|
+
|| ${a} === "boolean" || ${i} === null`).assign(u,(0,Ce._)`[${i}]`)}}}function aF({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ce._)`${e} !== undefined`,()=>t.assign((0,Ce._)`${e}[${r}]`,n))}function Nv(t,e,r,n=dl.Correct){let i=n===dl.Correct?Ce.operators.EQ:Ce.operators.NEQ,s;switch(t){case"null":return(0,Ce._)`${e} ${i} null`;case"array":s=(0,Ce._)`Array.isArray(${e})`;break;case"object":s=(0,Ce._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Ce._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Ce._)`typeof ${e} ${i} ${t}`}return n===dl.Correct?s:(0,Ce.not)(s);function a(u=Ce.nil){return(0,Ce.and)((0,Ce._)`typeof ${e} == "number"`,u,r?(0,Ce._)`isFinite(${e})`:Ce.nil)}}or.checkDataType=Nv;function Dv(t,e,r,n){if(t.length===1)return Nv(t[0],e,r,n);let i,s=(0,_x.toHash)(t);if(s.array&&s.object){let a=(0,Ce._)`typeof ${e} != "object"`;i=s.null?a:(0,Ce._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Ce.nil;s.number&&delete s.integer;for(let a in s)i=(0,Ce.and)(i,Nv(a,e,r,n));return i}or.checkDataTypes=Dv;var lF={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ce._)`{type: ${t}}`:(0,Ce._)`{type: ${e}}`};function Fv(t){let e=uF(t);(0,rF.reportError)(e,lF)}or.reportTypeError=Fv;function uF(t){let{gen:e,data:r,schema:n}=t,i=(0,_x.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Cx=F(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.assignDefaults=void 0;var hl=Me(),cF=Ve();function fF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)xx(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>xx(t,s,i.default))}Oh.assignDefaults=fF;function xx(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let u=(0,hl._)`${s}${(0,hl.getProperty)(e)}`;if(i){(0,cF.checkStrictMode)(t,`default is ignored for: ${u}`);return}let f=(0,hl._)`${u} === undefined`;a.useDefaults==="empty"&&(f=(0,hl._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,hl._)`${u} = ${(0,hl.stringify)(r)}`)}});var pn=F(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.validateUnion=at.validateArray=at.usePattern=at.callValidateCode=at.schemaProperties=at.allSchemaProperties=at.noPropertyInData=at.propertyInData=at.isOwnProperty=at.hasPropFunc=at.reportMissingProp=at.checkMissingProp=at.checkReportMissingProp=void 0;var pt=Me(),Lv=Ve(),ks=Wi(),dF=Ve();function hF(t,e){let{gen:r,data:n,it:i}=t;r.if(Uv(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,pt._)`${e}`},!0),t.error()})}at.checkReportMissingProp=hF;function pF({gen:t,data:e,it:{opts:r}},n,i){return(0,pt.or)(...n.map(s=>(0,pt.and)(Uv(t,e,s,r.ownProperties),(0,pt._)`${i} = ${s}`)))}at.checkMissingProp=pF;function mF(t,e){t.setParams({missingProperty:e},!0),t.error()}at.reportMissingProp=mF;function Rx(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,pt._)`Object.prototype.hasOwnProperty`})}at.hasPropFunc=Rx;function jv(t,e,r){return(0,pt._)`${Rx(t)}.call(${e}, ${r})`}at.isOwnProperty=jv;function gF(t,e,r,n){let i=(0,pt._)`${e}${(0,pt.getProperty)(r)} !== undefined`;return n?(0,pt._)`${i} && ${jv(t,e,r)}`:i}at.propertyInData=gF;function Uv(t,e,r,n){let i=(0,pt._)`${e}${(0,pt.getProperty)(r)} === undefined`;return n?(0,pt.or)(i,(0,pt.not)(jv(t,e,r))):i}at.noPropertyInData=Uv;function Ix(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}at.allSchemaProperties=Ix;function yF(t,e){return Ix(e).filter(r=>!(0,Lv.alwaysValidSchema)(t,e[r]))}at.schemaProperties=yF;function vF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,f,h){let g=h?(0,pt._)`${t}, ${e}, ${n}${i}`:e,m=[[ks.default.instancePath,(0,pt.strConcat)(ks.default.instancePath,s)],[ks.default.parentData,a.parentData],[ks.default.parentDataProperty,a.parentDataProperty],[ks.default.rootData,ks.default.rootData]];a.opts.dynamicRef&&m.push([ks.default.dynamicAnchors,ks.default.dynamicAnchors]);let S=(0,pt._)`${g}, ${r.object(...m)}`;return f!==pt.nil?(0,pt._)`${u}.call(${f}, ${S})`:(0,pt._)`${u}(${S})`}at.callValidateCode=vF;var SF=(0,pt._)`new RegExp`;function bF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,pt._)`${i.code==="new RegExp"?SF:(0,dF.useFunc)(t,i)}(${r}, ${n})`})}at.usePattern=bF;function _F(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let u=e.let("valid",!0);return a(()=>e.assign(u,!1)),u}return e.var(s,!0),a(()=>e.break()),s;function a(u){let f=e.const("len",(0,pt._)`${r}.length`);e.forRange("i",0,f,h=>{t.subschema({keyword:n,dataProp:h,dataPropType:Lv.Type.Num},s),e.if((0,pt.not)(s),u)})}}at.validateArray=_F;function wF(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,Lv.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),u=e.name("_valid");e.block(()=>r.forEach((f,h)=>{let g=t.subschema({keyword:n,schemaProp:h,compositeRule:!0},u);e.assign(a,(0,pt._)`${a} || ${u}`),t.mergeValidEvaluated(g,u)||e.if((0,pt.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}at.validateUnion=wF});var kx=F(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.validateKeywordUsage=hi.validSchemaType=hi.funcKeywordCode=hi.macroKeywordCode=void 0;var wr=Me(),Ho=Wi(),EF=pn(),xF=pc();function CF(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,u=e.macro.call(a.self,i,s,a),f=Px(r,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let h=r.name("valid");t.subschema({schema:u,schemaPath:wr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},h),t.pass(h,()=>t.error(!0))}hi.macroKeywordCode=CF;function RF(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:f}=t;OF(f,e);let h=!u&&e.compile?e.compile.call(f.self,s,a,f):e.validate,g=Px(n,i,h),m=n.let("valid");t.block$data(m,S),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function S(){if(e.errors===!1)C(),e.modifying&&Ox(t),A(()=>t.error());else{let T=e.async?E():x();e.modifying&&Ox(t),A(()=>IF(t,T))}}function E(){let T=n.let("ruleErrs",null);return n.try(()=>C((0,wr._)`await `),B=>n.assign(m,!1).if((0,wr._)`${B} instanceof ${f.ValidationError}`,()=>n.assign(T,(0,wr._)`${B}.errors`),()=>n.throw(B))),T}function x(){let T=(0,wr._)`${g}.errors`;return n.assign(T,null),C(wr.nil),T}function C(T=e.async?(0,wr._)`await `:wr.nil){let B=f.opts.passContext?Ho.default.this:Ho.default.self,Y=!("compile"in e&&!u||e.schema===!1);n.assign(m,(0,wr._)`${T}${(0,EF.callValidateCode)(t,g,B,Y)}`,e.modifying)}function A(T){var B;n.if((0,wr.not)((B=e.valid)!==null&&B!==void 0?B:m),T)}}hi.funcKeywordCode=RF;function Ox(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,wr._)`${n.parentData}[${n.parentDataProperty}]`))}function IF(t,e){let{gen:r}=t;r.if((0,wr._)`Array.isArray(${e})`,()=>{r.assign(Ho.default.vErrors,(0,wr._)`${Ho.default.vErrors} === null ? ${e} : ${Ho.default.vErrors}.concat(${e})`).assign(Ho.default.errors,(0,wr._)`${Ho.default.vErrors}.length`),(0,xF.extendErrors)(t)},()=>t.error())}function OF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Px(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,wr.stringify)(r)})}function PF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}hi.validSchemaType=PF;function kF({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(u=>!Object.prototype.hasOwnProperty.call(t,u)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}hi.validateKeywordUsage=kF});var Tx=F(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.extendSubschemaMode=As.extendSubschemaData=As.getSubschema=void 0;var pi=Me(),Ax=Ve();function AF(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let u=t.schema[e];return r===void 0?{schema:u,schemaPath:(0,pi._)`${t.schemaPath}${(0,pi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:u[r],schemaPath:(0,pi._)`${t.schemaPath}${(0,pi.getProperty)(e)}${(0,pi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Ax.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}As.getSubschema=AF;function TF(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=e;if(r!==void 0){let{errorPath:h,dataPathArr:g,opts:m}=e,S=u.let("data",(0,pi._)`${e.data}${(0,pi.getProperty)(r)}`,!0);f(S),t.errorPath=(0,pi.str)`${h}${(0,Ax.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,pi._)`${r}`,t.dataPathArr=[...g,t.parentDataProperty]}if(i!==void 0){let h=i instanceof pi.Name?i:u.let("data",i,!0);f(h),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(h){t.data=h,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,h]}}As.extendSubschemaData=TF;function qF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}As.extendSubschemaMode=qF});var Bv=F((p6,qx)=>{"use strict";qx.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var Mx=F((m6,$x)=>{"use strict";var Ts=$x.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Ph(e,n,i,t,"",t)};Ts.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ts.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ts.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ts.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ph(t,e,r,n,i,s,a,u,f,h){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,u,f,h);for(var g in n){var m=n[g];if(Array.isArray(m)){if(g in Ts.arrayKeywords)for(var S=0;S<m.length;S++)Ph(t,e,r,m[S],i+"/"+g+"/"+S,s,i,g,n,S)}else if(g in Ts.propsKeywords){if(m&&typeof m=="object")for(var E in m)Ph(t,e,r,m[E],i+"/"+g+"/"+$F(E),s,i,g,n,E)}else(g in Ts.keywords||t.allKeys&&!(g in Ts.skipKeywords))&&Ph(t,e,r,m,i+"/"+g,s,i,g,n)}r(n,i,s,a,u,f,h)}}function $F(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var gc=F(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.getSchemaRefs=qr.resolveUrl=qr.normalizeId=qr._getFullPath=qr.getFullPath=qr.inlineRef=void 0;var MF=Ve(),NF=Bv(),DF=Mx(),FF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function LF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Hv(t):e?Nx(t)<=e:!1}qr.inlineRef=LF;var jF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Hv(t){for(let e in t){if(jF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Hv)||typeof r=="object"&&Hv(r))return!0}return!1}function Nx(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!FF.has(r)&&(typeof t[r]=="object"&&(0,MF.eachItem)(t[r],n=>e+=Nx(n)),e===1/0))return 1/0}return e}function Dx(t,e="",r){r!==!1&&(e=pl(e));let n=t.parse(e);return Fx(t,n)}qr.getFullPath=Dx;function Fx(t,e){return t.serialize(e).split("#")[0]+"#"}qr._getFullPath=Fx;var UF=/#\/?$/;function pl(t){return t?t.replace(UF,""):""}qr.normalizeId=pl;function BF(t,e,r){return r=pl(r),t.resolve(e,r)}qr.resolveUrl=BF;var HF=/^[a-z_][-a-z0-9._]*$/i;function VF(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=pl(t[r]||e),s={"":i},a=Dx(n,i,!1),u={},f=new Set;return DF(t,{allKeys:!0},(m,S,E,x)=>{if(x===void 0)return;let C=a+S,A=s[x];typeof m[r]=="string"&&(A=T.call(this,m[r])),B.call(this,m.$anchor),B.call(this,m.$dynamicAnchor),s[S]=A;function T(Y){let H=this.opts.uriResolver.resolve;if(Y=pl(A?H(A,Y):Y),f.has(Y))throw g(Y);f.add(Y);let K=this.refs[Y];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?h(m,K.schema,Y):Y!==pl(C)&&(Y[0]==="#"?(h(m,u[Y],Y),u[Y]=m):this.refs[Y]=C),Y}function B(Y){if(typeof Y=="string"){if(!HF.test(Y))throw new Error(`invalid anchor "${Y}"`);T.call(this,`#${Y}`)}}}),u;function h(m,S,E){if(S!==void 0&&!NF(m,S))throw g(E)}function g(m){return new Error(`reference "${m}" resolves to more than one schema`)}}qr.getSchemaRefs=VF});var Sc=F(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.getData=qs.KeywordCxt=qs.validateFunctionCode=void 0;var Hx=vx(),Lx=mc(),Wv=Mv(),kh=mc(),WF=Cx(),vc=kx(),Vv=Tx(),fe=Me(),be=Wi(),YF=gc(),Yi=Ve(),yc=pc();function JF(t){if(Yx(t)&&(Jx(t),Wx(t))){GF(t);return}Vx(t,()=>(0,Hx.topBoolOrEmptySchema)(t))}qs.validateFunctionCode=JF;function Vx({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,fe._)`${be.default.data}, ${be.default.valCxt}`,n.$async,()=>{t.code((0,fe._)`"use strict"; ${jx(r,i)}`),KF(t,i),t.code(s)}):t.func(e,(0,fe._)`${be.default.data}, ${zF(i)}`,n.$async,()=>t.code(jx(r,i)).code(s))}function zF(t){return(0,fe._)`{${be.default.instancePath}="", ${be.default.parentData}, ${be.default.parentDataProperty}, ${be.default.rootData}=${be.default.data}${t.dynamicRef?(0,fe._)`, ${be.default.dynamicAnchors}={}`:fe.nil}}={}`}function KF(t,e){t.if(be.default.valCxt,()=>{t.var(be.default.instancePath,(0,fe._)`${be.default.valCxt}.${be.default.instancePath}`),t.var(be.default.parentData,(0,fe._)`${be.default.valCxt}.${be.default.parentData}`),t.var(be.default.parentDataProperty,(0,fe._)`${be.default.valCxt}.${be.default.parentDataProperty}`),t.var(be.default.rootData,(0,fe._)`${be.default.valCxt}.${be.default.rootData}`),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,fe._)`${be.default.valCxt}.${be.default.dynamicAnchors}`)},()=>{t.var(be.default.instancePath,(0,fe._)`""`),t.var(be.default.parentData,(0,fe._)`undefined`),t.var(be.default.parentDataProperty,(0,fe._)`undefined`),t.var(be.default.rootData,be.default.data),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,fe._)`{}`)})}function GF(t){let{schema:e,opts:r,gen:n}=t;Vx(t,()=>{r.$comment&&e.$comment&&Kx(t),tL(t),n.let(be.default.vErrors,null),n.let(be.default.errors,0),r.unevaluated&&QF(t),zx(t),iL(t)})}function QF(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,fe._)`${r}.evaluated`),e.if((0,fe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,fe._)`${t.evaluated}.props`,(0,fe._)`undefined`)),e.if((0,fe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,fe._)`${t.evaluated}.items`,(0,fe._)`undefined`))}function jx(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,fe._)`/*# sourceURL=${r} */`:fe.nil}function ZF(t,e){if(Yx(t)&&(Jx(t),Wx(t))){XF(t,e);return}(0,Hx.boolOrEmptySchema)(t,e)}function Wx({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Yx(t){return typeof t.schema!="boolean"}function XF(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&Kx(t),rL(t),nL(t);let s=n.const("_errs",be.default.errors);zx(t,s),n.var(e,(0,fe._)`${s} === ${be.default.errors}`)}function Jx(t){(0,Yi.checkUnknownRules)(t),eL(t)}function zx(t,e){if(t.opts.jtd)return Ux(t,[],!1,e);let r=(0,Lx.getSchemaTypes)(t.schema),n=(0,Lx.coerceAndCheckDataType)(t,r);Ux(t,r,!n,e)}function eL(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Yi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function tL(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Yi.checkStrictMode)(t,"default is ignored in the schema root")}function rL(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,YF.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function nL(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Kx({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,fe._)`${be.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,fe.str)`${n}/$comment`,u=t.scopeValue("root",{ref:e.root});t.code((0,fe._)`${be.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}function iL(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,fe._)`${be.default.errors} === 0`,()=>e.return(be.default.data),()=>e.throw((0,fe._)`new ${i}(${be.default.vErrors})`)):(e.assign((0,fe._)`${n}.errors`,be.default.vErrors),s.unevaluated&&sL(t),e.return((0,fe._)`${be.default.errors} === 0`))}function sL({gen:t,evaluated:e,props:r,items:n}){r instanceof fe.Name&&t.assign((0,fe._)`${e}.props`,r),n instanceof fe.Name&&t.assign((0,fe._)`${e}.items`,n)}function Ux(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:u,opts:f,self:h}=t,{RULES:g}=h;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Yi.schemaHasRulesButRef)(s,g))){i.block(()=>Qx(t,"$ref",g.all.$ref.definition));return}f.jtd||oL(t,e),i.block(()=>{for(let S of g.rules)m(S);m(g.post)});function m(S){(0,Wv.shouldUseGroup)(s,S)&&(S.type?(i.if((0,kh.checkDataType)(S.type,a,f.strictNumbers)),Bx(t,S),e.length===1&&e[0]===S.type&&r&&(i.else(),(0,kh.reportTypeError)(t)),i.endIf()):Bx(t,S),u||i.if((0,fe._)`${be.default.errors} === ${n||0}`))}}function Bx(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,WF.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Wv.shouldUseRule)(n,s)&&Qx(t,s.keyword,s.definition,e.type)})}function oL(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(aL(t,e),t.opts.allowUnionTypes||lL(t,e),uL(t,t.dataTypes))}function aL(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Gx(t.dataTypes,r)||Yv(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),fL(t,e)}}function lL(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Yv(t,"use allowUnionTypes to allow union type keyword")}function uL(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Wv.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>cL(e,a))&&Yv(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function cL(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Gx(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function fL(t,e){let r=[];for(let n of t.dataTypes)Gx(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Yv(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Yi.checkStrictMode)(t,e,t.opts.strictTypes)}var Ah=class{constructor(e,r,n){if((0,vc.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Yi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Zx(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,vc.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",be.default.errors))}result(e,r,n){this.failResult((0,fe.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,fe.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,fe._)`${r} !== undefined && (${(0,fe.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?yc.reportExtraError:yc.reportError)(this,this.def.error,r)}$dataError(){(0,yc.reportError)(this,this.def.$dataError||yc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,yc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=fe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=fe.nil,r=fe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,fe.or)((0,fe._)`${i} === undefined`,r)),e!==fe.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==fe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,fe.or)(a(),u());function a(){if(n.length){if(!(r instanceof fe.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,fe._)`${(0,kh.checkDataTypes)(f,r,s.opts.strictNumbers,kh.DataType.Wrong)}`}return fe.nil}function u(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,fe._)`!${f}(${r})`}return fe.nil}}subschema(e,r){let n=(0,Vv.getSubschema)(this.it,e);(0,Vv.extendSubschemaData)(n,this.it,e),(0,Vv.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return ZF(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Yi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Yi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,fe.Name)),!0}};qs.KeywordCxt=Ah;function Qx(t,e,r,n){let i=new Ah(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,vc.funcKeywordCode)(i,r):"macro"in r?(0,vc.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,vc.funcKeywordCode)(i,r)}var dL=/^\/(?:[^~]|~0|~1)*$/,hL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Zx(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return be.default.rootData;if(t[0]==="/"){if(!dL.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=be.default.rootData}else{let h=hL.exec(t);if(!h)throw new Error(`Invalid JSON-pointer: ${t}`);let g=+h[1];if(i=h[2],i==="#"){if(g>=e)throw new Error(f("property/index",g));return n[e-g]}if(g>e)throw new Error(f("data",g));if(s=r[e-g],!i)return s}let a=s,u=i.split("/");for(let h of u)h&&(s=(0,fe._)`${s}${(0,fe.getProperty)((0,Yi.unescapeJsonPointer)(h))}`,a=(0,fe._)`${a} && ${s}`);return a;function f(h,g){return`Cannot access ${h} ${g} levels up, current level is ${e}`}}qs.getData=Zx});var Th=F(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});var Jv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};zv.default=Jv});var bc=F(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var Kv=gc(),Gv=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Kv.resolveUrl)(e,r,n),this.missingSchema=(0,Kv.normalizeId)((0,Kv.getFullPath)(e,this.missingRef))}};Qv.default=Gv});var $h=F(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.resolveSchema=mn.getCompilingSchema=mn.resolveRef=mn.compileSchema=mn.SchemaEnv=void 0;var Bn=Me(),pL=Th(),Vo=Wi(),Hn=gc(),Xx=Ve(),mL=Sc(),ml=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Hn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};mn.SchemaEnv=ml;function Xv(t){let e=eC.call(this,t);if(e)return e;let r=(0,Hn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Bn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;t.$async&&(u=a.scopeValue("Error",{ref:pL.default,code:(0,Bn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let h={gen:a,allErrors:this.opts.allErrors,data:Vo.default.data,parentData:Vo.default.parentData,parentDataProperty:Vo.default.parentDataProperty,dataNames:[Vo.default.data],dataPathArr:[Bn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Bn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Bn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Bn._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(t),(0,mL.validateFunctionCode)(h),a.optimize(this.opts.code.optimize);let m=a.toString();g=`${a.scopeRefs(Vo.default.scope)}return ${m}`,this.opts.code.process&&(g=this.opts.code.process(g,t));let E=new Function(`${Vo.default.self}`,`${Vo.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:E}),E.errors=null,E.schema=t.schema,E.schemaEnv=t,t.$async&&(E.$async=!0),this.opts.code.source===!0&&(E.source={validateName:f,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:x,items:C}=h;E.evaluated={props:x instanceof Bn.Name?void 0:x,items:C instanceof Bn.Name?void 0:C,dynamicProps:x instanceof Bn.Name,dynamicItems:C instanceof Bn.Name},E.source&&(E.source.evaluated=(0,Bn.stringify)(E.evaluated))}return t.validate=E,t}catch(m){throw delete t.validate,delete t.validateName,g&&this.logger.error("Error compiling schema, function code:",g),m}finally{this._compilations.delete(t)}}mn.compileSchema=Xv;function gL(t,e,r){var n;r=(0,Hn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=SL.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;a&&(s=new ml({schema:a,schemaId:u,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=yL.call(this,s)}mn.resolveRef=gL;function yL(t){return(0,Hn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Xv.call(this,t)}function eC(t){for(let e of this._compilations)if(vL(e,t))return e}mn.getCompilingSchema=eC;function vL(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function SL(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||qh.call(this,t,e)}function qh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Hn._getFullPath)(this.opts.uriResolver,r),i=(0,Hn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Zv.call(this,r,t);let s=(0,Hn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=qh.call(this,t,a);return typeof u?.schema!="object"?void 0:Zv.call(this,r,u)}if(typeof a?.schema=="object"){if(a.validate||Xv.call(this,a),s===(0,Hn.normalizeId)(e)){let{schema:u}=a,{schemaId:f}=this.opts,h=u[f];return h&&(i=(0,Hn.resolveUrl)(this.opts.uriResolver,i,h)),new ml({schema:u,schemaId:f,root:t,baseId:i})}return Zv.call(this,r,a)}}mn.resolveSchema=qh;var bL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Zv(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let u of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,Xx.unescapeFragment)(u)];if(f===void 0)return;r=f;let h=typeof r=="object"&&r[this.opts.schemaId];!bL.has(u)&&h&&(e=(0,Hn.resolveUrl)(this.opts.uriResolver,e,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Xx.schemaHasRulesButRef)(r,this.RULES)){let u=(0,Hn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=qh.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new ml({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var tC=F((_6,_L)=>{_L.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var rS=F((w6,aC)=>{"use strict";var wL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),nC=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),eS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),iC=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),EL=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function tS(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var xL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function rC(t){return t.length=0,!0}function CL(t,e,r){if(t.length){let n=tS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function RL(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=CL;for(let f=0;f<t.length;f++){let h=t[f];if(!(h==="["||h==="]"))if(h===":"){if(s===!0&&(a=!0),!u(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(h==="%"){if(!u(i,n,r))break;u=rC}else{i.push(h);continue}}return i.length&&(u===rC?r.zone=i.join(""):a?n.push(i.join("")):n.push(tS(i))),r.address=n.join(""),r}function sC(t){if(IL(t,":")<2)return{host:t,isIPV6:!1};let e=RL(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function IL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function OL(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var PL={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},kL=/[@/?#:]/g,AL=/[@/?#]/g;function oC(t,e){let r=e?AL:kL;return r.lastIndex=0,t.replace(r,n=>PL[n])}function TL(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(eS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&iC(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function qL(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(eS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&iC(s)?e+=s:e+="%"+i,r+=2;continue}}EL(t[r])?e+=t[r]:e+=escape(t[r])}return e}function $L(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(eS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function ML(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!nC(r)){let n=sC(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=oC(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}aC.exports={nonSimpleDomain:xL,recomposeAuthority:ML,reescapeHostDelimiters:oC,normalizePercentEncoding:TL,normalizePathEncoding:qL,escapePreservingEscapes:$L,removeDotSegments:OL,isIPv4:nC,isUUID:wL,normalizeIPv6:sC,stringArrayToHexStripped:tS}});var dC=F((E6,fC)=>{"use strict";var{isUUID:NL}=rS(),DL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,FL=["http","https","ws","wss","urn","urn:uuid"];function LL(t){return FL.indexOf(t)!==-1}function nS(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function lC(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function uC(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function jL(t){return t.secure=nS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function UL(t){if((t.port===(nS(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function BL(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(DL);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=iS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function HL(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=iS(i);s&&(t=s.serialize(t,e));let a=t,u=t.nss;return a.path=`${n||e.nid}:${u}`,e.skipEscape=!0,a}function VL(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!NL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function WL(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var cC={scheme:"http",domainHost:!0,parse:lC,serialize:uC},YL={scheme:"https",domainHost:cC.domainHost,parse:lC,serialize:uC},Mh={scheme:"ws",domainHost:!0,parse:jL,serialize:UL},JL={scheme:"wss",domainHost:Mh.domainHost,parse:Mh.parse,serialize:Mh.serialize},zL={scheme:"urn",parse:BL,serialize:HL,skipNormalize:!0},KL={scheme:"urn:uuid",parse:VL,serialize:WL,skipNormalize:!0},Nh={http:cC,https:YL,ws:Mh,wss:JL,urn:zL,"urn:uuid":KL};Object.setPrototypeOf(Nh,null);function iS(t){return t&&(Nh[t]||Nh[t.toLowerCase()])||void 0}fC.exports={wsIsSecure:nS,SCHEMES:Nh,isValidSchemeName:LL,getSchemeHandler:iS}});var vC=F((x6,Dh)=>{"use strict";var{normalizeIPv6:GL,removeDotSegments:_c,recomposeAuthority:QL,normalizePercentEncoding:ZL,normalizePathEncoding:XL,escapePreservingEscapes:ej,reescapeHostDelimiters:tj,isIPv4:rj,nonSimpleDomain:nj}=rS(),{SCHEMES:ij,getSchemeHandler:pC}=dC();function sj(t,e){return typeof t=="string"?t=cj(t,e):typeof t=="object"&&(t=gl(Wo(t,e),e)),t}function oj(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=mC(gl(t,n),gl(e,n),n,!0);return n.skipEscape=!0,Wo(i,n)}function mC(t,e,r,n){let i={};return n||(t=gl(Wo(t,r),r),e=gl(Wo(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=_c(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=_c(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=_c(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=_c(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function aj(t,e,r){let n=hC(t,r),i=hC(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Wo(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=pC(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=ZL(r.path):(r.path=ej(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=QL(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let u=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(u=_c(u)),a===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),i.push(u)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var lj=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function uj(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function gC(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let a=t.match(lj);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let u=uj(n,a);if(u!==void 0&&(n.error=n.error||u,i=!0),n.host)if(rj(n.host)===!1){let g=GL(n.host);n.host=g.host.toLowerCase(),s=g.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let f=pC(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&nj(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(h){n.error=n.error||"Host's domain name can not be converted to ASCII: "+h}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=tj(unescape(n.host),s))),n.path&&(n.path=XL(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function gl(t,e){return gC(t,e).parsed}function cj(t,e){return yC(t,e).normalized}function yC(t,e){let{parsed:r,malformedAuthorityOrPort:n}=gC(t,e);return{normalized:n?t:Wo(r,e),malformedAuthorityOrPort:n}}function hC(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=yC(t,e);return n?void 0:r}if(typeof t=="object")return Wo(t,e)}var sS={SCHEMES:ij,normalize:sj,resolve:oj,resolveComponent:mC,equal:aj,serialize:Wo,parse:gl};Dh.exports=sS;Dh.exports.default=sS;Dh.exports.fastUri=sS});var bC=F(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});var SC=vC();SC.code='require("ajv/dist/runtime/uri").default';oS.default=SC});var OC=F(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.CodeGen=Kt.Name=Kt.nil=Kt.stringify=Kt.str=Kt._=Kt.KeywordCxt=void 0;var fj=Sc();Object.defineProperty(Kt,"KeywordCxt",{enumerable:!0,get:function(){return fj.KeywordCxt}});var yl=Me();Object.defineProperty(Kt,"_",{enumerable:!0,get:function(){return yl._}});Object.defineProperty(Kt,"str",{enumerable:!0,get:function(){return yl.str}});Object.defineProperty(Kt,"stringify",{enumerable:!0,get:function(){return yl.stringify}});Object.defineProperty(Kt,"nil",{enumerable:!0,get:function(){return yl.nil}});Object.defineProperty(Kt,"Name",{enumerable:!0,get:function(){return yl.Name}});Object.defineProperty(Kt,"CodeGen",{enumerable:!0,get:function(){return yl.CodeGen}});var dj=Th(),CC=bc(),hj=$v(),wc=$h(),pj=Me(),Ec=gc(),Fh=mc(),lS=Ve(),_C=tC(),mj=bC(),RC=(t,e)=>new RegExp(t,e);RC.code="new RegExp";var gj=["removeAdditional","useDefaults","coerceTypes"],yj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),vj={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Sj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},wC=200;function bj(t){var e,r,n,i,s,a,u,f,h,g,m,S,E,x,C,A,T,B,Y,H,K,X,k,w,P;let N=t.strict,D=(e=t.code)===null||e===void 0?void 0:e.optimize,L=D===!0||D===void 0?1:D||0,z=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:RC,Z=(i=t.uriResolver)!==null&&i!==void 0?i:mj.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(u=t.strictNumbers)!==null&&u!==void 0?u:N)!==null&&f!==void 0?f:!0,strictTypes:(g=(h=t.strictTypes)!==null&&h!==void 0?h:N)!==null&&g!==void 0?g:"log",strictTuples:(S=(m=t.strictTuples)!==null&&m!==void 0?m:N)!==null&&S!==void 0?S:"log",strictRequired:(x=(E=t.strictRequired)!==null&&E!==void 0?E:N)!==null&&x!==void 0?x:!1,code:t.code?{...t.code,optimize:L,regExp:z}:{optimize:L,regExp:z},loopRequired:(C=t.loopRequired)!==null&&C!==void 0?C:wC,loopEnum:(A=t.loopEnum)!==null&&A!==void 0?A:wC,meta:(T=t.meta)!==null&&T!==void 0?T:!0,messages:(B=t.messages)!==null&&B!==void 0?B:!0,inlineRefs:(Y=t.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(H=t.schemaId)!==null&&H!==void 0?H:"$id",addUsedSchema:(K=t.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(k=t.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(w=t.unicodeRegExp)!==null&&w!==void 0?w:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:Z}}var xc=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...bj(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new pj.ValueScope({scope:{},prefixes:yj,es5:r,lines:n}),this.logger=Rj(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,hj.getRules)(),EC.call(this,vj,e,"NOT SUPPORTED"),EC.call(this,Sj,e,"DEPRECATED","warn"),this._metaOpts=xj.call(this),e.formats&&wj.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Ej.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),_j.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=_C;n==="id"&&(i={..._C},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(g,m){await s.call(this,g.$schema);let S=this._addSchema(g,m);return S.validate||a.call(this,S)}async function s(g){g&&!this.getSchema(g)&&await i.call(this,{$ref:g},!0)}async function a(g){try{return this._compileSchemaEnv(g)}catch(m){if(!(m instanceof CC.default))throw m;return u.call(this,m),await f.call(this,m.missingSchema),a.call(this,g)}}function u({missingSchema:g,missingRef:m}){if(this.refs[g])throw new Error(`AnySchema ${g} is loaded but ${m} cannot be resolved`)}async function f(g){let m=await h.call(this,g);this.refs[g]||await s.call(this,m.$schema),this.refs[g]||this.addSchema(m,g,r)}async function h(g){let m=this._loading[g];if(m)return m;try{return await(this._loading[g]=n(g))}finally{delete this._loading[g]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Ec.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=xC.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new wc.SchemaEnv({schema:{},schemaId:n});if(r=wc.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=xC.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Ec.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Oj.call(this,n,r),!r)return(0,lS.eachItem)(n,s=>aS.call(this,s)),this;kj.call(this,r);let i={...r,type:(0,Fh.getJSONTypes)(r.type),schemaType:(0,Fh.getJSONTypes)(r.schemaType)};return(0,lS.eachItem)(n,i.type.length===0?s=>aS.call(this,s,i):s=>i.type.forEach(a=>aS.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let u of s)a=a[u];for(let u in n){let f=n[u];if(typeof f!="object")continue;let{$data:h}=f.definition,g=a[u];h&&g&&(a[u]=IC(g))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:u}=this.opts;if(typeof e=="object")a=e[u];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,Ec.normalizeId)(a||n);let h=Ec.getSchemaRefs.call(this,e,n);return f=new wc.SchemaEnv({schema:e,schemaId:u,meta:r,baseId:n,localRefs:h}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):wc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{wc.compileSchema.call(this,e)}finally{this.opts=r}}};xc.ValidationError=dj.default;xc.MissingRefError=CC.default;Kt.default=xc;function EC(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function xC(t){return t=(0,Ec.normalizeId)(t),this.schemas[t]||this.refs[t]}function _j(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function wj(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Ej(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function xj(){let t={...this.opts};for(let e of gj)delete t[e];return t}var Cj={log(){},warn(){},error(){}};function Rj(t){if(t===!1)return Cj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Ij=/^[a-z_$][a-z0-9_$:-]*$/i;function Oj(t,e){let{RULES:r}=this;if((0,lS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Ij.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function aS(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let u={keyword:t,definition:{...e,type:(0,Fh.getJSONTypes)(e.type),schemaType:(0,Fh.getJSONTypes)(e.schemaType)}};e.before?Pj.call(this,a,u,e.before):a.rules.push(u),s.all[t]=u,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function Pj(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function kj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=IC(e)),t.validateSchema=this.compile(e,!0))}var Aj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function IC(t){return{anyOf:[t,Aj]}}});var PC=F(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});var Tj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};uS.default=Tj});var qC=F(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.callRef=Yo.getValidate=void 0;var qj=bc(),kC=pn(),$r=Me(),vl=Wi(),AC=$h(),Lh=Ve(),$j={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:u,self:f}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return m();let g=AC.resolveRef.call(f,h,i,r);if(g===void 0)throw new qj.default(n.opts.uriResolver,i,r);if(g instanceof AC.SchemaEnv)return S(g);return E(g);function m(){if(s===h)return jh(t,a,s,s.$async);let x=e.scopeValue("root",{ref:h});return jh(t,(0,$r._)`${x}.validate`,h,h.$async)}function S(x){let C=TC(t,x);jh(t,C,x,x.$async)}function E(x){let C=e.scopeValue("schema",u.code.source===!0?{ref:x,code:(0,$r.stringify)(x)}:{ref:x}),A=e.name("valid"),T=t.subschema({schema:x,dataTypes:[],schemaPath:$r.nil,topSchemaRef:C,errSchemaPath:r},A);t.mergeEvaluated(T),t.ok(A)}}};function TC(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,$r._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Yo.getValidate=TC;function jh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:u,opts:f}=s,h=f.passContext?vl.default.this:$r.nil;n?g():m();function g(){if(!u.$async)throw new Error("async schema referenced by sync schema");let x=i.let("valid");i.try(()=>{i.code((0,$r._)`await ${(0,kC.callValidateCode)(t,e,h)}`),E(e),a||i.assign(x,!0)},C=>{i.if((0,$r._)`!(${C} instanceof ${s.ValidationError})`,()=>i.throw(C)),S(C),a||i.assign(x,!1)}),t.ok(x)}function m(){t.result((0,kC.callValidateCode)(t,e,h),()=>E(e),()=>S(e))}function S(x){let C=(0,$r._)`${x}.errors`;i.assign(vl.default.vErrors,(0,$r._)`${vl.default.vErrors} === null ? ${C} : ${vl.default.vErrors}.concat(${C})`),i.assign(vl.default.errors,(0,$r._)`${vl.default.vErrors}.length`)}function E(x){var C;if(!s.opts.unevaluated)return;let A=(C=r?.validate)===null||C===void 0?void 0:C.evaluated;if(s.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(s.props=Lh.mergeEvaluated.props(i,A.props,s.props));else{let T=i.var("props",(0,$r._)`${x}.evaluated.props`);s.props=Lh.mergeEvaluated.props(i,T,s.props,$r.Name)}if(s.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(s.items=Lh.mergeEvaluated.items(i,A.items,s.items));else{let T=i.var("items",(0,$r._)`${x}.evaluated.items`);s.items=Lh.mergeEvaluated.items(i,T,s.items,$r.Name)}}}Yo.callRef=jh;Yo.default=$j});var $C=F(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var Mj=PC(),Nj=qC(),Dj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Mj.default,Nj.default];cS.default=Dj});var MC=F(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});var Uh=Me(),$s=Uh.operators,Bh={maximum:{okStr:"<=",ok:$s.LTE,fail:$s.GT},minimum:{okStr:">=",ok:$s.GTE,fail:$s.LT},exclusiveMaximum:{okStr:"<",ok:$s.LT,fail:$s.GTE},exclusiveMinimum:{okStr:">",ok:$s.GT,fail:$s.LTE}},Fj={message:({keyword:t,schemaCode:e})=>(0,Uh.str)`must be ${Bh[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Uh._)`{comparison: ${Bh[t].okStr}, limit: ${e}}`},Lj={keyword:Object.keys(Bh),type:"number",schemaType:"number",$data:!0,error:Fj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Uh._)`${r} ${Bh[e].fail} ${n} || isNaN(${r})`)}};fS.default=Lj});var NC=F(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});var Cc=Me(),jj={message:({schemaCode:t})=>(0,Cc.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Cc._)`{multipleOf: ${t}}`},Uj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:jj,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),u=s?(0,Cc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Cc._)`${a} !== parseInt(${a})`;t.fail$data((0,Cc._)`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};dS.default=Uj});var FC=F(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});function DC(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}hS.default=DC;DC.code='require("ajv/dist/runtime/ucs2length").default'});var LC=F(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});var Jo=Me(),Bj=Ve(),Hj=FC(),Vj={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Jo.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Jo._)`{limit: ${t}}`},Wj={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Vj,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Jo.operators.GT:Jo.operators.LT,a=i.opts.unicode===!1?(0,Jo._)`${r}.length`:(0,Jo._)`${(0,Bj.useFunc)(t.gen,Hj.default)}(${r})`;t.fail$data((0,Jo._)`${a} ${s} ${n}`)}};pS.default=Wj});var jC=F(mS=>{"use strict";Object.defineProperty(mS,"__esModule",{value:!0});var Yj=pn(),Jj=Ve(),Sl=Me(),zj={message:({schemaCode:t})=>(0,Sl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Sl._)`{pattern: ${t}}`},Kj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:zj,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t,u=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=a.opts.code,h=f.code==="new RegExp"?(0,Sl._)`new RegExp`:(0,Jj.useFunc)(e,f),g=e.let("valid");e.try(()=>e.assign(g,(0,Sl._)`${h}(${s}, ${u}).test(${r})`),()=>e.assign(g,!1)),t.fail$data((0,Sl._)`!${g}`)}else{let f=(0,Yj.usePattern)(t,i);t.fail$data((0,Sl._)`!${f}.test(${r})`)}}};mS.default=Kj});var UC=F(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});var Rc=Me(),Gj={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Rc.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Rc._)`{limit: ${t}}`},Qj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Gj,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Rc.operators.GT:Rc.operators.LT;t.fail$data((0,Rc._)`Object.keys(${r}).length ${i} ${n}`)}};gS.default=Qj});var BC=F(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});var Ic=pn(),Oc=Me(),Zj=Ve(),Xj={message:({params:{missingProperty:t}})=>(0,Oc.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Oc._)`{missingProperty: ${t}}`},e2={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Xj,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:u}=a;if(!s&&r.length===0)return;let f=r.length>=u.loopRequired;if(a.allErrors?h():g(),u.strictRequired){let E=t.parentSchema.properties,{definedProperties:x}=t.it;for(let C of r)if(E?.[C]===void 0&&!x.has(C)){let A=a.schemaEnv.baseId+a.errSchemaPath,T=`required property "${C}" is not defined at "${A}" (strictRequired)`;(0,Zj.checkStrictMode)(a,T,a.opts.strictRequired)}}function h(){if(f||s)t.block$data(Oc.nil,m);else for(let E of r)(0,Ic.checkReportMissingProp)(t,E)}function g(){let E=e.let("missing");if(f||s){let x=e.let("valid",!0);t.block$data(x,()=>S(E,x)),t.ok(x)}else e.if((0,Ic.checkMissingProp)(t,r,E)),(0,Ic.reportMissingProp)(t,E),e.else()}function m(){e.forOf("prop",n,E=>{t.setParams({missingProperty:E}),e.if((0,Ic.noPropertyInData)(e,i,E,u.ownProperties),()=>t.error())})}function S(E,x){t.setParams({missingProperty:E}),e.forOf(E,n,()=>{e.assign(x,(0,Ic.propertyInData)(e,i,E,u.ownProperties)),e.if((0,Oc.not)(x),()=>{t.error(),e.break()})},Oc.nil)}}};yS.default=e2});var HC=F(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var Pc=Me(),t2={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Pc.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Pc._)`{limit: ${t}}`},r2={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:t2,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Pc.operators.GT:Pc.operators.LT;t.fail$data((0,Pc._)`${r}.length ${i} ${n}`)}};vS.default=r2});var Hh=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var VC=Bv();VC.code='require("ajv/dist/runtime/equal").default';SS.default=VC});var WC=F(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});var bS=mc(),Gt=Me(),n2=Ve(),i2=Hh(),s2={message:({params:{i:t,j:e}})=>(0,Gt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Gt._)`{i: ${t}, j: ${e}}`},o2={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s2,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=t;if(!n&&!i)return;let f=e.let("valid"),h=s.items?(0,bS.getSchemaTypes)(s.items):[];t.block$data(f,g,(0,Gt._)`${a} === false`),t.ok(f);function g(){let x=e.let("i",(0,Gt._)`${r}.length`),C=e.let("j");t.setParams({i:x,j:C}),e.assign(f,!0),e.if((0,Gt._)`${x} > 1`,()=>(m()?S:E)(x,C))}function m(){return h.length>0&&!h.some(x=>x==="object"||x==="array")}function S(x,C){let A=e.name("item"),T=(0,bS.checkDataTypes)(h,A,u.opts.strictNumbers,bS.DataType.Wrong),B=e.const("indices",(0,Gt._)`{}`);e.for((0,Gt._)`;${x}--;`,()=>{e.let(A,(0,Gt._)`${r}[${x}]`),e.if(T,(0,Gt._)`continue`),h.length>1&&e.if((0,Gt._)`typeof ${A} == "string"`,(0,Gt._)`${A} += "_"`),e.if((0,Gt._)`typeof ${B}[${A}] == "number"`,()=>{e.assign(C,(0,Gt._)`${B}[${A}]`),t.error(),e.assign(f,!1).break()}).code((0,Gt._)`${B}[${A}] = ${x}`)})}function E(x,C){let A=(0,n2.useFunc)(e,i2.default),T=e.name("outer");e.label(T).for((0,Gt._)`;${x}--;`,()=>e.for((0,Gt._)`${C} = ${x}; ${C}--;`,()=>e.if((0,Gt._)`${A}(${r}[${x}], ${r}[${C}])`,()=>{t.error(),e.assign(f,!1).break(T)})))}}};_S.default=o2});var YC=F(ES=>{"use strict";Object.defineProperty(ES,"__esModule",{value:!0});var wS=Me(),a2=Ve(),l2=Hh(),u2={message:"must be equal to constant",params:({schemaCode:t})=>(0,wS._)`{allowedValue: ${t}}`},c2={keyword:"const",$data:!0,error:u2,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,wS._)`!${(0,a2.useFunc)(e,l2.default)}(${r}, ${i})`):t.fail((0,wS._)`${s} !== ${r}`)}};ES.default=c2});var JC=F(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var kc=Me(),f2=Ve(),d2=Hh(),h2={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,kc._)`{allowedValues: ${t}}`},p2={keyword:"enum",schemaType:"array",$data:!0,error:h2,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let u=i.length>=a.opts.loopEnum,f,h=()=>f??(f=(0,f2.useFunc)(e,d2.default)),g;if(u||n)g=e.let("valid"),t.block$data(g,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let E=e.const("vSchema",s);g=(0,kc.or)(...i.map((x,C)=>S(E,C)))}t.pass(g);function m(){e.assign(g,!1),e.forOf("v",s,E=>e.if((0,kc._)`${h()}(${r}, ${E})`,()=>e.assign(g,!0).break()))}function S(E,x){let C=i[x];return typeof C=="object"&&C!==null?(0,kc._)`${h()}(${r}, ${E}[${x}])`:(0,kc._)`${r} === ${C}`}}};xS.default=p2});var zC=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var m2=MC(),g2=NC(),y2=LC(),v2=jC(),S2=UC(),b2=BC(),_2=HC(),w2=WC(),E2=YC(),x2=JC(),C2=[m2.default,g2.default,y2.default,v2.default,S2.default,b2.default,_2.default,w2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},E2.default,x2.default];CS.default=C2});var IS=F(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.validateAdditionalItems=void 0;var zo=Me(),RS=Ve(),R2={message:({params:{len:t}})=>(0,zo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,zo._)`{limit: ${t}}`},I2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:R2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,RS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}KC(t,n)}};function KC(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let u=r.const("len",(0,zo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,zo._)`${u} <= ${e.length}`);else if(typeof n=="object"&&!(0,RS.alwaysValidSchema)(a,n)){let h=r.var("valid",(0,zo._)`${u} <= ${e.length}`);r.if((0,zo.not)(h),()=>f(h)),t.ok(h)}function f(h){r.forRange("i",e.length,u,g=>{t.subschema({keyword:s,dataProp:g,dataPropType:RS.Type.Num},h),a.allErrors||r.if((0,zo.not)(h),()=>r.break())})}}Ac.validateAdditionalItems=KC;Ac.default=I2});var OS=F(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.validateTuple=void 0;var GC=Me(),Vh=Ve(),O2=pn(),P2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return QC(t,"additionalItems",e);r.items=!0,!(0,Vh.alwaysValidSchema)(r,e)&&t.ok((0,O2.validateArray)(t))}};function QC(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:u}=t;g(i),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=Vh.mergeEvaluated.items(n,r.length,u.items));let f=n.name("valid"),h=n.const("len",(0,GC._)`${s}.length`);r.forEach((m,S)=>{(0,Vh.alwaysValidSchema)(u,m)||(n.if((0,GC._)`${h} > ${S}`,()=>t.subschema({keyword:a,schemaProp:S,dataProp:S},f)),t.ok(f))});function g(m){let{opts:S,errSchemaPath:E}=u,x=r.length,C=x===m.minItems&&(x===m.maxItems||m[e]===!1);if(S.strictTuples&&!C){let A=`"${a}" is ${x}-tuple, but minItems or maxItems/${e} are not specified or different at path "${E}"`;(0,Vh.checkStrictMode)(u,A,S.strictTuples)}}}Tc.validateTuple=QC;Tc.default=P2});var ZC=F(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var k2=OS(),A2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,k2.validateTuple)(t,"items")};PS.default=A2});var eR=F(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var XC=Me(),T2=Ve(),q2=pn(),$2=IS(),M2={message:({params:{len:t}})=>(0,XC.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,XC._)`{limit: ${t}}`},N2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:M2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,T2.alwaysValidSchema)(n,e)&&(i?(0,$2.validateAdditionalItems)(t,i):t.ok((0,q2.validateArray)(t)))}};kS.default=N2});var tR=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var gn=Me(),Wh=Ve(),D2={message:({params:{min:t,max:e}})=>e===void 0?(0,gn.str)`must contain at least ${t} valid item(s)`:(0,gn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,gn._)`{minContains: ${t}}`:(0,gn._)`{minContains: ${t}, maxContains: ${e}}`},F2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:D2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,u,{minContains:f,maxContains:h}=n;s.opts.next?(a=f===void 0?1:f,u=h):a=1;let g=e.const("len",(0,gn._)`${i}.length`);if(t.setParams({min:a,max:u}),u===void 0&&a===0){(0,Wh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,Wh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Wh.alwaysValidSchema)(s,r)){let C=(0,gn._)`${g} >= ${a}`;u!==void 0&&(C=(0,gn._)`${C} && ${g} <= ${u}`),t.pass(C);return}s.items=!0;let m=e.name("valid");u===void 0&&a===1?E(m,()=>e.if(m,()=>e.break())):a===0?(e.let(m,!0),u!==void 0&&e.if((0,gn._)`${i}.length > 0`,S)):(e.let(m,!1),S()),t.result(m,()=>t.reset());function S(){let C=e.name("_valid"),A=e.let("count",0);E(C,()=>e.if(C,()=>x(A)))}function E(C,A){e.forRange("i",0,g,T=>{t.subschema({keyword:"contains",dataProp:T,dataPropType:Wh.Type.Num,compositeRule:!0},C),A()})}function x(C){e.code((0,gn._)`${C}++`),u===void 0?e.if((0,gn._)`${C} >= ${a}`,()=>e.assign(m,!0).break()):(e.if((0,gn._)`${C} > ${u}`,()=>e.assign(m,!1).break()),a===1?e.assign(m,!0):e.if((0,gn._)`${C} >= ${a}`,()=>e.assign(m,!0)))}}};AS.default=F2});var iR=F(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.validateSchemaDeps=mi.validatePropertyDeps=mi.error=void 0;var TS=Me(),L2=Ve(),qc=pn();mi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,TS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,TS._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${r}}`};var y2={keyword:"dependencies",type:"object",schemaType:"object",error:Si.error,code(t){let[e,r]=v2(t);Gx(t,e),Qx(t,r)}};function v2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function Gx(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let u=e[a];if(u.length===0)continue;let f=(0,wc.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:u.length,deps:u.join(", ")}),i.allErrors?r.if(f,()=>{for(let h of u)(0,wc.checkReportMissingProp)(t,h)}):(r.if((0,qS._)`${f} && (${(0,wc.checkMissingProp)(t,u,s)})`),(0,wc.reportMissingProp)(t,s),r.else())}}Si.validatePropertyDeps=Gx;function Qx(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let u in e)(0,g2.alwaysValidSchema)(s,e[u])||(r.if((0,wc.propertyInData)(r,n,u,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:u},a);t.mergeValidEvaluated(f,a)},()=>r.var(a,!0)),t.ok(a))}Si.validateSchemaDeps=Qx;Si.default=y2});var eR=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var Xx=Me(),S2=Je(),b2={message:"property name must be valid",params:({params:t})=>(0,Xx._)`{propertyName: ${t.propertyName}}`},_2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:b2,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,S2.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,Xx.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};$S.default=_2});var NS=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var Kh=dn(),Bn=Me(),w2=Ki(),Gh=Je(),E2={message:"must NOT have additional properties",params:({params:t})=>(0,Bn._)`{additionalProperty: ${t.additionalProperty}}`},C2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:E2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:u,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,Gh.alwaysValidSchema)(a,r))return;let h=(0,Kh.allSchemaProperties)(n.properties),g=(0,Kh.allSchemaProperties)(n.patternProperties);m(),t.ok((0,Bn._)`${s} === ${w2.default.errors}`);function m(){e.forIn("key",i,A=>{!h.length&&!g.length?C(A):e.if(S(A),()=>C(A))})}function S(A){let T;if(h.length>8){let j=(0,Gh.schemaRefOrVal)(a,n.properties,"properties");T=(0,Kh.isOwnProperty)(e,j,A)}else h.length?T=(0,Bn.or)(...h.map(j=>(0,Bn._)`${A} === ${j}`)):T=Bn.nil;return g.length&&(T=(0,Bn.or)(T,...g.map(j=>(0,Bn._)`${(0,Kh.usePattern)(t,j)}.test(${A})`))),(0,Bn.not)(T)}function _(A){e.code((0,Bn._)`delete ${i}[${A}]`)}function C(A){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){_(A);return}if(r===!1){t.setParams({additionalProperty:A}),t.error(),u||e.break();return}if(typeof r=="object"&&!(0,Gh.alwaysValidSchema)(a,r)){let T=e.name("valid");f.removeAdditional==="failing"?(x(A,T,!1),e.if((0,Bn.not)(T),()=>{t.reset(),_(A)})):(x(A,T),u||e.if((0,Bn.not)(T),()=>e.break()))}}function x(A,T,j){let Y={keyword:"additionalProperties",dataProp:A,dataPropType:Gh.Type.Str};j===!1&&Object.assign(Y,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(Y,T)}}};MS.default=C2});var nR=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var x2=lc(),tR=dn(),DS=Je(),rR=NS(),R2={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&rR.default.code(new x2.KeywordCxt(s,rR.default,"additionalProperties"));let a=(0,tR.allSchemaProperties)(r);for(let m of a)s.definedProperties.add(m);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=DS.mergeEvaluated.props(e,(0,DS.toHash)(a),s.props));let u=a.filter(m=>!(0,DS.alwaysValidSchema)(s,r[m]));if(u.length===0)return;let f=e.name("valid");for(let m of u)h(m)?g(m):(e.if((0,tR.propertyInData)(e,i,m,s.opts.ownProperties)),g(m),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(f);function h(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function g(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},f)}}};FS.default=R2});var aR=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var iR=dn(),Qh=Me(),sR=Je(),oR=Je(),I2={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,u=(0,iR.allSchemaProperties)(r),f=u.filter(x=>(0,sR.alwaysValidSchema)(s,r[x]));if(u.length===0||f.length===u.length&&(!s.opts.unevaluated||s.props===!0))return;let h=a.strictSchema&&!a.allowMatchingProperties&&i.properties,g=e.name("valid");s.props!==!0&&!(s.props instanceof Qh.Name)&&(s.props=(0,oR.evaluatedPropsToName)(e,s.props));let{props:m}=s;S();function S(){for(let x of u)h&&_(x),s.allErrors?C(x):(e.var(g,!0),C(x),e.if(g))}function _(x){for(let A in h)new RegExp(x).test(A)&&(0,sR.checkStrictMode)(s,`property ${A} matches pattern ${x} (use allowMatchingProperties)`)}function C(x){e.forIn("key",n,A=>{e.if((0,Qh._)`${(0,iR.usePattern)(t,x)}.test(${A})`,()=>{let T=f.includes(x);T||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:A,dataPropType:oR.Type.Str},g),s.opts.unevaluated&&m!==!0?e.assign((0,Qh._)`${m}[${A}]`,!0):!T&&!s.allErrors&&e.if((0,Qh.not)(g),()=>e.break())})})}}};LS.default=I2});var lR=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var O2=Je(),P2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,O2.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};jS.default=P2});var uR=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var k2=dn(),A2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:k2.validateUnion,error:{message:"must match a schema in anyOf"}};US.default=A2});var cR=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var Zh=Me(),T2=Je(),q2={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Zh._)`{passingSchemas: ${t.passing}}`},$2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:q2,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",!1),u=e.let("passing",null),f=e.name("_valid");t.setParams({passing:u}),e.block(h),t.result(a,()=>t.reset(),()=>t.error(!0));function h(){s.forEach((g,m)=>{let S;(0,T2.alwaysValidSchema)(i,g)?e.var(f,!0):S=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},f),m>0&&e.if((0,Zh._)`${f} && ${a}`).assign(a,!1).assign(u,(0,Zh._)`[${u}, ${m}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(u,m),S&&t.mergeEvaluated(S,Zh.Name)})})}}};BS.default=$2});var fR=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var M2=Je(),N2={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,a)=>{if((0,M2.alwaysValidSchema)(n,s))return;let u=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(u)})}};HS.default=N2});var pR=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var Xh=Me(),hR=Je(),D2={message:({params:t})=>(0,Xh.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Xh._)`{failingKeyword: ${t.ifClause}}`},F2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:D2,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,hR.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=dR(n,"then"),s=dR(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),u=e.name("_valid");if(f(),t.reset(),i&&s){let g=e.let("ifClause");t.setParams({ifClause:g}),e.if(u,h("then",g),h("else",g))}else i?e.if(u,h("then")):e.if((0,Xh.not)(u),h("else"));t.pass(a,()=>t.error(!0));function f(){let g=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);t.mergeEvaluated(g)}function h(g,m){return()=>{let S=t.subschema({keyword:g},u);e.assign(a,u),t.mergeValidEvaluated(S,a),m?e.assign(m,(0,Xh._)`${g}`):t.setParams({ifClause:g})}}}};function dR(t,e){let r=t.schema[e];return r!==void 0&&!(0,hR.alwaysValidSchema)(t,r)}VS.default=F2});var mR=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var L2=Je(),j2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,L2.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};WS.default=j2});var gR=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var U2=OS(),B2=Yx(),H2=PS(),V2=zx(),W2=Kx(),Y2=Zx(),J2=eR(),z2=NS(),K2=nR(),G2=aR(),Q2=lR(),Z2=uR(),X2=cR(),eU=fR(),tU=pR(),rU=mR();function nU(t=!1){let e=[Q2.default,Z2.default,X2.default,eU.default,tU.default,rU.default,J2.default,z2.default,Y2.default,K2.default,G2.default];return t?e.push(B2.default,V2.default):e.push(U2.default,H2.default),e.push(W2.default),e}YS.default=nU});var yR=F(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var $t=Me(),iU={message:({schemaCode:t})=>(0,$t.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,$t._)`{format: ${t}}`},sU={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:iU,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:u}=t,{opts:f,errSchemaPath:h,schemaEnv:g,self:m}=u;if(!f.validateFormats)return;i?S():_();function S(){let C=r.scopeValue("formats",{ref:m.formats,code:f.code.formats}),x=r.const("fDef",(0,$t._)`${C}[${a}]`),A=r.let("fType"),T=r.let("format");r.if((0,$t._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(A,(0,$t._)`${x}.type || "string"`).assign(T,(0,$t._)`${x}.validate`),()=>r.assign(A,(0,$t._)`"string"`).assign(T,x)),t.fail$data((0,$t.or)(j(),Y()));function j(){return f.strictSchema===!1?$t.nil:(0,$t._)`${a} && !${T}`}function Y(){let V=g.$async?(0,$t._)`(${x}.async ? await ${T}(${n}) : ${T}(${n}))`:(0,$t._)`${T}(${n})`,K=(0,$t._)`(typeof ${T} == "function" ? ${V} : ${T}.test(${n}))`;return(0,$t._)`${T} && ${T} !== true && ${A} === ${e} && !${K}`}}function _(){let C=m.formats[s];if(!C){j();return}if(C===!0)return;let[x,A,T]=Y(C);x===e&&t.pass(V());function j(){if(f.strictSchema===!1){m.logger.warn(K());return}throw new Error(K());function K(){return`unknown format "${s}" ignored in schema at path "${h}"`}}function Y(K){let ee=K instanceof RegExp?(0,$t.regexpCode)(K):f.code.formats?(0,$t._)`${f.code.formats}${(0,$t.getProperty)(s)}`:void 0,k=r.scopeValue("formats",{key:s,ref:K,code:ee});return typeof K=="object"&&!(K instanceof RegExp)?[K.type||"string",K.validate,(0,$t._)`${k}.validate`]:["string",K,k]}function V(){if(typeof C=="object"&&!(C instanceof RegExp)&&C.async){if(!g.$async)throw new Error("async format in sync schema");return(0,$t._)`await ${T}(${n})`}return typeof A=="function"?(0,$t._)`${T}(${n})`:(0,$t._)`${T}.test(${n})`}}}};JS.default=sU});var vR=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var oU=yR(),aU=[oU.default];zS.default=aU});var SR=F(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.contentVocabulary=dl.metadataVocabulary=void 0;dl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];dl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var _R=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var lU=Ox(),uU=Bx(),cU=gR(),fU=vR(),bR=SR(),dU=[lU.default,uU.default,(0,cU.default)(),fU.default,bR.metadataVocabulary,bR.contentVocabulary];KS.default=dU});var ER=F(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.DiscrError=void 0;var wR;(function(t){t.Tag="tag",t.Mapping="mapping"})(wR||(ep.DiscrError=wR={}))});var xR=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var hl=Me(),GS=ER(),CR=Mh(),hU=uc(),pU=Je(),mU={message:({params:{discrError:t,tagName:e}})=>t===GS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,hl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},gU={keyword:"discriminator",type:"object",schemaType:"object",error:mU,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let u=n.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),h=e.const("tag",(0,hl._)`${r}${(0,hl.getProperty)(u)}`);e.if((0,hl._)`typeof ${h} == "string"`,()=>g(),()=>t.error(!1,{discrError:GS.DiscrError.Tag,tag:h,tagName:u})),t.ok(f);function g(){let _=S();e.if(!1);for(let C in _)e.elseIf((0,hl._)`${h} === ${C}`),e.assign(f,m(_[C]));e.else(),t.error(!1,{discrError:GS.DiscrError.Mapping,tag:h,tagName:u}),e.endIf()}function m(_){let C=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:_},C);return t.mergeEvaluated(x,hl.Name),C}function S(){var _;let C={},x=T(i),A=!0;for(let V=0;V<a.length;V++){let K=a[V];if(K?.$ref&&!(0,pU.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=CR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof CR.SchemaEnv&&(K=K.schema),K===void 0)throw new hU.default(s.opts.uriResolver,s.baseId,k)}let ee=(_=K?.properties)===null||_===void 0?void 0:_[u];if(typeof ee!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);A=A&&(x||T(K)),j(ee,V)}if(!A)throw new Error(`discriminator: "${u}" must be required`);return C;function T({required:V}){return Array.isArray(V)&&V.includes(u)}function j(V,K){if(V.const)Y(V.const,K);else if(V.enum)for(let ee of V.enum)Y(ee,K);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function Y(V,K){if(typeof V!="string"||V in C)throw new Error(`discriminator: "${u}" values must be unique strings`);C[V]=K}}}};QS.default=gU});var RR=F((H6,yU)=>{yU.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var OR=F((ht,ZS)=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.MissingRefError=ht.ValidationError=ht.CodeGen=ht.Name=ht.nil=ht.stringify=ht.str=ht._=ht.KeywordCxt=ht.Ajv=void 0;var vU=wx(),SU=_R(),bU=xR(),IR=RR(),_U=["/properties"],tp="http://json-schema.org/draft-07/schema",pl=class extends vU.default{_addVocabularies(){super._addVocabularies(),SU.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(bU.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(IR,_U):IR;this.addMetaSchema(e,tp,!1),this.refs["http://json-schema.org/schema"]=tp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(tp)?tp:void 0)}};ht.Ajv=pl;ZS.exports=ht=pl;ZS.exports.Ajv=pl;Object.defineProperty(ht,"__esModule",{value:!0});ht.default=pl;var wU=lc();Object.defineProperty(ht,"KeywordCxt",{enumerable:!0,get:function(){return wU.KeywordCxt}});var ml=Me();Object.defineProperty(ht,"_",{enumerable:!0,get:function(){return ml._}});Object.defineProperty(ht,"str",{enumerable:!0,get:function(){return ml.str}});Object.defineProperty(ht,"stringify",{enumerable:!0,get:function(){return ml.stringify}});Object.defineProperty(ht,"nil",{enumerable:!0,get:function(){return ml.nil}});Object.defineProperty(ht,"Name",{enumerable:!0,get:function(){return ml.Name}});Object.defineProperty(ht,"CodeGen",{enumerable:!0,get:function(){return ml.CodeGen}});var EU=qh();Object.defineProperty(ht,"ValidationError",{enumerable:!0,get:function(){return EU.default}});var CU=uc();Object.defineProperty(ht,"MissingRefError",{enumerable:!0,get:function(){return CU.default}})});var Ve=F(tr=>{"use strict";var mb=Symbol.for("yaml.alias"),DR=Symbol.for("yaml.document"),fp=Symbol.for("yaml.map"),FR=Symbol.for("yaml.pair"),gb=Symbol.for("yaml.scalar"),dp=Symbol.for("yaml.seq"),Xi=Symbol.for("yaml.node.type"),tB=t=>!!t&&typeof t=="object"&&t[Xi]===mb,rB=t=>!!t&&typeof t=="object"&&t[Xi]===DR,nB=t=>!!t&&typeof t=="object"&&t[Xi]===fp,iB=t=>!!t&&typeof t=="object"&&t[Xi]===FR,LR=t=>!!t&&typeof t=="object"&&t[Xi]===gb,sB=t=>!!t&&typeof t=="object"&&t[Xi]===dp;function jR(t){if(t&&typeof t=="object")switch(t[Xi]){case fp:case dp:return!0}return!1}function oB(t){if(t&&typeof t=="object")switch(t[Xi]){case mb:case fp:case gb:case dp:return!0}return!1}var aB=t=>(LR(t)||jR(t))&&!!t.anchor;tr.ALIAS=mb;tr.DOC=DR;tr.MAP=fp;tr.NODE_TYPE=Xi;tr.PAIR=FR;tr.SCALAR=gb;tr.SEQ=dp;tr.hasAnchor=aB;tr.isAlias=tB;tr.isCollection=jR;tr.isDocument=rB;tr.isMap=nB;tr.isNode=oB;tr.isPair=iB;tr.isScalar=LR;tr.isSeq=sB});var Hc=F(yb=>{"use strict";var Ht=Ve(),Mr=Symbol("break visit"),UR=Symbol("skip children"),_i=Symbol("remove node");function hp(t,e){let r=BR(e);Ht.isDocument(t)?xl(null,t.contents,r,Object.freeze([t]))===_i&&(t.contents=null):xl(null,t,r,Object.freeze([]))}hp.BREAK=Mr;hp.SKIP=UR;hp.REMOVE=_i;function xl(t,e,r,n){let i=HR(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return VR(t,n,i),xl(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=xl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===_i&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=xl("key",e.key,r,n);if(s===Mr)return Mr;s===_i&&(e.key=null);let a=xl("value",e.value,r,n);if(a===Mr)return Mr;a===_i&&(e.value=null)}}return i}async function pp(t,e){let r=BR(e);Ht.isDocument(t)?await Rl(null,t.contents,r,Object.freeze([t]))===_i&&(t.contents=null):await Rl(null,t,r,Object.freeze([]))}pp.BREAK=Mr;pp.SKIP=UR;pp.REMOVE=_i;async function Rl(t,e,r,n){let i=await HR(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return VR(t,n,i),Rl(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await Rl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===_i&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=await Rl("key",e.key,r,n);if(s===Mr)return Mr;s===_i&&(e.key=null);let a=await Rl("value",e.value,r,n);if(a===Mr)return Mr;a===_i&&(e.value=null)}}return i}function BR(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function HR(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Ht.isMap(e))return r.Map?.(t,e,n);if(Ht.isSeq(e))return r.Seq?.(t,e,n);if(Ht.isPair(e))return r.Pair?.(t,e,n);if(Ht.isScalar(e))return r.Scalar?.(t,e,n);if(Ht.isAlias(e))return r.Alias?.(t,e,n)}function VR(t,e,r){let n=e[e.length-1];if(Ht.isCollection(n))n.items[t]=r;else if(Ht.isPair(n))t==="key"?n.key=r:n.value=r;else if(Ht.isDocument(n))n.contents=r;else{let i=Ht.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}yb.visit=hp;yb.visitAsync=pp});var vb=F(YR=>{"use strict";var WR=Ve(),lB=Hc(),uB={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},cB=t=>t.replace(/[!,[\]{}]/g,e=>uB[e]),Vc=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,a),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return r(String(a)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+cB(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&WR.isNode(e.contents)){let s={};lB.visit(e.contents,(a,u)=>{WR.isNode(u)&&u.tag&&(s[u.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(u=>u.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join(`
|
|
31
|
-
`)}};
|
|
30
|
+
deps: ${r}}`};var j2={keyword:"dependencies",type:"object",schemaType:"object",error:mi.error,code(t){let[e,r]=U2(t);rR(t,e),nR(t,r)}};function U2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function rR(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let u=e[a];if(u.length===0)continue;let f=(0,qc.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:u.length,deps:u.join(", ")}),i.allErrors?r.if(f,()=>{for(let h of u)(0,qc.checkReportMissingProp)(t,h)}):(r.if((0,TS._)`${f} && (${(0,qc.checkMissingProp)(t,u,s)})`),(0,qc.reportMissingProp)(t,s),r.else())}}mi.validatePropertyDeps=rR;function nR(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let u in e)(0,L2.alwaysValidSchema)(s,e[u])||(r.if((0,qc.propertyInData)(r,n,u,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:u},a);t.mergeValidEvaluated(f,a)},()=>r.var(a,!0)),t.ok(a))}mi.validateSchemaDeps=nR;mi.default=j2});var oR=F(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});var sR=Me(),B2=Ve(),H2={message:"property name must be valid",params:({params:t})=>(0,sR._)`{propertyName: ${t.propertyName}}`},V2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:H2,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,B2.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,sR.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};qS.default=V2});var MS=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var Yh=pn(),Vn=Me(),W2=Wi(),Jh=Ve(),Y2={message:"must NOT have additional properties",params:({params:t})=>(0,Vn._)`{additionalProperty: ${t.additionalProperty}}`},J2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Y2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:u,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,Jh.alwaysValidSchema)(a,r))return;let h=(0,Yh.allSchemaProperties)(n.properties),g=(0,Yh.allSchemaProperties)(n.patternProperties);m(),t.ok((0,Vn._)`${s} === ${W2.default.errors}`);function m(){e.forIn("key",i,A=>{!h.length&&!g.length?x(A):e.if(S(A),()=>x(A))})}function S(A){let T;if(h.length>8){let B=(0,Jh.schemaRefOrVal)(a,n.properties,"properties");T=(0,Yh.isOwnProperty)(e,B,A)}else h.length?T=(0,Vn.or)(...h.map(B=>(0,Vn._)`${A} === ${B}`)):T=Vn.nil;return g.length&&(T=(0,Vn.or)(T,...g.map(B=>(0,Vn._)`${(0,Yh.usePattern)(t,B)}.test(${A})`))),(0,Vn.not)(T)}function E(A){e.code((0,Vn._)`delete ${i}[${A}]`)}function x(A){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){E(A);return}if(r===!1){t.setParams({additionalProperty:A}),t.error(),u||e.break();return}if(typeof r=="object"&&!(0,Jh.alwaysValidSchema)(a,r)){let T=e.name("valid");f.removeAdditional==="failing"?(C(A,T,!1),e.if((0,Vn.not)(T),()=>{t.reset(),E(A)})):(C(A,T),u||e.if((0,Vn.not)(T),()=>e.break()))}}function C(A,T,B){let Y={keyword:"additionalProperties",dataProp:A,dataPropType:Jh.Type.Str};B===!1&&Object.assign(Y,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(Y,T)}}};$S.default=J2});var uR=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var z2=Sc(),aR=pn(),NS=Ve(),lR=MS(),K2={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&lR.default.code(new z2.KeywordCxt(s,lR.default,"additionalProperties"));let a=(0,aR.allSchemaProperties)(r);for(let m of a)s.definedProperties.add(m);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=NS.mergeEvaluated.props(e,(0,NS.toHash)(a),s.props));let u=a.filter(m=>!(0,NS.alwaysValidSchema)(s,r[m]));if(u.length===0)return;let f=e.name("valid");for(let m of u)h(m)?g(m):(e.if((0,aR.propertyInData)(e,i,m,s.opts.ownProperties)),g(m),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(f);function h(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function g(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},f)}}};DS.default=K2});var hR=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var cR=pn(),zh=Me(),fR=Ve(),dR=Ve(),G2={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,u=(0,cR.allSchemaProperties)(r),f=u.filter(C=>(0,fR.alwaysValidSchema)(s,r[C]));if(u.length===0||f.length===u.length&&(!s.opts.unevaluated||s.props===!0))return;let h=a.strictSchema&&!a.allowMatchingProperties&&i.properties,g=e.name("valid");s.props!==!0&&!(s.props instanceof zh.Name)&&(s.props=(0,dR.evaluatedPropsToName)(e,s.props));let{props:m}=s;S();function S(){for(let C of u)h&&E(C),s.allErrors?x(C):(e.var(g,!0),x(C),e.if(g))}function E(C){for(let A in h)new RegExp(C).test(A)&&(0,fR.checkStrictMode)(s,`property ${A} matches pattern ${C} (use allowMatchingProperties)`)}function x(C){e.forIn("key",n,A=>{e.if((0,zh._)`${(0,cR.usePattern)(t,C)}.test(${A})`,()=>{let T=f.includes(C);T||t.subschema({keyword:"patternProperties",schemaProp:C,dataProp:A,dataPropType:dR.Type.Str},g),s.opts.unevaluated&&m!==!0?e.assign((0,zh._)`${m}[${A}]`,!0):!T&&!s.allErrors&&e.if((0,zh.not)(g),()=>e.break())})})}}};FS.default=G2});var pR=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var Q2=Ve(),Z2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Q2.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};LS.default=Z2});var mR=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var X2=pn(),eU={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:X2.validateUnion,error:{message:"must match a schema in anyOf"}};jS.default=eU});var gR=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var Kh=Me(),tU=Ve(),rU={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Kh._)`{passingSchemas: ${t.passing}}`},nU={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:rU,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",!1),u=e.let("passing",null),f=e.name("_valid");t.setParams({passing:u}),e.block(h),t.result(a,()=>t.reset(),()=>t.error(!0));function h(){s.forEach((g,m)=>{let S;(0,tU.alwaysValidSchema)(i,g)?e.var(f,!0):S=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},f),m>0&&e.if((0,Kh._)`${f} && ${a}`).assign(a,!1).assign(u,(0,Kh._)`[${u}, ${m}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(u,m),S&&t.mergeEvaluated(S,Kh.Name)})})}}};US.default=nU});var yR=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var iU=Ve(),sU={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,a)=>{if((0,iU.alwaysValidSchema)(n,s))return;let u=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(u)})}};BS.default=sU});var bR=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var Gh=Me(),SR=Ve(),oU={message:({params:t})=>(0,Gh.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Gh._)`{failingKeyword: ${t.ifClause}}`},aU={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:oU,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,SR.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=vR(n,"then"),s=vR(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),u=e.name("_valid");if(f(),t.reset(),i&&s){let g=e.let("ifClause");t.setParams({ifClause:g}),e.if(u,h("then",g),h("else",g))}else i?e.if(u,h("then")):e.if((0,Gh.not)(u),h("else"));t.pass(a,()=>t.error(!0));function f(){let g=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);t.mergeEvaluated(g)}function h(g,m){return()=>{let S=t.subschema({keyword:g},u);e.assign(a,u),t.mergeValidEvaluated(S,a),m?e.assign(m,(0,Gh._)`${g}`):t.setParams({ifClause:g})}}}};function vR(t,e){let r=t.schema[e];return r!==void 0&&!(0,SR.alwaysValidSchema)(t,r)}HS.default=aU});var _R=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var lU=Ve(),uU={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,lU.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};VS.default=uU});var wR=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var cU=IS(),fU=ZC(),dU=OS(),hU=eR(),pU=tR(),mU=iR(),gU=oR(),yU=MS(),vU=uR(),SU=hR(),bU=pR(),_U=mR(),wU=gR(),EU=yR(),xU=bR(),CU=_R();function RU(t=!1){let e=[bU.default,_U.default,wU.default,EU.default,xU.default,CU.default,gU.default,yU.default,mU.default,vU.default,SU.default];return t?e.push(fU.default,hU.default):e.push(cU.default,dU.default),e.push(pU.default),e}WS.default=RU});var ER=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var At=Me(),IU={message:({schemaCode:t})=>(0,At.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,At._)`{format: ${t}}`},OU={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:IU,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:u}=t,{opts:f,errSchemaPath:h,schemaEnv:g,self:m}=u;if(!f.validateFormats)return;i?S():E();function S(){let x=r.scopeValue("formats",{ref:m.formats,code:f.code.formats}),C=r.const("fDef",(0,At._)`${x}[${a}]`),A=r.let("fType"),T=r.let("format");r.if((0,At._)`typeof ${C} == "object" && !(${C} instanceof RegExp)`,()=>r.assign(A,(0,At._)`${C}.type || "string"`).assign(T,(0,At._)`${C}.validate`),()=>r.assign(A,(0,At._)`"string"`).assign(T,C)),t.fail$data((0,At.or)(B(),Y()));function B(){return f.strictSchema===!1?At.nil:(0,At._)`${a} && !${T}`}function Y(){let H=g.$async?(0,At._)`(${C}.async ? await ${T}(${n}) : ${T}(${n}))`:(0,At._)`${T}(${n})`,K=(0,At._)`(typeof ${T} == "function" ? ${H} : ${T}.test(${n}))`;return(0,At._)`${T} && ${T} !== true && ${A} === ${e} && !${K}`}}function E(){let x=m.formats[s];if(!x){B();return}if(x===!0)return;let[C,A,T]=Y(x);C===e&&t.pass(H());function B(){if(f.strictSchema===!1){m.logger.warn(K());return}throw new Error(K());function K(){return`unknown format "${s}" ignored in schema at path "${h}"`}}function Y(K){let X=K instanceof RegExp?(0,At.regexpCode)(K):f.code.formats?(0,At._)`${f.code.formats}${(0,At.getProperty)(s)}`:void 0,k=r.scopeValue("formats",{key:s,ref:K,code:X});return typeof K=="object"&&!(K instanceof RegExp)?[K.type||"string",K.validate,(0,At._)`${k}.validate`]:["string",K,k]}function H(){if(typeof x=="object"&&!(x instanceof RegExp)&&x.async){if(!g.$async)throw new Error("async format in sync schema");return(0,At._)`await ${T}(${n})`}return typeof A=="function"?(0,At._)`${T}(${n})`:(0,At._)`${T}.test(${n})`}}}};YS.default=OU});var xR=F(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var PU=ER(),kU=[PU.default];JS.default=kU});var CR=F(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.contentVocabulary=bl.metadataVocabulary=void 0;bl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];bl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var IR=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var AU=$C(),TU=zC(),qU=wR(),$U=xR(),RR=CR(),MU=[AU.default,TU.default,(0,qU.default)(),$U.default,RR.metadataVocabulary,RR.contentVocabulary];zS.default=MU});var PR=F(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.DiscrError=void 0;var OR;(function(t){t.Tag="tag",t.Mapping="mapping"})(OR||(Qh.DiscrError=OR={}))});var AR=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var _l=Me(),KS=PR(),kR=$h(),NU=bc(),DU=Ve(),FU={message:({params:{discrError:t,tagName:e}})=>t===KS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,_l._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},LU={keyword:"discriminator",type:"object",schemaType:"object",error:FU,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let u=n.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),h=e.const("tag",(0,_l._)`${r}${(0,_l.getProperty)(u)}`);e.if((0,_l._)`typeof ${h} == "string"`,()=>g(),()=>t.error(!1,{discrError:KS.DiscrError.Tag,tag:h,tagName:u})),t.ok(f);function g(){let E=S();e.if(!1);for(let x in E)e.elseIf((0,_l._)`${h} === ${x}`),e.assign(f,m(E[x]));e.else(),t.error(!1,{discrError:KS.DiscrError.Mapping,tag:h,tagName:u}),e.endIf()}function m(E){let x=e.name("valid"),C=t.subschema({keyword:"oneOf",schemaProp:E},x);return t.mergeEvaluated(C,_l.Name),x}function S(){var E;let x={},C=T(i),A=!0;for(let H=0;H<a.length;H++){let K=a[H];if(K?.$ref&&!(0,DU.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=kR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof kR.SchemaEnv&&(K=K.schema),K===void 0)throw new NU.default(s.opts.uriResolver,s.baseId,k)}let X=(E=K?.properties)===null||E===void 0?void 0:E[u];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);A=A&&(C||T(K)),B(X,H)}if(!A)throw new Error(`discriminator: "${u}" must be required`);return x;function T({required:H}){return Array.isArray(H)&&H.includes(u)}function B(H,K){if(H.const)Y(H.const,K);else if(H.enum)for(let X of H.enum)Y(X,K);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function Y(H,K){if(typeof H!="string"||H in x)throw new Error(`discriminator: "${u}" values must be unique strings`);x[H]=K}}}};GS.default=LU});var TR=F((d9,jU)=>{jU.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var $R=F((mt,QS)=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.MissingRefError=mt.ValidationError=mt.CodeGen=mt.Name=mt.nil=mt.stringify=mt.str=mt._=mt.KeywordCxt=mt.Ajv=void 0;var UU=OC(),BU=IR(),HU=AR(),qR=TR(),VU=["/properties"],Zh="http://json-schema.org/draft-07/schema",wl=class extends UU.default{_addVocabularies(){super._addVocabularies(),BU.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(HU.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(qR,VU):qR;this.addMetaSchema(e,Zh,!1),this.refs["http://json-schema.org/schema"]=Zh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Zh)?Zh:void 0)}};mt.Ajv=wl;QS.exports=mt=wl;QS.exports.Ajv=wl;Object.defineProperty(mt,"__esModule",{value:!0});mt.default=wl;var WU=Sc();Object.defineProperty(mt,"KeywordCxt",{enumerable:!0,get:function(){return WU.KeywordCxt}});var El=Me();Object.defineProperty(mt,"_",{enumerable:!0,get:function(){return El._}});Object.defineProperty(mt,"str",{enumerable:!0,get:function(){return El.str}});Object.defineProperty(mt,"stringify",{enumerable:!0,get:function(){return El.stringify}});Object.defineProperty(mt,"nil",{enumerable:!0,get:function(){return El.nil}});Object.defineProperty(mt,"Name",{enumerable:!0,get:function(){return El.Name}});Object.defineProperty(mt,"CodeGen",{enumerable:!0,get:function(){return El.CodeGen}});var YU=Th();Object.defineProperty(mt,"ValidationError",{enumerable:!0,get:function(){return YU.default}});var JU=bc();Object.defineProperty(mt,"MissingRefError",{enumerable:!0,get:function(){return JU.default}})});var Ye=F(Xt=>{"use strict";var pb=Symbol.for("yaml.alias"),HR=Symbol.for("yaml.document"),lp=Symbol.for("yaml.map"),VR=Symbol.for("yaml.pair"),mb=Symbol.for("yaml.scalar"),up=Symbol.for("yaml.seq"),zi=Symbol.for("yaml.node.type"),xB=t=>!!t&&typeof t=="object"&&t[zi]===pb,CB=t=>!!t&&typeof t=="object"&&t[zi]===HR,RB=t=>!!t&&typeof t=="object"&&t[zi]===lp,IB=t=>!!t&&typeof t=="object"&&t[zi]===VR,WR=t=>!!t&&typeof t=="object"&&t[zi]===mb,OB=t=>!!t&&typeof t=="object"&&t[zi]===up;function YR(t){if(t&&typeof t=="object")switch(t[zi]){case lp:case up:return!0}return!1}function PB(t){if(t&&typeof t=="object")switch(t[zi]){case pb:case lp:case mb:case up:return!0}return!1}var kB=t=>(WR(t)||YR(t))&&!!t.anchor;Xt.ALIAS=pb;Xt.DOC=HR;Xt.MAP=lp;Xt.NODE_TYPE=zi;Xt.PAIR=VR;Xt.SCALAR=mb;Xt.SEQ=up;Xt.hasAnchor=kB;Xt.isAlias=xB;Xt.isCollection=YR;Xt.isDocument=CB;Xt.isMap=RB;Xt.isNode=PB;Xt.isPair=IB;Xt.isScalar=WR;Xt.isSeq=OB});var ef=F(gb=>{"use strict";var Bt=Ye(),Dr=Symbol("break visit"),JR=Symbol("skip children"),yi=Symbol("remove node");function cp(t,e){let r=zR(e);Bt.isDocument(t)?ql(null,t.contents,r,Object.freeze([t]))===yi&&(t.contents=null):ql(null,t,r,Object.freeze([]))}cp.BREAK=Dr;cp.SKIP=JR;cp.REMOVE=yi;function ql(t,e,r,n){let i=KR(t,e,r,n);if(Bt.isNode(i)||Bt.isPair(i))return GR(t,n,i),ql(t,i,r,n);if(typeof i!="symbol"){if(Bt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=ql(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Dr)return Dr;a===yi&&(e.items.splice(s,1),s-=1)}}}else if(Bt.isPair(e)){n=Object.freeze(n.concat(e));let s=ql("key",e.key,r,n);if(s===Dr)return Dr;s===yi&&(e.key=null);let a=ql("value",e.value,r,n);if(a===Dr)return Dr;a===yi&&(e.value=null)}}return i}async function fp(t,e){let r=zR(e);Bt.isDocument(t)?await $l(null,t.contents,r,Object.freeze([t]))===yi&&(t.contents=null):await $l(null,t,r,Object.freeze([]))}fp.BREAK=Dr;fp.SKIP=JR;fp.REMOVE=yi;async function $l(t,e,r,n){let i=await KR(t,e,r,n);if(Bt.isNode(i)||Bt.isPair(i))return GR(t,n,i),$l(t,i,r,n);if(typeof i!="symbol"){if(Bt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await $l(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Dr)return Dr;a===yi&&(e.items.splice(s,1),s-=1)}}}else if(Bt.isPair(e)){n=Object.freeze(n.concat(e));let s=await $l("key",e.key,r,n);if(s===Dr)return Dr;s===yi&&(e.key=null);let a=await $l("value",e.value,r,n);if(a===Dr)return Dr;a===yi&&(e.value=null)}}return i}function zR(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function KR(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Bt.isMap(e))return r.Map?.(t,e,n);if(Bt.isSeq(e))return r.Seq?.(t,e,n);if(Bt.isPair(e))return r.Pair?.(t,e,n);if(Bt.isScalar(e))return r.Scalar?.(t,e,n);if(Bt.isAlias(e))return r.Alias?.(t,e,n)}function GR(t,e,r){let n=e[e.length-1];if(Bt.isCollection(n))n.items[t]=r;else if(Bt.isPair(n))t==="key"?n.key=r:n.value=r;else if(Bt.isDocument(n))n.contents=r;else{let i=Bt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}gb.visit=cp;gb.visitAsync=fp});var yb=F(ZR=>{"use strict";var QR=Ye(),AB=ef(),TB={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},qB=t=>t.replace(/[!,[\]{}]/g,e=>TB[e]),tf=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,a),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return r(String(a)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+qB(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&QR.isNode(e.contents)){let s={};AB.visit(e.contents,(a,u)=>{QR.isNode(u)&&u.tag&&(s[u.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(u=>u.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join(`
|
|
31
|
+
`)}};tf.defaultYaml={explicit:!1,version:"1.2"};tf.defaultTags={"!!":"tag:yaml.org,2002:"};ZR.Directives=tf});var dp=F(rf=>{"use strict";var XR=Ye(),$B=ef();function MB(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function eI(t){let e=new Set;return $B.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function tI(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function NB(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=eI(t));let a=tI(e,i);return i.add(a),a},setAnchors:()=>{for(let s of r){let a=n.get(s);if(typeof a=="object"&&a.anchor&&(XR.isScalar(a.node)||XR.isCollection(a.node)))a.node.anchor=a.anchor;else{let u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=s,u}}},sourceObjects:n}}rf.anchorIsValid=MB;rf.anchorNames=eI;rf.createNodeAnchors=NB;rf.findNewAnchor=tI});var vb=F(rI=>{"use strict";function nf(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let a=n[i],u=nf(t,n,String(i),a);u===void 0?delete n[i]:u!==a&&(n[i]=u)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),a=nf(t,n,i,s);a===void 0?n.delete(i):a!==s&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let s=nf(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let a=nf(t,n,i,s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}return t.call(e,r,n)}rI.applyReviver=nf});var Ns=F(iI=>{"use strict";var DB=Ye();function nI(t,e,r){if(Array.isArray(t))return t.map((n,i)=>nI(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!DB.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}iI.toJS=nI});var hp=F(oI=>{"use strict";var FB=vb(),sI=Ye(),LB=Ns(),Sb=class{constructor(e){Object.defineProperty(this,sI.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!sI.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},u=LB.toJS(this,"",a);if(typeof i=="function")for(let{count:f,res:h}of a.anchors.values())i(h,f);return typeof s=="function"?FB.applyReviver(s,{"":u},"",u):u}};oI.NodeBase=Sb});var sf=F(aI=>{"use strict";var jB=dp(),UB=ef(),Ml=Ye(),BB=hp(),HB=Ns(),bb=class extends BB.NodeBase{constructor(e){super(Ml.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],UB.visit(e,{Node:(s,a)=>{(Ml.isAlias(a)||Ml.hasAnchor(a))&&n.push(a)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,a=this.resolve(i,r);if(!a){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let u=n.get(a);if(u||(HB.toJS(a,null,r),u=n.get(a)),u?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=pp(i,a,n)),u.count*u.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return u.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(jB.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function pp(t,e,r){if(Ml.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Ml.isCollection(e)){let n=0;for(let i of e.items){let s=pp(t,i,r);s>n&&(n=s)}return n}else if(Ml.isPair(e)){let n=pp(t,e.key,r),i=pp(t,e.value,r);return Math.max(n,i)}return 1}aI.Alias=bb});var Mt=F(_b=>{"use strict";var VB=Ye(),WB=hp(),YB=Ns(),JB=t=>!t||typeof t!="function"&&typeof t!="object",Ds=class extends WB.NodeBase{constructor(e){super(VB.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:YB.toJS(this.value,e,r)}toString(){return String(this.value)}};Ds.BLOCK_FOLDED="BLOCK_FOLDED";Ds.BLOCK_LITERAL="BLOCK_LITERAL";Ds.PLAIN="PLAIN";Ds.QUOTE_DOUBLE="QUOTE_DOUBLE";Ds.QUOTE_SINGLE="QUOTE_SINGLE";_b.Scalar=Ds;_b.isScalarValue=JB});var of=F(uI=>{"use strict";var zB=sf(),ta=Ye(),lI=Mt(),KB="tag:yaml.org,2002:";function GB(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function QB(t,e,r){if(ta.isDocument(t)&&(t=t.contents),ta.isNode(t))return t;if(ta.isPair(t)){let m=r.schema[ta.MAP].createNode?.(r.schema,null,r);return m.items.push(t),m}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:a,sourceObjects:u}=r,f;if(n&&t&&typeof t=="object"){if(f=u.get(t),f)return f.anchor??(f.anchor=i(t)),new zB.Alias(f.anchor);f={anchor:null,node:null},u.set(t,f)}e?.startsWith("!!")&&(e=KB+e.slice(2));let h=GB(t,e,a.tags);if(!h){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let m=new lI.Scalar(t);return f&&(f.node=m),m}h=t instanceof Map?a[ta.MAP]:Symbol.iterator in Object(t)?a[ta.SEQ]:a[ta.MAP]}s&&(s(h),delete r.onTagObj);let g=h?.createNode?h.createNode(r.schema,t,r):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(r.schema,t,r):new lI.Scalar(t);return e?g.tag=e:h.default||(g.tag=h.tag),f&&(f.node=g),g}uI.createNode=QB});var gp=F(mp=>{"use strict";var ZB=of(),vi=Ye(),XB=hp();function wb(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return ZB.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var cI=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Eb=class extends XB.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>vi.isNode(n)||vi.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(cI(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(vi.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,wb(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(vi.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&vi.isScalar(s)?s.value:s:vi.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!vi.isPair(r))return!1;let n=r.value;return n==null||e&&vi.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return vi.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(vi.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,wb(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};mp.Collection=Eb;mp.collectionFromPath=wb;mp.isEmptyPath=cI});var af=F(yp=>{"use strict";var eH=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function xb(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var tH=(t,e,r)=>t.endsWith(`
|
|
32
32
|
`)?xb(r,e):r.includes(`
|
|
33
33
|
`)?`
|
|
34
|
-
`+xb(r,e):(t.endsWith(" ")?"":" ")+r;
|
|
35
|
-
`)r===
|
|
36
|
-
`&&
|
|
37
|
-
`&&
|
|
38
|
-
${e}${t.slice(0,K)}`:(r===
|
|
39
|
-
${e}${t.slice(
|
|
40
|
-
`);n=e,i=e+1,s=t[i]}return n}
|
|
41
|
-
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function
|
|
34
|
+
`+xb(r,e):(t.endsWith(" ")?"":" ")+r;yp.indentComment=xb;yp.lineComment=tH;yp.stringifyComment=eH});var dI=F(lf=>{"use strict";var rH="flow",Cb="block",vp="quoted";function nH(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:u}={}){if(!i||i<0)return t;i<s&&(s=0);let f=Math.max(1+s,1+i-e.length);if(t.length<=f)return t;let h=[],g={},m=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?h.push(0):m=i-n);let S,E,x=!1,C=-1,A=-1,T=-1;r===Cb&&(C=fI(t,C,e.length),C!==-1&&(m=C+f));for(let Y;Y=t[C+=1];){if(r===vp&&Y==="\\"){switch(A=C,t[C+1]){case"x":C+=3;break;case"u":C+=5;break;case"U":C+=9;break;default:C+=1}T=C}if(Y===`
|
|
35
|
+
`)r===Cb&&(C=fI(t,C,e.length)),m=C+e.length+f,S=void 0;else{if(Y===" "&&E&&E!==" "&&E!==`
|
|
36
|
+
`&&E!==" "){let H=t[C+1];H&&H!==" "&&H!==`
|
|
37
|
+
`&&H!==" "&&(S=C)}if(C>=m)if(S)h.push(S),m=S+f,S=void 0;else if(r===vp){for(;E===" "||E===" ";)E=Y,Y=t[C+=1],x=!0;let H=C>T+1?C-2:A-1;if(g[H])return t;h.push(H),g[H]=!0,m=H+f,S=void 0}else x=!0}E=Y}if(x&&u&&u(),h.length===0)return t;a&&a();let B=t.slice(0,h[0]);for(let Y=0;Y<h.length;++Y){let H=h[Y],K=h[Y+1]||t.length;H===0?B=`
|
|
38
|
+
${e}${t.slice(0,K)}`:(r===vp&&g[H]&&(B+=`${t[H]}\\`),B+=`
|
|
39
|
+
${e}${t.slice(H+1,K)}`)}return B}function fI(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
40
|
+
`);n=e,i=e+1,s=t[i]}return n}lf.FOLD_BLOCK=Cb;lf.FOLD_FLOW=rH;lf.FOLD_QUOTED=vp;lf.foldFlowLines=nH});var cf=F(hI=>{"use strict";var Yn=Mt(),Fs=dI(),bp=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),_p=t=>/^(%|---|\.\.\.)/m.test(t);function iH(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,a=0;s<i;++s)if(t[s]===`
|
|
41
|
+
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function uf(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(_p(t)?" ":""),a="",u=0;for(let f=0,h=r[f];h;h=r[++f])if(h===" "&&r[f+1]==="\\"&&r[f+2]==="n"&&(a+=r.slice(u,f)+"\\ ",f+=1,u=f,h="\\"),h==="\\")switch(r[f+1]){case"u":{a+=r.slice(u,f);let g=r.substr(f+2,4);switch(g){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:g.substr(0,2)==="00"?a+="\\x"+g.substr(2):a+=r.substr(f,6)}f+=5,u=f+1}break;case"n":if(n||r[f+2]==='"'||r.length<i)f+=1;else{for(a+=r.slice(u,f)+`
|
|
42
42
|
|
|
43
43
|
`;r[f+2]==="\\"&&r[f+3]==="n"&&r[f+4]!=='"';)a+=`
|
|
44
|
-
`,f+=2;a+=s,r[f+2]===" "&&(a+="\\"),f+=1,u=f+1}break;default:f+=1}return a=u?a+r.slice(u):r,n?a:
|
|
45
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return
|
|
46
|
-
${r}`)+"'";return e.implicitKey?n:
|
|
44
|
+
`,f+=2;a+=s,r[f+2]===" "&&(a+="\\"),f+=1,u=f+1}break;default:f+=1}return a=u?a+r.slice(u):r,n?a:Fs.foldFlowLines(a,s,Fs.FOLD_QUOTED,bp(e,!1))}function Rb(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
45
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return uf(t,e);let r=e.indent||(_p(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
46
|
+
${r}`)+"'";return e.implicitKey?n:Fs.foldFlowLines(n,r,Fs.FOLD_FLOW,bp(e,!1))}function Nl(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=uf;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=Rb:s&&!i?n=uf:n=r?Rb:uf}return n(t,e)}var Ib;try{Ib=new RegExp(`(^|(?<!
|
|
47
47
|
))
|
|
48
48
|
+(?!
|
|
49
|
-
|$)`,"g")}catch{
|
|
49
|
+
|$)`,"g")}catch{Ib=/\n+(?!\n|$)/g}function Sp({comment:t,type:e,value:r},n,i,s){let{blockQuote:a,commentString:u,lineWidth:f}=n.options;if(!a||/\n[\t ]+$/.test(r))return Nl(r,n);let h=n.indent||(n.forceBlockIndent||_p(r)?" ":""),g=a==="literal"?!0:a==="folded"||e===Yn.Scalar.BLOCK_FOLDED?!1:e===Yn.Scalar.BLOCK_LITERAL?!0:!iH(r,f,h.length);if(!r)return g?`|
|
|
50
50
|
`:`>
|
|
51
51
|
`;let m,S;for(S=r.length;S>0;--S){let K=r[S-1];if(K!==`
|
|
52
|
-
`&&K!==" "&&K!==" ")break}let
|
|
53
|
-
`);
|
|
54
|
-
`&&(
|
|
55
|
-
`)T=A;else break}let
|
|
56
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),
|
|
57
|
-
${h}${
|
|
58
|
-
${h}${
|
|
59
|
-
`)||g&&/[[\]{},]/.test(s))return
|
|
60
|
-
`)?
|
|
61
|
-
`))return
|
|
62
|
-
${f}`);if(a){let S=
|
|
63
|
-
${e.indent}${u}`:u}
|
|
64
|
-
${u}:`):(A=`${A}:`,S&&(A+=
|
|
65
|
-
`:"",
|
|
66
|
-
${
|
|
67
|
-
`&&Y&&(
|
|
52
|
+
`&&K!==" "&&K!==" ")break}let E=r.substring(S),x=E.indexOf(`
|
|
53
|
+
`);x===-1?m="-":r===E||x!==E.length-1?(m="+",s&&s()):m="",E&&(r=r.slice(0,-E.length),E[E.length-1]===`
|
|
54
|
+
`&&(E=E.slice(0,-1)),E=E.replace(Ib,`$&${h}`));let C=!1,A,T=-1;for(A=0;A<r.length;++A){let K=r[A];if(K===" ")C=!0;else if(K===`
|
|
55
|
+
`)T=A;else break}let B=r.substring(0,T<A?T+1:A);B&&(r=r.substring(B.length),B=B.replace(/\n+/g,`$&${h}`));let H=(C?h?"2":"1":"")+m;if(t&&(H+=" "+u(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!g){let K=r.replace(/\n+/g,`
|
|
56
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),X=!1,k=bp(n,!0);a!=="folded"&&e!==Yn.Scalar.BLOCK_FOLDED&&(k.onOverflow=()=>{X=!0});let w=Fs.foldFlowLines(`${B}${K}${E}`,h,Fs.FOLD_BLOCK,k);if(!X)return`>${H}
|
|
57
|
+
${h}${w}`}return r=r.replace(/\n+/g,`$&${h}`),`|${H}
|
|
58
|
+
${h}${B}${r}${E}`}function sH(t,e,r,n){let{type:i,value:s}=t,{actualString:a,implicitKey:u,indent:f,indentStep:h,inFlow:g}=e;if(u&&s.includes(`
|
|
59
|
+
`)||g&&/[[\]{},]/.test(s))return Nl(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return u||g||!s.includes(`
|
|
60
|
+
`)?Nl(s,e):Sp(t,e,r,n);if(!u&&!g&&i!==Yn.Scalar.PLAIN&&s.includes(`
|
|
61
|
+
`))return Sp(t,e,r,n);if(_p(s)){if(f==="")return e.forceBlockIndent=!0,Sp(t,e,r,n);if(u&&f===h)return Nl(s,e)}let m=s.replace(/\n+/g,`$&
|
|
62
|
+
${f}`);if(a){let S=C=>C.default&&C.tag!=="tag:yaml.org,2002:str"&&C.test?.test(m),{compat:E,tags:x}=e.doc.schema;if(x.some(S)||E?.some(S))return Nl(s,e)}return u?m:Fs.foldFlowLines(m,f,Fs.FOLD_FLOW,bp(e,!1))}function oH(t,e,r,n){let{implicitKey:i,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:u}=t;u!==Yn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(u=Yn.Scalar.QUOTE_DOUBLE);let f=g=>{switch(g){case Yn.Scalar.BLOCK_FOLDED:case Yn.Scalar.BLOCK_LITERAL:return i||s?Nl(a.value,e):Sp(a,e,r,n);case Yn.Scalar.QUOTE_DOUBLE:return uf(a.value,e);case Yn.Scalar.QUOTE_SINGLE:return Rb(a.value,e);case Yn.Scalar.PLAIN:return sH(a,e,r,n);default:return null}},h=f(u);if(h===null){let{defaultKeyType:g,defaultStringType:m}=e.options,S=i&&g||m;if(h=f(S),h===null)throw new Error(`Unsupported default string type ${S}`)}return h}hI.stringifyString=oH});var ff=F(Ob=>{"use strict";var aH=dp(),Ls=Ye(),lH=af(),uH=cf();function cH(t,e){let r=Object.assign({blockQuote:!0,commentString:lH.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function fH(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(Ls.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function dH(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(Ls.isScalar(t)||Ls.isCollection(t))&&t.anchor;s&&aH.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let a=t.tag??(e.default?null:e.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}function hH(t,e,r,n){if(Ls.isPair(t))return t.toString(e,r,n);if(Ls.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=Ls.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=fH(e.doc.schema.tags,s));let a=dH(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let u=typeof i.stringify=="function"?i.stringify(s,e,r,n):Ls.isScalar(s)?uH.stringifyString(s,e,r,n):s.toString(e,r,n);return a?Ls.isScalar(s)||u[0]==="{"||u[0]==="["?`${a} ${u}`:`${a}
|
|
63
|
+
${e.indent}${u}`:u}Ob.createStringifyContext=cH;Ob.stringify=hH});var yI=F(gI=>{"use strict";var Ki=Ye(),pI=Mt(),mI=ff(),df=af();function pH({key:t,value:e},r,n,i){let{allNullValues:s,doc:a,indent:u,indentStep:f,options:{commentString:h,indentSeq:g,simpleKeys:m}}=r,S=Ki.isNode(t)&&t.comment||null;if(m){if(S)throw new Error("With simple keys, key nodes cannot have comments");if(Ki.isCollection(t)||!Ki.isNode(t)&&typeof t=="object"){let k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let E=!m&&(!t||S&&e==null&&!r.inFlow||Ki.isCollection(t)||(Ki.isScalar(t)?t.type===pI.Scalar.BLOCK_FOLDED||t.type===pI.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!E&&(m||!s),indent:u+f});let x=!1,C=!1,A=mI.stringify(t,r,()=>x=!0,()=>C=!0);if(!E&&!r.inFlow&&A.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");E=!0}if(r.inFlow){if(s||e==null)return x&&n&&n(),A===""?"?":E?`? ${A}`:A}else if(s&&!m||e==null&&E)return A=`? ${A}`,S&&!x?A+=df.lineComment(A,r.indent,h(S)):C&&i&&i(),A;x&&(S=null),E?(S&&(A+=df.lineComment(A,r.indent,h(S))),A=`? ${A}
|
|
64
|
+
${u}:`):(A=`${A}:`,S&&(A+=df.lineComment(A,r.indent,h(S))));let T,B,Y;Ki.isNode(e)?(T=!!e.spaceBefore,B=e.commentBefore,Y=e.comment):(T=!1,B=null,Y=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!E&&!S&&Ki.isScalar(e)&&(r.indentAtStart=A.length+1),C=!1,!g&&f.length>=2&&!r.inFlow&&!E&&Ki.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let H=!1,K=mI.stringify(e,r,()=>H=!0,()=>C=!0),X=" ";if(S||T||B){if(X=T?`
|
|
65
|
+
`:"",B){let k=h(B);X+=`
|
|
66
|
+
${df.indentComment(k,r.indent)}`}K===""&&!r.inFlow?X===`
|
|
67
|
+
`&&Y&&(X=`
|
|
68
68
|
|
|
69
|
-
`):
|
|
70
|
-
${r.indent}`}else if(!
|
|
71
|
-
`),P=
|
|
69
|
+
`):X+=`
|
|
70
|
+
${r.indent}`}else if(!E&&Ki.isCollection(e)){let k=K[0],w=K.indexOf(`
|
|
71
|
+
`),P=w!==-1,N=r.inFlow??e.flow??e.items.length===0;if(P||!N){let D=!1;if(P&&(k==="&"||k==="!")){let L=K.indexOf(" ");k==="&"&&L!==-1&&L<w&&K[L+1]==="!"&&(L=K.indexOf(" ",L+1)),(L===-1||w<L)&&(D=!0)}D||(X=`
|
|
72
72
|
${r.indent}`)}}else(K===""||K[0]===`
|
|
73
|
-
`)&&(
|
|
74
|
-
${f}${
|
|
75
|
-
`}}return t?(
|
|
76
|
-
`+
|
|
77
|
-
`))&&(h
|
|
78
|
-
${s}${i}${
|
|
79
|
-
`;return`${
|
|
80
|
-
${i}${
|
|
81
|
-
`:" ")}return
|
|
73
|
+
`)&&(X="");return A+=X+K,r.inFlow?H&&n&&n():Y&&!H?A+=df.lineComment(A,r.indent,h(Y)):C&&i&&i(),A}gI.stringifyPair=pH});var kb=F(Pb=>{"use strict";var vI=kt("process");function mH(t,...e){t==="debug"&&console.log(...e)}function gH(t,e){(t==="debug"||t==="warn")&&(typeof vI.emitWarning=="function"?vI.emitWarning(e):console.warn(e))}Pb.debug=mH;Pb.warn=gH});var Rp=F(Cp=>{"use strict";var xp=Ye(),SI=Mt(),wp="<<",Ep={identify:t=>t===wp||typeof t=="symbol"&&t.description===wp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new SI.Scalar(Symbol(wp)),{addToJSMap:bI}),stringify:()=>wp},yH=(t,e)=>(Ep.identify(e)||xp.isScalar(e)&&(!e.type||e.type===SI.Scalar.PLAIN)&&Ep.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Ep.tag&&r.default);function bI(t,e,r){let n=_I(t,r);if(xp.isSeq(n))for(let i of n.items)Ab(t,e,i);else if(Array.isArray(n))for(let i of n)Ab(t,e,i);else Ab(t,e,n)}function Ab(t,e,r){let n=_I(t,r);if(!xp.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function _I(t,e){return t&&xp.isAlias(e)?e.resolve(t.doc,t):e}Cp.addMergeToJSMap=bI;Cp.isMergeKey=yH;Cp.merge=Ep});var qb=F(xI=>{"use strict";var vH=kb(),wI=Rp(),SH=ff(),EI=Ye(),Tb=Ns();function bH(t,e,{key:r,value:n}){if(EI.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(wI.isMergeKey(t,r))wI.addMergeToJSMap(t,e,n);else{let i=Tb.toJS(r,"",t);if(e instanceof Map)e.set(i,Tb.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=_H(r,i,t),a=Tb.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function _H(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(EI.isNode(t)&&r?.doc){let n=SH.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),vH.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}xI.addPairToJSMap=bH});var js=F($b=>{"use strict";var CI=of(),wH=yI(),EH=qb(),Ip=Ye();function xH(t,e,r){let n=CI.createNode(t,void 0,r),i=CI.createNode(e,void 0,r);return new Op(n,i)}var Op=class t{constructor(e,r=null){Object.defineProperty(this,Ip.NODE_TYPE,{value:Ip.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Ip.isNode(r)&&(r=r.clone(e)),Ip.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return EH.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?wH.stringifyPair(this,e,r,n):JSON.stringify(this)}};$b.Pair=Op;$b.createPair=xH});var Mb=F(II=>{"use strict";var ra=Ye(),RI=ff(),Pp=af();function CH(t,e,r){return(e.inFlow??t.flow?IH:RH)(t,e,r)}function RH({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:u}){let{indent:f,options:{commentString:h}}=r,g=Object.assign({},r,{indent:s,type:null}),m=!1,S=[];for(let x=0;x<e.length;++x){let C=e[x],A=null;if(ra.isNode(C))!m&&C.spaceBefore&&S.push(""),kp(r,S,C.commentBefore,m),C.comment&&(A=C.comment);else if(ra.isPair(C)){let B=ra.isNode(C.key)?C.key:null;B&&(!m&&B.spaceBefore&&S.push(""),kp(r,S,B.commentBefore,m))}m=!1;let T=RI.stringify(C,g,()=>A=null,()=>m=!0);A&&(T+=Pp.lineComment(T,s,h(A))),m&&A&&(m=!1),S.push(n+T)}let E;if(S.length===0)E=i.start+i.end;else{E=S[0];for(let x=1;x<S.length;++x){let C=S[x];E+=C?`
|
|
74
|
+
${f}${C}`:`
|
|
75
|
+
`}}return t?(E+=`
|
|
76
|
+
`+Pp.indentComment(h(t),f),u&&u()):m&&a&&a(),E}function IH({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:u}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),h=!1,g=0,m=[];for(let x=0;x<t.length;++x){let C=t[x],A=null;if(ra.isNode(C))C.spaceBefore&&m.push(""),kp(e,m,C.commentBefore,!1),C.comment&&(A=C.comment);else if(ra.isPair(C)){let B=ra.isNode(C.key)?C.key:null;B&&(B.spaceBefore&&m.push(""),kp(e,m,B.commentBefore,!1),B.comment&&(h=!0));let Y=ra.isNode(C.value)?C.value:null;Y?(Y.comment&&(A=Y.comment),Y.commentBefore&&(h=!0)):C.value==null&&B?.comment&&(A=B.comment)}A&&(h=!0);let T=RI.stringify(C,f,()=>A=null);h||(h=m.length>g||T.includes(`
|
|
77
|
+
`)),x<t.length-1?T+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(h||(h=m.reduce((B,Y)=>B+Y.length+2,2)+(T.length+2)>e.options.lineWidth)),h&&(T+=",")),A&&(T+=Pp.lineComment(T,n,u(A))),m.push(T),g=m.length}let{start:S,end:E}=r;if(m.length===0)return S+E;if(!h){let x=m.reduce((C,A)=>C+A.length+2,2);h=e.options.lineWidth>0&&x>e.options.lineWidth}if(h){let x=S;for(let C of m)x+=C?`
|
|
78
|
+
${s}${i}${C}`:`
|
|
79
|
+
`;return`${x}
|
|
80
|
+
${i}${E}`}else return`${S}${a}${m.join(" ")}${a}${E}`}function kp({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Pp.indentComment(e(n),t);r.push(s.trimStart())}}II.stringifyCollection=CH});var Bs=F(Db=>{"use strict";var OH=Mb(),PH=qb(),kH=gp(),Us=Ye(),Ap=js(),AH=Mt();function hf(t,e){let r=Us.isScalar(e)?e.value:e;for(let n of t)if(Us.isPair(n)&&(n.key===e||n.key===r||Us.isScalar(n.key)&&n.key.value===r))return n}var Nb=class extends kH.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Us.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,a=new this(e),u=(f,h)=>{if(typeof s=="function")h=s.call(r,f,h);else if(Array.isArray(s)&&!s.includes(f))return;(h!==void 0||i)&&a.items.push(Ap.createPair(f,h,n))};if(r instanceof Map)for(let[f,h]of r)u(f,h);else if(r&&typeof r=="object")for(let f of Object.keys(r))u(f,r[f]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,r){let n;Us.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Ap.Pair(e,e?.value):n=new Ap.Pair(e.key,e.value);let i=hf(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Us.isScalar(i.value)&&AH.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let a=this.items.findIndex(u=>s(n,u)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let r=hf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=hf(this.items,e)?.value;return(!r&&Us.isScalar(i)?i.value:i)??void 0}has(e){return!!hf(this.items,e)}set(e,r){this.add(new Ap.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)PH.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Us.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),OH.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Db.YAMLMap=Nb;Db.findPair=hf});var Dl=F(PI=>{"use strict";var TH=Ye(),OI=Bs(),qH={collection:"map",default:!0,nodeClass:OI.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return TH.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>OI.YAMLMap.from(t,e,r)};PI.map=qH});var Hs=F(kI=>{"use strict";var $H=of(),MH=Mb(),NH=gp(),qp=Ye(),DH=Mt(),FH=Ns(),Fb=class extends NH.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(qp.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Tp(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Tp(e);if(typeof n!="number")return;let i=this.items[n];return!r&&qp.isScalar(i)?i.value:i}has(e){let r=Tp(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=Tp(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];qp.isScalar(i)&&DH.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(FH.toJS(s,String(i++),r));return n}toString(e,r,n){return e?MH.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let a=0;for(let u of r){if(typeof i=="function"){let f=r instanceof Set?u:String(a++);u=i.call(r,f,u)}s.items.push($H.createNode(u,void 0,n))}}return s}};function Tp(t){let e=qp.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}kI.YAMLSeq=Fb});var Fl=F(TI=>{"use strict";var LH=Ye(),AI=Hs(),jH={collection:"seq",default:!0,nodeClass:AI.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return LH.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>AI.YAMLSeq.from(t,e,r)};TI.seq=jH});var pf=F(qI=>{"use strict";var UH=cf(),BH={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),UH.stringifyString(t,e,r,n)}};qI.string=BH});var $p=F(NI=>{"use strict";var $I=Mt(),MI={identify:t=>t==null,createNode:()=>new $I.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $I.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&MI.test.test(t)?t:e.options.nullStr};NI.nullTag=MI});var Lb=F(FI=>{"use strict";var HH=Mt(),DI={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new HH.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&DI.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};FI.boolTag=DI});var Ll=F(LI=>{"use strict";function VH({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let u=e-(s.length-a-1);for(;u-- >0;)s+="0"}return s}LI.stringifyNumber=VH});var Ub=F(Mp=>{"use strict";var WH=Mt(),jb=Ll(),YH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:jb.stringifyNumber},JH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():jb.stringifyNumber(t)}},zH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new WH.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:jb.stringifyNumber};Mp.float=zH;Mp.floatExp=JH;Mp.floatNaN=YH});var Hb=F(Dp=>{"use strict";var jI=Ll(),Np=t=>typeof t=="bigint"||Number.isInteger(t),Bb=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function UI(t,e,r){let{value:n}=t;return Np(n)&&n>=0?r+n.toString(e):jI.stringifyNumber(t)}var KH={identify:t=>Np(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Bb(t,2,8,r),stringify:t=>UI(t,8,"0o")},GH={identify:Np,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Bb(t,0,10,r),stringify:jI.stringifyNumber},QH={identify:t=>Np(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Bb(t,2,16,r),stringify:t=>UI(t,16,"0x")};Dp.int=GH;Dp.intHex=QH;Dp.intOct=KH});var HI=F(BI=>{"use strict";var ZH=Dl(),XH=$p(),eV=Fl(),tV=pf(),rV=Lb(),Vb=Ub(),Wb=Hb(),nV=[ZH.map,eV.seq,tV.string,XH.nullTag,rV.boolTag,Wb.intOct,Wb.int,Wb.intHex,Vb.floatNaN,Vb.floatExp,Vb.float];BI.schema=nV});var YI=F(WI=>{"use strict";var iV=Mt(),sV=Dl(),oV=Fl();function VI(t){return typeof t=="bigint"||Number.isInteger(t)}var Fp=({value:t})=>JSON.stringify(t),aV=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Fp},{identify:t=>t==null,createNode:()=>new iV.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Fp},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Fp},{identify:VI,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>VI(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Fp}],lV={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},uV=[sV.map,oV.seq].concat(aV,lV);WI.schema=uV});var Jb=F(JI=>{"use strict";var mf=kt("buffer"),Yb=Mt(),cV=cf(),fV={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof mf.Buffer=="function")return mf.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){if(!r)return"";let a=r,u;if(typeof mf.Buffer=="function")u=a instanceof mf.Buffer?a.toString("base64"):mf.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let h=0;h<a.length;++h)f+=String.fromCharCode(a[h]);u=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Yb.Scalar.BLOCK_LITERAL),e!==Yb.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),h=Math.ceil(u.length/f),g=new Array(h);for(let m=0,S=0;m<h;++m,S+=f)g[m]=u.substr(S,f);u=g.join(e===Yb.Scalar.BLOCK_LITERAL?`
|
|
81
|
+
`:" ")}return cV.stringifyString({comment:t,type:e,value:u},n,i,s)}};JI.binary=fV});var Up=F(jp=>{"use strict";var Lp=Ye(),zb=js(),dV=Mt(),hV=Hs();function zI(t,e){if(Lp.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Lp.isPair(n)){if(Lp.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new zb.Pair(new dV.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
82
82
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
83
|
-
${s.comment}`:n.comment}n=i}t.items[r]=Up.isPair(n)?n:new Kb.Pair(n)}}else e("Expected a sequence for this tag");return t}function BI(t,e,r){let{replacer:n}=r,i=new VH.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let u,f;if(Array.isArray(a))if(a.length===2)u=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let h=Object.keys(a);if(h.length===1)u=h[0],f=a[u];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else u=a;i.items.push(Kb.createPair(u,f,r))}return i}var WH={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:UI,createNode:BI};Bp.createPairs=BI;Bp.pairs=WH;Bp.resolvePairs=UI});var Zb=F(Qb=>{"use strict";var HI=Ve(),Gb=Ws(),of=Qs(),YH=Zs(),VI=Hp(),ra=class t extends YH.YAMLSeq{constructor(){super(),this.add=of.YAMLMap.prototype.add.bind(this),this.delete=of.YAMLMap.prototype.delete.bind(this),this.get=of.YAMLMap.prototype.get.bind(this),this.has=of.YAMLMap.prototype.has.bind(this),this.set=of.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,a;if(HI.isPair(i)?(s=Gb.toJS(i.key,"",r),a=Gb.toJS(i.value,s,r)):s=Gb.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){let i=VI.createPairs(e,r,n),s=new this;return s.items=i.items,s}};ra.tag="tag:yaml.org,2002:omap";var JH={collection:"seq",identify:t=>t instanceof Map,nodeClass:ra,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=VI.resolvePairs(t,e),n=[];for(let{key:i}of r.items)HI.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ra,r)},createNode:(t,e,r)=>ra.from(t,e,r)};Qb.YAMLOMap=ra;Qb.omap=JH});var KI=F(Xb=>{"use strict";var WI=Dt();function YI({value:t,source:e},r){return e&&(t?JI:zI).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var JI={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new WI.Scalar(!0),stringify:YI},zI={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new WI.Scalar(!1),stringify:YI};Xb.falseTag=zI;Xb.trueTag=JI});var GI=F(Vp=>{"use strict";var zH=Dt(),e0=Al(),KH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:e0.stringifyNumber},GH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():e0.stringifyNumber(t)}},QH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new zH.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:e0.stringifyNumber};Vp.float=QH;Vp.floatExp=GH;Vp.floatNaN=KH});var ZI=F(lf=>{"use strict";var QI=Al(),af=t=>typeof t=="bigint"||Number.isInteger(t);function Wp(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,r);return i==="-"?-1*s:s}function t0(t,e,r){let{value:n}=t;if(af(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return QI.stringifyNumber(t)}var ZH={identify:af,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Wp(t,2,2,r),stringify:t=>t0(t,2,"0b")},XH={identify:af,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Wp(t,1,8,r),stringify:t=>t0(t,8,"0")},eV={identify:af,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Wp(t,0,10,r),stringify:QI.stringifyNumber},tV={identify:af,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Wp(t,2,16,r),stringify:t=>t0(t,16,"0x")};lf.int=eV;lf.intBin=ZH;lf.intHex=tV;lf.intOct=XH});var n0=F(r0=>{"use strict";var zp=Ve(),Yp=Ks(),Jp=Qs(),na=class t extends Jp.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;zp.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Yp.Pair(e.key,null):r=new Yp.Pair(e,null),Jp.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Jp.findPair(this.items,e);return!r&&zp.isPair(n)?zp.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Jp.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Yp.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push(Yp.createPair(a,null,n));return s}};na.tag="tag:yaml.org,2002:set";var rV={collection:"map",identify:t=>t instanceof Set,nodeClass:na,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>na.from(t,e,r),resolve(t,e){if(zp.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new na,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};r0.YAMLSet=na;r0.set=rV});var s0=F(Kp=>{"use strict";var nV=Al();function i0(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,u)=>a*i(60)+i(u),i(0));return r==="-"?i(-1)*s:s}function XI(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return nV.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var iV={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>i0(t,r),stringify:XI},sV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>i0(t,!1),stringify:XI},eO={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(eO.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,a,u]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,h=Date.UTC(r,n-1,i,s||0,a||0,u||0,f),g=e[8];if(g&&g!=="Z"){let m=i0(g,!1);Math.abs(m)<30&&(m*=60),h-=6e4*m}return new Date(h)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Kp.floatTime=sV;Kp.intTime=iV;Kp.timestamp=eO});var nO=F(rO=>{"use strict";var oV=Pl(),aV=Np(),lV=kl(),uV=nf(),cV=zb(),tO=KI(),o0=GI(),Gp=ZI(),fV=Op(),dV=Zb(),hV=Hp(),pV=n0(),a0=s0(),mV=[oV.map,lV.seq,uV.string,aV.nullTag,tO.trueTag,tO.falseTag,Gp.intBin,Gp.intOct,Gp.int,Gp.intHex,o0.floatNaN,o0.floatExp,o0.float,cV.binary,fV.merge,dV.omap,hV.pairs,pV.set,a0.intTime,a0.floatTime,a0.timestamp];rO.schema=mV});var hO=F(c0=>{"use strict";var aO=Pl(),gV=Np(),lO=kl(),yV=nf(),vV=jb(),l0=Bb(),u0=Vb(),SV=NI(),bV=LI(),uO=zb(),uf=Op(),cO=Zb(),fO=Hp(),iO=nO(),dO=n0(),Qp=s0(),sO=new Map([["core",SV.schema],["failsafe",[aO.map,lO.seq,yV.string]],["json",bV.schema],["yaml11",iO.schema],["yaml-1.1",iO.schema]]),oO={binary:uO.binary,bool:vV.boolTag,float:l0.float,floatExp:l0.floatExp,floatNaN:l0.floatNaN,floatTime:Qp.floatTime,int:u0.int,intHex:u0.intHex,intOct:u0.intOct,intTime:Qp.intTime,map:aO.map,merge:uf.merge,null:gV.nullTag,omap:cO.omap,pairs:fO.pairs,seq:lO.seq,set:dO.set,timestamp:Qp.timestamp},_V={"tag:yaml.org,2002:binary":uO.binary,"tag:yaml.org,2002:merge":uf.merge,"tag:yaml.org,2002:omap":cO.omap,"tag:yaml.org,2002:pairs":fO.pairs,"tag:yaml.org,2002:set":dO.set,"tag:yaml.org,2002:timestamp":Qp.timestamp};function wV(t,e,r){let n=sO.get(e);if(n&&!t)return r&&!n.includes(uf.merge)?n.concat(uf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(sO.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(uf.merge)),i.reduce((s,a)=>{let u=typeof a=="string"?oO[a]:a;if(!u){let f=JSON.stringify(a),h=Object.keys(oO).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(u)||s.push(u),s},[])}c0.coreKnownTags=_V;c0.getTags=wV});var h0=F(pO=>{"use strict";var f0=Ve(),EV=Pl(),CV=kl(),xV=nf(),Zp=hO(),RV=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,d0=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:u}){this.compat=Array.isArray(e)?Zp.getTags(e,"compat"):e?Zp.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Zp.coreKnownTags:{},this.tags=Zp.getTags(r,this.name,n),this.toStringOptions=u??null,Object.defineProperty(this,f0.MAP,{value:EV.map}),Object.defineProperty(this,f0.SCALAR,{value:xV.string}),Object.defineProperty(this,f0.SEQ,{value:CV.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?RV:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};pO.Schema=d0});var gO=F(mO=>{"use strict";var IV=Ve(),p0=Xc(),cf=Kc();function OV(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=p0.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(cf.indentComment(f,""))}let a=!1,u=null;if(t.contents){if(IV.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let g=s(t.contents.commentBefore);r.push(cf.indentComment(g,""))}i.forceBlockIndent=!!t.comment,u=t.contents.comment}let f=u?void 0:()=>a=!0,h=p0.stringify(t.contents,i,()=>u=null,f);u&&(h+=cf.lineComment(h,"",s(u))),(h[0]==="|"||h[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${h}`:r.push(h)}else r.push(p0.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
84
|
-
`)?(r.push("..."),r.push(
|
|
83
|
+
${s.comment}`:n.comment}n=i}t.items[r]=Lp.isPair(n)?n:new zb.Pair(n)}}else e("Expected a sequence for this tag");return t}function KI(t,e,r){let{replacer:n}=r,i=new hV.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let u,f;if(Array.isArray(a))if(a.length===2)u=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let h=Object.keys(a);if(h.length===1)u=h[0],f=a[u];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else u=a;i.items.push(zb.createPair(u,f,r))}return i}var pV={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:zI,createNode:KI};jp.createPairs=KI;jp.pairs=pV;jp.resolvePairs=zI});var Qb=F(Gb=>{"use strict";var GI=Ye(),Kb=Ns(),gf=Bs(),mV=Hs(),QI=Up(),na=class t extends mV.YAMLSeq{constructor(){super(),this.add=gf.YAMLMap.prototype.add.bind(this),this.delete=gf.YAMLMap.prototype.delete.bind(this),this.get=gf.YAMLMap.prototype.get.bind(this),this.has=gf.YAMLMap.prototype.has.bind(this),this.set=gf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,a;if(GI.isPair(i)?(s=Kb.toJS(i.key,"",r),a=Kb.toJS(i.value,s,r)):s=Kb.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){let i=QI.createPairs(e,r,n),s=new this;return s.items=i.items,s}};na.tag="tag:yaml.org,2002:omap";var gV={collection:"seq",identify:t=>t instanceof Map,nodeClass:na,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=QI.resolvePairs(t,e),n=[];for(let{key:i}of r.items)GI.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new na,r)},createNode:(t,e,r)=>na.from(t,e,r)};Gb.YAMLOMap=na;Gb.omap=gV});var rO=F(Zb=>{"use strict";var ZI=Mt();function XI({value:t,source:e},r){return e&&(t?eO:tO).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var eO={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ZI.Scalar(!0),stringify:XI},tO={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ZI.Scalar(!1),stringify:XI};Zb.falseTag=tO;Zb.trueTag=eO});var nO=F(Bp=>{"use strict";var yV=Mt(),Xb=Ll(),vV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Xb.stringifyNumber},SV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Xb.stringifyNumber(t)}},bV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new yV.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Xb.stringifyNumber};Bp.float=bV;Bp.floatExp=SV;Bp.floatNaN=vV});var sO=F(vf=>{"use strict";var iO=Ll(),yf=t=>typeof t=="bigint"||Number.isInteger(t);function Hp(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,r);return i==="-"?-1*s:s}function e0(t,e,r){let{value:n}=t;if(yf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return iO.stringifyNumber(t)}var _V={identify:yf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Hp(t,2,2,r),stringify:t=>e0(t,2,"0b")},wV={identify:yf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Hp(t,1,8,r),stringify:t=>e0(t,8,"0")},EV={identify:yf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Hp(t,0,10,r),stringify:iO.stringifyNumber},xV={identify:yf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Hp(t,2,16,r),stringify:t=>e0(t,16,"0x")};vf.int=EV;vf.intBin=_V;vf.intHex=xV;vf.intOct=wV});var r0=F(t0=>{"use strict";var Yp=Ye(),Vp=js(),Wp=Bs(),ia=class t extends Wp.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Yp.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Vp.Pair(e.key,null):r=new Vp.Pair(e,null),Wp.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Wp.findPair(this.items,e);return!r&&Yp.isPair(n)?Yp.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Wp.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Vp.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push(Vp.createPair(a,null,n));return s}};ia.tag="tag:yaml.org,2002:set";var CV={collection:"map",identify:t=>t instanceof Set,nodeClass:ia,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ia.from(t,e,r),resolve(t,e){if(Yp.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ia,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};t0.YAMLSet=ia;t0.set=CV});var i0=F(Jp=>{"use strict";var RV=Ll();function n0(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,u)=>a*i(60)+i(u),i(0));return r==="-"?i(-1)*s:s}function oO(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return RV.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var IV={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>n0(t,r),stringify:oO},OV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>n0(t,!1),stringify:oO},aO={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(aO.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,a,u]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,h=Date.UTC(r,n-1,i,s||0,a||0,u||0,f),g=e[8];if(g&&g!=="Z"){let m=n0(g,!1);Math.abs(m)<30&&(m*=60),h-=6e4*m}return new Date(h)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Jp.floatTime=OV;Jp.intTime=IV;Jp.timestamp=aO});var cO=F(uO=>{"use strict";var PV=Dl(),kV=$p(),AV=Fl(),TV=pf(),qV=Jb(),lO=rO(),s0=nO(),zp=sO(),$V=Rp(),MV=Qb(),NV=Up(),DV=r0(),o0=i0(),FV=[PV.map,AV.seq,TV.string,kV.nullTag,lO.trueTag,lO.falseTag,zp.intBin,zp.intOct,zp.int,zp.intHex,s0.floatNaN,s0.floatExp,s0.float,qV.binary,$V.merge,MV.omap,NV.pairs,DV.set,o0.intTime,o0.floatTime,o0.timestamp];uO.schema=FV});var bO=F(u0=>{"use strict";var pO=Dl(),LV=$p(),mO=Fl(),jV=pf(),UV=Lb(),a0=Ub(),l0=Hb(),BV=HI(),HV=YI(),gO=Jb(),Sf=Rp(),yO=Qb(),vO=Up(),fO=cO(),SO=r0(),Kp=i0(),dO=new Map([["core",BV.schema],["failsafe",[pO.map,mO.seq,jV.string]],["json",HV.schema],["yaml11",fO.schema],["yaml-1.1",fO.schema]]),hO={binary:gO.binary,bool:UV.boolTag,float:a0.float,floatExp:a0.floatExp,floatNaN:a0.floatNaN,floatTime:Kp.floatTime,int:l0.int,intHex:l0.intHex,intOct:l0.intOct,intTime:Kp.intTime,map:pO.map,merge:Sf.merge,null:LV.nullTag,omap:yO.omap,pairs:vO.pairs,seq:mO.seq,set:SO.set,timestamp:Kp.timestamp},VV={"tag:yaml.org,2002:binary":gO.binary,"tag:yaml.org,2002:merge":Sf.merge,"tag:yaml.org,2002:omap":yO.omap,"tag:yaml.org,2002:pairs":vO.pairs,"tag:yaml.org,2002:set":SO.set,"tag:yaml.org,2002:timestamp":Kp.timestamp};function WV(t,e,r){let n=dO.get(e);if(n&&!t)return r&&!n.includes(Sf.merge)?n.concat(Sf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(dO.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Sf.merge)),i.reduce((s,a)=>{let u=typeof a=="string"?hO[a]:a;if(!u){let f=JSON.stringify(a),h=Object.keys(hO).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(u)||s.push(u),s},[])}u0.coreKnownTags=VV;u0.getTags=WV});var d0=F(_O=>{"use strict";var c0=Ye(),YV=Dl(),JV=Fl(),zV=pf(),Gp=bO(),KV=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,f0=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:u}){this.compat=Array.isArray(e)?Gp.getTags(e,"compat"):e?Gp.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Gp.coreKnownTags:{},this.tags=Gp.getTags(r,this.name,n),this.toStringOptions=u??null,Object.defineProperty(this,c0.MAP,{value:YV.map}),Object.defineProperty(this,c0.SCALAR,{value:zV.string}),Object.defineProperty(this,c0.SEQ,{value:JV.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?KV:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};_O.Schema=f0});var EO=F(wO=>{"use strict";var GV=Ye(),h0=ff(),bf=af();function QV(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=h0.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(bf.indentComment(f,""))}let a=!1,u=null;if(t.contents){if(GV.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let g=s(t.contents.commentBefore);r.push(bf.indentComment(g,""))}i.forceBlockIndent=!!t.comment,u=t.contents.comment}let f=u?void 0:()=>a=!0,h=h0.stringify(t.contents,i,()=>u=null,f);u&&(h+=bf.lineComment(h,"",s(u))),(h[0]==="|"||h[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${h}`:r.push(h)}else r.push(h0.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
84
|
+
`)?(r.push("..."),r.push(bf.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||u)&&r[r.length-1]!==""&&r.push(""),r.push(bf.indentComment(s(f),"")))}return r.join(`
|
|
85
85
|
`)+`
|
|
86
|
-
`}
|
|
86
|
+
`}wO.stringifyDocument=QV});var _f=F(xO=>{"use strict";var ZV=sf(),jl=gp(),Sn=Ye(),XV=js(),eW=Ns(),tW=d0(),rW=EO(),p0=dp(),nW=vb(),iW=of(),m0=yb(),g0=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Sn.NODE_TYPE,{value:Sn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:a}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new m0.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[Sn.NODE_TYPE]:{value:Sn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Sn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ul(this.contents)&&this.contents.add(e)}addIn(e,r){Ul(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=p0.anchorNames(this);e.anchor=!r||n.has(r)?p0.findNewAnchor(r||"a",n):r}return new ZV.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let A=B=>typeof B=="number"||B instanceof String||B instanceof Number,T=r.filter(A).map(String);T.length>0&&(r=r.concat(T)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:u,keepUndefined:f,onTagObj:h,tag:g}=n??{},{onAnchor:m,setAnchors:S,sourceObjects:E}=p0.createNodeAnchors(this,a||"a"),x={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:m,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:E},C=iW.createNode(e,g,x);return u&&Sn.isCollection(C)&&(C.flow=!0),S(),C}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new XV.Pair(i,s)}delete(e){return Ul(this.contents)?this.contents.delete(e):!1}deleteIn(e){return jl.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ul(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Sn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return jl.isEmptyPath(e)?!r&&Sn.isScalar(this.contents)?this.contents.value:this.contents:Sn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Sn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return jl.isEmptyPath(e)?this.contents!==void 0:Sn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=jl.collectionFromPath(this.schema,[e],r):Ul(this.contents)&&this.contents.set(e,r)}setIn(e,r){jl.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=jl.collectionFromPath(this.schema,Array.from(e),r):Ul(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new m0.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new m0.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new tW.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:a}={}){let u={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=eW.toJS(this.contents,r??"",u);if(typeof s=="function")for(let{count:h,res:g}of u.anchors.values())s(g,h);return typeof a=="function"?nW.applyReviver(a,{"":f},"",f):f}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return rW.stringifyDocument(this,e)}};function Ul(t){if(Sn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}xO.Document=g0});var xf=F(Ef=>{"use strict";var wf=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},y0=class extends wf{constructor(e,r,n){super("YAMLParseError",e,r,n)}},v0=class extends wf{constructor(e,r,n){super("YAMLWarning",e,r,n)}},sW=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(u=>e.linePos(u));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,a=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let u=Math.min(s-39,a.length-79);a="\u2026"+a.substring(u),s-=u-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,s))){let u=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);u.length>80&&(u=u.substring(0,79)+`\u2026
|
|
87
87
|
`),a=u+a}if(/[^ ]/.test(a)){let u=1,f=r.linePos[1];f?.line===n&&f.col>i&&(u=Math.max(1,Math.min(f.col-i,80-s)));let h=" ".repeat(s)+"^".repeat(u);r.message+=`:
|
|
88
88
|
|
|
89
89
|
${a}
|
|
90
90
|
${h}
|
|
91
|
-
`}};
|
|
92
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(
|
|
93
|
-
`+
|
|
94
|
-
`+Y.comment:
|
|
95
|
-
`+
|
|
96
|
-
`+k:
|
|
97
|
-
`+P.comment:
|
|
98
|
-
`+A.comment:h.comment=A.comment),h.range=[n.offset,
|
|
99
|
-
`.repeat(Math.max(1,a.length-1)):"",A=n+i.length;return e.source&&(A+=e.source.length),{value:
|
|
100
|
-
`;for(let
|
|
91
|
+
`}};Ef.YAMLError=wf;Ef.YAMLParseError=y0;Ef.YAMLWarning=v0;Ef.prettifyError=sW});var Cf=F(CO=>{"use strict";function oW(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:u}){let f=!1,h=u,g=u,m="",S="",E=!1,x=!1,C=null,A=null,T=null,B=null,Y=null,H=null,K=null;for(let w of t)switch(x&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&s(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),C&&(h&&w.type!=="comment"&&w.type!=="newline"&&s(C,"TAB_AS_INDENT","Tabs are not allowed as indentation"),C=null),w.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&w.source.includes(" ")&&(C=w),g=!0;break;case"comment":{g||s(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let P=w.source.substring(1)||" ";m?m+=S+P:m=P,S="",h=!1;break}case"newline":h?m?m+=w.source:(!H||r!=="seq-item-ind")&&(f=!0):S+=w.source,h=!0,E=!0,(A||T)&&(B=w),g=!0;break;case"anchor":A&&s(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&s(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),A=w,K??(K=w.offset),h=!1,g=!1,x=!0;break;case"tag":{T&&s(w,"MULTIPLE_TAGS","A node can have at most one tag"),T=w,K??(K=w.offset),h=!1,g=!1,x=!0;break}case r:(A||T)&&s(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),H&&s(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),H=w,h=r==="seq-item-ind"||r==="explicit-key-ind",g=!1;break;case"comma":if(e){Y&&s(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),Y=w,h=!1,g=!1;break}default:s(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),h=!1,g=!1}let X=t[t.length-1],k=X?X.offset+X.source.length:i;return x&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),C&&(h&&C.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&s(C,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:Y,found:H,spaceBefore:f,comment:m,hasNewline:E,anchor:A,tag:T,newlineAfterProp:B,end:k,start:K??k}}CO.resolveProps=oW});var Qp=F(RO=>{"use strict";function S0(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
92
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(S0(e.key)||S0(e.value))return!0}return!1;default:return!0}}RO.containsNewline=S0});var b0=F(IO=>{"use strict";var aW=Qp();function lW(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&aW.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}IO.flowIndentCheck=lW});var _0=F(PO=>{"use strict";var OO=Ye();function uW(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||OO.isScalar(s)&&OO.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,r))}PO.mapIncludes=uW});var MO=F($O=>{"use strict";var kO=js(),cW=Bs(),AO=Cf(),fW=Qp(),TO=b0(),dW=_0(),qO="All mapping items must start at the same column";function hW({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??cW.YAMLMap,u=new a(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,h=null;for(let g of n.items){let{start:m,key:S,sep:E,value:x}=g,C=AO.resolveProps(m,{indicator:"explicit-key-ind",next:S??E?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),A=!C.found;if(A){if(S&&(S.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in S&&S.indent!==n.indent&&i(f,"BAD_INDENT",qO)),!C.anchor&&!C.tag&&!E){h=C.end,C.comment&&(u.comment?u.comment+=`
|
|
93
|
+
`+C.comment:u.comment=C.comment);continue}(C.newlineAfterProp||fW.containsNewline(S))&&i(S??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else C.found?.indent!==n.indent&&i(f,"BAD_INDENT",qO);r.atKey=!0;let T=C.end,B=S?t(r,S,C,i):e(r,T,m,null,C,i);r.schema.compat&&TO.flowIndentCheck(n.indent,S,i),r.atKey=!1,dW.mapIncludes(r,u.items,B)&&i(T,"DUPLICATE_KEY","Map keys must be unique");let Y=AO.resolveProps(E??[],{indicator:"map-value-ind",next:x,offset:B.range[2],onError:i,parentIndent:n.indent,startOnNewline:!S||S.type==="block-scalar"});if(f=Y.end,Y.found){A&&(x?.type==="block-map"&&!Y.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&C.start<Y.found.offset-1024&&i(B.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let H=x?t(r,x,Y,i):e(r,f,E,null,Y,i);r.schema.compat&&TO.flowIndentCheck(n.indent,x,i),f=H.range[2];let K=new kO.Pair(B,H);r.options.keepSourceTokens&&(K.srcToken=g),u.items.push(K)}else{A&&i(B.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),Y.comment&&(B.comment?B.comment+=`
|
|
94
|
+
`+Y.comment:B.comment=Y.comment);let H=new kO.Pair(B);r.options.keepSourceTokens&&(H.srcToken=g),u.items.push(H)}}return h&&h<f&&i(h,"IMPOSSIBLE","Map comment with trailing content"),u.range=[n.offset,f,h??f],u}$O.resolveBlockMap=hW});var DO=F(NO=>{"use strict";var pW=Hs(),mW=Cf(),gW=b0();function yW({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??pW.YAMLSeq,u=new a(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,h=null;for(let{start:g,value:m}of n.items){let S=mW.resolveProps(g,{indicator:"seq-item-ind",next:m,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!S.found)if(S.anchor||S.tag||m)m?.type==="block-seq"?i(S.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{h=S.end,S.comment&&(u.comment=S.comment);continue}let E=m?t(r,m,S,i):e(r,S.end,g,null,S,i);r.schema.compat&&gW.flowIndentCheck(n.indent,m,i),f=E.range[2],u.items.push(E)}return u.range=[n.offset,f,h??f],u}NO.resolveBlockSeq=yW});var Bl=F(FO=>{"use strict";function vW(t,e,r,n){let i="";if(t){let s=!1,a="";for(let u of t){let{source:f,type:h}=u;switch(h){case"space":s=!0;break;case"comment":{r&&!s&&n(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let g=f.substring(1)||" ";i?i+=a+g:i=g,a="";break}case"newline":i&&(a+=f),s=!0;break;default:n(u,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}e+=f.length}}return{comment:i,offset:e}}FO.resolveEnd=vW});var BO=F(UO=>{"use strict";var SW=Ye(),bW=js(),LO=Bs(),_W=Hs(),wW=Bl(),jO=Cf(),EW=Qp(),xW=_0(),w0="Block collections are not allowed within flow collections",E0=t=>t&&(t.type==="block-map"||t.type==="block-seq");function CW({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=n.start.source==="{",u=a?"flow map":"flow sequence",f=s?.nodeClass??(a?LO.YAMLMap:_W.YAMLSeq),h=new f(r.schema);h.flow=!0;let g=r.atRoot;g&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let m=n.offset+n.start.source.length;for(let A=0;A<n.items.length;++A){let T=n.items[A],{start:B,key:Y,sep:H,value:K}=T,X=jO.resolveProps(B,{flow:u,indicator:"explicit-key-ind",next:Y??H?.[0],offset:m,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!X.found){if(!X.anchor&&!X.tag&&!H&&!K){A===0&&X.comma?i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):A<n.items.length-1&&i(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),X.comment&&(h.comment?h.comment+=`
|
|
95
|
+
`+X.comment:h.comment=X.comment),m=X.end;continue}!a&&r.options.strict&&EW.containsNewline(Y)&&i(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)X.comma&&i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(X.comma||i(X.start,"MISSING_CHAR",`Missing , between ${u} items`),X.comment){let k="";e:for(let w of B)switch(w.type){case"comma":case"space":break;case"comment":k=w.source.substring(1);break e;default:break e}if(k){let w=h.items[h.items.length-1];SW.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
|
|
96
|
+
`+k:w.comment=k,X.comment=X.comment.substring(k.length+1)}}if(!a&&!H&&!X.found){let k=K?t(r,K,X,i):e(r,X.end,H,null,X,i);h.items.push(k),m=k.range[2],E0(K)&&i(k.range,"BLOCK_IN_FLOW",w0)}else{r.atKey=!0;let k=X.end,w=Y?t(r,Y,X,i):e(r,k,B,null,X,i);E0(Y)&&i(w.range,"BLOCK_IN_FLOW",w0),r.atKey=!1;let P=jO.resolveProps(H??[],{flow:u,indicator:"map-value-ind",next:K,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(P.found){if(!a&&!X.found&&r.options.strict){if(H)for(let L of H){if(L===P.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}X.start<P.found.offset-1024&&i(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else K&&("source"in K&&K.source?.[0]===":"?i(K,"MISSING_CHAR",`Missing space after : in ${u}`):i(P.start,"MISSING_CHAR",`Missing , or : between ${u} items`));let N=K?t(r,K,P,i):P.found?e(r,P.end,H,null,P,i):null;N?E0(K)&&i(N.range,"BLOCK_IN_FLOW",w0):P.comment&&(w.comment?w.comment+=`
|
|
97
|
+
`+P.comment:w.comment=P.comment);let D=new bW.Pair(w,N);if(r.options.keepSourceTokens&&(D.srcToken=T),a){let L=h;xW.mapIncludes(r,L.items,w)&&i(k,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(D)}else{let L=new LO.YAMLMap(r.schema);L.flow=!0,L.items.push(D);let z=(N??w).range;L.range=[w.range[0],z[1],z[2]],h.items.push(L)}m=N?N.range[2]:P.end}}let S=a?"}":"]",[E,...x]=n.end,C=m;if(E?.source===S)C=E.offset+E.source.length;else{let A=u[0].toUpperCase()+u.substring(1),T=g?`${A} must end with a ${S}`:`${A} in block collection must be sufficiently indented and end with a ${S}`;i(m,g?"MISSING_CHAR":"BAD_INDENT",T),E&&E.source.length!==1&&x.unshift(E)}if(x.length>0){let A=wW.resolveEnd(x,C,r.options.strict,i);A.comment&&(h.comment?h.comment+=`
|
|
98
|
+
`+A.comment:h.comment=A.comment),h.range=[n.offset,C,A.offset]}else h.range=[n.offset,C,C];return h}UO.resolveFlowCollection=CW});var VO=F(HO=>{"use strict";var RW=Ye(),IW=Mt(),OW=Bs(),PW=Hs(),kW=MO(),AW=DO(),TW=BO();function x0(t,e,r,n,i,s){let a=r.type==="block-map"?kW.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?AW.resolveBlockSeq(t,e,r,n,s):TW.resolveFlowCollection(t,e,r,n,s),u=a.constructor;return i==="!"||i===u.tagName?(a.tag=u.tagName,a):(i&&(a.tag=i),a)}function qW(t,e,r,n,i){let s=n.tag,a=s?e.directives.tagName(s.source,S=>i(s,"TAG_RESOLVE_FAILED",S)):null;if(r.type==="block-seq"){let{anchor:S,newlineAfterProp:E}=n,x=S&&s?S.offset>s.offset?S:s:S??s;x&&(!E||E.offset<x.offset)&&i(x,"MISSING_CHAR","Missing newline after block sequence props")}let u=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===OW.YAMLMap.tagName&&u==="map"||a===PW.YAMLSeq.tagName&&u==="seq")return x0(t,e,r,i,a);let f=e.schema.tags.find(S=>S.tag===a&&S.collection===u);if(!f){let S=e.schema.knownTags[a];if(S?.collection===u)e.schema.tags.push(Object.assign({},S,{default:!1})),f=S;else return S?i(s,"BAD_COLLECTION_TYPE",`${S.tag} used for ${u} collection, but expects ${S.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),x0(t,e,r,i,a)}let h=x0(t,e,r,i,a,f),g=f.resolve?.(h,S=>i(s,"TAG_RESOLVE_FAILED",S),e.options)??h,m=RW.isNode(g)?g:new IW.Scalar(g);return m.range=h.range,m.tag=a,f?.format&&(m.format=f.format),m}HO.composeCollection=qW});var R0=F(WO=>{"use strict";var C0=Mt();function $W(t,e,r){let n=e.offset,i=MW(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?C0.Scalar.BLOCK_FOLDED:C0.Scalar.BLOCK_LITERAL,a=e.source?NW(e.source):[],u=a.length;for(let C=a.length-1;C>=0;--C){let A=a[C][1];if(A===""||A==="\r")u=C;else break}if(u===0){let C=i.chomp==="+"&&a.length>0?`
|
|
99
|
+
`.repeat(Math.max(1,a.length-1)):"",A=n+i.length;return e.source&&(A+=e.source.length),{value:C,type:s,comment:i.comment,range:[n,A,A]}}let f=e.indent+i.indent,h=e.offset+i.length,g=0;for(let C=0;C<u;++C){let[A,T]=a[C];if(T===""||T==="\r")i.indent===0&&A.length>f&&(f=A.length);else{A.length<f&&r(h+A.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=A.length),g=C,f===0&&!t.atRoot&&r(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=A.length+T.length+1}for(let C=a.length-1;C>=u;--C)a[C][0].length>f&&(u=C+1);let m="",S="",E=!1;for(let C=0;C<g;++C)m+=a[C][0].slice(f)+`
|
|
100
|
+
`;for(let C=g;C<u;++C){let[A,T]=a[C];h+=A.length+T.length+1;let B=T[T.length-1]==="\r";if(B&&(T=T.slice(0,-1)),T&&A.length<f){let H=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(h-T.length-(B?2:1),"BAD_INDENT",H),A=""}s===C0.Scalar.BLOCK_LITERAL?(m+=S+A.slice(f)+T,S=`
|
|
101
101
|
`):A.length>f||T[0]===" "?(S===" "?S=`
|
|
102
|
-
`:!
|
|
102
|
+
`:!E&&S===`
|
|
103
103
|
`&&(S=`
|
|
104
104
|
|
|
105
105
|
`),m+=S+A.slice(f)+T,S=`
|
|
106
|
-
`,
|
|
106
|
+
`,E=!0):T===""?S===`
|
|
107
107
|
`?m+=`
|
|
108
108
|
`:S=`
|
|
109
|
-
`:(m+=S+T,S=" ",
|
|
110
|
-
`+a[
|
|
109
|
+
`:(m+=S+T,S=" ",E=!1)}switch(i.chomp){case"-":break;case"+":for(let C=u;C<a.length;++C)m+=`
|
|
110
|
+
`+a[C][0].slice(f);m[m.length-1]!==`
|
|
111
111
|
`&&(m+=`
|
|
112
112
|
`);break;default:m+=`
|
|
113
|
-
`}let
|
|
113
|
+
`}let x=n+i.length+e.source.length;return{value:m,type:s,comment:i.comment,range:[n,x,x]}}function MW({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],a=0,u="",f=-1;for(let S=1;S<i.length;++S){let E=i[S];if(!u&&(E==="-"||E==="+"))u=E;else{let x=Number(E);!a&&x?a=x:f===-1&&(f=t+S)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let h=!1,g="",m=i.length;for(let S=1;S<e.length;++S){let E=e[S];switch(E.type){case"space":h=!0;case"newline":m+=E.source.length;break;case"comment":r&&!h&&n(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=E.source.length,g=E.source.substring(1);break;case"error":n(E,"UNEXPECTED_TOKEN",E.message),m+=E.source.length;break;default:{let x=`Unexpected token in block scalar header: ${E.type}`;n(E,"UNEXPECTED_TOKEN",x);let C=E.source;C&&typeof C=="string"&&(m+=C.length)}}}return{mode:s,indent:a,chomp:u,comment:g,length:m}}function NW(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}WO.resolveBlockScalar=$W});var O0=F(JO=>{"use strict";var I0=Mt(),DW=Bl();function FW(t,e,r){let{offset:n,type:i,source:s,end:a}=t,u,f,h=(S,E,x)=>r(n+S,E,x);switch(i){case"scalar":u=I0.Scalar.PLAIN,f=LW(s,h);break;case"single-quoted-scalar":u=I0.Scalar.QUOTE_SINGLE,f=jW(s,h);break;case"double-quoted-scalar":u=I0.Scalar.QUOTE_DOUBLE,f=UW(s,h);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let g=n+s.length,m=DW.resolveEnd(a,g,e,r);return{value:f,type:u,comment:m.comment,range:[n,g,m.offset]}}function LW(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),YO(t)}function jW(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),YO(t.slice(1,-1)).replace(/''/g,"'")}function YO(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
114
114
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
115
115
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],s=" ",a=e.lastIndex;for(r.lastIndex=a;n=r.exec(t);)n[1]===""?s===`
|
|
116
116
|
`?i+=s:s=`
|
|
117
|
-
`:(i+=s+n[1],s=" "),a=r.lastIndex;let u=/[ \t]*(.*)/sy;return u.lastIndex=a,n=u.exec(t),i+s+(n?.[1]??"")}function
|
|
117
|
+
`:(i+=s+n[1],s=" "),a=r.lastIndex;let u=/[ \t]*(.*)/sy;return u.lastIndex=a,n=u.exec(t),i+s+(n?.[1]??"")}function UW(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
|
|
118
118
|
`))if(i===`
|
|
119
|
-
`){let{fold:s,offset:a}=
|
|
119
|
+
`){let{fold:s,offset:a}=BW(t,n);r+=s,n=a}else if(i==="\\"){let s=t[++n],a=HW[s];if(a)r+=a;else if(s===`
|
|
120
120
|
`)for(s=t[n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="\r"&&t[n+1]===`
|
|
121
|
-
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let u=
|
|
121
|
+
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let u=s==="x"?2:s==="u"?4:8;r+=VW(t,n+1,u,e),n+=u}else{let u=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),r+=u}}else if(i===" "||i===" "){let s=n,a=t[n+1];for(;a===" "||a===" ";)a=t[++n+1];a!==`
|
|
122
122
|
`&&!(a==="\r"&&t[n+2]===`
|
|
123
|
-
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function
|
|
123
|
+
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function BW(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
|
|
124
124
|
`||n==="\r")&&!(n==="\r"&&t[e+2]!==`
|
|
125
125
|
`);)n===`
|
|
126
126
|
`&&(r+=`
|
|
127
|
-
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var
|
|
128
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
127
|
+
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var HW={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
128
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function VW(t,e,r,n){let i=t.substr(e,r),a=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let u=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}}JO.resolveFlowScalar=FW});var GO=F(KO=>{"use strict";var sa=Ye(),zO=Mt(),WW=R0(),YW=O0();function JW(t,e,r,n){let{value:i,type:s,comment:a,range:u}=e.type==="block-scalar"?WW.resolveBlockScalar(t,e,n):YW.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,m=>n(r,"TAG_RESOLVE_FAILED",m)):null,h;t.options.stringKeys&&t.atKey?h=t.schema[sa.SCALAR]:f?h=zW(t.schema,i,f,r,n):e.type==="scalar"?h=KW(t,i,e,n):h=t.schema[sa.SCALAR];let g;try{let m=h.resolve(i,S=>n(r??e,"TAG_RESOLVE_FAILED",S),t.options);g=sa.isScalar(m)?m:new zO.Scalar(m)}catch(m){let S=m instanceof Error?m.message:String(m);n(r??e,"TAG_RESOLVE_FAILED",S),g=new zO.Scalar(i)}return g.range=u,g.source=i,s&&(g.type=s),f&&(g.tag=f),h.format&&(g.format=h.format),a&&(g.comment=a),g}function zW(t,e,r,n,i){if(r==="!")return t[sa.SCALAR];let s=[];for(let u of t.tags)if(!u.collection&&u.tag===r)if(u.default&&u.test)s.push(u);else return u;for(let u of s)if(u.test?.test(e))return u;let a=t.knownTags[r];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[sa.SCALAR])}function KW({atKey:t,directives:e,schema:r},n,i,s){let a=r.tags.find(u=>(u.default===!0||t&&u.default==="key")&&u.test?.test(n))||r[sa.SCALAR];if(r.compat){let u=r.compat.find(f=>f.default&&f.test?.test(n))??r[sa.SCALAR];if(a.tag!==u.tag){let f=e.tagString(a.tag),h=e.tagString(u.tag),g=`Value may be parsed as either ${f} or ${h}`;s(i,"TAG_RESOLVE_FAILED",g,!0)}}return a}KO.composeScalar=JW});var ZO=F(QO=>{"use strict";function GW(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}QO.emptyScalarPosition=GW});var tP=F(k0=>{"use strict";var QW=sf(),ZW=Ye(),XW=VO(),XO=GO(),eY=Bl(),tY=ZO(),rY={composeNode:eP,composeEmptyNode:P0};function eP(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:a,anchor:u,tag:f}=r,h,g=!0;switch(e.type){case"alias":h=nY(t,e,n),(u||f)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=XO.composeScalar(t,e,f,n),u&&(h.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=XW.composeCollection(rY,t,e,r,n),u&&(h.anchor=u.source.substring(1))}catch(m){let S=m instanceof Error?m.message:String(m);n(e,"RESOURCE_EXHAUSTION",S)}break;default:{let m=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",m),g=!1}}return h??(h=P0(t,e.offset,void 0,null,r,n)),u&&h.anchor===""&&n(u,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!ZW.isScalar(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?h.comment=a:h.commentBefore=a),t.options.keepSourceTokens&&g&&(h.srcToken=e),h}function P0(t,e,r,n,{spaceBefore:i,comment:s,anchor:a,tag:u,end:f},h){let g={type:"scalar",offset:tY.emptyScalarPosition(e,r,n),indent:-1,source:""},m=XO.composeScalar(t,g,u,h);return a&&(m.anchor=a.source.substring(1),m.anchor===""&&h(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),s&&(m.comment=s,m.range[2]=f),m}function nY({options:t},{offset:e,source:r,end:n},i){let s=new QW.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+r.length,u=eY.resolveEnd(n,a,t.strict,i);return s.range=[e,a,u.offset],u.comment&&(s.comment=u.comment),s}k0.composeEmptyNode=P0;k0.composeNode=eP});var iP=F(nP=>{"use strict";var iY=_f(),rP=tP(),sY=Bl(),oY=Cf();function aY(t,e,{offset:r,start:n,value:i,end:s},a){let u=Object.assign({_directives:e},t),f=new iY.Document(void 0,u),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},g=oY.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});g.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!g.hasNewline&&a(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?rP.composeNode(h,i,g,a):rP.composeEmptyNode(h,g.end,n,null,g,a);let m=f.contents.range[2],S=sY.resolveEnd(s,m,!1,a);return S.comment&&(f.comment=S.comment),f.range=[r,m,S.offset],f}nP.composeDoc=aY});var T0=F(aP=>{"use strict";var lY=kt("process"),uY=yb(),cY=_f(),Rf=xf(),sP=Ye(),fY=iP(),dY=Bl();function If(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function oP(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
|
|
129
129
|
|
|
130
130
|
`:`
|
|
131
|
-
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var
|
|
132
|
-
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(
|
|
131
|
+
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var A0=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let a=If(r);s?this.warnings.push(new Rf.YAMLWarning(a,n,i)):this.errors.push(new Rf.YAMLParseError(a,n,i))},this.directives=new uY.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=oP(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
132
|
+
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(sP.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];sP.isPair(a)&&(a=a.key);let u=a.commentBefore;a.commentBefore=u?`${n}
|
|
133
133
|
${u}`:n}else{let a=s.commentBefore;s.commentBefore=a?`${n}
|
|
134
|
-
${a}`:n}}r
|
|
135
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new
|
|
134
|
+
${a}`:n}}if(r){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:oP(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(lY.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=If(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=fY.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=dY.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
135
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new cY.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};aP.Composer=A0});var cP=F(Zp=>{"use strict";var hY=R0(),pY=O0(),mY=xf(),lP=cf();function gY(t,e=!0,r){if(t){let n=(i,s,a)=>{let u=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(u,s,a);else throw new mY.YAMLParseError([u,u+1],s,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return pY.resolveFlowScalar(t,e,n);case"block-scalar":return hY.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function yY(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,u=lP.stringifyString({type:a,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
136
136
|
`}];switch(u[0]){case"|":case">":{let h=u.indexOf(`
|
|
137
137
|
`),g=u.substring(0,h),m=u.substring(h+1)+`
|
|
138
|
-
`,S=[{type:"block-scalar-header",offset:s,indent:n,source:g}];return
|
|
139
|
-
`}),{type:"block-scalar",offset:s,indent:n,props:S,source:m}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:u,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:u,end:f};default:return{type:"scalar",offset:s,indent:n,source:u,end:f}}}function
|
|
138
|
+
`,S=[{type:"block-scalar-header",offset:s,indent:n,source:g}];return uP(S,f)||S.push({type:"newline",offset:-1,indent:n,source:`
|
|
139
|
+
`}),{type:"block-scalar",offset:s,indent:n,props:S,source:m}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:u,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:u,end:f};default:return{type:"scalar",offset:s,indent:n,source:u,end:f}}}function vY(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=r,u="indent"in t?t.indent:null;if(n&&typeof u=="number"&&(u+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let h=t.props[0];if(h.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=h.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let f=lP.stringifyString({type:a,value:e},{implicitKey:i||u===null,indent:u!==null&&u>0?" ".repeat(u):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":SY(t,f);break;case'"':q0(t,f,"double-quoted-scalar");break;case"'":q0(t,f,"single-quoted-scalar");break;default:q0(t,f,"scalar")}}function SY(t,e){let r=e.indexOf(`
|
|
140
140
|
`),n=e.substring(0,r),i=e.substring(r+1)+`
|
|
141
|
-
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,u=[{type:"block-scalar-header",offset:s,indent:a,source:n}];
|
|
142
|
-
`});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:a,props:u,source:i})}}function
|
|
143
|
-
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}
|
|
141
|
+
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,u=[{type:"block-scalar-header",offset:s,indent:a,source:n}];uP(u,"end"in t?t.end:void 0)||u.push({type:"newline",offset:-1,indent:a,source:`
|
|
142
|
+
`});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:a,props:u,source:i})}}function uP(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function q0(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
143
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Zp.createScalarToken=yY;Zp.resolveAsScalar=gY;Zp.setScalarValue=vY});var dP=F(fP=>{"use strict";var bY=t=>"type"in t?em(t):Xp(t);function em(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=em(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Xp(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Xp(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Xp(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Xp({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=em(e)),r)for(let s of r)i+=s.source;return n&&(i+=em(n)),i}fP.stringify=bY});var gP=F(mP=>{"use strict";var $0=Symbol("break visit"),_Y=Symbol("skip children"),hP=Symbol("remove item");function oa(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),pP(Object.freeze([]),t,e)}oa.BREAK=$0;oa.SKIP=_Y;oa.REMOVE=hP;oa.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};oa.parentCollection=(t,e)=>{let r=oa.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function pP(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let u=pP(Object.freeze(t.concat([[i,a]])),s.items[a],r);if(typeof u=="number")a=u-1;else{if(u===$0)return $0;u===hP&&(s.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}mP.visit=oa});var tm=F(Fr=>{"use strict";var M0=cP(),wY=dP(),EY=gP(),N0="\uFEFF",D0="",F0="",L0="",xY=t=>!!t&&"items"in t,CY=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function RY(t){switch(t){case N0:return"<BOM>";case D0:return"<DOC>";case F0:return"<FLOW_END>";case L0:return"<SCALAR>";default:return JSON.stringify(t)}}function IY(t){switch(t){case N0:return"byte-order-mark";case D0:return"doc-mode";case F0:return"flow-error-end";case L0:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
144
144
|
`:case`\r
|
|
145
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
146
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
147
|
-
\r `),
|
|
145
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Fr.createScalarToken=M0.createScalarToken;Fr.resolveAsScalar=M0.resolveAsScalar;Fr.setScalarValue=M0.setScalarValue;Fr.stringify=wY.stringify;Fr.visit=EY.visit;Fr.BOM=N0;Fr.DOCUMENT=D0;Fr.FLOW_END=F0;Fr.SCALAR=L0;Fr.isCollection=xY;Fr.isScalar=CY;Fr.prettyToken=RY;Fr.tokenType=IY});var B0=F(vP=>{"use strict";var Of=tm();function Jn(t){switch(t){case void 0:case" ":case`
|
|
146
|
+
`:case"\r":case" ":return!0;default:return!1}}var yP=new Set("0123456789ABCDEFabcdef"),OY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),rm=new Set(",[]{}"),PY=new Set(` ,[]{}
|
|
147
|
+
\r `),j0=t=>!t||PY.has(t),U0=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
148
148
|
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
149
149
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
150
150
|
`||!i&&!this.atEnd)return e+n+1}return r===`
|
|
151
|
-
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&
|
|
152
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
151
|
+
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Jn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
152
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Of.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Of.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Jn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Jn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Jn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(j0),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Jn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Of.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(j0),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Jn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
|
|
153
153
|
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
|
|
154
|
-
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>
|
|
154
|
+
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Jn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case`
|
|
155
155
|
`:e=s,r=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
156
156
|
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
157
157
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
158
158
|
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let u=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
159
|
-
`&&s>=this.pos&&s+1+r>u)e=s;else break}while(!0);return yield
|
|
159
|
+
`&&s>=this.pos&&s+1+r>u)e=s;else break}while(!0);return yield Of.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(Jn(s)||e&&rm.has(s))break;r=n}else if(Jn(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
|
|
160
160
|
`?(n+=1,i=`
|
|
161
|
-
`,s=this.buffer[n+1]):r=n),s==="#"||e&&
|
|
162
|
-
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&
|
|
161
|
+
`,s=this.buffer[n+1]):r=n),s==="#"||e&&rm.has(s))break;if(i===`
|
|
162
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&rm.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Of.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(j0),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Jn(n)||r&&rm.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Jn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(OY.has(r))r=this.buffer[++e];else if(r==="%"&&yP.has(this.buffer[e+1])&&yP.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
163
163
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
164
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};
|
|
164
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};vP.Lexer=U0});var V0=F(SP=>{"use strict";var H0=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};SP.LineCounter=H0});var Y0=F(xP=>{"use strict";var kY=kt("process"),bP=tm(),AY=B0();function Vs(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function _P(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function EP(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function nm(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Hl(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function im(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function wP(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Vs(e.start,"explicit-key-ind")&&!Vs(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,EP(e.value)?e.value.end?im(e.value.end,e.sep):e.value.end=e.sep:im(e.start,e.sep),delete e.sep)}var W0=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new AY.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,kY.env.LOG_TOKENS&&console.log("|",bP.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=bP.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&wP(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&_P(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{_P(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=nm(this.peek(2)),n=Hl(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
165
165
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
166
|
-
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){
|
|
166
|
+
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){im(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let a=[];for(let u=0;u<r.sep.length;++u){let f=r.sep[u];switch(f.type){case"newline":a.push(u);break;case"space":break;case"comment":f.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=r.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Vs(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(EP(r.key)&&!Vs(r.sep,"newline")){let a=Hl(r.start),u=r.key,f=r.sep;f.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:u,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(Vs(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let a=Hl(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Vs(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(a):(Object.assign(r,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Vs(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){im(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Vs(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=nm(n),s=Hl(i);wP(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let u={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
167
167
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
168
|
-
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=
|
|
168
|
+
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=nm(e),n=Hl(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=nm(e),n=Hl(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};xP.Parser=W0});var PP=F(kf=>{"use strict";var CP=T0(),TY=_f(),Pf=xf(),qY=kb(),$Y=Ye(),MY=V0(),RP=Y0();function IP(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new MY.LineCounter||null,prettyErrors:e}}function NY(t,e={}){let{lineCounter:r,prettyErrors:n}=IP(e),i=new RP.Parser(r?.addNewLine),s=new CP.Composer(e),a=Array.from(s.compose(i.parse(t)));if(n&&r)for(let u of a)u.errors.forEach(Pf.prettifyError(t,r)),u.warnings.forEach(Pf.prettifyError(t,r));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function OP(t,e={}){let{lineCounter:r,prettyErrors:n}=IP(e),i=new RP.Parser(r?.addNewLine),s=new CP.Composer(e),a=null;for(let u of s.compose(i.parse(t),!0,t.length))if(!a)a=u;else if(a.options.logLevel!=="silent"){a.errors.push(new Pf.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(a.errors.forEach(Pf.prettifyError(t,r)),a.warnings.forEach(Pf.prettifyError(t,r))),a}function DY(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=OP(t,r);if(!i)return null;if(i.warnings.forEach(s=>qY.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function FY(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return $Y.isDocument(t)&&!n?t.toString(r):new TY.Document(t,n,r).toString(r)}kf.parse=DY;kf.parseAllDocuments=NY;kf.parseDocument=OP;kf.stringify=FY});var z0=F(tt=>{"use strict";var LY=T0(),jY=_f(),UY=d0(),J0=xf(),BY=sf(),Ws=Ye(),HY=js(),VY=Mt(),WY=Bs(),YY=Hs(),JY=tm(),zY=B0(),KY=V0(),GY=Y0(),sm=PP(),kP=ef();tt.Composer=LY.Composer;tt.Document=jY.Document;tt.Schema=UY.Schema;tt.YAMLError=J0.YAMLError;tt.YAMLParseError=J0.YAMLParseError;tt.YAMLWarning=J0.YAMLWarning;tt.Alias=BY.Alias;tt.isAlias=Ws.isAlias;tt.isCollection=Ws.isCollection;tt.isDocument=Ws.isDocument;tt.isMap=Ws.isMap;tt.isNode=Ws.isNode;tt.isPair=Ws.isPair;tt.isScalar=Ws.isScalar;tt.isSeq=Ws.isSeq;tt.Pair=HY.Pair;tt.Scalar=VY.Scalar;tt.YAMLMap=WY.YAMLMap;tt.YAMLSeq=YY.YAMLSeq;tt.CST=JY;tt.Lexer=zY.Lexer;tt.LineCounter=KY.LineCounter;tt.Parser=GY.Parser;tt.parse=sm.parse;tt.parseAllDocuments=sm.parseAllDocuments;tt.parseDocument=sm.parseDocument;tt.stringify=sm.stringify;tt.visit=kP.visit;tt.visitAsync=kP.visitAsync});var om=F(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.getDeepKeys=Yl.toJSON=void 0;var sJ=["function","symbol","undefined"],oJ=["constructor","prototype","__proto__"],aJ=Object.getPrototypeOf({});function lJ(){let t={},e=this;for(let r of TP(e))if(typeof r=="string"){let n=e[r],i=typeof n;sJ.includes(i)||(t[r]=n)}return t}Yl.toJSON=lJ;function TP(t,e=[]){let r=[];for(;t&&t!==aJ;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(oJ))n.delete(i);return n}Yl.getDeepKeys=TP});var K0=F(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.addInspectMethod=Jl.format=void 0;var qP=kt("util"),uJ=om(),$P=qP.inspect.custom||Symbol.for("nodejs.util.inspect.custom");Jl.format=qP.format;function cJ(t){t[$P]=fJ}Jl.addInspectMethod=cJ;function fJ(){let t={},e=this;for(let r of uJ.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[$P],t}});var DP=F(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.lazyJoinStacks=Si.joinStacks=Si.isWritableStack=Si.isLazyStack=void 0;var dJ=/\r?\n/,hJ=/\bono[ @]/;function pJ(t){return!!(t&&t.configurable&&typeof t.get=="function")}Si.isLazyStack=pJ;function mJ(t){return!!(!t||t.writable||typeof t.set=="function")}Si.isWritableStack=mJ;function MP(t,e){let r=NP(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
169
169
|
|
|
170
|
-
`+n:r||n}
|
|
171
|
-
`)}return t}function
|
|
172
|
-
`:"")+r.message),{originalError:r,props:n,message:s}}jl.normalizeArgs=tJ});var Z0=F(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.Ono=void 0;var cm=qP(),MP=$P(),rJ=am(),nJ=Q0;fm.Ono=nJ;function Q0(t,e){e=MP.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=MP.normalizeArgs(n,e),u=new t(a);return cm.extendError(u,i,s)}return r[Symbol.species]=t,r}Q0.toJSON=function(e){return rJ.toJSON.call(e)};Q0.extend=function(e,r,n){return n||r instanceof Error?cm.extendError(e,r,n):r?cm.extendError(e,void 0,r):cm.extendError(e)}});var NP=F(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.ono=void 0;var oa=Z0(),iJ=Ci;dm.ono=iJ;Ci.error=new oa.Ono(Error);Ci.eval=new oa.Ono(EvalError);Ci.range=new oa.Ono(RangeError);Ci.reference=new oa.Ono(ReferenceError);Ci.syntax=new oa.Ono(SyntaxError);Ci.type=new oa.Ono(TypeError);Ci.uri=new oa.Ono(URIError);var sJ=Ci;function Ci(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(sJ))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return Ci.error.apply(void 0,t)}});var FP=F(DP=>{"use strict";Object.defineProperty(DP,"__esModule",{value:!0});var s7=qt("util")});var ro=F((Yn,Ul)=>{"use strict";var oJ=Yn&&Yn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),aJ=Yn&&Yn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&oJ(e,t,r)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ono=void 0;var LP=NP();Object.defineProperty(Yn,"ono",{enumerable:!0,get:function(){return LP.ono}});var lJ=Z0();Object.defineProperty(Yn,"Ono",{enumerable:!0,get:function(){return lJ.Ono}});aJ(FP(),Yn);Yn.default=LP.ono;typeof Ul=="object"&&typeof Ul.exports=="object"&&(Ul.exports=Object.assign(Ul.exports.default,Ul.exports))});var X0=F(_f=>{"use strict";var uJ=_f&&_f.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_f,"__esModule",{value:!0});_f.default=cJ;var jP=uJ(qt("path"));function cJ(t){return t.startsWith("\\\\?\\")?t:t.split(jP.default?.win32?.sep).join(jP.default?.posix?.sep??"/")}});var UP=F(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.isWindows=void 0;var fJ=/^win/.test(globalThis.process?globalThis.process.platform:""),dJ=()=>fJ;hm.isWindows=dJ});var vn=F(mt=>{"use strict";var hJ=mt&&mt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),pJ=mt&&mt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mJ=mt&&mt.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&hJ(r,e,n[i]);return pJ(r,e),r}}(),gJ=mt&&mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mt,"__esModule",{value:!0});mt.parse=void 0;mt.resolve=BP;mt.cwd=HP;mt.getProtocol=i_;mt.getExtension=CJ;mt.stripQuery=VP;mt.getHash=WP;mt.stripHash=r_;mt.isHttp=xJ;mt.isFileSystemPath=n_;mt.fromFileSystemPath=RJ;mt.toFileSystemPath=IJ;mt.safePointerToPath=OJ;mt.relative=PJ;var mm=gJ(X0()),t_=mJ(qt("path")),yJ=/\//g,vJ=/^(\w{2,}):\/\//i,SJ=/~1/g,bJ=/~0/g,_J=qt("path"),pm=UP(),wJ=[[/\?/g,"%3F"],[/#/g,"%23"]],e_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],EJ=t=>new URL(t);mt.parse=EJ;function BP(t,e){let r=new URL((0,mm.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,mm.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:u}=n;return s+a+u+i}return n.toString()+i}function HP(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function i_(t){let e=vJ.exec(t||"");if(e)return e[1].toLowerCase()}function CJ(t){let e=t.lastIndexOf(".");return e>=0?VP(t.substr(e).toLowerCase()):""}function VP(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function WP(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function r_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function xJ(t){let e=i_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function n_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=i_(t);return e===void 0||e==="file"}function RJ(t){if((0,pm.isWindows)()){let e=HP(),r=t.toUpperCase(),i=(0,mm.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),u=t_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||u)&&!e.startsWith("http")&&(t=(0,_J.join)(e,t)),t=(0,mm.default)(t)}t=encodeURI(t);for(let e of wJ)t=t.replace(e[0],e[1]);return t}function IJ(t,e){t=decodeURI(t);for(let n=0;n<e_.length;n+=2)t=t.replace(e_[n],e_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,pm.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,pm.isWindows)()?t:"/"+t)),(0,pm.isWindows)()&&!r&&(t=t.replace(yJ,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function OJ(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(SJ,"/").replace(bJ,"~"))}function PJ(t,e){if(!n_(t)||!n_(e))return BP(t,e);let r=t_.default.dirname(r_(t)),n=r_(e);return t_.default.relative(r,n)+WP(e)}});var Sn=F(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.InvalidPointerError=It.TimeoutError=It.MissingPointerError=It.UnmatchedResolverError=It.ResolverError=It.UnmatchedParserError=It.ParserError=It.JSONParserErrorGroup=It.JSONParserError=void 0;It.isHandledError=kJ;It.normalizeError=AJ;var YP=ro(),gm=vn(),Jn=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,YP.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};It.JSONParserError=Jn;var ym=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,gm.toFileSystemPath)(e.$refs._root$Ref.path)}'`,YP.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};It.JSONParserErrorGroup=ym;var s_=class extends Jn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};It.ParserError=s_;var o_=class extends Jn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};It.UnmatchedParserError=o_;var a_=class extends Jn{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};It.ResolverError=a_;var l_=class extends Jn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};It.UnmatchedResolverError=l_;var u_=class extends Jn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,gm.getHash)(r)}". Token "${e}" does not exist.`,(0,gm.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};It.MissingPointerError=u_;var c_=class extends Jn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};It.TimeoutError=c_;var f_=class extends Jn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,gm.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};It.InvalidPointerError=f_;function kJ(t){return t instanceof Jn||t instanceof ym}function AJ(t){return t.path===null&&(t.path=[]),t}});var wf=F(Dr=>{"use strict";var TJ=Dr&&Dr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qJ=Dr&&Dr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$J=Dr&&Dr.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&TJ(r,e,n[i]);return qJ(r,e),r}}(),MJ=Dr&&Dr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.nullSymbol=void 0;var d_=MJ(Bl()),h_=$J(vn()),Sm=Sn();Dr.nullSymbol=Symbol("null");var NJ=/\//g,DJ=/~/g,FJ=/~1/g,LJ=/~0/g,jJ=t=>{try{return decodeURIComponent(t)}catch{return t}},bm=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=zP(e);for(let a=0;a<i.length;a++){if(vm(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!KP(n)&&"$ref"in this.value)return this;let u=i[a];if(this.value[u]===void 0||this.value[u]===null&&a===i.length-1){let f=!1;for(let _=i.length-1;_>a;_--){let C=i.slice(a,_+1).join("/");if(this.value[C]!==void 0){this.value=this.value[C],a=_,f=!0;break}}if(f)continue;if(u in this.value&&this.value[u]===null){this.value=Dr.nullSymbol;continue}this.value=null;let h=this.$ref.path||"",g=this.path.replace(h,""),m=t.join("",s),S=n?.replace(h,"");throw new Sm.MissingPointerError(u,decodeURI(this.originalPath),g,m,S)}else this.value=this.value[u];s.push(u)}return(!this.value||this.value.$ref&&h_.resolve(this.path,this.value.$ref)!==n)&&vm(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=zP(e);for(let a=0;a<i.length-1;a++)vm(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=JP(this,s,{});return vm(this,n),s=i[i.length-1],JP(this,s,r),e}static parse(e,r){let n=h_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=jJ(i[s].replace(FJ,"/").replace(LJ,"~"));if(i[0]!=="")throw new Sm.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(DJ,"~0").replace(NJ,"~1"))}return e}};function vm(t,e,r){if(d_.default.isAllowed$Ref(t.value,e)){let n=h_.resolve(t.path,t.value.$ref);if(n===t.path&&!KP(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,d_.default.isExtended$Ref(t.value)?(t.value=d_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Dr.default=bm;function JP(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new Sm.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
173
|
-
Cannot set "${e}" of a non-object.`);return r}function
|
|
174
|
-
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=
|
|
175
|
-
"${s}" not found.`);return a.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};
|
|
176
|
-
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new
|
|
170
|
+
`+n:r||n}Si.joinStacks=MP;function gJ(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return MP({stack:n},r)},enumerable:!1,configurable:!0}):yJ(e,t)}Si.lazyJoinStacks=gJ;function NP(t){if(t){let e=t.split(dJ),r;for(let n=0;n<e.length;n++){let i=e[n];if(hJ.test(i))r===void 0&&(r=n);else if(r!==void 0){e.splice(r,n-r);break}}if(e.length>0)return e.join(`
|
|
171
|
+
`)}return t}function yJ(t,e){Object.defineProperty(t,"stack",{get:()=>NP(e.get.apply(t)),enumerable:!1,configurable:!0})}});var jP=F(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.extendError=void 0;var FP=K0(),am=DP(),LP=om(),vJ=["name","message","stack"];function SJ(t,e,r){let n=t;return bJ(n,e),e&&typeof e=="object"&&_J(n,e),n.toJSON=LP.toJSON,FP.addInspectMethod&&FP.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}lm.extendError=SJ;function bJ(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");am.isLazyStack(r)?am.lazyJoinStacks(r,t,e):am.isWritableStack(r)&&(t.stack=am.joinStacks(t,e))}function _J(t,e){let r=LP.getDeepKeys(e,vJ),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var UP=F(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.normalizeArgs=zl.normalizeOptions=void 0;var wJ=K0();function EJ(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?wJ.format:typeof t.format=="function"?t.format:!1}}zl.normalizeOptions=EJ;function xJ(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
|
|
172
|
+
`:"")+r.message),{originalError:r,props:n,message:s}}zl.normalizeArgs=xJ});var Q0=F(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.Ono=void 0;var um=jP(),BP=UP(),CJ=om(),RJ=G0;cm.Ono=RJ;function G0(t,e){e=BP.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=BP.normalizeArgs(n,e),u=new t(a);return um.extendError(u,i,s)}return r[Symbol.species]=t,r}G0.toJSON=function(e){return CJ.toJSON.call(e)};G0.extend=function(e,r,n){return n||r instanceof Error?um.extendError(e,r,n):r?um.extendError(e,void 0,r):um.extendError(e)}});var HP=F(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.ono=void 0;var aa=Q0(),IJ=bi;fm.ono=IJ;bi.error=new aa.Ono(Error);bi.eval=new aa.Ono(EvalError);bi.range=new aa.Ono(RangeError);bi.reference=new aa.Ono(ReferenceError);bi.syntax=new aa.Ono(SyntaxError);bi.type=new aa.Ono(TypeError);bi.uri=new aa.Ono(URIError);var OJ=bi;function bi(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(OJ))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return bi.error.apply(void 0,t)}});var WP=F(VP=>{"use strict";Object.defineProperty(VP,"__esModule",{value:!0});var O7=kt("util")});var Js=F((zn,Kl)=>{"use strict";var PJ=zn&&zn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kJ=zn&&zn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&PJ(e,t,r)};Object.defineProperty(zn,"__esModule",{value:!0});zn.ono=void 0;var YP=HP();Object.defineProperty(zn,"ono",{enumerable:!0,get:function(){return YP.ono}});var AJ=Q0();Object.defineProperty(zn,"Ono",{enumerable:!0,get:function(){return AJ.Ono}});kJ(WP(),zn);zn.default=YP.ono;typeof Kl=="object"&&typeof Kl.exports=="object"&&(Kl.exports=Object.assign(Kl.exports.default,Kl.exports))});var Z0=F(Af=>{"use strict";var TJ=Af&&Af.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Af,"__esModule",{value:!0});Af.default=qJ;var JP=TJ(kt("path"));function qJ(t){return t.startsWith("\\\\?\\")?t:t.split(JP.default?.win32?.sep).join(JP.default?.posix?.sep??"/")}});var zP=F(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.isWindows=void 0;var $J=/^win/.test(globalThis.process?globalThis.process.platform:""),MJ=()=>$J;dm.isWindows=MJ});var bn=F(yt=>{"use strict";var NJ=yt&&yt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DJ=yt&&yt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FJ=yt&&yt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&NJ(r,e,n[i]);return DJ(r,e),r}})(),LJ=yt&&yt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yt,"__esModule",{value:!0});yt.parse=void 0;yt.resolve=KP;yt.cwd=GP;yt.getProtocol=n_;yt.getExtension=JJ;yt.stripQuery=QP;yt.getHash=ZP;yt.stripHash=t_;yt.isHttp=zJ;yt.isFileSystemPath=r_;yt.fromFileSystemPath=KJ;yt.toFileSystemPath=GJ;yt.safePointerToPath=QJ;yt.relative=ZJ;var pm=LJ(Z0()),e_=FJ(kt("path")),jJ=/\//g,UJ=/^(\w{2,}):\/\//i,BJ=/~1/g,HJ=/~0/g,VJ=kt("path"),hm=zP(),WJ=[[/\?/g,"%3F"],[/#/g,"%23"]],X0=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],YJ=t=>new URL(t);yt.parse=YJ;function KP(t,e){let r=new URL((0,pm.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,pm.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:u}=n;return s+a+u+i}return n.toString()+i}function GP(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function n_(t){let e=UJ.exec(t||"");if(e)return e[1].toLowerCase()}function JJ(t){let e=t.lastIndexOf(".");return e>=0?QP(t.substr(e).toLowerCase()):""}function QP(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function ZP(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function t_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function zJ(t){let e=n_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function r_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=n_(t);return e===void 0||e==="file"}function KJ(t){if((0,hm.isWindows)()){let e=GP(),r=t.toUpperCase(),i=(0,pm.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),u=e_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||u)&&!e.startsWith("http")&&(t=(0,VJ.join)(e,t)),t=(0,pm.default)(t)}t=encodeURI(t);for(let e of WJ)t=t.replace(e[0],e[1]);return t}function GJ(t,e){t=decodeURI(t);for(let n=0;n<X0.length;n+=2)t=t.replace(X0[n],X0[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,hm.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,hm.isWindows)()?t:"/"+t)),(0,hm.isWindows)()&&!r&&(t=t.replace(jJ,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function QJ(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(BJ,"/").replace(HJ,"~"))}function ZJ(t,e){if(!r_(t)||!r_(e))return KP(t,e);let r=e_.default.dirname(t_(t)),n=t_(e);return e_.default.relative(r,n)+ZP(e)}});var _n=F(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.InvalidPointerError=Ct.TimeoutError=Ct.MissingPointerError=Ct.UnmatchedResolverError=Ct.ResolverError=Ct.UnmatchedParserError=Ct.ParserError=Ct.JSONParserErrorGroup=Ct.JSONParserError=void 0;Ct.isHandledError=XJ;Ct.normalizeError=ez;var XP=Js(),mm=bn(),Kn=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,XP.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Ct.JSONParserError=Kn;var gm=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,mm.toFileSystemPath)(e.$refs._root$Ref.path)}'`,XP.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};Ct.JSONParserErrorGroup=gm;var i_=class extends Kn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Ct.ParserError=i_;var s_=class extends Kn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Ct.UnmatchedParserError=s_;var o_=class extends Kn{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};Ct.ResolverError=o_;var a_=class extends Kn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Ct.UnmatchedResolverError=a_;var l_=class extends Kn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,mm.getHash)(r)}". Token "${e}" does not exist.`,(0,mm.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Ct.MissingPointerError=l_;var u_=class extends Kn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Ct.TimeoutError=u_;var c_=class extends Kn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,mm.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Ct.InvalidPointerError=c_;function XJ(t){return t instanceof Kn||t instanceof gm}function ez(t){return t.path===null&&(t.path=[]),t}});var Tf=F(Lr=>{"use strict";var tz=Lr&&Lr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rz=Lr&&Lr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nz=Lr&&Lr.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&tz(r,e,n[i]);return rz(r,e),r}})(),iz=Lr&&Lr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.nullSymbol=void 0;var f_=iz(Gl()),d_=nz(bn()),vm=_n();Lr.nullSymbol=Symbol("null");var sz=/\//g,oz=/~/g,az=/~1/g,lz=/~0/g,uz=t=>{try{return decodeURIComponent(t)}catch{return t}},Sm=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=t1(e);for(let a=0;a<i.length;a++){if(ym(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!r1(n)&&"$ref"in this.value)return this;let u=i[a];if(this.value[u]===void 0||this.value[u]===null&&a===i.length-1){let f=!1;for(let E=i.length-1;E>a;E--){let x=i.slice(a,E+1).join("/");if(this.value[x]!==void 0){this.value=this.value[x],a=E,f=!0;break}}if(f)continue;if(u in this.value&&this.value[u]===null){this.value=Lr.nullSymbol;continue}this.value=null;let h=this.$ref.path||"",g=this.path.replace(h,""),m=t.join("",s),S=n?.replace(h,"");throw new vm.MissingPointerError(u,decodeURI(this.originalPath),g,m,S)}else this.value=this.value[u];s.push(u)}return(!this.value||this.value.$ref&&d_.resolve(this.path,this.value.$ref)!==n)&&ym(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=t1(e);for(let a=0;a<i.length-1;a++)ym(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=e1(this,s,{});return ym(this,n),s=i[i.length-1],e1(this,s,r),e}static parse(e,r){let n=d_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=uz(i[s].replace(az,"/").replace(lz,"~"));if(i[0]!=="")throw new vm.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(oz,"~0").replace(sz,"~1"))}return e}};function ym(t,e,r){if(f_.default.isAllowed$Ref(t.value,e)){let n=d_.resolve(t.path,t.value.$ref);if(n===t.path&&!r1(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,f_.default.isExtended$Ref(t.value)?(t.value=f_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Lr.default=Sm;function e1(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new vm.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
173
|
+
Cannot set "${e}" of a non-object.`);return r}function t1(t){if((0,vm.isHandledError)(t))throw t;return t}function r1(t){return typeof t=="string"&&Sm.parse(t).length==0}});var Gl=F(Gi=>{"use strict";var cz=Gi&&Gi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fz=Gi&&Gi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dz=Gi&&Gi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&cz(r,e,n[i]);return fz(r,e),r}})();Object.defineProperty(Gi,"__esModule",{value:!0});var bm=dz(Tf()),_m=_n(),h_=bn(),p_=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(_m.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,_m.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new bm.default(this,e,n);try{let a=s.resolve(this.value,r,i);return a.value===bm.nullSymbol&&(a.value=null),a}catch(a){if(!r||!r.continueOnError||!(0,_m.isHandledError)(a))throw a;return a.path===null&&(a.path=(0,h_.safePointerToPath)((0,h_.getHash)(i))),a instanceof _m.InvalidPointerError&&(a.source=decodeURI((0,h_.stripHash)(i))),this.addError(a),null}}set(e,r){let n=new bm.default(this,e);this.value=n.set(this.value,r),this.value===bm.nullSymbol&&(this.value=null)}static is$Ref(e){return!!e&&typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&e.$ref.length>0}static isExternal$Ref(e){return t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};Gi.default=p_});var a1=F(Gn=>{"use strict";var hz=Gn&&Gn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pz=Gn&&Gn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mz=Gn&&Gn.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&hz(r,e,n[i]);return pz(r,e),r}})(),o1=Gn&&Gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});var n1=Js(),gz=o1(Gl()),zs=mz(bn()),i1=o1(Z0()),m_=class{paths(...e){return s1(this._$refs,e.flat()).map(n=>(0,i1.default)(n.decoded))}values(...e){let r=this._$refs;return s1(r,e.flat()).reduce((i,s)=>(i[(0,i1.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=zs.resolve(this._root$Ref.path,e),i=zs.stripHash(n),s=this._$refs[i];if(!s)throw(0,n1.ono)(`Error resolving $ref pointer "${e}".
|
|
174
|
+
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=zs.resolve(this._root$Ref.path,e);let r=zs.stripHash(e);return this._$refs[r]}_add(e){let r=zs.stripHash(e),n=new gz.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=zs.resolve(this._root$Ref.path,e),s=zs.stripHash(i),a=this._$refs[s];if(!a)throw(0,n1.ono)(`Error resolving $ref pointer "${e}".
|
|
175
|
+
"${s}" not found.`);return a.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};Gn.default=m_;function s1(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?zs.toFileSystemPath(n,!0):n}))}});var u1=F(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.all=yz;Ql.filter=vz;Ql.sort=Sz;Ql.run=bz;function yz(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function vz(t,e,r){return t.filter(n=>!!l1(n,e,r))}function Sz(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function bz(t,e,r,n){let i,s,a=0;return new Promise((u,f)=>{h();function h(){if(i=t[a++],!i)return f(s);try{let E=l1(i,e,r,g,n);if(E&&typeof E.then=="function")E.then(m,S);else if(E!==void 0)m(E);else if(a===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(E){S(E)}}function g(E,x){E?S(E):m(x)}function m(E){u({plugin:i,result:E})}function S(E){s={plugin:i,error:E},h()}})}function l1(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var y_=F(Qi=>{"use strict";var _z=Qi&&Qi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wz=Qi&&Qi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),c1=Qi&&Qi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&_z(r,e,n[i]);return wz(r,e),r}})();Object.defineProperty(Qi,"__esModule",{value:!0});var g_=Js(),Ez=c1(bn()),Ks=c1(u1()),la=_n();async function xz(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),a={url:t,hash:i,extension:Ez.getExtension(t)};try{let u=await Cz(a,r,e);s.pathType=u.plugin.name,a.data=u.result;let f=await Rz(a,r,e);return s.value=f.result,f.result}catch(u){throw(0,la.isHandledError)(u)&&(s.value=u),u}}async function Cz(t,e,r){let n=Ks.all(e.resolve);n=Ks.filter(n,"canRead",t),Ks.sort(n);try{return await Ks.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new la.UnmatchedResolverError(t.url):!i||!("error"in i)?g_.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof la.ResolverError?i.error:new la.ResolverError(i,t.url)}}async function Rz(t,e,r){let n=Ks.all(e.parse),i=Ks.filter(n,"canParse",t),s=i.length>0?i:n;Ks.sort(s);try{let a=await Ks.run(s,"parse",t,r);if(!a.plugin.allowEmpty&&Iz(a.result))throw g_.ono.syntax(`Error parsing "${t.url}" as ${a.plugin.name}.
|
|
176
|
+
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new la.UnmatchedParserError(t.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?g_.ono.syntax(`Unable to parse ${t.url}`):a.error instanceof la.ParserError?a.error:new la.ParserError(a.error.message,t.url)}}function Iz(t){return t===void 0||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0||Buffer.isBuffer(t)&&t.length===0}Qi.default=xz});var d1=F(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});var f1=_n();v_.default={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string"){if(e.trim().length===0)return;try{return JSON.parse(e)}catch(r){if(this.allowBOM)try{let n=e.indexOf("{");return e=e.slice(n),JSON.parse(e)}catch(n){throw new f1.ParserError(n.message,t.url)}throw new f1.ParserError(r.message,t.url)}}else return e}}});var Zl=F((j7,ua)=>{"use strict";function h1(t){return typeof t>"u"||t===null}function Oz(t){return typeof t=="object"&&t!==null}function Pz(t){return Array.isArray(t)?t:h1(t)?[]:[t]}function kz(t,e){if(e){let r=Object.keys(e);for(let n=0,i=r.length;n<i;n+=1){let s=r[n];t[s]=e[s]}}return t}function Az(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function Tz(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}ua.exports.isNothing=h1;ua.exports.isObject=Oz;ua.exports.toArray=Pz;ua.exports.repeat=Az;ua.exports.isNegativeZero=Tz;ua.exports.extend=kz});var Xl=F((U7,m1)=>{"use strict";function p1(t,e){let r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
|
177
177
|
|
|
178
|
-
`+t.mark.snippet),n+" "+r):n}function
|
|
179
|
-
`+u
|
|
180
|
-
`,u
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
\r`;function
|
|
184
|
-
|
|
185
|
-
`,e-1))}function
|
|
186
|
-
`,
|
|
187
|
-
`);break}
|
|
188
|
-
`,
|
|
189
|
-
`,
|
|
190
|
-
`,
|
|
191
|
-
`,
|
|
192
|
-
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));
|
|
193
|
-
`,n)
|
|
194
|
-
`&&(
|
|
195
|
-
`+
|
|
196
|
-
`,
|
|
178
|
+
`+t.mark.snippet),n+" "+r):n}function qf(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=p1(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}qf.prototype=Object.create(Error.prototype);qf.prototype.constructor=qf;qf.prototype.toString=function(e){return this.name+": "+p1(this,e)};m1.exports=qf});var y1=F((B7,g1)=>{"use strict";var $f=Zl();function S_(t,e,r,n,i){let s="",a="",u=Math.floor(i/2)-1;return n-e>u&&(s=" ... ",e=n-u+s.length),r-n>u&&(a=" ...",r=n+u-a.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+a,pos:n-e+s.length}}function b_(t,e){return $f.repeat(" ",e-t.length)+t}function qz(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);let r=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;for(;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);let u="",f=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+f+3);for(let m=1;m<=e.linesBefore&&!(a-m<0);m++){let S=S_(t.buffer,n[a-m],i[a-m],t.position-(n[a]-n[a-m]),h);u=$f.repeat(" ",e.indent)+b_((t.line-m+1).toString(),f)+" | "+S.str+`
|
|
179
|
+
`+u}let g=S_(t.buffer,n[a],i[a],t.position,h);u+=$f.repeat(" ",e.indent)+b_((t.line+1).toString(),f)+" | "+g.str+`
|
|
180
|
+
`,u+=$f.repeat("-",e.indent+f+3+g.pos)+`^
|
|
181
|
+
`;for(let m=1;m<=e.linesAfter&&!(a+m>=i.length);m++){let S=S_(t.buffer,n[a+m],i[a+m],t.position-(n[a]-n[a+m]),h);u+=$f.repeat(" ",e.indent)+b_((t.line+m+1).toString(),f)+" | "+S.str+`
|
|
182
|
+
`}return u.replace(/\n$/,"")}g1.exports=qz});var ur=F((H7,S1)=>{"use strict";var v1=Xl(),$z=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Mz=["scalar","sequence","mapping"];function Nz(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function Dz(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if($z.indexOf(r)===-1)throw new v1('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Nz(e.styleAliases||null),Mz.indexOf(this.kind)===-1)throw new v1('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}S1.exports=Dz});var E_=F((V7,_1)=>{"use strict";var Mf=Xl(),__=ur();function b1(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}function Fz(){let t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function e(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(let r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(e);return t}function w_(t){return this.extend(t)}w_.prototype.extend=function(e){let r=[],n=[];if(e instanceof __)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new Mf("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof __))throw new Mf("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Mf("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Mf("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof __))throw new Mf("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(w_.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=b1(i,"implicit"),i.compiledExplicit=b1(i,"explicit"),i.compiledTypeMap=Fz(i.compiledImplicit,i.compiledExplicit),i};_1.exports=w_});var x_=F((W7,w1)=>{"use strict";var Lz=ur();w1.exports=new Lz("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var C_=F((Y7,E1)=>{"use strict";var jz=ur();E1.exports=new jz("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var R_=F((J7,x1)=>{"use strict";var Uz=ur();x1.exports=new Uz("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var I_=F((z7,C1)=>{"use strict";var Bz=E_();C1.exports=new Bz({explicit:[x_(),C_(),R_()]})});var O_=F((K7,R1)=>{"use strict";var Hz=ur();function Vz(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function Wz(){return null}function Yz(t){return t===null}R1.exports=new Hz("tag:yaml.org,2002:null",{kind:"scalar",resolve:Vz,construct:Wz,predicate:Yz,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var P_=F((G7,I1)=>{"use strict";var Jz=ur();function zz(t){if(t===null)return!1;let e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function Kz(t){return t==="true"||t==="True"||t==="TRUE"}function Gz(t){return Object.prototype.toString.call(t)==="[object Boolean]"}I1.exports=new Jz("tag:yaml.org,2002:bool",{kind:"scalar",resolve:zz,construct:Kz,predicate:Gz,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var k_=F((Q7,O1)=>{"use strict";var Qz=Zl(),Zz=ur();function Xz(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function eK(t){return t>=48&&t<=55}function tK(t){return t>=48&&t<=57}function rK(t){if(t===null)return!1;let e=t.length,r=0,n=!1;if(!e)return!1;let i=t[r];if((i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++){if(i=t[r],i!=="0"&&i!=="1")return!1;n=!0}return n&&Number.isFinite(Nf(t))}if(i==="x"){for(r++;r<e;r++){if(!Xz(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Nf(t))}if(i==="o"){for(r++;r<e;r++){if(!eK(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Nf(t))}}for(;r<e;r++){if(!tK(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(Nf(t)):!1}function Nf(t){let e=t,r=1,n=e[0];if((n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}function nK(t){return Nf(t)}function iK(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!Qz.isNegativeZero(t)}O1.exports=new Zz("tag:yaml.org,2002:int",{kind:"scalar",resolve:rK,construct:nK,predicate:iK,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var A_=F((Z7,k1)=>{"use strict";var P1=Zl(),sK=ur(),oK=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),aK=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function lK(t){return t===null||!oK.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:aK.test(t)}function uK(t){let e=t.toLowerCase(),r=e[0]==="-"?-1:1;return"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}var cK=/^[-+]?[0-9]+e/;function fK(t,e){if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(P1.isNegativeZero(t))return"-0.0";let r=t.toString(10);return cK.test(r)?r.replace("e",".e"):r}function dK(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||P1.isNegativeZero(t))}k1.exports=new sK("tag:yaml.org,2002:float",{kind:"scalar",resolve:lK,construct:uK,predicate:dK,represent:fK,defaultStyle:"lowercase"})});var T_=F((X7,A1)=>{"use strict";A1.exports=I_().extend({implicit:[O_(),P_(),k_(),A_()]})});var q_=F((eQ,T1)=>{"use strict";T1.exports=T_()});var $_=F((tQ,M1)=>{"use strict";var hK=ur(),q1=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),$1=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function pK(t){return t===null?!1:q1.exec(t)!==null||$1.exec(t)!==null}function mK(t){let e=0,r=null,n=q1.exec(t);if(n===null&&(n=$1.exec(t)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,a=+n[3];if(!n[4])return new Date(Date.UTC(i,s,a));let u=+n[4],f=+n[5],h=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let m=+n[10],S=+(n[11]||0);r=(m*60+S)*6e4,n[9]==="-"&&(r=-r)}let g=new Date(Date.UTC(i,s,a,u,f,h,e));return r&&g.setTime(g.getTime()-r),g}function gK(t){return t.toISOString()}M1.exports=new hK("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:pK,construct:mK,instanceOf:Date,represent:gK})});var M_=F((rQ,N1)=>{"use strict";var yK=ur();function vK(t){return t==="<<"||t===null}N1.exports=new yK("tag:yaml.org,2002:merge",{kind:"scalar",resolve:vK})});var D_=F((nQ,D1)=>{"use strict";var SK=ur(),N_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
183
|
+
\r`;function bK(t){if(t===null)return!1;let e=0,r=t.length,n=N_;for(let i=0;i<r;i++){let s=n.indexOf(t.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function _K(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=N_,i=0,s=[];for(let u=0;u<r;u++)u%4===0&&u&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(u));let a=r%4*6;return a===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):a===18?(s.push(i>>10&255),s.push(i>>2&255)):a===12&&s.push(i>>4&255),new Uint8Array(s)}function wK(t){let e="",r=0,n=t.length,i=N_;for(let a=0;a<n;a++)a%3===0&&a&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[a];let s=n%3;return s===0?(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]):s===2?(e+=i[r>>10&63],e+=i[r>>4&63],e+=i[r<<2&63],e+=i[64]):s===1&&(e+=i[r>>2&63],e+=i[r<<4&63],e+=i[64],e+=i[64]),e}function EK(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}D1.exports=new SK("tag:yaml.org,2002:binary",{kind:"scalar",resolve:bK,construct:_K,predicate:EK,represent:wK})});var F_=F((iQ,F1)=>{"use strict";var xK=ur(),CK=Object.prototype.hasOwnProperty,RK=Object.prototype.toString;function IK(t){if(t===null)return!0;let e=[],r=t;for(let n=0,i=r.length;n<i;n+=1){let s=r[n],a=!1;if(RK.call(s)!=="[object Object]")return!1;let u;for(u in s)if(CK.call(s,u))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(u)===-1)e.push(u);else return!1}return!0}function OK(t){return t!==null?t:[]}F1.exports=new xK("tag:yaml.org,2002:omap",{kind:"sequence",resolve:IK,construct:OK})});var L_=F((sQ,L1)=>{"use strict";var PK=ur(),kK=Object.prototype.toString;function AK(t){if(t===null)return!0;let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(kK.call(s)!=="[object Object]")return!1;let a=Object.keys(s);if(a.length!==1)return!1;r[n]=[a[0],s[a[0]]]}return!0}function TK(t){if(t===null)return[];let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],a=Object.keys(s);r[n]=[a[0],s[a[0]]]}return r}L1.exports=new PK("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:AK,construct:TK})});var j_=F((oQ,j1)=>{"use strict";var qK=ur(),$K=Object.prototype.hasOwnProperty;function MK(t){if(t===null)return!0;let e=t;for(let r in e)if($K.call(e,r)&&e[r]!==null)return!1;return!0}function NK(t){return t!==null?t:{}}j1.exports=new qK("tag:yaml.org,2002:set",{kind:"mapping",resolve:MK,construct:NK})});var wm=F((aQ,U1)=>{"use strict";U1.exports=q_().extend({implicit:[$_(),M_()],explicit:[D_(),F_(),L_(),j_()]})});var ak=F((lQ,V_)=>{"use strict";var ca=Zl(),K1=Xl(),DK=y1(),FK=wm(),Qn=Object.prototype.hasOwnProperty,Em=1,G1=2,Q1=3,xm=4,U_=1,LK=2,B1=3,jK=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,UK=/[\x85\u2028\u2029]/,BK=/[,\[\]{}]/,Z1=/^(?:!|!!|![0-9A-Za-z-]+!)$/,X1=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function H1(t){return Object.prototype.toString.call(t)}function _i(t){return t===10||t===13}function Zi(t){return t===9||t===32}function jr(t){return t===9||t===32||t===10||t===13}function eu(t){return t===44||t===91||t===93||t===123||t===125}function HK(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function VK(t){return t===120?2:t===117?4:t===85?8:0}function WK(t){return t>=48&&t<=57?t-48:-1}function V1(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
184
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function YK(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function ek(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var tk=new Array(256),rk=new Array(256);for(let t=0;t<256;t++)tk[t]=V1(t)?1:0,rk[t]=V1(t);function JK(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||FK,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxMergeSeqLength=typeof e.maxMergeSeqLength=="number"?e.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function nk(t,e){let r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=DK(r),new K1(e,r)}function ce(t,e){throw nk(t,e)}function Cm(t,e){t.onWarning&&t.onWarning.call(null,nk(t,e))}function fa(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];Qn.call(i,e)||(i[e]={existed:Qn.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function zK(t){t.anchorMapTransactions.push(Object.create(null))}function KK(t){let e=t.anchorMapTransactions.pop(),r=t.anchorMapTransactions;if(r.length===0)return;let n=r[r.length-1],i=Object.keys(e);for(let s=0,a=i.length;s<a;s+=1){let u=i[s];Qn.call(n,u)||(n[u]=e[u])}}function GK(t){let e=t.anchorMapTransactions.pop(),r=Object.keys(e);for(let n=r.length-1;n>=0;n-=1){let i=e[r[n]];i.existed?t.anchorMap[r[n]]=i.value:delete t.anchorMap[r[n]]}}function ik(t){return{position:t.position,line:t.line,lineStart:t.lineStart,lineIndent:t.lineIndent,firstTabInLine:t.firstTabInLine,tag:t.tag,anchor:t.anchor,kind:t.kind,result:t.result}}function W1(t,e){t.position=e.position,t.line=e.line,t.lineStart=e.lineStart,t.lineIndent=e.lineIndent,t.firstTabInLine=e.firstTabInLine,t.tag=e.tag,t.anchor=e.anchor,t.kind=e.kind,t.result=e.result}var Y1={YAML:function(e,r,n){e.version!==null&&ce(e,"duplication of %YAML directive"),n.length!==1&&ce(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&ce(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),a=parseInt(i[2],10);s!==1&&ce(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&Cm(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&ce(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],Z1.test(s)||ce(e,"ill-formed tag handle (first argument) of the TAG directive"),Qn.call(e.tagMap,s)&&ce(e,'there is a previously declared suffix for "'+s+'" tag handle'),X1.test(i)||ce(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{ce(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function Gs(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,a=i.length;s<a;s+=1){let u=i.charCodeAt(s);u===9||u>=32&&u<=1114111||ce(t,"expected valid JSON character")}else jK.test(i)&&ce(t,"the stream contains non-printable characters");t.result+=i}}function J1(t,e,r,n){ca.isObject(r)||ce(t,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(r);for(let s=0,a=i.length;s<a;s+=1){let u=i[s];Qn.call(e,u)||(ek(e,u,r[u]),n[u]=!0)}}function tu(t,e,r,n,i,s,a,u,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let h=0,g=i.length;h<g;h+=1)Array.isArray(i[h])&&ce(t,"nested arrays are not supported inside keys"),typeof i=="object"&&H1(i[h])==="[object Object]"&&(i[h]="[object Object]")}if(typeof i=="object"&&H1(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s)){s.length>t.maxMergeSeqLength&&ce(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let h=new Set;for(let g=0,m=s.length;g<m;g+=1){let S=s[g];h.has(S)||(h.add(S),J1(t,e,S,r))}}else J1(t,e,s,r);else!t.json&&!Qn.call(r,i)&&Qn.call(e,i)&&(t.line=a||t.line,t.lineStart=u||t.lineStart,t.position=f||t.position,ce(t,"duplicated mapping key")),ek(e,i,s),delete r[i];return e}function B_(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):ce(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Nt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;Zi(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(_i(i))for(B_(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&Cm(t,"deficient indentation"),n}function Rm(t){let e=t.position,r=t.input.charCodeAt(e);return!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||jr(r)))}function H_(t,e){e===1?t.result+=" ":e>1&&(t.result+=ca.repeat(`
|
|
185
|
+
`,e-1))}function QK(t,e,r){let n,i,s,a,u,f,h=t.kind,g=t.result,m=t.input.charCodeAt(t.position);if(jr(m)||eu(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96)return!1;if(m===63||m===45){let S=t.input.charCodeAt(t.position+1);if(jr(S)||r&&eu(S))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;m!==0;){if(m===58){let S=t.input.charCodeAt(t.position+1);if(jr(S)||r&&eu(S))break}else if(m===35){let S=t.input.charCodeAt(t.position-1);if(jr(S))break}else{if(t.position===t.lineStart&&Rm(t)||r&&eu(m))break;if(_i(m))if(a=t.line,u=t.lineStart,f=t.lineIndent,Nt(t,!1,-1),t.lineIndent>=e){s=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=a,t.lineStart=u,t.lineIndent=f;break}}s&&(Gs(t,n,i,!1),H_(t,t.line-a),n=i=t.position,s=!1),Zi(m)||(i=t.position+1),m=t.input.charCodeAt(++t.position)}return Gs(t,n,i,!1),t.result?!0:(t.kind=h,t.result=g,!1)}function ZK(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(Gs(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else _i(i)?(Gs(t,r,n,!0),H_(t,Nt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Rm(t)?ce(t,"unexpected end of the document within a single quoted scalar"):(t.position++,Zi(i)||(n=t.position));ce(t,"unexpected end of the stream within a single quoted scalar")}function XK(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return Gs(t,r,t.position,!0),t.position++,!0;if(s===92){if(Gs(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),_i(s))Nt(t,!1,e);else if(s<256&&tk[s])t.result+=rk[s],t.position++;else if((i=VK(s))>0){let a=i,u=0;for(;a>0;a--)s=t.input.charCodeAt(++t.position),(i=HK(s))>=0?u=(u<<4)+i:ce(t,"expected hexadecimal character");t.result+=YK(u),t.position++}else ce(t,"unknown escape sequence");r=n=t.position}else _i(s)?(Gs(t,r,n,!0),H_(t,Nt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Rm(t)?ce(t,"unexpected end of the document within a double quoted scalar"):(t.position++,Zi(s)||(n=t.position))}ce(t,"unexpected end of the stream within a double quoted scalar")}function eG(t,e){let r=!0,n,i,s,a=t.tag,u,f=t.anchor,h,g,m,S,E=Object.create(null),x,C,A,T=t.input.charCodeAt(t.position);if(T===91)h=93,S=!1,u=[];else if(T===123)h=125,S=!0,u={};else return!1;for(t.anchor!==null&&fa(t,t.anchor,u),T=t.input.charCodeAt(++t.position);T!==0;){if(Nt(t,!0,e),T=t.input.charCodeAt(t.position),T===h)return t.position++,t.tag=a,t.anchor=f,t.kind=S?"mapping":"sequence",t.result=u,!0;if(r?T===44&&ce(t,"expected the node content, but found ','"):ce(t,"missed comma between flow collection entries"),C=x=A=null,g=m=!1,T===63){let B=t.input.charCodeAt(t.position+1);jr(B)&&(g=m=!0,t.position++,Nt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,ru(t,e,Em,!1,!0),C=t.tag,x=t.result,Nt(t,!0,e),T=t.input.charCodeAt(t.position),(m||t.line===n)&&T===58&&(g=!0,T=t.input.charCodeAt(++t.position),Nt(t,!0,e),ru(t,e,Em,!1,!0),A=t.result),S?tu(t,u,E,C,x,A,n,i,s):g?u.push(tu(t,null,E,C,x,A,n,i,s)):u.push(x),Nt(t,!0,e),T=t.input.charCodeAt(t.position),T===44?(r=!0,T=t.input.charCodeAt(++t.position)):r=!1}ce(t,"unexpected end of the stream within a flow collection")}function tG(t,e){let r,n=U_,i=!1,s=!1,a=e,u=0,f=!1,h,g=t.input.charCodeAt(t.position);if(g===124)r=!1;else if(g===62)r=!0;else return!1;for(t.kind="scalar",t.result="";g!==0;)if(g=t.input.charCodeAt(++t.position),g===43||g===45)U_===n?n=g===43?B1:LK:ce(t,"repeat of a chomping mode identifier");else if((h=WK(g))>=0)h===0?ce(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ce(t,"repeat of an indentation width identifier"):(a=e+h-1,s=!0);else break;if(Zi(g)){do g=t.input.charCodeAt(++t.position);while(Zi(g));if(g===35)do g=t.input.charCodeAt(++t.position);while(!_i(g)&&g!==0)}for(;g!==0;){for(B_(t),t.lineIndent=0,g=t.input.charCodeAt(t.position);(!s||t.lineIndent<a)&&g===32;)t.lineIndent++,g=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>a&&(a=t.lineIndent),_i(g)){u++;continue}if(!s&&a===0&&ce(t,"missing indentation for block scalar"),t.lineIndent<a){n===B1?t.result+=ca.repeat(`
|
|
186
|
+
`,i?1+u:u):n===U_&&i&&(t.result+=`
|
|
187
|
+
`);break}r?Zi(g)?(f=!0,t.result+=ca.repeat(`
|
|
188
|
+
`,i?1+u:u)):f?(f=!1,t.result+=ca.repeat(`
|
|
189
|
+
`,u+1)):u===0?i&&(t.result+=" "):t.result+=ca.repeat(`
|
|
190
|
+
`,u):t.result+=ca.repeat(`
|
|
191
|
+
`,i?1+u:u),i=!0,s=!0,u=0;let m=t.position;for(;!_i(g)&&g!==0;)g=t.input.charCodeAt(++t.position);Gs(t,m,t.position,!1)}return!0}function z1(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&fa(t,t.anchor,i);let a=t.input.charCodeAt(t.position);for(;a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ce(t,"tab characters must not be used in indentation")),a===45);){let u=t.input.charCodeAt(t.position+1);if(!jr(u))break;if(s=!0,t.position++,Nt(t,!0,-1)&&t.lineIndent<=e){i.push(null),a=t.input.charCodeAt(t.position);continue}let f=t.line;if(ru(t,e,Q1,!1,!0),i.push(t.result),Nt(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&a!==0)ce(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return s?(t.tag=r,t.anchor=n,t.kind="sequence",t.result=i,!0):!1}function sk(t,e,r){let n,i,s,a,u=t.tag,f=t.anchor,h={},g=Object.create(null),m=null,S=null,E=null,x=!1,C=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&fa(t,t.anchor,h);let A=t.input.charCodeAt(t.position);for(;A!==0;){!x&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ce(t,"tab characters must not be used in indentation"));let T=t.input.charCodeAt(t.position+1),B=t.line;if((A===63||A===58)&&jr(T))A===63?(x&&(tu(t,h,g,m,S,null,i,s,a),m=S=E=null),C=!0,x=!0,n=!0):x?(x=!1,n=!0):ce(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,A=T;else{if(i=t.line,s=t.lineStart,a=t.position,!ru(t,r,G1,!1,!0))break;if(t.line===B){for(A=t.input.charCodeAt(t.position);Zi(A);)A=t.input.charCodeAt(++t.position);if(A===58)A=t.input.charCodeAt(++t.position),jr(A)||ce(t,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(tu(t,h,g,m,S,null,i,s,a),m=S=E=null),C=!0,x=!1,n=!1,m=t.tag,S=t.result;else if(C)ce(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=u,t.anchor=f,!0}else if(C)ce(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=u,t.anchor=f,!0}if((t.line===B||t.lineIndent>e)&&(x&&(i=t.line,s=t.lineStart,a=t.position),ru(t,e,xm,!0,n)&&(x?S=t.result:E=t.result),x||(tu(t,h,g,m,S,E,i,s,a),m=S=E=null),Nt(t,!0,-1),A=t.input.charCodeAt(t.position)),(t.line===B||t.lineIndent>e)&&A!==0)ce(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return x&&tu(t,h,g,m,S,null,i,s,a),C&&(t.tag=u,t.anchor=f,t.kind="mapping",t.result=h),C}function rG(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&ce(t,"duplication of a tag property"),s=t.input.charCodeAt(++t.position),s===60?(e=!0,s=t.input.charCodeAt(++t.position)):s===33?(r=!0,n="!!",s=t.input.charCodeAt(++t.position)):n="!";let a=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(a,t.position),s=t.input.charCodeAt(++t.position)):ce(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!jr(s);)s===33&&(r?ce(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(a-1,t.position+1),Z1.test(n)||ce(t,"named tag handle cannot contain such characters"),r=!0,a=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(a,t.position),BK.test(i)&&ce(t,"tag suffix cannot contain flow indicator characters")}i&&!X1.test(i)&&ce(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{ce(t,"tag name is malformed: "+i)}return e?t.tag=i:Qn.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:ce(t,'undeclared tag handle "'+n+'"'),!0}function nG(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&ce(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!jr(e)&&!eu(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&ce(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function iG(t){let e=t.input.charCodeAt(t.position);if(e!==42)return!1;e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!jr(e)&&!eu(e);)e=t.input.charCodeAt(++t.position);t.position===r&&ce(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return Qn.call(t.anchorMap,n)||ce(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Nt(t,!0,-1),!0}function sG(t,e,r,n){let i=ik(t);return zK(t),W1(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,sk(t,r,n)&&t.kind==="mapping"?(KK(t),!0):(GK(t),W1(t,i),!1)}function ru(t,e,r,n,i){let s,a,u=1,f=!1,h=!1,g=null,m,S,E;t.depth>=t.maxDepth&&ce(t,"nesting exceeded maxDepth ("+t.maxDepth+")"),t.depth+=1,t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null;let x=s=a=xm===r||Q1===r;if(n&&Nt(t,!0,-1)&&(f=!0,t.lineIndent>e?u=1:t.lineIndent===e?u=0:t.lineIndent<e&&(u=-1)),u===1)for(;;){let C=t.input.charCodeAt(t.position),A=ik(t);if(f&&(C===33&&t.tag!==null||C===38&&t.anchor!==null)||!rG(t)&&!nG(t))break;g===null&&(g=A),Nt(t,!0,-1)?(f=!0,a=x,t.lineIndent>e?u=1:t.lineIndent===e?u=0:t.lineIndent<e&&(u=-1)):a=!1}if(a&&(a=f||i),u===1||xm===r)if(Em===r||G1===r?S=e:S=e+1,E=t.position-t.lineStart,u===1)if(a&&(z1(t,E)||sk(t,E,S))||eG(t,S))h=!0;else{let C=t.input.charCodeAt(t.position);g!==null&&x&&!a&&C!==124&&C!==62&&sG(t,g,g.position-g.lineStart,S)||s&&tG(t,S)||ZK(t,S)||XK(t,S)?h=!0:iG(t)?(h=!0,(t.tag!==null||t.anchor!==null)&&ce(t,"alias node should not have any properties")):QK(t,S,Em===r)&&(h=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&fa(t,t.anchor,t.result)}else u===0&&(h=a&&z1(t,E));if(t.tag===null)t.anchor!==null&&fa(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&ce(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let C=0,A=t.implicitTypes.length;C<A;C+=1)if(m=t.implicitTypes[C],m.resolve(t.result)){t.result=m.construct(t.result),t.tag=m.tag,t.anchor!==null&&fa(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(Qn.call(t.typeMap[t.kind||"fallback"],t.tag))m=t.typeMap[t.kind||"fallback"][t.tag];else{m=null;let C=t.typeMap.multi[t.kind||"fallback"];for(let A=0,T=C.length;A<T;A+=1)if(t.tag.slice(0,C[A].tag.length)===C[A].tag){m=C[A];break}}m||ce(t,"unknown tag !<"+t.tag+">"),t.result!==null&&m.kind!==t.kind&&ce(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+m.kind+'", not "'+t.kind+'"'),m.resolve(t.result,t.tag)?(t.result=m.construct(t.result,t.tag),t.anchor!==null&&fa(t,t.anchor,t.result)):ce(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||h}function oG(t){let e=t.position,r=!1,n;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(n=t.input.charCodeAt(t.position))!==0&&(Nt(t,!0,-1),n=t.input.charCodeAt(t.position),!(t.lineIndent>0||n!==37));){r=!0,n=t.input.charCodeAt(++t.position);let i=t.position;for(;n!==0&&!jr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),a=[];for(s.length<1&&ce(t,"directive name must not be less than one character in length");n!==0;){for(;Zi(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!_i(n));break}if(_i(n))break;for(i=t.position;n!==0&&!jr(n);)n=t.input.charCodeAt(++t.position);a.push(t.input.slice(i,t.position))}n!==0&&B_(t),Qn.call(Y1,s)?Y1[s](t,s,a):Cm(t,'unknown document directive "'+s+'"')}if(Nt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Nt(t,!0,-1)):r&&ce(t,"directives end mark is expected"),ru(t,t.lineIndent-1,xm,!1,!0),Nt(t,!0,-1),t.checkLineBreaks&&UK.test(t.input.slice(e,t.position))&&Cm(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Rm(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Nt(t,!0,-1));return}t.position<t.length-1&&ce(t,"end of the stream or a document separator is expected")}function ok(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
192
|
+
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new JK(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,ce(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)oG(r);return r.documents}function aG(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=ok(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function lG(t,e){let r=ok(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new K1("expected a single document in the stream, but found more")}}V_.exports.loadAll=aG;V_.exports.load=lG});var Ok=F((uQ,Ik)=>{"use strict";var Pm=Zl(),Uf=Xl(),uG=wm(),gk=Object.prototype.toString,yk=Object.prototype.hasOwnProperty,K_=65279,cG=9,Ff=10,fG=13,dG=32,hG=33,pG=34,W_=35,mG=37,gG=38,yG=39,vG=42,vk=44,SG=45,Im=58,bG=61,_G=62,wG=63,EG=64,Sk=91,bk=93,xG=96,_k=123,CG=124,wk=125,cr={};cr[0]="\\0";cr[7]="\\a";cr[8]="\\b";cr[9]="\\t";cr[10]="\\n";cr[11]="\\v";cr[12]="\\f";cr[13]="\\r";cr[27]="\\e";cr[34]='\\"';cr[92]="\\\\";cr[133]="\\N";cr[160]="\\_";cr[8232]="\\L";cr[8233]="\\P";var RG=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],IG=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function OG(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let a=n[i],u=String(e[a]);a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2));let f=t.compiledTypeMap.fallback[a];f&&yk.call(f.styleAliases,u)&&(u=f.styleAliases[u]),r[a]=u}return r}function PG(t){let e,r,n=t.toString(16).toUpperCase();if(t<=255)e="x",r=2;else if(t<=65535)e="u",r=4;else if(t<=4294967295)e="U",r=8;else throw new Uf("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Pm.repeat("0",r-n.length)+n}var kG=1,Lf=2;function AG(t){this.schema=t.schema||uG,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Pm.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=OG(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Lf:kG,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function lk(t,e){let r=Pm.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let a,u=t.indexOf(`
|
|
193
|
+
`,n);u===-1?(a=t.slice(n),n=s):(a=t.slice(n,u+1),n=u+1),a.length&&a!==`
|
|
194
|
+
`&&(i+=r),i+=a}return i}function Y_(t,e){return`
|
|
195
|
+
`+Pm.repeat(" ",t.indent*e)}function TG(t,e){for(let r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function Om(t){return t===dG||t===cG}function jf(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==K_||t>=65536&&t<=1114111}function uk(t){return jf(t)&&t!==K_&&t!==fG&&t!==Ff}function ck(t,e,r){let n=uk(t),i=n&&!Om(t);return(r?n:n&&t!==vk&&t!==Sk&&t!==bk&&t!==_k&&t!==wk)&&t!==W_&&!(e===Im&&!i)||uk(e)&&!Om(e)&&t===W_||e===Im&&i}function qG(t){return jf(t)&&t!==K_&&!Om(t)&&t!==SG&&t!==wG&&t!==Im&&t!==vk&&t!==Sk&&t!==bk&&t!==_k&&t!==wk&&t!==W_&&t!==gG&&t!==vG&&t!==hG&&t!==CG&&t!==bG&&t!==_G&&t!==yG&&t!==pG&&t!==mG&&t!==EG&&t!==xG}function $G(t){return!Om(t)&&t!==Im}function Df(t,e){let r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function Ek(t){return/^\n* /.test(t)}var xk=1,J_=2,Ck=3,Rk=4,nu=5;function MG(t,e,r,n,i,s,a,u){let f,h=0,g=null,m=!1,S=!1,E=n!==-1,x=-1,C=qG(Df(t,0))&&$G(Df(t,t.length-1));if(e||a)for(f=0;f<t.length;h>=65536?f+=2:f++){if(h=Df(t,f),!jf(h))return nu;C=C&&ck(h,g,u),g=h}else{for(f=0;f<t.length;h>=65536?f+=2:f++){if(h=Df(t,f),h===Ff)m=!0,E&&(S=S||f-x-1>n&&t[x+1]!==" ",x=f);else if(!jf(h))return nu;C=C&&ck(h,g,u),g=h}S=S||E&&f-x-1>n&&t[x+1]!==" "}return!m&&!S?C&&!a&&!i(t)?xk:s===Lf?nu:J_:r>9&&Ek(t)?nu:a?s===Lf?nu:J_:S?Rk:Ck}function NG(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===Lf?'""':"''";if(!t.noCompatMode&&(RG.indexOf(e)!==-1||IG.test(e)))return t.quotingType===Lf?'"'+e+'"':"'"+e+"'";let s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),u=n||t.flowLevel>-1&&r>=t.flowLevel;function f(h){return TG(t,h)}switch(MG(e,u,t.indent,a,f,t.quotingType,t.forceQuotes&&!n,i)){case xk:return e;case J_:return"'"+e.replace(/'/g,"''")+"'";case Ck:return"|"+fk(e,t.indent)+dk(lk(e,s));case Rk:return">"+fk(e,t.indent)+dk(lk(DG(e,a),s));case nu:return'"'+FG(e,a)+'"';default:throw new Uf("impossible error: invalid scalar style")}})()}function fk(t,e){let r=Ek(t)?String(e):"",n=t[t.length-1]===`
|
|
196
|
+
`,s=n&&(t[t.length-2]===`
|
|
197
197
|
`||t===`
|
|
198
|
-
`)
|
|
199
|
-
`}function
|
|
200
|
-
`?t.slice(0,-1):t}function
|
|
201
|
-
`);return
|
|
202
|
-
`||t[0]===" ",s,a;a=r.exec(t);){
|
|
203
|
-
`:"")+
|
|
198
|
+
`)?"+":n?"":"-";return r+s+`
|
|
199
|
+
`}function dk(t){return t[t.length-1]===`
|
|
200
|
+
`?t.slice(0,-1):t}function DG(t,e){let r=/(\n+)([^\n]*)/g,n=(function(){let u=t.indexOf(`
|
|
201
|
+
`);return u=u!==-1?u:t.length,r.lastIndex=u,hk(t.slice(0,u),e)})(),i=t[0]===`
|
|
202
|
+
`||t[0]===" ",s,a;for(;a=r.exec(t);){let u=a[1],f=a[2];s=f[0]===" ",n+=u+(!i&&!s&&f!==""?`
|
|
203
|
+
`:"")+hk(f,e),i=s}return n}function hk(t,e){if(t===""||t[0]===" ")return t;let r=/ [^ ]/g,n,i=0,s,a=0,u=0,f="";for(;n=r.exec(t);)u=n.index,u-i>e&&(s=a>i?a:u,f+=`
|
|
204
204
|
`+t.slice(i,s),i=s+1),a=u;return f+=`
|
|
205
205
|
`,t.length-i>e&&a>i?f+=t.slice(i,a)+`
|
|
206
|
-
`+t.slice(a+1):f+=t.slice(i),f.slice(1)}function
|
|
207
|
-
`:""}
|
|
206
|
+
`+t.slice(a+1):f+=t.slice(i),f.slice(1)}function FG(t){let e="",r=0;for(let n=0;n<t.length;r>=65536?n+=2:n++){r=Df(t,n);let i=cr[r];!i&&jf(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||PG(r)}return e}function LG(t,e,r){let n="",i=t.tag;for(let s=0,a=r.length;s<a;s+=1){let u=r[s];t.replacer&&(u=t.replacer.call(r,String(s),u)),(Xi(t,e,u,!1,!1)||typeof u>"u"&&Xi(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump)}t.tag=i,t.dump="["+n+"]"}function pk(t,e,r,n){let i="",s=t.tag;for(let a=0,u=r.length;a<u;a+=1){let f=r[a];t.replacer&&(f=t.replacer.call(r,String(a),f)),(Xi(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&Xi(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Y_(t,e)),t.dump&&Ff===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump)}t.tag=s,t.dump=i||"[]"}function jG(t,e,r){let n="",i=t.tag,s=Object.keys(r);for(let a=0,u=s.length;a<u;a+=1){let f="";n!==""&&(f+=", "),t.condenseFlow&&(f+='"');let h=s[a],g=r[h];t.replacer&&(g=t.replacer.call(r,h,g)),Xi(t,e,h,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Xi(t,e,g,!1,!1)&&(f+=t.dump,n+=f))}t.tag=i,t.dump="{"+n+"}"}function UG(t,e,r,n){let i="",s=t.tag,a=Object.keys(r);if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new Uf("sortKeys must be a boolean or a function");for(let u=0,f=a.length;u<f;u+=1){let h="";(!n||i!=="")&&(h+=Y_(t,e));let g=a[u],m=r[g];if(t.replacer&&(m=t.replacer.call(r,g,m)),!Xi(t,e+1,g,!0,!0,!0))continue;let S=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;S&&(t.dump&&Ff===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,S&&(h+=Y_(t,e)),Xi(t,e+1,m,!0,S)&&(t.dump&&Ff===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,i+=h)}t.tag=s,t.dump=i||"{}"}function mk(t,e,r){let n=r?t.explicitTypes:t.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let a=n[i];if((a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){let u=t.styleMap[a.tag]||a.defaultStyle,f;if(gk.call(a.represent)==="[object Function]")f=a.represent(e,u);else if(yk.call(a.represent,u))f=a.represent[u](e,u);else throw new Uf("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');t.dump=f}return!0}}return!1}function Xi(t,e,r,n,i,s,a){t.tag=null,t.dump=r,mk(t,r,!1)||mk(t,r,!0);let u=gk.call(t.dump),f=n;n&&(n=t.flowLevel<0||t.flowLevel>e);let h=u==="[object Object]"||u==="[object Array]",g,m;if(h&&(g=t.duplicates.indexOf(r),m=g!==-1),(t.tag!==null&&t.tag!=="?"||m||t.indent!==2&&e>0)&&(i=!1),m&&t.usedDuplicates[g])t.dump="*ref_"+g;else{if(h&&m&&!t.usedDuplicates[g]&&(t.usedDuplicates[g]=!0),u==="[object Object]")n&&Object.keys(t.dump).length!==0?(UG(t,e,t.dump,i),m&&(t.dump="&ref_"+g+t.dump)):(jG(t,e,t.dump),m&&(t.dump="&ref_"+g+" "+t.dump));else if(u==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?pk(t,e-1,t.dump,i):pk(t,e,t.dump,i),m&&(t.dump="&ref_"+g+t.dump)):(LG(t,e,t.dump),m&&(t.dump="&ref_"+g+" "+t.dump));else if(u==="[object String]")t.tag!=="?"&&NG(t,t.dump,e,s,f);else{if(u==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Uf("unacceptable kind of an object to dump "+u)}if(t.tag!==null&&t.tag!=="?"){let S=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21");t.tag[0]==="!"?S="!"+S:S.slice(0,18)==="tag:yaml.org,2002:"?S="!!"+S.slice(18):S="!<"+S+">",t.dump=S+" "+t.dump}}return!0}function BG(t,e){let r=[],n=[];z_(t,r,n);let i=n.length;for(let s=0;s<i;s+=1)e.duplicates.push(r[n[s]]);e.usedDuplicates=new Array(i)}function z_(t,e,r){if(t!==null&&typeof t=="object"){let n=e.indexOf(t);if(n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(let i=0,s=t.length;i<s;i+=1)z_(t[i],e,r);else{let i=Object.keys(t);for(let s=0,a=i.length;s<a;s+=1)z_(t[i[s]],e,r)}}}function HG(t,e){e=e||{};let r=new AG(e);r.noRefs||BG(t,r);let n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Xi(r,0,n,!0,!0)?r.dump+`
|
|
207
|
+
`:""}Ik.exports.dump=HG});var Q_=F((cQ,Er)=>{"use strict";var Pk=ak(),VG=Ok();function G_(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}Er.exports.Type=ur();Er.exports.Schema=E_();Er.exports.FAILSAFE_SCHEMA=I_();Er.exports.JSON_SCHEMA=T_();Er.exports.CORE_SCHEMA=q_();Er.exports.DEFAULT_SCHEMA=wm();Er.exports.load=Pk.load;Er.exports.loadAll=Pk.loadAll;Er.exports.dump=VG.dump;Er.exports.YAMLException=Xl();Er.exports.types={binary:D_(),float:A_(),map:R_(),null:O_(),pairs:L_(),set:j_(),timestamp:$_(),bool:P_(),int:k_(),merge:M_(),omap:F_(),seq:C_(),str:x_()};Er.exports.safeLoad=G_("safeLoad","load");Er.exports.safeLoadAll=G_("safeLoadAll","loadAll");Er.exports.safeDump=G_("safeDump","dump")});var kk=F(Bf=>{"use strict";var WG=Bf&&Bf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bf,"__esModule",{value:!0});var YG=_n(),JG=WG(Q_()),zG=Q_();Bf.default={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")try{return JG.default.load(e,{schema:zG.JSON_SCHEMA})}catch(r){throw new YG.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var Ak=F(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var KG=_n(),GG=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;Z_.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&GG.test(t.url)},parse(t){if(typeof t.data=="string")return t.data;if(Buffer.isBuffer(t.data))return t.data.toString(this.encoding);throw new KG.ParserError("data is not text",t.url)}}});var Tk=F(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var QG=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;X_.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&QG.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var Nk=F(Zn=>{"use strict";var ZG=Zn&&Zn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XG=Zn&&Zn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),e4=Zn&&Zn.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&ZG(r,e,n[i]);return XG(r,e),r}})(),t4=Zn&&Zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});var r4=t4(kt("fs")),qk=Js(),$k=e4(bn()),Mk=_n();Zn.default={order:100,canRead(t){return $k.isFileSystemPath(t.url)},async read(t){let e;try{e=$k.toFileSystemPath(t.url)}catch(r){throw new Mk.ResolverError(qk.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await r4.default.promises.readFile(e)}catch(r){throw new Mk.ResolverError((0,qk.ono)(r,`Error opening file "${e}"`),e)}}}});var Lk=F(es=>{"use strict";var n4=es&&es.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i4=es&&es.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),s4=es&&es.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&n4(r,e,n[i]);return i4(r,e),r}})();Object.defineProperty(es,"__esModule",{value:!0});var km=Js(),Hf=s4(bn()),Dk=_n();es.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return Hf.isHttp(t.url)},read(t){let e=Hf.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Hf.parse(location.href).protocol),Fk(e,this)}};async function Fk(t,e,r){t=Hf.parse(t);let n=r||[];n.push(t.href);try{let i=await o4(t,e);if(i.status>=400)throw(0,km.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new Dk.ResolverError((0,km.ono)({status:i.status},`Error downloading ${n[0]}.
|
|
208
208
|
Too many redirects:
|
|
209
209
|
${n.join(`
|
|
210
|
-
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Am.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Tf.resolve(t.href,i.headers.location);return Ok(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new Ik.ResolverError((0,Am.ono)(i,`Error downloading ${t.href}`),t.href)}}async function qG(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var tw=F(ss=>{"use strict";var Gl=ss&&ss.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ss,"__esModule",{value:!0});ss.getNewOptions=ss.getJsonSchemaRefParserDefaultOptions=void 0;var $G=Gl(s1()),MG=Gl(bk()),NG=Gl(_k()),DG=Gl(wk()),FG=Gl(Rk()),LG=Gl(Pk()),jG=()=>({parse:{json:{...$G.default},yaml:{...MG.default},text:{...NG.default},binary:{...DG.default}},resolve:{file:{...FG.default},http:{...LG.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});ss.getJsonSchemaRefParserDefaultOptions=jG;var UG=t=>{let e=(0,ss.getJsonSchemaRefParserDefaultOptions)();return t&&Ak(e,t),e};ss.getNewOptions=UG;function Ak(t,e){if(kk(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],a=t[i];kk(s)?t[i]=Ak(a||{},s):s!==void 0&&(t[i]=s)}}return t}function kk(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var qk=F(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.normalizeArgs=Tk;var BG=tw();function Tk(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,BG.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Tm.default=Tk});var $k=F(Gn=>{"use strict";var HG=Gn&&Gn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VG=Gn&&Gn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WG=Gn&&Gn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&HG(r,e,n[i]);return VG(r,e),r}}(),rw=Gn&&Gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});var YG=rw(Bl()),JG=rw(wf()),zG=rw(v_()),Ql=WG(vn()),KG=Sn();function GG(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=nw(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function nw(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),YG.default.isExternal$Ref(t)&&a.push(QG(t,e,r,n));let u=Object.keys(t);for(let f of u){let h=JG.default.join(e,f),g=t[f];a=a.concat(nw(g,h,r,n,i,s))}}return a}async function QG(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Ql.resolve(i?Ql.cwd():e,t.$ref),a=Ql.stripHash(s),u=r._$refs[a];if(u)return Promise.resolve(u.value);try{let f=await(0,zG.default)(s,r,n),h=nw(f,a+"#",r,n,new Set,!0);return Promise.all(h)}catch(f){if(!n?.continueOnError||!(0,KG.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Ql.stripHash(e)),f.path=Ql.safePointerToPath(Ql.getHash(e))),[]}}Gn.default=GG});var Dk=F(Qn=>{"use strict";var ZG=Qn&&Qn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),XG=Qn&&Qn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e4=Qn&&Qn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&ZG(r,e,n[i]);return XG(r,e),r}}(),Nk=Qn&&Qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qn,"__esModule",{value:!0});var qm=Nk(Bl()),qf=Nk(wf()),iw=e4(vn());function t4(t,e){let r=[];sw(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),r4(r)}function sw(t,e,r,n,i,s,a,u){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(qm.default.isAllowed$Ref(f))Mk(t,e,r,n,i,s,a,u);else{let h=Object.keys(f).sort((g,m)=>g==="definitions"?-1:m==="definitions"?1:g.length-m.length);for(let g of h){let m=qf.default.join(r,g),S=qf.default.join(n,g),_=f[g];qm.default.isAllowed$Ref(_)?Mk(f,g,r,S,i,s,a,u):sw(f,g,m,S,i,s,a,u)}}}function Mk(t,e,r,n,i,s,a,u){let f=e===null?t:t[e],h=iw.resolve(r,f.$ref),g=a._resolve(h,n,u);if(g===null)return;let S=qf.default.parse(n).length,_=iw.stripHash(g.path),C=iw.getHash(g.path),x=_!==a._root$Ref.path,A=qm.default.isExtended$Ref(f);i+=g.indirections;let T=n4(s,t,e);if(T)if(S<T.depth||i<T.indirections)i4(s,T);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:S,file:_,hash:C,value:g.value,circular:g.circular,extended:A,external:x,indirections:i}),(!T||x)&&sw(g.value,null,g.path,n,i+1,s,a,u)}function r4(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),u=s.pathFromRoot.lastIndexOf("/definitions");return a!==u?u-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=qf.default.join(n,qf.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=qm.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function n4(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function i4(t,e){let r=t.indexOf(e);t.splice(r,1)}Qn.default=t4});var Hk=F(Zn=>{"use strict";var s4=Zn&&Zn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),o4=Zn&&Zn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a4=Zn&&Zn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&s4(r,e,n[i]);return o4(r,e),r}}(),Uk=Zn&&Zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});var $m=Uk(Bl()),Fk=Uk(wf()),l4=ro(),Lk=a4(vn()),u4=Sn();Zn.default=c4;function c4(t,e){let r=Date.now(),n=ow(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function ow(t,e,r,n,i,s,a,u,f){let h,g={value:t,circular:!1};if(u&&u.timeoutMs&&Date.now()-f>u.timeoutMs)throw new u4.TimeoutError(u.timeoutMs);let m=u.dereference||{},S=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!S(r)){if(n.add(t),i.add(t),$m.default.isAllowed$Ref(t,u))h=jk(t,e,r,n,i,s,a,u,f),g.circular=h.circular,g.value=h.value;else for(let _ of Object.keys(t)){let C=Fk.default.join(e,_),x=Fk.default.join(r,_);if(S(x))continue;let A=t[_],T=!1;if($m.default.isAllowed$Ref(A,u)){if(h=jk(A,C,x,n,i,s,a,u,f),T=h.circular,t[_]!==h.value){let j=new Map;m?.preservedProperties&&typeof t[_]=="object"&&!Array.isArray(t[_])&&m?.preservedProperties.forEach(Y=>{Y in t[_]&&j.set(Y,t[_][Y])}),t[_]=h.value,m?.preservedProperties&&j.size&&typeof t[_]=="object"&&!Array.isArray(t[_])&&j.forEach((Y,V)=>{t[_][V]=Y}),m?.onDereference?.(A.$ref,t[_],t,_)}}else n.has(A)?T=Bk(C,a,u):(h=ow(A,C,x,n,i,s,a,u,f),T=h.circular,t[_]!==h.value&&(t[_]=h.value));g.circular=g.circular||T}n.delete(t)}return g}function jk(t,e,r,n,i,s,a,u,f){let g=$m.default.isExternal$Ref(t)&&u?.dereference?.externalReferenceResolution==="root",m=Lk.resolve(g?Lk.cwd():e,t.$ref),S=s.get(m);if(S&&!S.circular){let j=Object.keys(t);if(j.length>1){let Y={};for(let V of j)V!=="$ref"&&!(V in S.value)&&(Y[V]=t[V]);return{circular:S.circular,value:Object.assign({},S.value,Y)}}return S}let _=a._resolve(m,e,u);if(_===null)return{circular:!1,value:null};let C=_.circular,x=C||n.has(_.value);x&&Bk(e,a,u);let A=$m.default.dereference(t,_.value);if(!x){let j=ow(A,_.path,r,n,i,s,a,u,f);x=j.circular,A=j.value}x&&!C&&u.dereference?.circular==="ignore"&&(A=t),C&&(A.$ref=r);let T={circular:x,value:A};return Object.keys(t).length===1&&s.set(m,T),T}function Bk(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw l4.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var Vk=F(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});function f4(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}aw.default=f4()});var Yk=F($f=>{"use strict";var d4=$f&&$f.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($f,"__esModule",{value:!0});$f.default=h4;var Wk=d4(Vk());function h4(t,e){if(t){e.then(function(r){(0,Wk.default)(function(){t(null,r)})},function(r){(0,Wk.default)(function(){t(r)})});return}else return e}});var Gk=F(_e=>{"use strict";var p4=_e&&_e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),m4=_e&&_e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g4=_e&&_e.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&p4(r,e,n[i]);return m4(r,e),r}}(),ha=_e&&_e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_e,"__esModule",{value:!0});_e.getJsonSchemaRefParserDefaultOptions=_e.jsonSchemaParserNormalizeArgs=_e.dereferenceInternal=_e.JSONParserErrorGroup=_e.isHandledError=_e.UnmatchedParserError=_e.ParserError=_e.ResolverError=_e.MissingPointerError=_e.InvalidPointerError=_e.JSONParserError=_e.UnmatchedResolverError=_e.dereference=_e.bundle=_e.resolve=_e.parse=_e.$RefParser=void 0;var Jk=ha(e1()),y4=ha(v_()),Mf=ha(qk());_e.jsonSchemaParserNormalizeArgs=Mf.default;var v4=ha($k()),S4=ha(Dk()),Kk=ha(Hk());_e.dereferenceInternal=Kk.default;var da=g4(vn()),bn=Sn();Object.defineProperty(_e,"JSONParserError",{enumerable:!0,get:function(){return bn.JSONParserError}});Object.defineProperty(_e,"InvalidPointerError",{enumerable:!0,get:function(){return bn.InvalidPointerError}});Object.defineProperty(_e,"MissingPointerError",{enumerable:!0,get:function(){return bn.MissingPointerError}});Object.defineProperty(_e,"ResolverError",{enumerable:!0,get:function(){return bn.ResolverError}});Object.defineProperty(_e,"ParserError",{enumerable:!0,get:function(){return bn.ParserError}});Object.defineProperty(_e,"UnmatchedParserError",{enumerable:!0,get:function(){return bn.UnmatchedParserError}});Object.defineProperty(_e,"UnmatchedResolverError",{enumerable:!0,get:function(){return bn.UnmatchedResolverError}});Object.defineProperty(_e,"isHandledError",{enumerable:!0,get:function(){return bn.isHandledError}});Object.defineProperty(_e,"JSONParserErrorGroup",{enumerable:!0,get:function(){return bn.JSONParserErrorGroup}});var zk=ro(),Xn=ha(Yk()),b4=tw();Object.defineProperty(_e,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return b4.getJsonSchemaRefParserDefaultOptions}});var ao=class t{constructor(){this.schema=null,this.$refs=new Jk.default}async parse(){let e=(0,Mf.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,zk.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,Xn.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new Jk.default;let n="http";if(da.isFileSystemPath(e.path))e.path=da.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=da.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=da.resolve(da.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,y4.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,Xn.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,Xn.default)(e.callback,Promise.resolve(this.schema));throw zk.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,bn.isHandledError)(i)?(0,Xn.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[da.stripHash(e.path)]&&this.$refs._$refs[da.stripHash(e.path)].addError(i),(0,Xn.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Mf.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,v4.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Mf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,S4.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Mf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Kk.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}};_e.$RefParser=ao;_e.default=ao;function lw(t){if(bn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new bn.JSONParserErrorGroup(t)}_e.parse=ao.parse;_e.resolve=ao.resolve;_e.bundle=ao.bundle;_e.dereference=ao.dereference});var Za=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};import*as Se from"fs";import*as xe from"path";function xt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function at(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${xt(t)}_${e}`:e}function rv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Fu(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),u=n[a];u&&delete r[u],n[a]=i,r[i]=s}return r}function vN(t){return JSON.parse(JSON.stringify(t))}function SN(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function bN(t,e){try{return JSON.parse(t)}catch{return e}}function _N(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function wN(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}import*as tt from"fs";import*as Nn from"path";var ch={preRequest:"pre-request.js",postResponse:"post-response.js"},yr={collection:"collection.json",folder:"folder.json",request:"request.json"},FE={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},Lu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},cn="scripts";function fh(t){if(!tt.existsSync(t))return;let e={},r=Nn.join(t,ch.preRequest);tt.existsSync(r)&&(e.preRequest=tt.readFileSync(r,"utf-8"));let n=Nn.join(t,ch.postResponse);return tt.existsSync(n)&&(e.postResponse=tt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function dh(t,e){await tt.promises.mkdir(t,{recursive:!0});let r=Nn.join(t,ch.preRequest);e.preRequest?await tt.promises.writeFile(r,e.preRequest,"utf-8"):tt.existsSync(r)&&await tt.promises.unlink(r);let n=Nn.join(t,ch.postResponse);e.postResponse?await tt.promises.writeFile(n,e.postResponse,"utf-8"):tt.existsSync(n)&&await tt.promises.unlink(n)}function LE(t){for(let[e,r]of Object.entries(FE)){let n=Nn.join(t,e);if(tt.existsSync(n))try{let i=tt.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function jE(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function UE(t,e){for(let r of Object.keys(FE))if(r!==e){let n=Nn.join(t,r);if(tt.existsSync(n))try{await tt.promises.unlink(n)}catch{}}}function BE(t){if(tt.existsSync(t))try{let e=tt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function HE(t,e,r){let n=Nn.join(t,Lu.responseSchema),i=Nn.join(t,Lu.bodySchema);e?await tt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):tt.existsSync(n)&&await tt.promises.unlink(n),r?await tt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):tt.existsSync(i)&&await tt.promises.unlink(i)}function nv(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=nv(r.items,e);if(n)return n}}}function iv(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&iv(n.items,e))return!0}return!1}function VE(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function sv(t,e){let r;try{r=tt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===cn)continue;if(n.name===e)return Nn.join(t,n.name);let i=sv(Nn.join(t,n.name),e);if(i)return i}}function Bi(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],a=0;for(let S of s){let _=parseInt(S.substring(1));_>a&&(a=_)}let u="";if(a>0)u=`t${a}`;else{let S=r.match(/[_\s-](\d+\.\d+)[_\s-]/);S&&(u=`v${S[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let h=f.split("-").filter(S=>S.length>0),g=[];i&&g.push(i),g.push(...h),u&&g.push(u);let m=g.join("-");if(m||(m="item"),e.includes(m)){let S=2;for(;e.includes(`${m}-${S}`);)S++;m=`${m}-${S}`}return m}var $s=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){Se.existsSync(this.collectionsDir)||Se.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Se.existsSync(this.collectionsDir))return[];let e=Se.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=xe.join(this.collectionsDir,e),n=xe.join(r,yr.collection);if(Se.existsSync(n))try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(r,cn)),u=this.loadItemsFromDir(r,s.id,s.order);return{id:s.id,name:s.name,description:s.description,version:s.version,variables:s.variables,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,i);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=Se.readdirSync(e,{withFileTypes:!0});for(let u of a){if(!u.isDirectory()||u.name===cn)continue;let f=xe.join(e,u.name);if(Se.existsSync(xe.join(f,yr.folder))){let h=this.loadFolderFromDir(f,u.name);h&&s.set(u.name,h)}else if(Se.existsSync(xe.join(f,yr.request))){let h=this.loadRequestFromDir(f,u.name);h&&s.set(u.name,h)}}if(n&&n.length>0){for(let u of n){let f=s.get(u);f&&(i.push(f),s.delete(u))}for(let u of s.values())i.push(u)}else for(let u of s.values())i.push(u);return i}loadFolderFromDir(e,r){let n=xe.join(e,yr.folder);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(e,cn)),u=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"folder",name:s.name,description:s.description,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,i);return}}loadRequestFromDir(e,r){let n=xe.join(e,yr.request);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(e,cn)),u=s.body,f=this.loadBodyFromDir(e);f&&(u=f);let h=this.loadSchemaFile(xe.join(e,Lu.responseSchema)),g=this.loadSchemaFile(xe.join(e,Lu.bodySchema)),m=xe.join(e,"doc.md"),S=Se.existsSync(m)?Se.readFileSync(m,"utf-8"):void 0;return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"request",name:s.name,description:s.description,method:s.method,url:s.url,params:s.params,query:s.query,headers:s.headers,body:u,auth:s.auth,settings:s.settings,scripts:a,deprecated:s.deprecated,...S&&{doc:S},...h&&{responseSchema:h},...g&&{bodySchema:g}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return fh(e)}loadBodyFromDir(e){return LE(e)}loadSchemaFile(e){return BE(e)}async saveSchemaFiles(e,r){return HE(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=at(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=Se.readdirSync(this.collectionsDir);r=Bi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=xe.join(this.collectionsDir,r);await Se.promises.mkdir(n,{recursive:!0});let i={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth};await Se.promises.writeFile(xe.join(n,yr.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(xe.join(n,cn),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await Se.promises.writeFile(xe.join(n,yr.collection),JSON.stringify(i,null,2),"utf-8")),this.cache.set(e.id,e)}async saveItemsToDir(e,r){let n=[];for(let i of r){let s=this.idToSlugMap.get(i.id);s||(s=Bi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=xe.join(e,s);await Se.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}return n}async saveFolderToDir(e,r){let n={id:r.id,name:r.name,description:r.description,auth:r.auth};if(await Se.promises.writeFile(xe.join(e,yr.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(xe.join(e,cn),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await Se.promises.writeFile(xe.join(e,yr.folder),JSON.stringify(n,null,2),"utf-8"))}}async saveRequestToDir(e,r){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(r.body),s={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:n,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}};await Se.promises.writeFile(xe.join(e,yr.request),JSON.stringify(s,null,2),"utf-8"),i&&await Se.promises.writeFile(xe.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await Se.promises.writeFile(xe.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(xe.join(e,cn),r.scripts)}prepareBodyForSave(e){return jE(e)}async cleanupOldBodyFiles(e,r){return UE(e,r)}async saveScriptsToDir(e,r){return dh(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=xe.join(this.collectionsDir,r);if(!Se.existsSync(n))return!1;try{return await Se.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?Se.existsSync(xe.join(this.collectionsDir,r,yr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return xe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||at(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(xe.join(s,cn),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(xe.join(n,cn))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=xe.join(this.collectionsDir,i),a=xe.join(s,yr.collection),u=Se.readFileSync(a,"utf-8"),h={...JSON.parse(u),...r,id:e};await Se.promises.writeFile(a,JSON.stringify(h,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let g=this.findItemPath(e,n);if(!g)throw new Error(`Parent folder ${n} not found`);a=g}else a=xe.join(this.collectionsDir,s);let u=this.idToSlugMap.get(r.id);if(!u){let g=Se.readdirSync(a).filter(m=>Se.statSync(xe.join(a,m)).isDirectory()&&m!==cn);u=Bi(r.name,g),this.idToSlugMap.set(r.id,u),this.slugToIdMap.set(u,r.id)}let f=xe.join(a,u);await Se.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let h=this.findItemById(i.items,r.id);if(h)Object.assign(h,r);else if(n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!Se.existsSync(i))return!1;try{await Se.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let a=this.findItemById(i.items,r);if(!a)return!1;let{id:u,type:f,items:h,...g}=n;return Object.assign(a,g),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,r);if(!a||!Se.existsSync(a))return!1;let u;if(n){let g=this.findItemPath(e,n);if(!g)return!1;u=g}else u=xe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let h=xe.join(u,f);if(Se.existsSync(h))return!1;try{await Se.promises.rename(a,h);let g=this.findItemById(i.items,r);if(g){let m=g.type==="folder"?{...g,items:g.items?[...g.items]:[]}:{...g};if(this.deleteItemFromTree(i.items,r),n){let S=this.findItemById(i.items,n);S&&S.type==="folder"&&(S.items=S.items||[],S.items.push(m))}else i.items.push(m)}return!0}catch(g){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,g),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let u of n){let f=this.idToSlugMap.get(u);f&&a.push(f)}try{if(r){let u=this.findItemPath(e,r);if(!u)return!1;let f=xe.join(u,yr.folder),h=Se.readFileSync(f,"utf-8"),g=JSON.parse(h);g.order=a,await Se.promises.writeFile(f,JSON.stringify(g,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let u=xe.join(this.collectionsDir,s,yr.collection),f=Se.readFileSync(u,"utf-8"),h=JSON.parse(f);h.order=a,await Se.promises.writeFile(u,JSON.stringify(h,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(u){return console.error("[FolderCollectionStore] Failed to reorder items:",u),!1}}sortItemsByOrder(e,r){return VE(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return sv(xe.join(this.collectionsDir,n),i)}findItemById(e,r){return nv(e,r)}deleteItemFromTree(e,r){return iv(e,r)}};function ov(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(WE),source:{format:"folder",filePath:e,version:t.version}}}function WE(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(WE)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function EN(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(av)}}function av(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(av)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var ju=class{store;constructor(e){this.store=new $s(e)}loadAll(){return this.store.loadAll().map(r=>ov(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return ov(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return ov(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(EN(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,av(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var Uu=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};var lt=class{static parseSetCookie(e,r){let n=e.split(";").map(g=>g.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let u=i.substring(0,a).trim(),f=i.substring(a+1).trim(),h={name:u,value:f,domain:r};for(let g of s){let m=g.indexOf("="),S=(m===-1?g:g.substring(0,m)).toLowerCase(),_=m===-1?"":g.substring(m+1);switch(S){case"domain":h.domain=_.startsWith(".")?_.substring(1):_;break;case"path":h.path=_;break;case"expires":h.expires=_;break;case"max-age":h.maxAge=parseInt(_,10);break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break;case"samesite":h.sameSite=_;break}}return h}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let u=this.parseSetCookie(a,r);u&&n.push(u)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}};var Bu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return lt.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return lt.parseCookieHeaders(e,r)}isExpired(e){return lt.isExpired(e)}domainMatches(e,r){return lt.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};import*as Ms from"fs";import*as Ao from"path";function ph(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Hu(t){if(!Ms.existsSync(t))return CN();let e=hh(Ao.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Ms.readdirSync(t).filter(h=>h.endsWith(".json")).filter(h=>!h.endsWith(".local.json")).filter(h=>!ph(h)),s={};for(let h of i){let g=hh(Ao.join(t,h))||{},m=Ao.basename(h,".json");s[m]={description:g.description,requiresConfirmation:g.requiresConfirmation,variables:g.variables||{}}}let u=(hh(Ao.join(t,"_global.local.json"))||{}).variables||{},f={};for(let h of Object.keys(s)){let g=Ao.join(t,`${h}.local.json`);if(Ms.existsSync(g)){let m=hh(g)||{};f[h]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:u,localCredentials:f}}function CN(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function hh(t){try{if(!Ms.existsSync(t))return null;let e=Ms.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var Hi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};var Dn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",u=e.indexOf("?");u!==-1&&(a=e.substring(u),s=e.substring(0,u));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let h=/:(\w+)(?:\([^)]*\))?(\?)?/g,g=s.replace(h,(m,S,_)=>{let C=r[S];return C!==void 0&&C!==""?encodeURIComponent(C):_?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${S}`),m)});return g=g.replace(/([^:])\/+/g,"$1/"),g.length>1&&g.endsWith("/")&&(g=g.slice(0,-1)),`${n}${i}${g}${a}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,h]=e.split("?");n=f,h&&new URLSearchParams(h).forEach((m,S)=>{i[S]=m})}let s={...i,...r},a=new URLSearchParams;for(let[f,h]of Object.entries(s))h!=null&&a.append(f,h);let u=a.toString();return u?`${n}?${u}`:n}};import xN from"crypto";var gh=new Uint8Array(256),mh=gh.length;function lv(){return mh>gh.length-16&&(xN.randomFillSync(gh),mh=0),gh.slice(mh,mh+=16)}var Gt=[];for(let t=0;t<256;++t)Gt.push((t+256).toString(16).slice(1));function YE(t,e=0){return Gt[t[e+0]]+Gt[t[e+1]]+Gt[t[e+2]]+Gt[t[e+3]]+"-"+Gt[t[e+4]]+Gt[t[e+5]]+"-"+Gt[t[e+6]]+Gt[t[e+7]]+"-"+Gt[t[e+8]]+Gt[t[e+9]]+"-"+Gt[t[e+10]]+Gt[t[e+11]]+Gt[t[e+12]]+Gt[t[e+13]]+Gt[t[e+14]]+Gt[t[e+15]]}import RN from"crypto";var uv={randomUUID:RN.randomUUID};function IN(t,e,r){if(uv.randomUUID&&!e&&!t)return uv.randomUUID();t=t||{};let n=t.random||(t.rng||lv)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return YE(n)}var Xa=IN;function ON(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function PN(){return Date.now()}function JE(){return Xa()}function kN(){return Xa()}function zE(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function AN(){let t=zE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function TN(){return Math.random()<.5}function qN(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function $N(){return Math.floor(Date.now()/1e3)}function MN(){return new Date().toISOString()}function NN(){return new Date().toISOString().split("T")[0]}function DN(){return new Date().toISOString().split("T")[1].split(".")[0]}function FN(){return new Date().toISOString()}function LN(t=""){return Buffer.from(String(t)).toString("base64")}function jN(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function UN(t=""){return encodeURIComponent(String(t))}function BN(t=""){return decodeURIComponent(String(t))}var KE={randomInt:ON,timestamp:PN,guid:kN,uuid:JE,randomUUID:JE,randomString:zE,randomHexadecimal:qN,randomEmail:AN,randomBoolean:TN,isoTimestamp:FN,timestamp_s:$N,datetime:MN,date:NN,time:DN,base64Encode:LN,base64Decode:jN,urlEncode:UN,urlDecode:BN};function HN(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Vi(t,e){let r=KE[t];return r?e&&e.length>0?r(...e):r():null}function VN(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?HN(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function To(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],a=i[1];if(!(s in e)){let u=Vi(a);u!==null&&(n||(n={...e}),n[s]=u)}}return n??e}import*as yh from"vm";var WN=100;function qo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function $o(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=yh.createContext(r);return yh.runInContext(t,n,{timeout:WN,displayErrors:!1})}catch{return}}import*as vh from"crypto";function Wu(t){if(!t||!t.includes("|"))return null;let e=YN(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=JN(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function YN(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let u=t[a],f=a>0?t[a-1]:"",h=a<t.length-1?t[a+1]:"";if(f==="\\"){r+=u;continue}if(u==="'"&&!s)i=!i;else if(u==='"'&&!i)s=!s;else if(u==="("&&!i&&!s)n++;else if(u===")"&&!i&&!s)n--;else if(u==="|"&&n===0&&!i&&!s){if(h==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=u}return r&&e.push(r),e}function JN(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:zN(n)}}function zN(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function Rt(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=e[t],i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Yu(t,e,r={}){let n=t;for(let i of e)n=KN(n,i.name,i.args,r);return n}function KN(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=Rt(r[0],n),s=r[1]!==void 0?Rt(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(Rt(r[0],n)):"",s=r[1]!==void 0?String(Rt(r[1],n)):"";return String(t).replace(new RegExp(QN(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Rt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Rt(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(Rt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=Rt(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Rt(r[0],n);return Number(t)+i}case"subtract":{let i=Rt(r[0],n);return Number(t)-i}case"multiply":{let i=Rt(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?Rt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Rt(r[1],n):"base64"),u={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return vh.createHash(u).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Rt(r[0],n)):"",s=String(r[1]!==void 0?Rt(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?Rt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return vh.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=Rt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Rt(r[0],n),s=r[1]!==void 0?Rt(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:GN(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Rt(s,n)));return i.length===1?t.map(s=>Vu(s,i[0])):t.map(s=>{let a={};for(let u of i){let f=Vu(s,u);f!==void 0&&(a[u]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(Rt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>Vu(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Vu(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function GN(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,u=Rt(a,r);return t.filter(f=>{let h=Vu(f,i);if(h===void 0)return!1;switch(s){case">":return Number(h)>Number(u);case">=":return Number(h)>=Number(u);case"<":return Number(h)<Number(u);case"<=":return Number(h)<=Number(u);case"=":return String(h)===String(u);case"!=":return String(h)!==String(u);case"*=":return String(h).includes(String(u));case"^=":return String(h).startsWith(String(u));case"$=":return String(h).endsWith(String(u));default:return!0}})}function Vu(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function QN(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function GE(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}var Mo=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{([^}]+)\}\}/g,(u,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,u));let n="",i=0,s=/\{\{([^}]+)\}\}/g,a;for(;(a=s.exec(e))!==null;){let u=a[1].trim(),f=this.resolveTemplateContent(u,this.allVariables,a[0]);if(f!==a[0]){n+=e.slice(i,a.index);let h=this.getStringContext(e,a.index);n+=h?this.escapeForString(String(f),h):String(f)}else n+=e.slice(i,a.index+a[0].length);i=a.index+a[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{([^}]+)\}\}/g,(h,g)=>this.resolveTemplateContent(g.trim(),i,h));let s="",a=0,u=/\{\{([^}]+)\}\}/g,f;for(;(f=u.exec(e))!==null;){let h=f[1].trim(),g=this.resolveTemplateContent(h,i,f[0]);if(g!==f[0]){s+=e.slice(a,f.index);let m=this.getStringContext(e,f.index);s+=m?this.escapeForString(String(g),m):String(g)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let u=GE(i[2],r),f=Vi(i[1],u);return f!==null?String(f):n}let s=Wu(e);if(s){let u=this.resolveFilterInput(s.input,r);if(u!==void 0){let f=Yu(u,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let u=a[1];if(r[u]!==void 0){let f=this.deserializeValue(r[u]),h=a[2],g=this.resolvePropertyAccess(f,h);if(g!==void 0)return typeof g=="object"?JSON.stringify(g):String(g)}}if(r[e]!==void 0){let u=r[e];return typeof u=="string"&&u.charCodeAt(0)===30?u.slice(1):String(u)}if(qo(e)){let u=this.deserializeVariables(r),f=To(e,u),h=$o(e,f);if(h!==void 0)return String(h)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=GE(n[2],r),a=Vi(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let a=this.deserializeValue(r[s]),u=this.resolvePropertyAccess(a,i[2]);if(u!==void 0)return u}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(qo(e)){let s=this.deserializeVariables(r),a=To(e,s),u=$o(e,a);if(u!==void 0)return u}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},No=class{interpolate(e,r){return!e||typeof e!="string"?e:new Mo({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{([^}]+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}};function ZN(t){return new Mo(t)}var Ns=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new No,this.urlBuilder=new Dn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Hi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};import*as XN from"http";import*as Ju from"https";import{URL as QE}from"url";import*as Sh from"zlib";var Fn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Do=class{settings;version;constructor(e){this.settings={...Fn,...e};try{this.version=qt("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,r,n,i){let s=Date.now(),a=new QE(e.url),u=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(m=>m.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let g={hostname:a.hostname,port:a.port||(u?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(g.headers["Accept-Encoding"]="gzip, deflate"),u&&(g.rejectUnauthorized=r.strictSSL,r.strictSSL?g.agent=Ju.globalAgent:g.agent=new Ju.Agent({rejectUnauthorized:!1})),new Promise((m,S)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",S(x);return}let C=(u?Ju:XN).request(g,async x=>{let A=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(A)){if(n>=r.maxRedirects){S(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let j=x.headers.location;if(!j){S(new Error("Redirect response missing Location header"));return}let Y=new QE(j,e.url).toString(),V=e.method;!r.followOriginalMethod&&[301,302,303].includes(A)&&(V="GET");let K={...e.headers};r.followAuthHeader||(delete K.authorization,delete K.Authorization);try{let ee=await this.executeInternal({...e,url:Y,method:V,headers:K,body:V==="GET"?void 0:e.body},r,n+1,i),k=Date.now();ee.time=k-s,m(ee)}catch(ee){S(ee)}return}let T=[];x.on("data",j=>T.push(j)),x.on("end",()=>{let j=Date.now(),Y=Buffer.concat(T),V=x.headers["content-encoding"];if(r.decompress&&V)try{V==="gzip"?Y=Sh.gunzipSync(Y):V==="deflate"&&(Y=Sh.inflateSync(Y))}catch(P){console.warn("[NodeHttpClient] Decompression failed:",P)}let K=Y.toString("utf-8"),ee;try{ee=JSON.parse(K)}catch{ee=K}let k={};for(let[P,N]of Object.entries(x.headers))(typeof N=="string"||Array.isArray(N))&&(k[P]=N);let E=this.parseCookies(x.headers["set-cookie"],a.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:k,cookies:E,body:ee,time:j-s,size:Y.length})})});if(i&&i.addEventListener("abort",()=>{C.destroy();let x=new Error("Request cancelled");x.name="AbortError",S(x)}),C.on("error",x=>{S(x)}),C.on("timeout",()=>{C.destroy(),S(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);C.write(x)}C.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(g=>g.trim()),[s,...a]=i,[u,f]=s.split("="),h={name:u.trim(),value:f?.trim()||"",domain:r};for(let g of a){let[m,S]=g.split("=");switch(m.toLowerCase().trim()){case"domain":h.domain=S?.trim();break;case"path":h.path=S?.trim();break;case"expires":h.expires=S?.trim();break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break}}return h}):[]}};function cv(t){return{timeout:t?.timeout??Fn.timeout,followRedirects:t?.followRedirects??Fn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Fn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Fn.followAuthHeader,maxRedirects:t?.maxRedirects??Fn.maxRedirects,strictSSL:t?.strictSSL??Fn.strictSSL,decompress:t?.decompress??Fn.decompress,includeCookies:t?.includeCookies??Fn.includeCookies}}var Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}async execute(e){let r=cv(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}};var Yi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},fv=class{name="logging";priority=1e3;intercept(e,r){return e}},dv=class{name="timing";priority=1;intercept(e,r,n){return e}},hv=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}};import*as Xt from"crypto";import*as kU from"querystring";import*as AR from"vm";import*as xU from"crypto";import*as Ec from"fs";import{createRequire as RU}from"module";import*as bi from"path";function np(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function PR(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}var rp=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Xa}),crypto:()=>xU,path:()=>bi,querystring:()=>qt("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>ZE(),PR),moment:()=>this.loadOptionalModule("moment",()=>XE(),np),tv4:()=>this.loadOptionalModule("tv4",()=>tC()),ajv:()=>this.loadOptionalModule("ajv",()=>OR()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>qt("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e)if(this.initializeModules(n)){this.modulesPath=n;break}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
210
|
+
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,km.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Hf.resolve(t.href,i.headers.location);return Fk(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new Dk.ResolverError((0,km.ono)(i,`Error downloading ${t.href}`),t.href)}}async function o4(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var ew=F(ts=>{"use strict";var iu=ts&&ts.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ts,"__esModule",{value:!0});ts.getNewOptions=ts.getJsonSchemaRefParserDefaultOptions=void 0;var a4=iu(d1()),l4=iu(kk()),u4=iu(Ak()),c4=iu(Tk()),f4=iu(Nk()),d4=iu(Lk()),h4=()=>({parse:{json:{...a4.default},yaml:{...l4.default},text:{...u4.default},binary:{...c4.default}},resolve:{file:{...f4.default},http:{...d4.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});ts.getJsonSchemaRefParserDefaultOptions=h4;var p4=t=>{let e=(0,ts.getJsonSchemaRefParserDefaultOptions)();return t&&Uk(e,t),e};ts.getNewOptions=p4;function Uk(t,e){if(jk(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],a=t[i];jk(s)?t[i]=Uk(a||{},s):s!==void 0&&(t[i]=s)}}return t}function jk(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var Hk=F(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.normalizeArgs=Bk;var m4=ew();function Bk(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,m4.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Am.default=Bk});var Vk=F(Xn=>{"use strict";var g4=Xn&&Xn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y4=Xn&&Xn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v4=Xn&&Xn.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&g4(r,e,n[i]);return y4(r,e),r}})(),tw=Xn&&Xn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xn,"__esModule",{value:!0});var S4=tw(Gl()),b4=tw(Tf()),_4=tw(y_()),su=v4(bn()),w4=_n();function E4(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=rw(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function rw(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),S4.default.isExternal$Ref(t)&&a.push(x4(t,e,r,n));let u=Object.keys(t);for(let f of u){let h=b4.default.join(e,f),g=t[f];a=a.concat(rw(g,h,r,n,i,s))}}return a}async function x4(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=su.resolve(i?su.cwd():e,t.$ref),a=su.stripHash(s),u=r._$refs[a];if(u)return Promise.resolve(u.value);try{let f=await(0,_4.default)(s,r,n),h=rw(f,a+"#",r,n,new Set,!0);return Promise.all(h)}catch(f){if(!n?.continueOnError||!(0,w4.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(su.stripHash(e)),f.path=su.safePointerToPath(su.getHash(e))),[]}}Xn.default=E4});var Jk=F(ei=>{"use strict";var C4=ei&&ei.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R4=ei&&ei.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I4=ei&&ei.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&C4(r,e,n[i]);return R4(r,e),r}})(),Yk=ei&&ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ei,"__esModule",{value:!0});var Tm=Yk(Gl()),Vf=Yk(Tf()),nw=I4(bn());function O4(t,e){let r=[];iw(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),P4(r)}function iw(t,e,r,n,i,s,a,u){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Tm.default.isAllowed$Ref(f))Wk(t,e,r,n,i,s,a,u);else{let h=Object.keys(f).sort((g,m)=>g==="definitions"?-1:m==="definitions"?1:g.length-m.length);for(let g of h){let m=Vf.default.join(r,g),S=Vf.default.join(n,g),E=f[g];Tm.default.isAllowed$Ref(E)?Wk(f,g,r,S,i,s,a,u):iw(f,g,m,S,i,s,a,u)}}}function Wk(t,e,r,n,i,s,a,u){let f=e===null?t:t[e],h=nw.resolve(r,f.$ref),g=a._resolve(h,n,u);if(g===null)return;let S=Vf.default.parse(n).length,E=nw.stripHash(g.path),x=nw.getHash(g.path),C=E!==a._root$Ref.path,A=Tm.default.isExtended$Ref(f);i+=g.indirections;let T=k4(s,t,e);if(T)if(S<T.depth||i<T.indirections)A4(s,T);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:S,file:E,hash:x,value:g.value,circular:g.circular,extended:A,external:C,indirections:i}),(!T||C)&&iw(g.value,null,g.path,n,i+1,s,a,u)}function P4(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),u=s.pathFromRoot.lastIndexOf("/definitions");return a!==u?u-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=Vf.default.join(n,Vf.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Tm.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function k4(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function A4(t,e){let r=t.indexOf(e);t.splice(r,1)}ei.default=O4});var Xk=F(ti=>{"use strict";var T4=ti&&ti.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),q4=ti&&ti.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$4=ti&&ti.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&T4(r,e,n[i]);return q4(r,e),r}})(),Qk=ti&&ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ti,"__esModule",{value:!0});var qm=Qk(Gl()),zk=Qk(Tf()),M4=Js(),Kk=$4(bn()),N4=_n();ti.default=D4;function D4(t,e){let r=Date.now(),n=sw(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function sw(t,e,r,n,i,s,a,u,f){let h,g={value:t,circular:!1};if(u&&u.timeoutMs&&Date.now()-f>u.timeoutMs)throw new N4.TimeoutError(u.timeoutMs);let m=u.dereference||{},S=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!S(r)){if(n.add(t),i.add(t),qm.default.isAllowed$Ref(t,u))h=Gk(t,e,r,n,i,s,a,u,f),g.circular=h.circular,g.value=h.value;else for(let E of Object.keys(t)){let x=zk.default.join(e,E),C=zk.default.join(r,E);if(S(C))continue;let A=t[E],T=!1;if(qm.default.isAllowed$Ref(A,u)){if(h=Gk(A,x,C,n,i,s,a,u,f),T=h.circular,t[E]!==h.value){let B=new Map;m?.preservedProperties&&typeof t[E]=="object"&&!Array.isArray(t[E])&&m?.preservedProperties.forEach(Y=>{Y in t[E]&&B.set(Y,t[E][Y])}),t[E]=h.value,m?.preservedProperties&&B.size&&typeof t[E]=="object"&&!Array.isArray(t[E])&&B.forEach((Y,H)=>{t[E][H]=Y}),m?.onDereference?.(A.$ref,t[E],t,E)}}else n.has(A)?T=Zk(x,a,u):(h=sw(A,x,C,n,i,s,a,u,f),T=h.circular,t[E]!==h.value&&(t[E]=h.value));g.circular=g.circular||T}n.delete(t)}return g}function Gk(t,e,r,n,i,s,a,u,f){let g=qm.default.isExternal$Ref(t)&&u?.dereference?.externalReferenceResolution==="root",m=Kk.resolve(g?Kk.cwd():e,t.$ref),S=s.get(m);if(S&&!S.circular){let B=Object.keys(t);if(B.length>1){let Y={};for(let H of B)H!=="$ref"&&!(H in S.value)&&(Y[H]=t[H]);return{circular:S.circular,value:Object.assign({},S.value,Y)}}return S}let E=a._resolve(m,e,u);if(E===null)return{circular:!1,value:null};let x=E.circular,C=x||n.has(E.value);C&&Zk(e,a,u);let A=qm.default.dereference(t,E.value);if(!C){let B=sw(A,E.path,r,n,i,s,a,u,f);C=B.circular,A=B.value}C&&!x&&u.dereference?.circular==="ignore"&&(A=t),x&&(A.$ref=r);let T={circular:C,value:A};return Object.keys(t).length===1&&s.set(m,T),T}function Zk(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw M4.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var eA=F(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});function F4(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}ow.default=F4()});var rA=F(Wf=>{"use strict";var L4=Wf&&Wf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wf,"__esModule",{value:!0});Wf.default=j4;var tA=L4(eA());function j4(t,e){if(t){e.then(function(r){(0,tA.default)(function(){t(null,r)})},function(r){(0,tA.default)(function(){t(r)})});return}else return e}});var oA=F(_e=>{"use strict";var U4=_e&&_e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B4=_e&&_e.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),H4=_e&&_e.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&U4(r,e,n[i]);return B4(r,e),r}})(),ha=_e&&_e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_e,"__esModule",{value:!0});_e.getJsonSchemaRefParserDefaultOptions=_e.jsonSchemaParserNormalizeArgs=_e.dereferenceInternal=_e.JSONParserErrorGroup=_e.isHandledError=_e.UnmatchedParserError=_e.ParserError=_e.ResolverError=_e.MissingPointerError=_e.InvalidPointerError=_e.JSONParserError=_e.UnmatchedResolverError=_e.dereference=_e.bundle=_e.resolve=_e.parse=_e.$RefParser=void 0;var nA=ha(a1()),V4=ha(y_()),Yf=ha(Hk());_e.jsonSchemaParserNormalizeArgs=Yf.default;var W4=ha(Vk()),Y4=ha(Jk()),sA=ha(Xk());_e.dereferenceInternal=sA.default;var da=H4(bn()),wn=_n();Object.defineProperty(_e,"JSONParserError",{enumerable:!0,get:function(){return wn.JSONParserError}});Object.defineProperty(_e,"InvalidPointerError",{enumerable:!0,get:function(){return wn.InvalidPointerError}});Object.defineProperty(_e,"MissingPointerError",{enumerable:!0,get:function(){return wn.MissingPointerError}});Object.defineProperty(_e,"ResolverError",{enumerable:!0,get:function(){return wn.ResolverError}});Object.defineProperty(_e,"ParserError",{enumerable:!0,get:function(){return wn.ParserError}});Object.defineProperty(_e,"UnmatchedParserError",{enumerable:!0,get:function(){return wn.UnmatchedParserError}});Object.defineProperty(_e,"UnmatchedResolverError",{enumerable:!0,get:function(){return wn.UnmatchedResolverError}});Object.defineProperty(_e,"isHandledError",{enumerable:!0,get:function(){return wn.isHandledError}});Object.defineProperty(_e,"JSONParserErrorGroup",{enumerable:!0,get:function(){return wn.JSONParserErrorGroup}});var iA=Js(),ri=ha(rA()),J4=ew();Object.defineProperty(_e,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return J4.getJsonSchemaRefParserDefaultOptions}});var Qs=class t{constructor(){this.schema=null,this.$refs=new nA.default}async parse(){let e=(0,Yf.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,iA.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,ri.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new nA.default;let n="http";if(da.isFileSystemPath(e.path))e.path=da.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=da.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=da.resolve(da.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,V4.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,ri.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,ri.default)(e.callback,Promise.resolve(this.schema));throw iA.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,wn.isHandledError)(i)?(0,ri.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[da.stripHash(e.path)]&&this.$refs._$refs[da.stripHash(e.path)].addError(i),(0,ri.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Yf.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,W4.default)(this,e.options),aw(this),(0,ri.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,ri.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Yf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Y4.default)(this,e.options),aw(this),(0,ri.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,ri.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Yf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,sA.default)(this,e.options),aw(this),(0,ri.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,ri.default)(e.callback,Promise.reject(r))}}};_e.$RefParser=Qs;_e.default=Qs;function aw(t){if(wn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new wn.JSONParserErrorGroup(t)}_e.parse=Qs.parse;_e.resolve=Qs.resolve;_e.bundle=Qs.bundle;_e.dereference=Qs.dereference});var il=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};import*as Se from"fs";import*as xe from"path";function Et(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function ut(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${Et(t)}_${e}`:e}function tv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Ku(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),u=n[a];u&&delete r[u],n[a]=i,r[i]=s}return r}function IN(t){return JSON.parse(JSON.stringify(t))}function ON(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function PN(t,e){try{return JSON.parse(t)}catch{return e}}function kN(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function AN(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}import*as it from"fs";import*as Fn from"path";var fh={preRequest:"pre-request.js",postResponse:"post-response.js"},br={collection:"collection.json",folder:"folder.json",request:"request.json"},LE={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},Gu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},dn="scripts";function dh(t){if(!it.existsSync(t))return;let e={},r=Fn.join(t,fh.preRequest);it.existsSync(r)&&(e.preRequest=it.readFileSync(r,"utf-8"));let n=Fn.join(t,fh.postResponse);return it.existsSync(n)&&(e.postResponse=it.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function hh(t,e){await it.promises.mkdir(t,{recursive:!0});let r=Fn.join(t,fh.preRequest);e.preRequest?await it.promises.writeFile(r,e.preRequest,"utf-8"):it.existsSync(r)&&await it.promises.unlink(r);let n=Fn.join(t,fh.postResponse);e.postResponse?await it.promises.writeFile(n,e.postResponse,"utf-8"):it.existsSync(n)&&await it.promises.unlink(n)}function jE(t){for(let[e,r]of Object.entries(LE)){let n=Fn.join(t,e);if(it.existsSync(n))try{let i=it.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function UE(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function BE(t,e){for(let r of Object.keys(LE))if(r!==e){let n=Fn.join(t,r);if(it.existsSync(n))try{await it.promises.unlink(n)}catch{}}}function HE(t){if(it.existsSync(t))try{let e=it.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function VE(t,e,r){let n=Fn.join(t,Gu.responseSchema),i=Fn.join(t,Gu.bodySchema);e?await it.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):it.existsSync(n)&&await it.promises.unlink(n),r?await it.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):it.existsSync(i)&&await it.promises.unlink(i)}function rv(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=rv(r.items,e);if(n)return n}}}function nv(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&nv(n.items,e))return!0}return!1}function WE(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function iv(t,e){let r;try{r=it.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===dn)continue;if(n.name===e)return Fn.join(t,n.name);let i=iv(Fn.join(t,n.name),e);if(i)return i}}function Fi(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],a=0;for(let S of s){let E=parseInt(S.substring(1));E>a&&(a=E)}let u="";if(a>0)u=`t${a}`;else{let S=r.match(/[_\s-](\d+\.\d+)[_\s-]/);S&&(u=`v${S[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let h=f.split("-").filter(S=>S.length>0),g=[];i&&g.push(i),g.push(...h),u&&g.push(u);let m=g.join("-");if(m||(m="item"),e.includes(m)){let S=2;for(;e.includes(`${m}-${S}`);)S++;m=`${m}-${S}`}return m}var Cs=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){Se.existsSync(this.collectionsDir)||Se.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Se.existsSync(this.collectionsDir))return[];let e=Se.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=xe.join(this.collectionsDir,e),n=xe.join(r,br.collection);if(Se.existsSync(n))try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(r,dn)),u=this.loadItemsFromDir(r,s.id,s.order);return{id:s.id,name:s.name,description:s.description,version:s.version,variables:s.variables,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,i);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=Se.readdirSync(e,{withFileTypes:!0});for(let u of a){if(!u.isDirectory()||u.name===dn)continue;let f=xe.join(e,u.name);if(Se.existsSync(xe.join(f,br.folder))){let h=this.loadFolderFromDir(f,u.name);h&&s.set(u.name,h)}else if(Se.existsSync(xe.join(f,br.request))){let h=this.loadRequestFromDir(f,u.name);h&&s.set(u.name,h)}}if(n&&n.length>0){for(let u of n){let f=s.get(u);f&&(i.push(f),s.delete(u))}for(let u of s.values())i.push(u)}else for(let u of s.values())i.push(u);return i}loadFolderFromDir(e,r){let n=xe.join(e,br.folder);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(e,dn)),u=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"folder",name:s.name,description:s.description,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,i);return}}loadRequestFromDir(e,r){let n=xe.join(e,br.request);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(e,dn)),u=s.body,f=this.loadBodyFromDir(e);f&&(u=f);let h=this.loadSchemaFile(xe.join(e,Gu.responseSchema)),g=this.loadSchemaFile(xe.join(e,Gu.bodySchema)),m=xe.join(e,"doc.md"),S=Se.existsSync(m)?Se.readFileSync(m,"utf-8"):void 0;return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"request",name:s.name,description:s.description,method:s.method,url:s.url,params:s.params,query:s.query,headers:s.headers,body:u,auth:s.auth,settings:s.settings,scripts:a,deprecated:s.deprecated,...S&&{doc:S},...h&&{responseSchema:h},...g&&{bodySchema:g}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return dh(e)}loadBodyFromDir(e){return jE(e)}loadSchemaFile(e){return HE(e)}async saveSchemaFiles(e,r){return VE(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=ut(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=Se.readdirSync(this.collectionsDir);r=Fi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=xe.join(this.collectionsDir,r);await Se.promises.mkdir(n,{recursive:!0});let i={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth};await Se.promises.writeFile(xe.join(n,br.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(xe.join(n,dn),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await Se.promises.writeFile(xe.join(n,br.collection),JSON.stringify(i,null,2),"utf-8")),this.cache.set(e.id,e)}async saveItemsToDir(e,r){let n=[];for(let i of r){let s=this.idToSlugMap.get(i.id);s||(s=Fi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=xe.join(e,s);await Se.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}return n}async saveFolderToDir(e,r){let n={id:r.id,name:r.name,description:r.description,auth:r.auth};if(await Se.promises.writeFile(xe.join(e,br.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(xe.join(e,dn),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await Se.promises.writeFile(xe.join(e,br.folder),JSON.stringify(n,null,2),"utf-8"))}}async saveRequestToDir(e,r){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(r.body),s={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:n,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}};await Se.promises.writeFile(xe.join(e,br.request),JSON.stringify(s,null,2),"utf-8"),i&&await Se.promises.writeFile(xe.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await Se.promises.writeFile(xe.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(xe.join(e,dn),r.scripts)}prepareBodyForSave(e){return UE(e)}async cleanupOldBodyFiles(e,r){return BE(e,r)}async saveScriptsToDir(e,r){return hh(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=xe.join(this.collectionsDir,r);if(!Se.existsSync(n))return!1;try{return await Se.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?Se.existsSync(xe.join(this.collectionsDir,r,br.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return xe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||ut(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(xe.join(s,dn),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(xe.join(n,dn))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=xe.join(this.collectionsDir,i),a=xe.join(s,br.collection),u=Se.readFileSync(a,"utf-8"),h={...JSON.parse(u),...r,id:e};await Se.promises.writeFile(a,JSON.stringify(h,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let g=this.findItemPath(e,n);if(!g)throw new Error(`Parent folder ${n} not found`);a=g}else a=xe.join(this.collectionsDir,s);let u=this.idToSlugMap.get(r.id);if(!u){let g=Se.readdirSync(a).filter(m=>Se.statSync(xe.join(a,m)).isDirectory()&&m!==dn);u=Fi(r.name,g),this.idToSlugMap.set(r.id,u),this.slugToIdMap.set(u,r.id)}let f=xe.join(a,u);await Se.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let h=this.findItemById(i.items,r.id);if(h)Object.assign(h,r);else if(n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!Se.existsSync(i))return!1;try{await Se.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let a=this.findItemById(i.items,r);if(!a)return!1;let{id:u,type:f,items:h,...g}=n;return Object.assign(a,g),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,r);if(!a||!Se.existsSync(a))return!1;let u;if(n){let g=this.findItemPath(e,n);if(!g)return!1;u=g}else u=xe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let h=xe.join(u,f);if(Se.existsSync(h))return!1;try{await Se.promises.rename(a,h);let g=this.findItemById(i.items,r);if(g){let m=g.type==="folder"?{...g,items:g.items?[...g.items]:[]}:{...g};if(this.deleteItemFromTree(i.items,r),n){let S=this.findItemById(i.items,n);S&&S.type==="folder"&&(S.items=S.items||[],S.items.push(m))}else i.items.push(m)}return!0}catch(g){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,g),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let u of n){let f=this.idToSlugMap.get(u);f&&a.push(f)}try{if(r){let u=this.findItemPath(e,r);if(!u)return!1;let f=xe.join(u,br.folder),h=Se.readFileSync(f,"utf-8"),g=JSON.parse(h);g.order=a,await Se.promises.writeFile(f,JSON.stringify(g,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let u=xe.join(this.collectionsDir,s,br.collection),f=Se.readFileSync(u,"utf-8"),h=JSON.parse(f);h.order=a,await Se.promises.writeFile(u,JSON.stringify(h,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(u){return console.error("[FolderCollectionStore] Failed to reorder items:",u),!1}}sortItemsByOrder(e,r){return WE(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return iv(xe.join(this.collectionsDir,n),i)}findItemById(e,r){return rv(e,r)}deleteItemFromTree(e,r){return nv(e,r)}};function sv(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(YE),source:{format:"folder",filePath:e,version:t.version}}}function YE(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(YE)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function TN(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(ov)}}function ov(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(ov)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var Qu=class{store;constructor(e){this.store=new Cs(e)}loadAll(){return this.store.loadAll().map(r=>sv(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return sv(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return sv(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(TN(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,ov(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var Zu=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};var ct=class{static parseSetCookie(e,r){let n=e.split(";").map(g=>g.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let u=i.substring(0,a).trim(),f=i.substring(a+1).trim(),h={name:u,value:f,domain:r};for(let g of s){let m=g.indexOf("="),S=(m===-1?g:g.substring(0,m)).toLowerCase(),E=m===-1?"":g.substring(m+1);switch(S){case"domain":h.domain=E.startsWith(".")?E.substring(1):E;break;case"path":h.path=E;break;case"expires":h.expires=E;break;case"max-age":h.maxAge=parseInt(E,10);break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break;case"samesite":h.sameSite=E;break}}return h}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let u=this.parseSetCookie(a,r);u&&n.push(u)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}};var Xu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ct.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return ct.parseCookieHeaders(e,r)}isExpired(e){return ct.isExpired(e)}domainMatches(e,r){return ct.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};import*as Rs from"fs";import*as Ao from"path";function mh(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function ec(t){if(!Rs.existsSync(t))return qN();let e=ph(Ao.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Rs.readdirSync(t).filter(h=>h.endsWith(".json")).filter(h=>!h.endsWith(".local.json")).filter(h=>!mh(h)),s={};for(let h of i){let g=ph(Ao.join(t,h))||{},m=Ao.basename(h,".json");s[m]={description:g.description,requiresConfirmation:g.requiresConfirmation,variables:g.variables||{}}}let u=(ph(Ao.join(t,"_global.local.json"))||{}).variables||{},f={};for(let h of Object.keys(s)){let g=Ao.join(t,`${h}.local.json`);if(Rs.existsSync(g)){let m=ph(g)||{};f[h]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:u,localCredentials:f}}function qN(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function ph(t){try{if(!Rs.existsSync(t))return null;let e=Rs.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var Li=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};var Ln=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",u=e.indexOf("?");u!==-1&&(a=e.substring(u),s=e.substring(0,u));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let h=/:(\w+)(?:\([^)]*\))?(\?)?/g,g=s.replace(h,(m,S,E)=>{let x=r[S];return x!==void 0&&x!==""?encodeURIComponent(x):E?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${S}`),m)});return g=g.replace(/([^:])\/+/g,"$1/"),g.length>1&&g.endsWith("/")&&(g=g.slice(0,-1)),`${n}${i}${g}${a}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,h]=e.split("?");n=f,h&&new URLSearchParams(h).forEach((m,S)=>{i[S]=m})}let s={...i,...r},a=new URLSearchParams;for(let[f,h]of Object.entries(s))h!=null&&a.append(f,h);let u=a.toString();return u?`${n}?${u}`:n}};var zt=[];for(let t=0;t<256;++t)zt.push((t+256).toString(16).slice(1));function JE(t,e=0){return(zt[t[e+0]]+zt[t[e+1]]+zt[t[e+2]]+zt[t[e+3]]+"-"+zt[t[e+4]]+zt[t[e+5]]+"-"+zt[t[e+6]]+zt[t[e+7]]+"-"+zt[t[e+8]]+zt[t[e+9]]+"-"+zt[t[e+10]]+zt[t[e+11]]+zt[t[e+12]]+zt[t[e+13]]+zt[t[e+14]]+zt[t[e+15]]).toLowerCase()}var $N=new Uint8Array(16);function av(){return crypto.getRandomValues($N)}function MN(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():NN(t,e,r)}function NN(t,e,r){t=t||{};let n=t.random??t.rng?.()??av();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return JE(n)}var sl=MN;function DN(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function FN(){return Date.now()}function zE(){return sl()}function LN(){return sl()}function KE(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function jN(){let t=KE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function UN(){return Math.random()<.5}function BN(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function HN(){return Math.floor(Date.now()/1e3)}function VN(){return new Date().toISOString()}function WN(){return new Date().toISOString().split("T")[0]}function YN(){return new Date().toISOString().split("T")[1].split(".")[0]}function JN(){return new Date().toISOString()}function zN(t=""){return Buffer.from(String(t)).toString("base64")}function KN(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function GN(t=""){return encodeURIComponent(String(t))}function QN(t=""){return decodeURIComponent(String(t))}var GE={randomInt:DN,timestamp:FN,guid:LN,uuid:zE,randomUUID:zE,randomString:KE,randomHexadecimal:BN,randomEmail:jN,randomBoolean:UN,isoTimestamp:JN,timestamp_s:HN,datetime:VN,date:WN,time:YN,base64Encode:zN,base64Decode:KN,urlEncode:GN,urlDecode:QN};function ZN(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function ji(t,e){let r=GE[t];return r?e&&e.length>0?r(...e):r():null}function XN(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?ZN(n):void 0,s=ji(r,i);return s===null?e:String(s)}catch{return e}})}function To(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],a=i[1];if(!(s in e)){let u=ji(a);u!==null&&(n||(n={...e}),n[s]=u)}}return n??e}import*as gh from"vm";var eD=100;function qo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function $o(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=gh.createContext(r);return gh.runInContext(t,n,{timeout:eD,displayErrors:!1})}catch{return}}import*as yh from"crypto";function tD(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function rc(t){if(!t||!t.includes("|"))return null;let e=rD(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=nD(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function rD(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let u=t[a],f=a>0?t[a-1]:"",h=a<t.length-1?t[a+1]:"";if(f==="\\"){r+=u;continue}if(u==="'"&&!s)i=!i;else if(u==='"'&&!i)s=!s;else if(u==="("&&!i&&!s)n++;else if(u===")"&&!i&&!s)n--;else if(u==="|"&&n===0&&!i&&!s){if(h==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=u}return r&&e.push(r),e}function nD(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:iD(n)}}function iD(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function xt(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=tD(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function nc(t,e,r={}){let n=t;for(let i of e)n=sD(n,i.name,i.args,r);return n}function sD(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=xt(r[0],n),s=r[1]!==void 0?xt(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(xt(r[0],n)):"",s=r[1]!==void 0?String(xt(r[1],n)):"";return String(t).replace(new RegExp(aD(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(xt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(xt(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(xt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=xt(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=xt(r[0],n);return Number(t)+i}case"subtract":{let i=xt(r[0],n);return Number(t)-i}case"multiply":{let i=xt(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?xt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?xt(r[1],n):"base64"),u={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return yh.createHash(u).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(xt(r[0],n)):"",s=String(r[1]!==void 0?xt(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?xt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return yh.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=xt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=xt(r[0],n),s=r[1]!==void 0?xt(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:oD(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(xt(s,n)));return i.length===1?t.map(s=>tc(s,i[0])):t.map(s=>{let a={};for(let u of i){let f=tc(s,u);f!==void 0&&(a[u]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(xt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>tc(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?tc(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function oD(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,u=xt(a,r);return t.filter(f=>{let h=tc(f,i);if(h===void 0)return!1;switch(s){case">":return Number(h)>Number(u);case">=":return Number(h)>=Number(u);case"<":return Number(h)<Number(u);case"<=":return Number(h)<=Number(u);case"=":return String(h)===String(u);case"!=":return String(h)!==String(u);case"*=":return String(h).includes(String(u));case"^=":return String(h).startsWith(String(u));case"$=":return String(h).endsWith(String(u));default:return!0}})}function tc(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function aD(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function QE(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}var Mo=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{([^}]+)\}\}/g,(u,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,u));let n="",i=0,s=/\{\{([^}]+)\}\}/g,a;for(;(a=s.exec(e))!==null;){let u=a[1].trim(),f=this.resolveTemplateContent(u,this.allVariables,a[0]);if(f!==a[0]){n+=e.slice(i,a.index);let h=this.getStringContext(e,a.index);n+=h?this.escapeForString(String(f),h):String(f)}else n+=e.slice(i,a.index+a[0].length);i=a.index+a[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{([^}]+)\}\}/g,(h,g)=>this.resolveTemplateContent(g.trim(),i,h));let s="",a=0,u=/\{\{([^}]+)\}\}/g,f;for(;(f=u.exec(e))!==null;){let h=f[1].trim(),g=this.resolveTemplateContent(h,i,f[0]);if(g!==f[0]){s+=e.slice(a,f.index);let m=this.getStringContext(e,f.index);s+=m?this.escapeForString(String(g),m):String(g)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let u=QE(i[2],r),f=ji(i[1],u);return f!==null?String(f):n}let s=rc(e);if(s){let u=this.resolveFilterInput(s.input,r);if(u!==void 0){let f=nc(u,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let u=a[1];if(r[u]!==void 0){let f=this.deserializeValue(r[u]),h=a[2],g=this.resolvePropertyAccess(f,h);if(g!==void 0)return typeof g=="object"?JSON.stringify(g):String(g)}}if(r[e]!==void 0){let u=r[e];return typeof u=="string"&&u.charCodeAt(0)===30?u.slice(1):String(u)}if(qo(e)){let u=this.deserializeVariables(r),f=To(e,u),h=$o(e,f);if(h!==void 0)return String(h)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=QE(n[2],r),a=ji(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let a=this.deserializeValue(r[s]),u=this.resolvePropertyAccess(a,i[2]);if(u!==void 0)return u}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(qo(e)){let s=this.deserializeVariables(r),a=To(e,s),u=$o(e,a);if(u!==void 0)return u}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},No=class{interpolate(e,r){return!e||typeof e!="string"?e:new Mo({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{([^}]+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}};function lD(t){return new Mo(t)}var Is=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new No,this.urlBuilder=new Ln}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Li.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};import*as uD from"http";import*as ic from"https";import{URL as ZE}from"url";import*as vh from"zlib";var jn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Do=class{settings;version;constructor(e){this.settings={...jn,...e};try{this.version=kt("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,r,n,i){let s=Date.now(),a=new ZE(e.url),u=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(m=>m.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let g={hostname:a.hostname,port:a.port||(u?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(g.headers["Accept-Encoding"]="gzip, deflate"),u&&(g.rejectUnauthorized=r.strictSSL,r.strictSSL?g.agent=ic.globalAgent:g.agent=new ic.Agent({rejectUnauthorized:!1})),new Promise((m,S)=>{if(i?.aborted){let C=new Error("Request cancelled");C.name="AbortError",S(C);return}let x=(u?ic:uD).request(g,async C=>{let A=C.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(A)){if(n>=r.maxRedirects){S(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let B=C.headers.location;if(!B){S(new Error("Redirect response missing Location header"));return}let Y=new ZE(B,e.url).toString(),H=e.method;!r.followOriginalMethod&&[301,302,303].includes(A)&&(H="GET");let K={...e.headers};r.followAuthHeader||(delete K.authorization,delete K.Authorization);try{let X=await this.executeInternal({...e,url:Y,method:H,headers:K,body:H==="GET"?void 0:e.body},r,n+1,i),k=Date.now();X.time=k-s,m(X)}catch(X){S(X)}return}let T=[];C.on("data",B=>T.push(B)),C.on("end",()=>{let B=Date.now(),Y=Buffer.concat(T),H=C.headers["content-encoding"];if(r.decompress&&H)try{H==="gzip"?Y=vh.gunzipSync(Y):H==="deflate"&&(Y=vh.inflateSync(Y))}catch(P){console.warn("[NodeHttpClient] Decompression failed:",P)}let K=Y.toString("utf-8"),X;try{X=JSON.parse(K)}catch{X=K}let k={};for(let[P,N]of Object.entries(C.headers))(typeof N=="string"||Array.isArray(N))&&(k[P]=N);let w=this.parseCookies(C.headers["set-cookie"],a.hostname);m({status:C.statusCode||0,statusText:C.statusMessage||"",headers:k,cookies:w,body:X,time:B-s,size:Y.length})})});if(i&&i.addEventListener("abort",()=>{x.destroy();let C=new Error("Request cancelled");C.name="AbortError",S(C)}),x.on("error",C=>{S(C)}),x.on("timeout",()=>{x.destroy(),S(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let C=typeof e.body=="string"?e.body:JSON.stringify(e.body);x.write(C)}x.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(g=>g.trim()),[s,...a]=i,[u,f]=s.split("="),h={name:u.trim(),value:f?.trim()||"",domain:r};for(let g of a){let[m,S]=g.split("=");switch(m.toLowerCase().trim()){case"domain":h.domain=S?.trim();break;case"path":h.path=S?.trim();break;case"expires":h.expires=S?.trim();break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break}}return h}):[]}};function lv(t){return{timeout:t?.timeout??jn.timeout,followRedirects:t?.followRedirects??jn.followRedirects,followOriginalMethod:t?.followOriginalMethod??jn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??jn.followAuthHeader,maxRedirects:t?.maxRedirects??jn.maxRedirects,strictSSL:t?.strictSSL??jn.strictSSL,decompress:t?.decompress??jn.decompress,includeCookies:t?.includeCookies??jn.includeCookies}}var Ui=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=lv(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}};var Bi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},uv=class{name="logging";priority=1e3;intercept(e,r){return e}},cv=class{name="timing";priority=1;intercept(e,r,n){return e}},fv=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}};import*as Qt from"crypto";import*as XU from"querystring";import*as DR from"vm";import*as zU from"crypto";import*as $c from"fs";import{createRequire as KU}from"module";import*as gi from"path";function ep(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function MR(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}var Xh=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:sl}),crypto:()=>zU,path:()=>gi,querystring:()=>kt("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>XE(),MR),moment:()=>this.loadOptionalModule("moment",()=>ex(),ep),tv4:()=>this.loadOptionalModule("tv4",()=>rx()),ajv:()=>this.loadOptionalModule("ajv",()=>$R()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>kt("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e)if(this.initializeModules(n)){this.modulesPath=n;break}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
211
211
|
${this.getModuleInstallInstructions(e)}`)}getModuleInstallInstructions(e){let n={moment:"^2.30.1",lodash:"^4.17.21",tv4:"^1.3.0",ajv:"^8.17.1"}[e]||"latest";return`To use ${e}, add it to http-forge/modules/package.json:
|
|
212
212
|
{
|
|
213
213
|
"dependencies": {
|
|
214
214
|
"${e}": "${n}"
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=
|
|
218
|
-
Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let r=this.getAvailableModules(),n=[];for(let i of r)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,r,n,i){this.moduleCache.set(e,{module:r,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}};function
|
|
217
|
+
Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=gi.join(e,"package.json");return $c.existsSync(r)?(this.customModulesRequire=KU(r),this.loadAvailableModules(e),this.loadGlobalSetup(e),this.logDebug(`Module loader initialized with ${this.availableModules.size} workspace modules`),!0):(this.logDebug(`No modules/package.json found at ${e}`),!1)}catch(r){return console.error("Failed to initialize modules:",r),!1}}loadAvailableModules(e){try{let r=gi.join(e,"package.json"),n=$c.readFileSync(r,"utf-8"),i=JSON.parse(n);if(typeof i!="object"||i===null)throw new Error("Invalid package.json: must be an object");let s=i.dependencies||{},a=i.devDependencies||{};if(typeof s!="object"||typeof a!="object")throw new Error("Invalid dependencies in package.json");Object.keys(s).forEach(u=>{typeof u=="string"&&u.trim()&&this.availableModules.add(u.trim())}),Object.keys(a).forEach(u=>{typeof u=="string"&&u.trim()&&this.availableModules.add(u.trim())}),this.logDebug(`Loaded ${this.availableModules.size} modules from package.json`)}catch(r){let n=`Failed to load workspace modules from package.json: ${r instanceof Error?r.message:r}`;this.logError(n)}}loadGlobalSetup(e){let r=gi.join(e,"global-setup.js");if($c.existsSync(r))try{this.customModulesRequire&&(this.globalSetupExports=this.customModulesRequire("./global-setup.js"))}catch(n){console.error("Failed to load global-setup.js:",n),this.globalSetupExports=void 0}}createRequireFunction(){return e=>{let r=Date.now();try{if(this.resolveStack.has(e))throw new Error(`Circular dependency detected: ${Array.from(this.resolveStack).join(" -> ")} -> ${e}`);if(this.resolveStack.size>=this.options.maxResolveDepth)throw new Error(`Maximum module resolve depth (${this.options.maxResolveDepth}) exceeded`);this.resolveStack.add(e);let n=this.moduleCache.get(e);if(n)return this.logDebug(`Module cache hit: ${e}`),n.module;if(this.builtinModules[e]){this.logDebug(`Loading built-in module: ${e}`);let a=this.builtinModules[e]();return this.cacheModule(e,a,"builtin",Date.now()-r),a}if(!this.modulesPath)throw new Error("Module loading is not initialized. No valid modules/ directory found. Create http-forge-assets/modules/package.json first.");if(e.startsWith("./")||e.startsWith("../")){if(!this.customModulesRequire)throw new Error(`Cannot load local module '${e}': No modules/ folder found. Create http-forge-assets/modules/package.json first.`);let a=gi.resolve(this.modulesPath,e),u=gi.normalize(a),f=gi.normalize(this.modulesPath);if(!u.startsWith(f))throw new Error(`Security violation: Attempt to load module outside modules directory: ${e}`);try{this.logDebug(`Loading relative module: ${e}`);let h=this.customModulesRequire(e);return this.cacheModule(e,h,"relative",Date.now()-r),h}catch(h){throw new Error(`Failed to load local module '${e}': ${h.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let a=this.customModulesRequire(e);return this.cacheModule(e,a,"workspace",Date.now()-r),a}catch(a){throw new Error(`Module '${e}' is in package.json but failed to load: ${a.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
|
|
218
|
+
Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let r=this.getAvailableModules(),n=[];for(let i of r)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,r,n,i){this.moduleCache.set(e,{module:r,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}};function ZS(t,e){return new Xh(t,e)}import*as rb from"vm";function GU(t){let e={...t};return e.get=r=>{let n=r.toLowerCase();for(let[i,s]of Object.entries(t))if(i.toLowerCase()===n)return s},e.has=r=>{let n=r.toLowerCase();return Object.keys(t).some(i=>i.toLowerCase()===n)},e.toObject=()=>({...t}),e.each=r=>{for(let[n,i]of Object.entries(t))r({key:n,value:i})},e}function XS(t){let e=GU(t.headers);return{status:t.status,code:t.status,statusText:t.statusText,headers:e,body:t.body,cookies:t.cookies||{},responseTime:t.responseTime,responseSize:t.responseSize,getHeader(r){let n=r.toLowerCase();for(let[i,s]of Object.entries(t.headers))if(i.toLowerCase()===n)return s},getCookie(r){return t.cookies?.[r]},reason(){return this.statusText},json(){if(typeof this.body=="object")return this.body;try{return JSON.parse(this.body)}catch{return null}},text(){return typeof this.body=="string"?this.body:JSON.stringify(this.body)},cookie(r){return this.cookies?.[r]},hasCookie(r){return this.cookies?r in this.cookies:!1},to:{have:{status(r){if(t.status!==r)throw new Error(`Expected status ${r} but got ${t.status}`)},header(r,n){let i=t.headers[r]||t.headers[r.toLowerCase()];if(!i)throw new Error(`Expected header "${r}" to exist`);if(n!==void 0&&i!==n)throw new Error(`Expected header "${r}" to be "${n}" but got "${i}"`)},body(r){let n=typeof t.body=="string"?t.body:JSON.stringify(t.body);if(r!==void 0&&n!==r)throw new Error(`Expected body to be "${r}" but got "${n}"`)},jsonBody(r){let n=typeof t.body=="object"?t.body:JSON.parse(t.body);if(r!==void 0&&JSON.stringify(n)!==JSON.stringify(r))throw new Error("Expected JSON body to match")}},be:{get ok(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be OK (2xx) but got ${t.status}`);return(()=>{})},get success(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be successful (2xx) but got ${t.status}`);return(()=>{})},get error(){if(t.status<400)throw new Error(`Expected response to be error (4xx/5xx) but got ${t.status}`);return(()=>{})},get clientError(){if(t.status<400||t.status>=500)throw new Error(`Expected response to be client error (4xx) but got ${t.status}`);return(()=>{})},get serverError(){if(t.status<500||t.status>=600)throw new Error(`Expected response to be server error (5xx) but got ${t.status}`);return(()=>{})}}}}}function Mc(t){return{_value:t,_negated:!1,_deep:!1,get not(){return this._negated=!this._negated,this},get to(){return this},get be(){return this},get have(){return this},get deep(){return this._deep=!0,this},_assert(r,n){if(!(this._negated?!r:r))throw new Error(n)},equal(r){return this._deep?(this._deep=!1,this.eql(r)):(this._assert(this._value===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}equal ${JSON.stringify(r)}`),this)},eql(r){let n=JSON.stringify(this._value)===JSON.stringify(r);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}deeply equal ${JSON.stringify(r)}`),this},property(r,n){let i=typeof this._value=="object"&&this._value!==null&&r in this._value;return n!==void 0?this._assert(i&&this._value[r]===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}" with value ${JSON.stringify(n)}`):this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}"`),this},get ok(){return this._assert(!!this._value,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be truthy`),this},get exist(){return this._assert(this._value!==null&&this._value!==void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}exist`),this},include(r){let n=!1;return typeof this._value=="string"?n=this._value.includes(r):Array.isArray(this._value)?n=this._value.includes(r):typeof this._value=="object"&&this._value!==null&&(n=r in this._value),this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}include ${JSON.stringify(r)}`),this},oneOf(r){let n=Array.isArray(r)&&r.includes(this._value);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be one of ${JSON.stringify(r)}`),this},match(r){let n=r.test(String(this._value));return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}match ${r}`),this},above(r){return this._assert(Number(this._value)>r,`Expected ${this._value} to ${this._negated?"not ":""}be above ${r}`),this},below(r){return this._assert(Number(this._value)<r,`Expected ${this._value} to ${this._negated?"not ":""}be below ${r}`),this},greaterThan(r){return this.above(r)},lessThan(r){return this.below(r)},within(r,n){let i=Number(this._value);return this._assert(i>=r&&i<=n,`Expected ${this._value} to ${this._negated?"not ":""}be within ${r}..${n}`),this},get true(){return this._assert(this._value===!0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be true`),this},get false(){return this._assert(this._value===!1,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be false`),this},get null(){return this._assert(this._value===null,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be null`),this},get undefined(){return this._assert(this._value===void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be undefined`),this},get empty(){let r=!1;return this._value===null||this._value===void 0?r=!0:typeof this._value=="string"||Array.isArray(this._value)?r=this._value.length===0:typeof this._value=="object"&&(r=Object.keys(this._value).length===0),this._assert(r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be empty`),this},length(r){let n=Array.isArray(this._value)||typeof this._value=="string"?this._value.length:Object.keys(this._value||{}).length;return this._assert(n===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have length ${r}`),this},lengthOf(r){return this.length(r)},a(r){let n=Array.isArray(this._value)?"array":typeof this._value;return this._assert(n===r.toLowerCase(),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be a(n) ${r} (got ${n})`),this},an(r){return this.a(r)},members(r){let n=this._value,i=Array.isArray(n)&&Array.isArray(r)&&r.every(s=>n.some(a=>JSON.stringify(a)===JSON.stringify(s)));return this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have members ${JSON.stringify(r)}`),this},keys(...r){let n=Array.isArray(r[0])?r[0]:r,i=Object.keys(this._value||{}),s=n.every(a=>i.includes(a));return this._assert(s,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have keys ${JSON.stringify(n)}`),this},string(r){return this._assert(typeof this._value=="string"&&this._value.includes(r),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}contain string "${r}"`),this}}}function tp(t){return typeof t=="string"?t:t.filter(e=>e&&e.trim()).join(`
|
|
219
219
|
|
|
220
220
|
// --- Next Script ---
|
|
221
221
|
|
|
222
|
-
`)}function xc(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function sp(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function OU(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function tb(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{t.push({name:n,passed:!0})},u=>{t.push({name:n,passed:!1,message:u.message||String(u)})});e.push(a)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r._pendingTests=e,r}function rb(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function PU(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var Rc=class{constructor(e,r){this.deps=e;this.initialContext=r;this.initializeSession()}vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:u=>e.cookieJar?e.cookieJar.get(u,i)?.value:void 0,set:(u,f)=>{e.cookieJar&&e.cookieJar.set({name:u,value:f,domain:i})},has:u=>e.cookieJar?e.cookieJar.has(u,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(u=>({name:u.name,value:u.value})):[],toObject:()=>{if(!e.cookieJar)return{};let u=e.cookieJar.getAll(i),f={};for(let h of u)f[h.name]=h.value;return f},jar:()=>{let u=e.cookieJar;return{getAll(f,h){try{if(!u){h(null,[]);return}let g=u.getAll(f).map(m=>({name:m.name,value:m.value,domain:m.domain,path:m.path,httpOnly:m.httpOnly,secure:m.secure}));h(null,g)}catch(g){h(g,[])}},get(f,h,g){try{if(!u){g(null,void 0);return}let m=u.get(h,f);g(null,m?{name:m.name,value:m.value,domain:m.domain}:void 0)}catch(m){g(m,void 0)}},set(f,h,g,m){try{if(!u){(m||g)?.(null);return}typeof h=="string"&&typeof g=="string"?(u.set({name:h,value:g,domain:f}),m?.(null)):typeof h=="object"&&(u.set({...h,domain:f}),g?.(null))}catch(S){(m||g)?.(S)}},unset(f,h,g){try{if(!u){g?.(null);return}u.delete(h,f),g?.(null)}catch(m){g?.(m)}},clear(f){try{if(!u){f?.(null);return}u.clear(),f?.(null)}catch(h){f?.(h)}}}},remove:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},unset:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(r,e),response:null,test:tb(this.assertions),expect:Cc,cookies:s,execution:{setNextRequest(u){a._nextRequest=u},skipRequest(){a._skipRequest=!0},location:n.info?.requestName||""},setNextRequest(u){a._nextRequest=u},visualizer:{set(u,f){a._visualizerData={template:u,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:u=>{u&&u.key&&(e.headers[u.key]=u.value||"")},get:u=>{for(let[f,h]of Object.entries(e.headers))if(f.toLowerCase()===u.toLowerCase())return h},has:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase())return!0;return!1},remove:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase()){delete e.headers[f];break}},update:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}}},upsert:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}e.headers[u.key]=u.value||""}},toObject:()=>{let u={};for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&(u[f]=h);return u},each:u=>{for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&u({key:f,value:h})}},a={get mode(){return n(e.body?.type)},set mode(u){let f=i(u);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let u=e.body?.content;return typeof u=="string"?u:u&&typeof u=="object"?JSON.stringify(u):""},set raw(u){e.body?(e.body.type="raw",e.body.content=u):e.body={type:"raw",content:u}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return PU(e.url)},set url(u){e.url=typeof u=="string"?u:String(u)},get method(){return e.method},set method(u){e.method=u},headers:s,get body(){return a},set body(u){if(u==null)e.body=null;else if(typeof u=="string")e.body={type:"raw",content:u};else if(typeof u=="object")if(u.type||u.mode||u.content!==void 0){let f=u.mode?i(u.mode):u.type||"raw";e.body={type:f,format:u.format,content:u.content}}else e.body={type:"raw",content:u}},get params(){return e.params||{}},set params(u){e.params=u||{}},get query(){return e.query||{}},set query(u){e.query=u||{}},get auth(){return r.request?.auth||null},set auth(u){r.request&&(r.request.auth=u)},get certificate(){return r.request?.certificate||null},set certificate(u){r.request&&(r.request.certificate=u)},get description(){return r.request?.description||null},set description(u){r.request&&(r.request.description=u)},get name(){return r.request?.name||null},set name(u){r.request&&(r.request.name=u)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(u){r.request&&(r.request.disabled=u)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(u){let f={};for(let[h,g]of Object.entries(e.headers))typeof g=="string"&&(f[h]=g);return f},addQueryParams(u){if(typeof u=="string"){let f=new URLSearchParams(u);for(let[h,g]of f)e.query||(e.query={}),e.query[h]=g}else Array.isArray(u)&&(e.query||(e.query={}),u.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(u){e.query&&(typeof u=="string"?delete e.query[u]:Array.isArray(u)&&u.forEach(f=>{let h=typeof f=="string"?f:f.key;h&&delete e.query[h]}))},authorizeUsing(u,f){r.request&&(typeof u=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=u,f&&(r.request.auth.parameters=f)):typeof u=="object"&&(r.request.auth=u))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(u,f){r.request&&(r.request.description={content:u,type:f||"text/plain"})},setHeader(u,f){e.headers[u]=f},removeHeader(u){delete e.headers[u]},setBody(u,f,h){e.body={type:f||e.body?.type||"raw",format:h||e.body?.format,content:u}}}}async executePreRequest(e){let r=ip(e);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r);nb.runInContext(n,this.vmContext,{timeout:5e3});let i=sp(this.consoleMessages),s=this.initialContext.request.body,a=!this.bodiesEqual(this.modifiedRequest.body,s);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:xc(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:xc(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:xc(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:i.length>0?i:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:[`[error] Script execution failed: ${n.message}`],modifiedVariables:this.ctx?.variables?.toObject(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=ip(e);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=eb(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(u,f,h){return i.assertions.push({name:String(f),passed:!!h,message:h?void 0:`"${String(f)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n);nb.runInContext(s,this.vmContext,{timeout:5e3}),this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0);let a=sp(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:a.length>0?a:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){return this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"}),{testResults:[...this.assertions],consoleOutput:[`[error] Script execution failed: ${i.message}`],modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.vmContext=null,this.ctx=null,this.assertions=[]}};function TR(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function qR(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function AU(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=TR(r[2],e),i=Vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return qR(e[t]);if(qo(t)){let n=To(t,e),i=$o(t,n);if(i!==void 0)return i}}var Fe=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};function kR(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)a=Xt.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let u=Buffer.concat(s);return{key:u.subarray(0,e),iv:u.subarray(e,e+r)}}function ib(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,a){let u=i instanceof Fe?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=Xt.randomBytes(8),{key:h,iv:g}=kR(s,e,r,f),m=Xt.createCipheriv(n(e),h,g),S=Buffer.concat([m.update(u),m.final()]),_=Buffer.concat([Buffer.from("Salted__"),f,S]);return{ciphertext:new Fe(S),salt:new Fe(f),toString:C=>C?C.stringify(new Fe(_)):_.toString("base64")}}else{let f=s.toBuffer(),h=a?.iv&&a.iv instanceof Fe?a.iv.toBuffer():Buffer.alloc(r),g=Xt.createCipheriv(n(f.length),f,h);a?.padding===!1&&g.setAutoPadding(!1);let m=Buffer.concat([g.update(u),g.final()]);return{ciphertext:new Fe(m),toString:S=>S?S.stringify(new Fe(m)):m.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let u=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,h;u.subarray(0,8).toString()==="Salted__"?(h=u.subarray(8,16),f=u.subarray(16)):(h=Buffer.alloc(0),f=u);let{key:g,iv:m}=kR(s,e,r,h),S=Xt.createDecipheriv(n(e),g,m);return new Fe(Buffer.concat([S.update(f),S.final()]))}else{let u=s.toBuffer(),f=a?.iv&&a.iv instanceof Fe?a.iv.toBuffer():Buffer.alloc(r),h=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),g=Xt.createDecipheriv(n(u.length),u,f);return a?.padding===!1&&g.setAutoPadding(!1),new Fe(Buffer.concat([g.update(h),g.final()]))}}}}function TU(){let t=r=>n=>{let i=n instanceof Fe?n.toBuffer():Buffer.from(String(n),"utf8");return new Fe(Xt.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Fe?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof Fe?i.toBuffer():Buffer.from(String(i),"utf8");return new Fe(Xt.createHmac(r,a).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:ib("aes",32,16),DES:ib("des",8,8),TripleDES:ib("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Fe?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof Fe?n.toBuffer():Buffer.from(String(n),"utf8"),u=(i?.keySize||4)*4,f=i?.iterations||1;return new Fe(Xt.pbkdf2Sync(s,a,f,u,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Fe.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Fe.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Fe.fromHex(r)},Latin1:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Fe(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Fe(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Fe(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Fe(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Fe(r):new Fe(Buffer.from(String(r))):new Fe(Buffer.alloc(0)),random:r=>new Fe(Xt.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Zi=class t{constructor(e,r=[]){this.httpService=e;this.moduleLoader=XS(r)}moduleLoader;createRequestSession(e){return new Rc({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this)},e)}createVM(e,r){let n=this.moduleLoader.getGlobalSetupExports(),i=this.moduleLoader.createRequireFunction(),s={ctx:e,hf:e,pm:e,console:r,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:a=>Buffer.from(a,"base64").toString("binary"),btoa:a=>Buffer.from(a,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:Xt,_:i("lodash"),require:i,moment:np(),querystring:kU,CryptoJS:TU(),postman:{setNextRequest:a=>e.setNextRequest?.(a),setGlobalVariable:(a,u)=>e.globals?.set(a,u),getGlobalVariable:a=>e.globals?.get(a),clearGlobalVariable:a=>e.globals?.unset(a),setEnvironmentVariable:(a,u)=>e.environment?.set(a,u),getEnvironmentVariable:a=>e.environment?.get(a),clearEnvironmentVariable:a=>e.environment?.unset(a)},jsonStringify:(a,u,f)=>JSON.stringify(a,u,f),jsonParse:a=>JSON.parse(a),xml2Json:a=>{try{let u=this.moduleLoader.createRequireFunction()("xml2js"),f;return u.parseString(a,{explicitArray:!1},(h,g)=>{if(h)throw h;f=g}),f}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return AR.createContext(s)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},u=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,u),h=this.createVariableScope(s),g=this.createVariableScope(i),m=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),S={...m,set:(C,x)=>{let A=this.serializeValue(x);m.set(C,A),n[C]=A},unset(C){m.unset(C),delete n[C]},clear(){m.clear();for(let C of Object.keys(a))delete n[C]}};return h.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,S.replaceIn=f.replaceIn,{globals:h,collectionVariables:g,variables:f,environment:S,session:S,iterationData:{get:C=>u[C],has:C=>C in u,toObject:()=>({...u}),toJSON:()=>JSON.stringify(u)},sendRequest:this.createSendRequest(),expect:Cc,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let a={get:u=>u in e?this.deserializeValue(e[u]):u in s?s[u]:u in r?this.deserializeValue(r[u]):u in n?this.deserializeValue(n[u]):this.deserializeValue(i[u]),set:(u,f)=>{e[u]=this.serializeValue(f)},has(u){return u in e||u in s||u in r||u in r||u in n||u in i},unset(u){delete e[u]},clear(){Object.keys(e).forEach(u=>delete e[u])},toObject(){return{...i,...n,...r,...s,...e}},replaceIn(u){if(!u||typeof u!="string")return u;let f=a.toObject();return u.replace(/\{\{([^}]+)\}\}/g,(h,g)=>{let m=g.trim(),S=m.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(S)try{let x=TR(S[2],f),A=Vi(S[1],x);return A!==null?String(A):h}catch{return h}let _=Wu(m);if(_){let x=AU(_.input,f);if(x!==void 0){let A=Yu(x,_.filters,f);return A!==void 0?String(A):h}return h}let C=a.get(m);if(C!==void 0)return String(C);if(qo(m)){let x={};for(let[j,Y]of Object.entries(f))x[j]=qR(Y);let A=To(m,x),T=$o(m,A);if(T!==void 0)return String(T)}return h})}};return a}createEnvironmentScope(e,r,n,i){let s=(a,u,f)=>{n&&(i?n(a,u,f):n(u||"",a==="set"?f:void 0))};return{name:r||"",get:a=>this.deserializeValue(e[a]),set:(a,u)=>{let f=this.serializeValue(u);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}};var gl=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[qt("path").join(s.forgeRoot,"modules")]:[],u=new Wi(new Dn,new Yi,e);this.scriptExecutor=new Zi(u,a)}}scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...n.additionalVariables||{}},u={...s},f=this.buildHttpRequest(e,n.overrides),h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),m={request:{url:f.url,method:f.method,headers:{...f.headers},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:void 0},variables:a,collectionVariables:r.variables||{},globals:{},sessionVariables:{},environmentVariables:u,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onSessionChange:n.onSessionChange,onEnvironmentChange:n.onEnvironmentChange},S=this.scriptExecutor.createRequestSession(m),_,C;try{if(!n.skipPreRequest&&g.preRequest.length>0){let T=await S.executePreRequest(g.preRequest);if(_={success:T.success,error:T.error,modifiedVariables:T.modifiedVariables,modifiedEnvironment:T.modifiedEnvironmentVariables,modifiedGlobals:T.modifiedGlobals,modifiedCollectionVariables:T.modifiedCollectionVariables,consoleOutput:T.consoleOutput,modifiedRequest:T.modifiedRequest?{url:T.modifiedRequest.url,method:T.modifiedRequest.method,headers:T.modifiedRequest.headers,body:T.modifiedRequest.body?.content}:void 0},T.modifiedVariables&&(a={...a,...T.modifiedVariables}),T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables}),T.modifiedRequest){let j=T.modifiedRequest;j.url&&(f.url=j.url),j.method&&(f.method=j.method),j.headers&&(f.headers={...f.headers,...j.headers}),j.body!==void 0&&(f.body=j.body?.content||j.body)}if(!T.success)throw new Error(`Pre-request script failed: ${T.error}`)}let x={...u,...a};f=this.interpolateRequest(f,x);let A=await this.httpClient.send(f);if(!n.skipPostResponse&&g.postResponse.length>0){let T=await S.executePostResponse(g.postResponse,{status:A.status,statusText:A.statusText,headers:A.headers,body:A.body,cookies:Object.fromEntries(A.cookies.map(j=>[j.name,j.value])),responseTime:A.time,responseSize:A.size,executedRequest:{url:f.url,method:f.method,headers:f.headers||{},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:{type:"none",content:""},params:{},query:{}}});C={success:!0,assertions:T.testResults,consoleOutput:T.consoleOutput,modifiedEnvironment:T.modifiedEnvironmentVariables},T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables})}return{response:A,preRequestResult:_,postResponseResult:C,totalTime:Date.now()-i,finalRequest:f,variables:{environment:u,local:a}}}finally{S.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let g=new URLSearchParams;for(let m of e.query)m.enabled!==!1&&g.append(m.key,m.value);n+=(n.includes("?")?"&":"?")+g.toString()}let i=r?.url||n,s=r?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let g of e.headers)g.enabled!==!1&&(a[g.key]=g.value);let u={...a,...r?.headers||{}},f,h=r?.body||e.body;return h&&(typeof h=="string"?f=h:h.content&&(f=typeof h.content=="string"?h.content:JSON.stringify(h.content))),this.preprocessor&&h&&this.preprocessor.setContentTypeHeader(u,h),{url:i,method:s,headers:u,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Ns.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,a)=>{for(let u of s){if(u.type==="request"&&u.id===r)return n.push(...a),!0;if(u.type==="folder"){let f=[...a,u];if(i(u.items,f))return!0}}return!1};return i(e.items,[]),n}};function qU(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Ic=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!r||a.environment===r)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let a=qU(),u=Date.now(),f={id:a,timestamp:u,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let h=this.requestIndex.get(e)||[];for(h.unshift(a);h.length>this.maxEntriesPerRequest;){let g=h.pop();g&&(this.entries.delete(g),this.fullResponses.delete(g))}if(this.requestIndex.set(e,h),this.storeFullResponses){let g={timestamp:u,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,g)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Oc=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let u=await fetch(e.url,a),f=Date.now(),h=u.headers.get("content-type")||"",g;try{h.includes("application/json")?g=await u.json():h.includes("text/")?g=await u.text():g=await u.text()}catch{g=null}let m={};return u.headers.forEach((S,_)=>{let C=m[_];C!==void 0?m[_]=Array.isArray(C)?[...C,S]:[C,S]:m[_]=S}),{status:u.status,statusText:u.statusText,headers:m,cookies:[],body:g,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};var sb={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},zo=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;case"binary":default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){return typeof e=="object"&&e.query?JSON.stringify({query:e.query,variables:e.variables||void 0,operationName:e.operationName||void 0}):typeof e=="string"?e:JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=sb["x-www-form-urlencoded"];break;case"raw":s=r.format?sb[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=sb.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}};var Ko=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};var Go=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let a=this.parseCsvLine(r[s]),u={};n.forEach((f,h)=>{u[f]=a[h]||""}),i.push(u)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],u=e[s+1];a==='"'?i&&u==='"'?(n+='"',s++):i=!i:a===","&&!i?(r.push(n.trim()),n=""):n+=a}return r.push(n.trim()),r}};import*as zr from"fs/promises";import*as yl from"path";var Pc=class{async readFile(e){return zr.readFile(e,"utf-8")}async writeFile(e,r){let n=yl.dirname(e);await this.mkdir(n),await zr.writeFile(e,r,"utf-8")}async exists(e){try{return await zr.access(e),!0}catch{return!1}}async mkdir(e){await zr.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=yl.basename(s);for(let u of e)if(this.matchPattern(a,u)){i.push(s);break}})}catch{}return i}async readDir(e){return zr.readdir(e)}async isDirectory(e){try{return(await zr.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await zr.readdir(e,{withFileTypes:!0});for(let i of n){let s=yl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};var ob=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new No,this.fileSystem=e.fileSystem||new Pc,this.preprocessor=e.preprocessor||new zo,this.dataFileParser=e.dataFileParser||new Go,this.cookieJar=e.cookieJar||new Bu,e.enableHistory?this.requestHistory=e.requestHistory||new Ic({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Do(s)}else this.httpClient=new Oc;let r=e.forgeRoot?[qt("path").join(e.forgeRoot,"modules")]:[],n=new Wi(new Dn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Zi(n,r),this.parserRegistry=new Uu,this.parserRegistry.register("http-forge",new Ko),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=qt("path").join(e.forgeRoot,"collections");this.collectionLoader=new ju(s)}else this.collectionLoader=new Za(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Hi(e.environmentConfig):Hi.fromVariables({}),this.forgeEnv=Ns.fromResolver(this.environmentStore),this.requestExecutor=new gl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new Yi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Za)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new Hi(e),this.forgeEnv=Ns.fromResolver(this.environmentStore),this.requestExecutor=new gl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=qt("path"),i=n.join(e,"environments"),s,a=Hu(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,h]of Object.entries(a.environments)){let g=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...h.variables,...g}}}}else{let f=qt("fs"),h=n.join(i,"environments.json");if(f.existsSync(h))try{let g=f.readFileSync(h,"utf-8"),m=JSON.parse(g);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[S,_]of Object.entries(m.environments)){let C=_;s.environments[S]={name:C.name||S,variables:C.variables||{}}}}catch(g){console.warn(`[ForgeContainer] Failed to load environments from ${h}:`,g)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};import*as sA from"path";import*as vl from"crypto";var $U=3e4,kc=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),u=new URLSearchParams;u.append("grant_type","refresh_token"),u.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,u,s,a,n);let h=await this.httpService.execute({method:"POST",url:i,headers:f,body:u.toString()}),g=this.parseTokenResponse(h.body,e);g.refreshToken||(g.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,g),g.refreshToken&&await this.storeRefreshToken(m,g.refreshToken),g}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,h,g,m;if(f){h=this.generateCodeVerifier();let ee=e.pkceMethod||"S256";g=ee==="S256"?this.generateCodeChallengeS256(h):h,m=ee}let S=e.state||vl.randomBytes(16).toString("hex"),_=await this.getCallbackUri(),C=new URL(n);if(C.searchParams.set("response_type","code"),C.searchParams.set("client_id",s),C.searchParams.set("redirect_uri",_),u&&C.searchParams.set("scope",u),C.searchParams.set("state",S),g&&(C.searchParams.set("code_challenge",g),C.searchParams.set("code_challenge_method",m)),e.audience&&C.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&C.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[ee,k]of Object.entries(e.extraParams))C.searchParams.set(ee,this.resolve(k,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((ee,k)=>{this.pendingAuthCallback={resolve:ee,reject:k,state:S}});await this.browserService.openExternal(C.toString());let A;try{A=await Promise.race([x,new Promise((ee,k)=>setTimeout(()=>{this.pendingAuthCallback=null,k(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(A.state&&A.state!==S)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let T=new URLSearchParams;T.append("grant_type","authorization_code"),T.append("code",A.code),T.append("redirect_uri",_),h&&T.append("code_verifier",h);let j={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,j,T,s,a,r);let Y=await this.httpService.execute({method:"POST",url:i,headers:j,body:T.toString()}),V=this.parseTokenResponse(Y.body,e),K=this.buildCacheKeyString(e);return this.tokenCache.set(K,V),V.refreshToken&&await this.storeRefreshToken(K,V.refreshToken),V}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||vl.randomBytes(16).toString("hex"),u=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",u),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[_,C]of Object.entries(e.extraParams))f.searchParams.set(_,this.resolve(C,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let h=new Promise((_,C)=>{this.pendingImplicitCallback={resolve:_,reject:C,state:a}});await this.browserService.openExternal(f.toString());let g;try{g=await Promise.race([h,new Promise((_,C)=>setTimeout(()=>{this.pendingImplicitCallback=null,C(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(g.state&&g.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let m={accessToken:g.accessToken,tokenType:g.tokenType||e.tokenPrefix||"Bearer",expiresAt:g.expiresIn?Date.now()+g.expiresIn*1e3:void 0,raw:{access_token:g.accessToken,token_type:g.tokenType,expires_in:g.expiresIn}},S=this.buildCacheKeyString(e);return this.tokenCache.set(S,m),m}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),u&&f.append("scope",u),n==="password"){let m=this.resolve(e.username||"",r),S=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");f.append("username",m),f.append("password",S)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,S]of Object.entries(e.extraParams))f.append(m,this.resolve(S,r));let h={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,h,f,s,a,r);let g=await this.httpService.execute({method:"POST",url:i,headers:h,body:f.toString()});return this.parseTokenResponse(g.body,e)}applyClientAuth(e,r,n,i,s,a){if(e.clientAuthentication==="header"){let u=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${u}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let a=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:a?Date.now()+a*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-$U:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return vl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return vl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}};import*as Qo from"fs";import*as Vs from"path";function Sl(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Qo.writeFileSync(t,r.join(`
|
|
223
|
-
`),"utf-8")}function
|
|
224
|
-
`)}function FU(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}import*as lr from"fs";import*as ab from"path";var bl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){lr.existsSync(this.collectionsDir)||lr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!lr.existsSync(this.collectionsDir))return[];let e=lr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=ab.join(this.collectionsDir,n),s=lr.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(lr.existsSync(r))try{let n=lr.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=at(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await lr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!lr.existsSync(r))return!1;try{return await lr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return lr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return ab.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||at(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:a,type:u,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let u=this.findItemById(i.items,n);if(u&&u.type==="folder")u.items=u.items||[],u.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),u=[];for(let f of n){let h=a.get(f);h&&(u.push(h),a.delete(f))}for(let f of a.values())u.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.items=u)}else i.items=u;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}};var Tc=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new $s(n):new bl(n)}static createForFormat(e,r){return e==="folder"?new $s(r):new bl(r)}};import*as pt from"fs";import*as Hn from"path";function $R(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function LU(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>MR(e)),event:lb(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function MR(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(MR):[],event:lb(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(jU),url:UU(e),body:BU(e),auth:HU(e.auth),description:e.description},event:lb(e.scripts),protocolProfileBehavior:VU(e.settings)}}}function jU(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function UU(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let h=i[1];/^{{.*}}$/.test(h)?n=[h]:n=h.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let h=a[1].replace(/^\//,"");h.endsWith("/")?(s=h.slice(0,-1).split("/"),s.push("")):s=h.length>0?h.split("/"):[]}let u;if(Array.isArray(t.query)&&t.query.length>0)u=t.query.map(h=>{let g={key:h.key,value:h.value};return h.enabled===!1&&(g.disabled=!0),g});else{let h=r.indexOf("?");h!==-1&&(u=r.substring(h+1).split("&").map(m=>{let[S,..._]=m.split("=");return{key:S,value:_.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([h,g])=>({key:h,value:String(g)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:u&&u.length>0?u:void 0,variable:f&&f.length>0?f:void 0}}function BU(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=$R(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||$R(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function HU(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function VU(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function lb(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var qc=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Tc.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}collectionsDir;collections=new Map;fileWatcher;loader;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){pt.existsSync(this.collectionsDir)||pt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.loadCollections(),this.onCollectionsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=at(e.name)),await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:u,type:f,...h}=n;Object.assign(a,h)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=at(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:at(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);let i=at(r),s=this.loader.getCollectionPath(e),a=Hn.join(this.collectionsDir,i);if(!pt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let u=Hn.join(a,"collection.json");if(pt.existsSync(u)){let h=JSON.parse(pt.readFileSync(u,"utf-8"));h.id=i,h.name=r,pt.writeFileSync(u,JSON.stringify(h,null,2))}else pt.writeFileSync(u,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:at(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!pt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Hn.dirname(s),u=at(n),f=Hn.join(a,u);this.copyDirRecursive(s,f);let h=Hn.join(f,"folder.json");if(pt.existsSync(h)){let S=JSON.parse(pt.readFileSync(h,"utf-8"));S.id=u,S.name=n,pt.writeFileSync(h,JSON.stringify(S,null,2))}else pt.writeFileSync(h,JSON.stringify({id:u,name:n,type:"folder"},null,2));let g=this.loader.load(e);g&&this.collections.set(e,g);let m=this.findItemById(g?.items||[],u);return m||{id:u,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||at(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){pt.existsSync(r)||pt.mkdirSync(r,{recursive:!0});for(let n of pt.readdirSync(e,{withFileTypes:!0})){let i=Hn.join(e,n.name),s=Hn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):pt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=pt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||at(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=h=>{if(!h)return;switch(h.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:h.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let S=h.basic?.find(T=>T.key==="username"),_=h.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:S?.value||"",password:_?.value||""}};case"apikey":let C=h.apikey?.find(T=>T.key==="key"),x=h.apikey?.find(T=>T.key==="value"),A=h.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:C?.value||"",value:x?.value||"",in:A?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=h=>{if(!Array.isArray(h)||h.length===0)return;let g={};for(let m of h){let S=m.script?.exec;if(!S)continue;let _=Array.isArray(S)?S.join(`
|
|
225
|
-
`):S;m.listen==="prerequest"?g.preRequest=_:m.listen==="test"&&(g.postResponse=_)}return g.preRequest||g.postResponse?g:void 0},i=h=>{if(!h||typeof h!="object")return;let g={};return h.followRedirects===!1&&(g.followRedirects=!1),h.followOriginalHttpMethod===!0&&(g.followOriginalMethod=!0),h.followAuthorizationHeader===!1&&(g.followAuthHeader=!1),h.maxRedirects!==void 0&&(g.maxRedirects=h.maxRedirects),h.requestTimeout!==void 0&&(g.timeout=h.requestTimeout),Object.keys(g).length>0?g:void 0},s=h=>{if(!h||typeof h=="string")return;let g=h.query;if(!(!Array.isArray(g)||g.length===0))return g.map(m=>({key:m.key||"",value:m.value||"",enabled:m.disabled!==!0}))},a=h=>{if(typeof h=="string")return h;if(!h)return"";let g=new Set;if(Array.isArray(h.variable))for(let S of h.variable)S.key&&g.add(S.key);if(g.size===0&&h.raw)return h.raw;let m="";if(h.protocol&&(m+=h.protocol+"://"),h.host&&(m+=Array.isArray(h.host)?h.host.join("."):h.host),h.port&&(m+=":"+h.port),h.path){let _=(Array.isArray(h.path)?h.path:[h.path]).map(C=>{let x=C.startsWith(":")?C.substring(1):C;return g.has(x)?":"+x:(C.startsWith(":"),C)});m+="/"+_.join("/")}return!m&&h.raw?h.raw:m},u=h=>h.map(g=>{if(g.item)return{id:at(g.name),type:"folder",name:g.name,description:g.description,auth:r(g.auth),scripts:n(g.event),items:u(g.item)};{let m=g.request||{};return{id:at(g.name),type:"request",name:g.name,description:g.description||m.description,method:typeof m.method=="string"?m.method:"GET",url:a(m.url),query:s(m.url),headers:Array.isArray(m.header)?m.header.map(S=>({key:S.key||S.name||"",value:S.value||S.value||"",enabled:S.disabled!==!0})):[],body:(()=>{let S=m.body;if(S){if(S.mode==="raw"&&S.raw){let _=S.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:S.raw}}if(S.mode==="urlencoded"&&Array.isArray(S.urlencoded))return{type:"x-www-form-urlencoded",content:S.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(S.mode==="formdata"&&Array.isArray(S.formdata))return{type:"form-data",content:S.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(S.mode==="graphql"&&S.graphql){let _;if(S.graphql.variables)try{_=JSON.parse(S.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:S.graphql.query||"",variables:_}}}if(S.mode==="binary")return{type:"binary",content:""}}})(),auth:r(m.auth),scripts:n(g.event),settings:i(g.protocolProfileBehavior)}}}),f={id:at(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),items:u(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=LU(n),s=JSON.stringify(i,null,2);pt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Hn.join(r,xt(n.name));pt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Sl(Hn.join(i,`${xt(n.name)}.env`),s),Ac(i,xt(n.name),n.scripts),op(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}};import*as qr from"fs";import*as mn from"path";var er={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"]},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null},_l={config:"http-forge.config.json"},Zo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"};var wl=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=mn.join(e,_l.config),this.config=this.loadConfig(),this.setupFileWatcher()}config;configPath;fileWatcher;loadConfig(){if(!qr.existsSync(this.configPath))return{...er};try{let e=qr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${_l.config}. Using default configuration.`),{...er}}}mergeWithDefaults(e){return{version:e.version??er.version,storage:{...er.storage,...e.storage},request:{...er.request,...e.request},scripts:{...er.scripts,...e.scripts},runner:{...er.runner,...e.runner},environments:{...er.environments,...e.environments},restClientExport:{...er.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:er.proxy,mcp:{...er.mcp,...e.mcp,cors:{...er.mcp.cors,...e.mcp?.cors}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,_l.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return mn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??er.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return mn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return mn.join(this.getRootPath(),Zo.collections)}getEnvironmentsPath(){return mn.join(this.getRootPath(),Zo.environments)}getFlowsPath(){return mn.join(this.getRootPath(),Zo.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return mn.join(this.getRootPath(),Zo.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return qr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(er,null,2);await qr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)qr.existsSync(i)||await qr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)qr.existsSync(i)||await qr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await qr.promises.writeFile(mn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await qr.promises.writeFile(mn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await qr.promises.writeFile(mn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}};var WU="httpForge.cookies",$c=class{constructor(e,r=WU){this.store=e;this.storeKey=r;this.loadCookies()}cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return lt.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return lt.parseCookieHeaders(e,r)}isExpired(e){return lt.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return lt.domainMatches(e,r)}get count(){return this.cookies.size}};var Mc=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(u=>u.name===s.name&&u.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(lt.isExpired(s)||s.domain&&!lt.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return lt.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}};import*as Bt from"fs";import*as Kr from"path";function ap(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let u of i){if(!u)continue;let f=u.key??u.name,h=typeof u.enabled=="boolean"?u.enabled:!0;f&&h!==!1&&(s[f]=u.value??u.initial??"")}else if(typeof i=="object"&&i!==null)for(let[u,f]of Object.entries(i))s[u]=String(f??"");let a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function YU(t,e){try{let r=await e.readFile(t);return ap(r)}catch{return null}}var Nc={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Dc=class{constructor(e,r,n,i){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;let s=n.getEnvironmentsPath();this.environmentsPath=s,this.sharedConfigPath=Kr.join(s,"_global.json"),this.localConfigPath=Kr.join(s,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(Nc.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.setupFileWatcher()}environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Bt.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Bt.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}}getEnvOverridesStateKey(e){return`${Nc.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(r,n)}setEnvironmentVariable(e,r){let n=this.selectedEnvironment;this.localEnvironmentValues.has(n)||this.localEnvironmentValues.set(n,{}),this.localEnvironmentValues.get(n)[e]=String(r),this.persistEnvironmentOverrides(n)}deleteEnvironmentVariable(e){let r=this.selectedEnvironment,n=this.localEnvironmentValues.get(r);n&&(delete n[e],this.persistEnvironmentOverrides(r))}clearEnvironmentVariables(){let e=this.selectedEnvironment;this.localEnvironmentValues.set(e,{}),this.persistEnvironmentOverrides(e)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}async setSessionVariable(e,r){this.setEnvironmentVariable(e,r)}getSessionVariable(e){return this.getEnvironmentVariableLocal(e)}getSessionVariables(){return this.getEnvironmentVariableLocals()}async deleteSessionVariable(e){this.deleteEnvironmentVariable(e)}async clearSessionVariables(){this.clearEnvironmentVariables()}hasSessionVariable(e){return this.getEnvironmentVariableLocal(e)!==void 0}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],a=i?.credentials?.[r],u=i?.variables||{},f=a?.variables||{},h=a&&a.headers||{},g=Fu(n.defaultHeaders||{},h),m=this.localEnvironmentValues.get(r)||{},S={...n.globalVariables||{},...s.variables||{},...u,...f,...m};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:g,variables:S}}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let a=Kr.join(e,"globals.env");Sl(a,s)}n.forEach(a=>{let u=i?.environments?.[a];if(!u)return;let f={...u.variables||{}};r&&(f={...s,...f});let h=Kr.join(e,`${xt(a)}.env`);Sl(h,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Kr.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Bt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Bt.readFileSync(e,"utf-8"),n=ap(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Kr.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Hu(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...this.getSessionVariables(),...r||{}};return new Mo({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},variables:{}})}saveFolderSharedConfig(e){Bt.existsSync(this.environmentsPath)||Bt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Bt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!ph(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=Kr.basename(s,".json");if(!i.has(a))try{Bt.unlinkSync(Kr.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let u={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(Kr.join(this.environmentsPath,`${s}.json`),u)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Bt.existsSync(e))return null;let r=Bt.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=Kr.dirname(e);Bt.existsSync(n)||Bt.mkdirSync(n,{recursive:!0}),Bt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}};var Fc=class t{constructor(e,r,n,i,s,a,u,f,h,g,m,S){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=u;this.folderScriptsChain=f;this.onConsoleOutput=h;this.collectionName=g;this.iteration=m;this.iterationCount=S}async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),u=this.envConfigService.getResolvedEnvironment(this.environment);if(!u)throw new Error(`Environment "${this.environment}" not found or not configured`);let f={request:e,variables:{...r},environmentVariables:u.variables||{},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(m,S,_)=>{m==="set"&&S&&_!==void 0?this.envConfigService.setEnvironmentVariable(S,_):m==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S):m==="clear"&&this.envConfigService.clearEnvironmentVariables()}},h=this.scriptExecutor.createRequestSession(f),g=null;try{let m={...r},S={...e},_;if(s.length>0){let D=await h.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput),D.nextRequest!==void 0&&(_=D.nextRequest),D.skipRequest){let L={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:L,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:m,nextRequest:_}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(S.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(S.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(S.params=D.modifiedRequest.params),D.modifiedRequest.query&&(S.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(S.body=D.modifiedRequest.body)),D.modifiedVariables&&(m=D.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,u,m);let{url:C,headers:x,body:A,method:T}=g,j={};for(let D in x)Object.prototype.hasOwnProperty.call(x,D)&&(j[D.toUpperCase()]=x[D]);if(!j.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let L=this.cookieJar.getCookieHeader(C);L&&(j.COOKIE=L)}let Y={method:T,url:C,headers:j,body:A.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},V=await this.httpService.execute(Y);this.cookieJar&&V.headers&&await this.cookieJar.setCookiesFromResponse(C,V.headers);let K=Date.now()-i,ee=[],k={},E;if(a.length>0){let D=0;if(V.body)if(typeof V.body=="string")D=Buffer.byteLength(V.body,"utf8");else if(Buffer.isBuffer(V.body))D=V.body.length;else try{D=Buffer.byteLength(JSON.stringify(V.body),"utf8")}catch{D=0}let L={};V.cookies&&Array.isArray(V.cookies)&&V.cookies.forEach(ie=>{ie.name&&(L[ie.name]=ie.value)});let z={executedRequest:g,status:V.status,statusText:V.statusText,headers:rb(V.headers||{}),body:V.body,cookies:L,responseTime:V.time,responseSize:D},Z=await h.executePostResponse(a,z);ee=Z.testResults,k=Z.modifiedEnvironmentVariables||{},E=Z.visualizerData,Z.nextRequest!==void 0&&(_=Z.nextRequest),Z.consoleOutput&&Z.consoleOutput.length>0&&this.onConsoleOutput?.(Z.consoleOutput)}let P=ee.length===0||ee.every(D=>D.passed),N=ee.length>0?P:V.status>=200&&V.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:j},response:{status:V.status,statusText:V.statusText,headers:V.headers||{},body:V.body,time:V.time||K,cookies:V.cookies||[]},duration:K,timestamp:Date.now(),passed:N,assertions:ee,modifiedVariables:m,modifiedEnvironmentVariables:k,nextRequest:_,visualizerData:E}}catch(m){return this.handleError(e,g,m,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,a=r?.method||e.method,u=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),h=n?.stack?String(n.stack):"",g=this.errorBodyFormat,m,S;g==="html"||g==="both"?(m=t.formatErrorAsHtml(f,h),S={"content-type":"text/html; charset=utf-8"}):(m=f,S={});let _={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:u||"",method:a||"GET",headers:r?.headers||{},body:r?.body||_,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:S,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
222
|
+
`)}function Nc(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function rp(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function QU(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function eb(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{t.push({name:n,passed:!0})},u=>{t.push({name:n,passed:!1,message:u.message||String(u)})});e.push(a)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r._pendingTests=e,r}function tb(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function ZU(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var Dc=class{constructor(e,r){this.deps=e;this.initialContext=r;this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:u=>e.cookieJar?e.cookieJar.get(u,i)?.value:void 0,set:(u,f)=>{e.cookieJar&&e.cookieJar.set({name:u,value:f,domain:i})},has:u=>e.cookieJar?e.cookieJar.has(u,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(u=>({name:u.name,value:u.value})):[],toObject:()=>{if(!e.cookieJar)return{};let u=e.cookieJar.getAll(i),f={};for(let h of u)f[h.name]=h.value;return f},jar:()=>{let u=e.cookieJar;return{getAll(f,h){try{if(!u){h(null,[]);return}let g=u.getAll(f).map(m=>({name:m.name,value:m.value,domain:m.domain,path:m.path,httpOnly:m.httpOnly,secure:m.secure}));h(null,g)}catch(g){h(g,[])}},get(f,h,g){try{if(!u){g(null,void 0);return}let m=u.get(h,f);g(null,m?{name:m.name,value:m.value,domain:m.domain}:void 0)}catch(m){g(m,void 0)}},set(f,h,g,m){try{if(!u){(m||g)?.(null);return}typeof h=="string"&&typeof g=="string"?(u.set({name:h,value:g,domain:f}),m?.(null)):typeof h=="object"&&(u.set({...h,domain:f}),g?.(null))}catch(S){(m||g)?.(S)}},unset(f,h,g){try{if(!u){g?.(null);return}u.delete(h,f),g?.(null)}catch(m){g?.(m)}},clear(f){try{if(!u){f?.(null);return}u.clear(),f?.(null)}catch(h){f?.(h)}}}},remove:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},unset:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(r,e),response:null,test:eb(this.assertions),expect:Mc,cookies:s,execution:{setNextRequest(u){a._nextRequest=u},skipRequest(){a._skipRequest=!0},location:n.info?.requestName||""},setNextRequest(u){a._nextRequest=u},visualizer:{set(u,f){a._visualizerData={template:u,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:u=>{u&&u.key&&(e.headers[u.key]=u.value||"")},get:u=>{for(let[f,h]of Object.entries(e.headers))if(f.toLowerCase()===u.toLowerCase())return h},has:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase())return!0;return!1},remove:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase()){delete e.headers[f];break}},update:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}}},upsert:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}e.headers[u.key]=u.value||""}},toObject:()=>{let u={};for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&(u[f]=h);return u},each:u=>{for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&u({key:f,value:h})}},a={get mode(){return n(e.body?.type)},set mode(u){let f=i(u);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let u=e.body?.content;return typeof u=="string"?u:u&&typeof u=="object"?JSON.stringify(u):""},set raw(u){e.body?(e.body.type="raw",e.body.content=u):e.body={type:"raw",content:u}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return ZU(e.url)},set url(u){e.url=typeof u=="string"?u:String(u)},get method(){return e.method},set method(u){e.method=u},headers:s,get body(){return a},set body(u){if(u==null)e.body=null;else if(typeof u=="string")e.body={type:"raw",content:u};else if(typeof u=="object")if(u.type||u.mode||u.content!==void 0){let f=u.mode?i(u.mode):u.type||"raw";e.body={type:f,format:u.format,content:u.content}}else e.body={type:"raw",content:u}},get params(){return e.params||{}},set params(u){e.params=u||{}},get query(){return e.query||{}},set query(u){e.query=u||{}},get auth(){return r.request?.auth||null},set auth(u){r.request&&(r.request.auth=u)},get certificate(){return r.request?.certificate||null},set certificate(u){r.request&&(r.request.certificate=u)},get description(){return r.request?.description||null},set description(u){r.request&&(r.request.description=u)},get name(){return r.request?.name||null},set name(u){r.request&&(r.request.name=u)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(u){r.request&&(r.request.disabled=u)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(u){let f={};for(let[h,g]of Object.entries(e.headers))typeof g=="string"&&(f[h]=g);return f},addQueryParams(u){if(typeof u=="string"){let f=new URLSearchParams(u);for(let[h,g]of f)e.query||(e.query={}),e.query[h]=g}else Array.isArray(u)&&(e.query||(e.query={}),u.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(u){e.query&&(typeof u=="string"?delete e.query[u]:Array.isArray(u)&&u.forEach(f=>{let h=typeof f=="string"?f:f.key;h&&delete e.query[h]}))},authorizeUsing(u,f){r.request&&(typeof u=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=u,f&&(r.request.auth.parameters=f)):typeof u=="object"&&(r.request.auth=u))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(u,f){r.request&&(r.request.description={content:u,type:f||"text/plain"})},setHeader(u,f){e.headers[u]=f},removeHeader(u){delete e.headers[u]},setBody(u,f,h){e.body={type:f||e.body?.type||"raw",format:h||e.body?.format,content:u}}}}async executePreRequest(e){let r=tp(e);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r);rb.runInContext(n,this.vmContext,{timeout:5e3});let i=rp(this.consoleMessages),s=this.initialContext.request.body,a=!this.bodiesEqual(this.modifiedRequest.body,s);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Nc(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:Nc(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Nc(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:i.length>0?i:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:[`[error] Script execution failed: ${n.message}`],modifiedVariables:this.ctx?.variables?.toObject(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=tp(e);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=XS(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(u,f,h){return i.assertions.push({name:String(f),passed:!!h,message:h?void 0:`"${String(f)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n);rb.runInContext(s,this.vmContext,{timeout:5e3}),this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0);let a=rp(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:a.length>0?a:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){return this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"}),{testResults:[...this.assertions],consoleOutput:[`[error] Script execution failed: ${i.message}`],modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.vmContext=null,this.ctx=null,this.assertions=[]}};function FR(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function LR(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function eB(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=FR(r[2],e),i=ji(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return LR(e[t]);if(qo(t)){let n=To(t,e),i=$o(t,n);if(i!==void 0)return i}}var Le=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};function NR(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)a=Qt.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let u=Buffer.concat(s);return{key:u.subarray(0,e),iv:u.subarray(e,e+r)}}function nb(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,a){let u=i instanceof Le?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=Qt.randomBytes(8),{key:h,iv:g}=NR(s,e,r,f),m=Qt.createCipheriv(n(e),h,g),S=Buffer.concat([m.update(u),m.final()]),E=Buffer.concat([Buffer.from("Salted__"),f,S]);return{ciphertext:new Le(S),salt:new Le(f),toString:x=>x?x.stringify(new Le(E)):E.toString("base64")}}else{let f=s.toBuffer(),h=a?.iv&&a.iv instanceof Le?a.iv.toBuffer():Buffer.alloc(r),g=Qt.createCipheriv(n(f.length),f,h);a?.padding===!1&&g.setAutoPadding(!1);let m=Buffer.concat([g.update(u),g.final()]);return{ciphertext:new Le(m),toString:S=>S?S.stringify(new Le(m)):m.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let u=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,h;u.subarray(0,8).toString()==="Salted__"?(h=u.subarray(8,16),f=u.subarray(16)):(h=Buffer.alloc(0),f=u);let{key:g,iv:m}=NR(s,e,r,h),S=Qt.createDecipheriv(n(e),g,m);return new Le(Buffer.concat([S.update(f),S.final()]))}else{let u=s.toBuffer(),f=a?.iv&&a.iv instanceof Le?a.iv.toBuffer():Buffer.alloc(r),h=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),g=Qt.createDecipheriv(n(u.length),u,f);return a?.padding===!1&&g.setAutoPadding(!1),new Le(Buffer.concat([g.update(h),g.final()]))}}}}function tB(){let t=r=>n=>{let i=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8");return new Le(Qt.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof Le?i.toBuffer():Buffer.from(String(i),"utf8");return new Le(Qt.createHmac(r,a).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:nb("aes",32,16),DES:nb("des",8,8),TripleDES:nb("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Le?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8"),u=(i?.keySize||4)*4,f=i?.iterations||1;return new Le(Qt.pbkdf2Sync(s,a,f,u,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Le.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Le.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Le.fromHex(r)},Latin1:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Le(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Le(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Le(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Le(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Le(r):new Le(Buffer.from(String(r))):new Le(Buffer.alloc(0)),random:r=>new Le(Qt.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Ji=class t{constructor(e,r=[]){this.httpService=e;this.moduleLoader=ZS(r)}httpService;moduleLoader;createRequestSession(e){return new Dc({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this)},e)}createVM(e,r){let n=this.moduleLoader.getGlobalSetupExports(),i=this.moduleLoader.createRequireFunction(),s={ctx:e,hf:e,pm:e,console:r,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:a=>Buffer.from(a,"base64").toString("binary"),btoa:a=>Buffer.from(a,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:Qt,_:i("lodash"),require:i,moment:ep(),querystring:XU,CryptoJS:tB(),postman:{setNextRequest:a=>e.setNextRequest?.(a),setGlobalVariable:(a,u)=>e.globals?.set(a,u),getGlobalVariable:a=>e.globals?.get(a),clearGlobalVariable:a=>e.globals?.unset(a),setEnvironmentVariable:(a,u)=>e.environment?.set(a,u),getEnvironmentVariable:a=>e.environment?.get(a),clearEnvironmentVariable:a=>e.environment?.unset(a)},jsonStringify:(a,u,f)=>JSON.stringify(a,u,f),jsonParse:a=>JSON.parse(a),xml2Json:a=>{try{let u=this.moduleLoader.createRequireFunction()("xml2js"),f;return u.parseString(a,{explicitArray:!1},(h,g)=>{if(h)throw h;f=g}),f}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return DR.createContext(s)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},u=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,u),h=this.createVariableScope(s),g=this.createVariableScope(i),m=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),S={...m,set:(x,C)=>{let A=this.serializeValue(C);m.set(x,A),n[x]=A},unset(x){m.unset(x),delete n[x]},clear(){m.clear();for(let x of Object.keys(a))delete n[x]}};return h.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,S.replaceIn=f.replaceIn,{globals:h,collectionVariables:g,variables:f,environment:S,session:S,iterationData:{get:x=>u[x],has:x=>x in u,toObject:()=>({...u}),toJSON:()=>JSON.stringify(u)},sendRequest:this.createSendRequest(),expect:Mc,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let a={get:u=>u in e?this.deserializeValue(e[u]):u in s?s[u]:u in r?this.deserializeValue(r[u]):u in n?this.deserializeValue(n[u]):this.deserializeValue(i[u]),set:(u,f)=>{e[u]=this.serializeValue(f)},has(u){return u in e||u in s||u in r||u in r||u in n||u in i},unset(u){delete e[u]},clear(){Object.keys(e).forEach(u=>delete e[u])},toObject(){return{...i,...n,...r,...s,...e}},replaceIn(u){if(!u||typeof u!="string")return u;let f=a.toObject();return u.replace(/\{\{([^}]+)\}\}/g,(h,g)=>{let m=g.trim(),S=m.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(S)try{let C=FR(S[2],f),A=ji(S[1],C);return A!==null?String(A):h}catch{return h}let E=rc(m);if(E){let C=eB(E.input,f);if(C!==void 0){let A=nc(C,E.filters,f);return A!==void 0?String(A):h}return h}let x=a.get(m);if(x!==void 0)return String(x);if(qo(m)){let C={};for(let[B,Y]of Object.entries(f))C[B]=LR(Y);let A=To(m,C),T=$o(m,A);if(T!==void 0)return String(T)}return h})}};return a}createEnvironmentScope(e,r,n,i){let s=(a,u,f)=>{n&&(i?n(a,u,f):n(u||"",a==="set"?f:void 0))};return{name:r||"",get:a=>this.deserializeValue(e[a]),set:(a,u)=>{let f=this.serializeValue(u);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}};var xl=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[kt("path").join(s.forgeRoot,"modules")]:[],u=new Ui(new Ln,new Bi,e);this.scriptExecutor=new Ji(u,a)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...n.additionalVariables||{}},u={...s},f=this.buildHttpRequest(e,n.overrides),h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),m={request:{url:f.url,method:f.method,headers:{...f.headers},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:void 0},variables:a,collectionVariables:r.variables||{},globals:{},sessionVariables:{},environmentVariables:u,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onSessionChange:n.onSessionChange,onEnvironmentChange:n.onEnvironmentChange},S=this.scriptExecutor.createRequestSession(m),E,x;try{if(!n.skipPreRequest&&g.preRequest.length>0){let T=await S.executePreRequest(g.preRequest);if(E={success:T.success,error:T.error,modifiedVariables:T.modifiedVariables,modifiedEnvironment:T.modifiedEnvironmentVariables,modifiedGlobals:T.modifiedGlobals,modifiedCollectionVariables:T.modifiedCollectionVariables,consoleOutput:T.consoleOutput,modifiedRequest:T.modifiedRequest?{url:T.modifiedRequest.url,method:T.modifiedRequest.method,headers:T.modifiedRequest.headers,body:T.modifiedRequest.body?.content}:void 0},T.modifiedVariables&&(a={...a,...T.modifiedVariables}),T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables}),T.modifiedRequest){let B=T.modifiedRequest;B.url&&(f.url=B.url),B.method&&(f.method=B.method),B.headers&&(f.headers={...f.headers,...B.headers}),B.body!==void 0&&(f.body=B.body?.content||B.body)}if(!T.success)throw new Error(`Pre-request script failed: ${T.error}`)}let C={...u,...a};f=this.interpolateRequest(f,C);let A=await this.httpClient.send(f);if(!n.skipPostResponse&&g.postResponse.length>0){let T=await S.executePostResponse(g.postResponse,{status:A.status,statusText:A.statusText,headers:A.headers,body:A.body,cookies:Object.fromEntries(A.cookies.map(B=>[B.name,B.value])),responseTime:A.time,responseSize:A.size,executedRequest:{url:f.url,method:f.method,headers:f.headers||{},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:{type:"none",content:""},params:{},query:{}}});x={success:!0,assertions:T.testResults,consoleOutput:T.consoleOutput,modifiedEnvironment:T.modifiedEnvironmentVariables},T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables})}return{response:A,preRequestResult:E,postResponseResult:x,totalTime:Date.now()-i,finalRequest:f,variables:{environment:u,local:a}}}finally{S.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let g=new URLSearchParams;for(let m of e.query)m.enabled!==!1&&g.append(m.key,m.value);n+=(n.includes("?")?"&":"?")+g.toString()}let i=r?.url||n,s=r?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let g of e.headers)g.enabled!==!1&&(a[g.key]=g.value);let u={...a,...r?.headers||{}},f,h=r?.body||e.body;return h&&(typeof h=="string"?f=h:h.content&&(f=typeof h.content=="string"?h.content:JSON.stringify(h.content))),this.preprocessor&&h&&this.preprocessor.setContentTypeHeader(u,h),{url:i,method:s,headers:u,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Is.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,a)=>{for(let u of s){if(u.type==="request"&&u.id===r)return n.push(...a),!0;if(u.type==="folder"){let f=[...a,u];if(i(u.items,f))return!0}}return!1};return i(e.items,[]),n}};function rB(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Fc=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!r||a.environment===r)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let a=rB(),u=Date.now(),f={id:a,timestamp:u,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let h=this.requestIndex.get(e)||[];for(h.unshift(a);h.length>this.maxEntriesPerRequest;){let g=h.pop();g&&(this.entries.delete(g),this.fullResponses.delete(g))}if(this.requestIndex.set(e,h),this.storeFullResponses){let g={timestamp:u,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,g)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Lc=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let u=await fetch(e.url,a),f=Date.now(),h=u.headers.get("content-type")||"",g;try{h.includes("application/json")?g=await u.json():h.includes("text/")?g=await u.text():g=await u.text()}catch{g=null}let m={};return u.headers.forEach((S,E)=>{let x=m[E];x!==void 0?m[E]=Array.isArray(x)?[...x,S]:[x,S]:m[E]=S}),{status:u.status,statusText:u.statusText,headers:m,cookies:[],body:g,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};var ib={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},Ko=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){return typeof e=="object"&&e.query?JSON.stringify({query:e.query,variables:e.variables||void 0,operationName:e.operationName||void 0}):typeof e=="string"?e:JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=ib["x-www-form-urlencoded"];break;case"raw":s=r.format?ib[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=ib.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}};var Go=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};var Qo=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let a=this.parseCsvLine(r[s]),u={};n.forEach((f,h)=>{u[f]=a[h]||""}),i.push(u)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],u=e[s+1];a==='"'?i&&u==='"'?(n+='"',s++):i=!i:a===","&&!i?(r.push(n.trim()),n=""):n+=a}return r.push(n.trim()),r}};import*as Kr from"fs/promises";import*as Cl from"path";var jc=class{async readFile(e){return Kr.readFile(e,"utf-8")}async writeFile(e,r){let n=Cl.dirname(e);await this.mkdir(n),await Kr.writeFile(e,r,"utf-8")}async exists(e){try{return await Kr.access(e),!0}catch{return!1}}async mkdir(e){await Kr.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Cl.basename(s);for(let u of e)if(this.matchPattern(a,u)){i.push(s);break}})}catch{}return i}async readDir(e){return Kr.readdir(e)}async isDirectory(e){try{return(await Kr.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await Kr.readdir(e,{withFileTypes:!0});for(let i of n){let s=Cl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};var sb=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new No,this.fileSystem=e.fileSystem||new jc,this.preprocessor=e.preprocessor||new Ko,this.dataFileParser=e.dataFileParser||new Qo,this.cookieJar=e.cookieJar||new Xu,e.enableHistory?this.requestHistory=e.requestHistory||new Fc({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Do(s)}else this.httpClient=new Lc;let r=e.forgeRoot?[kt("path").join(e.forgeRoot,"modules")]:[],n=new Ui(new Ln,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Ji(n,r),this.parserRegistry=new Zu,this.parserRegistry.register("http-forge",new Go),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=kt("path").join(e.forgeRoot,"collections");this.collectionLoader=new Qu(s)}else this.collectionLoader=new il(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Li(e.environmentConfig):Li.fromVariables({}),this.forgeEnv=Is.fromResolver(this.environmentStore),this.requestExecutor=new xl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new Bi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof il)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new Li(e),this.forgeEnv=Is.fromResolver(this.environmentStore),this.requestExecutor=new xl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=kt("path"),i=n.join(e,"environments"),s,a=ec(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,h]of Object.entries(a.environments)){let g=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...h.variables,...g}}}}else{let f=kt("fs"),h=n.join(i,"environments.json");if(f.existsSync(h))try{let g=f.readFileSync(h,"utf-8"),m=JSON.parse(g);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[S,E]of Object.entries(m.environments)){let x=E;s.environments[S]={name:x.name||S,variables:x.variables||{}}}}catch(g){console.warn(`[ForgeContainer] Failed to load environments from ${h}:`,g)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};import*as mA from"path";import*as Rl from"crypto";var nB=3e4,Uc=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),u=new URLSearchParams;u.append("grant_type","refresh_token"),u.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,u,s,a,n);let h=await this.httpService.execute({method:"POST",url:i,headers:f,body:u.toString()}),g=this.parseTokenResponse(h.body,e);g.refreshToken||(g.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,g),g.refreshToken&&await this.storeRefreshToken(m,g.refreshToken),g}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,h,g,m;if(f){h=this.generateCodeVerifier();let X=e.pkceMethod||"S256";g=X==="S256"?this.generateCodeChallengeS256(h):h,m=X}let S=e.state||Rl.randomBytes(16).toString("hex"),E=await this.getCallbackUri(),x=new URL(n);if(x.searchParams.set("response_type","code"),x.searchParams.set("client_id",s),x.searchParams.set("redirect_uri",E),u&&x.searchParams.set("scope",u),x.searchParams.set("state",S),g&&(x.searchParams.set("code_challenge",g),x.searchParams.set("code_challenge_method",m)),e.audience&&x.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&x.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[X,k]of Object.entries(e.extraParams))x.searchParams.set(X,this.resolve(k,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let C=new Promise((X,k)=>{this.pendingAuthCallback={resolve:X,reject:k,state:S}});await this.browserService.openExternal(x.toString());let A;try{A=await Promise.race([C,new Promise((X,k)=>setTimeout(()=>{this.pendingAuthCallback=null,k(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(A.state&&A.state!==S)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let T=new URLSearchParams;T.append("grant_type","authorization_code"),T.append("code",A.code),T.append("redirect_uri",E),h&&T.append("code_verifier",h);let B={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,B,T,s,a,r);let Y=await this.httpService.execute({method:"POST",url:i,headers:B,body:T.toString()}),H=this.parseTokenResponse(Y.body,e),K=this.buildCacheKeyString(e);return this.tokenCache.set(K,H),H.refreshToken&&await this.storeRefreshToken(K,H.refreshToken),H}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||Rl.randomBytes(16).toString("hex"),u=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",u),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[E,x]of Object.entries(e.extraParams))f.searchParams.set(E,this.resolve(x,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let h=new Promise((E,x)=>{this.pendingImplicitCallback={resolve:E,reject:x,state:a}});await this.browserService.openExternal(f.toString());let g;try{g=await Promise.race([h,new Promise((E,x)=>setTimeout(()=>{this.pendingImplicitCallback=null,x(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(g.state&&g.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let m={accessToken:g.accessToken,tokenType:g.tokenType||e.tokenPrefix||"Bearer",expiresAt:g.expiresIn?Date.now()+g.expiresIn*1e3:void 0,raw:{access_token:g.accessToken,token_type:g.tokenType,expires_in:g.expiresIn}},S=this.buildCacheKeyString(e);return this.tokenCache.set(S,m),m}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),u&&f.append("scope",u),n==="password"){let m=this.resolve(e.username||"",r),S=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");f.append("username",m),f.append("password",S)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,S]of Object.entries(e.extraParams))f.append(m,this.resolve(S,r));let h={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,h,f,s,a,r);let g=await this.httpService.execute({method:"POST",url:i,headers:h,body:f.toString()});return this.parseTokenResponse(g.body,e)}applyClientAuth(e,r,n,i,s,a){if(e.clientAuthentication==="header"){let u=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${u}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let a=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:a?Date.now()+a*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-nB:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return Rl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Rl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}};import*as Zo from"fs";import*as Ms from"path";function Il(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Zo.writeFileSync(t,r.join(`
|
|
223
|
+
`),"utf-8")}function Bc(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&Zo.writeFileSync(Ms.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&Zo.writeFileSync(Ms.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function iB(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Ms.isAbsolute(n)?n:Ms.join(t,n)}async function sB(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function np(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Ms.join(e,Et(n.name));Zo.mkdirSync(i,{recursive:!0}),Bc(i,Et(n.name),n.scripts),np(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=Et(i.name)+".http",a=Ms.join(e,s),u=oB(i,r);Zo.writeFileSync(a,u,"utf-8"),Bc(e,Et(i.name),i.scripts)}})}function oB(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${Et(e.name)}.env`),r.push(`# request scripts: ${Et(t.name)}.pre.js and .post.js`);let n=aB(t);return r.push(`${t.method} ${n}`),(t.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{r.push(`${i.key}: ${i.value}`)}),t.body&&t.body.content&&r.push("",t.body.content),r.join(`
|
|
224
|
+
`)}function aB(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}import*as ar from"fs";import*as ob from"path";var Ol=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){ar.existsSync(this.collectionsDir)||ar.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!ar.existsSync(this.collectionsDir))return[];let e=ar.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=ob.join(this.collectionsDir,n),s=ar.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(ar.existsSync(r))try{let n=ar.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=ut(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await ar.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!ar.existsSync(r))return!1;try{return await ar.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return ar.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return ob.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||ut(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:a,type:u,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let u=this.findItemById(i.items,n);if(u&&u.type==="folder")u.items=u.items||[],u.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),u=[];for(let f of n){let h=a.get(f);h&&(u.push(h),a.delete(f))}for(let f of a.values())u.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.items=u)}else i.items=u;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}};var Hc=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new Cs(n):new Ol(n)}static createForFormat(e,r){return e==="folder"?new Cs(r):new Ol(r)}};import*as gt from"fs";import*as Wn from"path";function jR(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function lB(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>UR(e)),event:ab(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function UR(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(UR):[],event:ab(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(uB),url:cB(e),body:fB(e),auth:dB(e.auth),description:e.description},event:ab(e.scripts),protocolProfileBehavior:hB(e.settings)}}}function uB(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function cB(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let h=i[1];/^{{.*}}$/.test(h)?n=[h]:n=h.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let h=a[1].replace(/^\//,"");h.endsWith("/")?(s=h.slice(0,-1).split("/"),s.push("")):s=h.length>0?h.split("/"):[]}let u;if(Array.isArray(t.query)&&t.query.length>0)u=t.query.map(h=>{let g={key:h.key,value:h.value};return h.enabled===!1&&(g.disabled=!0),g});else{let h=r.indexOf("?");h!==-1&&(u=r.substring(h+1).split("&").map(m=>{let[S,...E]=m.split("=");return{key:S,value:E.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([h,g])=>({key:h,value:String(g)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:u&&u.length>0?u:void 0,variable:f&&f.length>0?f:void 0}}function fB(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=jR(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||jR(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function dB(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function hB(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function ab(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var Vc=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Hc.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){gt.existsSync(this.collectionsDir)||gt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.loadCollections(),this.onCollectionsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=ut(e.name)),await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:u,type:f,...h}=n;Object.assign(a,h)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=ut(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:ut(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);let i=ut(r),s=this.loader.getCollectionPath(e),a=Wn.join(this.collectionsDir,i);if(!gt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let u=Wn.join(a,"collection.json");if(gt.existsSync(u)){let h=JSON.parse(gt.readFileSync(u,"utf-8"));h.id=i,h.name=r,gt.writeFileSync(u,JSON.stringify(h,null,2))}else gt.writeFileSync(u,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:ut(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!gt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Wn.dirname(s),u=ut(n),f=Wn.join(a,u);this.copyDirRecursive(s,f);let h=Wn.join(f,"folder.json");if(gt.existsSync(h)){let S=JSON.parse(gt.readFileSync(h,"utf-8"));S.id=u,S.name=n,gt.writeFileSync(h,JSON.stringify(S,null,2))}else gt.writeFileSync(h,JSON.stringify({id:u,name:n,type:"folder"},null,2));let g=this.loader.load(e);g&&this.collections.set(e,g);let m=this.findItemById(g?.items||[],u);return m||{id:u,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||ut(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){gt.existsSync(r)||gt.mkdirSync(r,{recursive:!0});for(let n of gt.readdirSync(e,{withFileTypes:!0})){let i=Wn.join(e,n.name),s=Wn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):gt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=gt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||ut(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=h=>{if(!h)return;switch(h.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:h.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let S=h.basic?.find(T=>T.key==="username"),E=h.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:S?.value||"",password:E?.value||""}};case"apikey":let x=h.apikey?.find(T=>T.key==="key"),C=h.apikey?.find(T=>T.key==="value"),A=h.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:x?.value||"",value:C?.value||"",in:A?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=h=>{if(!Array.isArray(h)||h.length===0)return;let g={};for(let m of h){let S=m.script?.exec;if(!S)continue;let E=Array.isArray(S)?S.join(`
|
|
225
|
+
`):S;m.listen==="prerequest"?g.preRequest=E:m.listen==="test"&&(g.postResponse=E)}return g.preRequest||g.postResponse?g:void 0},i=h=>{if(!h||typeof h!="object")return;let g={};return h.followRedirects===!1&&(g.followRedirects=!1),h.followOriginalHttpMethod===!0&&(g.followOriginalMethod=!0),h.followAuthorizationHeader===!1&&(g.followAuthHeader=!1),h.maxRedirects!==void 0&&(g.maxRedirects=h.maxRedirects),h.requestTimeout!==void 0&&(g.timeout=h.requestTimeout),Object.keys(g).length>0?g:void 0},s=h=>{if(!h||typeof h=="string")return;let g=h.query;if(!(!Array.isArray(g)||g.length===0))return g.map(m=>({key:m.key||"",value:m.value||"",enabled:m.disabled!==!0}))},a=h=>{if(typeof h=="string")return h;if(!h)return"";let g=new Set;if(Array.isArray(h.variable))for(let S of h.variable)S.key&&g.add(S.key);if(g.size===0&&h.raw)return h.raw;let m="";if(h.protocol&&(m+=h.protocol+"://"),h.host&&(m+=Array.isArray(h.host)?h.host.join("."):h.host),h.port&&(m+=":"+h.port),h.path){let E=(Array.isArray(h.path)?h.path:[h.path]).map(x=>{let C=x.startsWith(":")?x.substring(1):x;return g.has(C)?":"+C:(x.startsWith(":"),x)});m+="/"+E.join("/")}return!m&&h.raw?h.raw:m},u=h=>h.map(g=>{if(g.item)return{id:ut(g.name),type:"folder",name:g.name,description:g.description,auth:r(g.auth),scripts:n(g.event),items:u(g.item)};{let m=g.request||{};return{id:ut(g.name),type:"request",name:g.name,description:g.description||m.description,method:typeof m.method=="string"?m.method:"GET",url:a(m.url),query:s(m.url),headers:Array.isArray(m.header)?m.header.map(S=>({key:S.key||S.name||"",value:S.value||S.value||"",enabled:S.disabled!==!0})):[],body:(()=>{let S=m.body;if(S){if(S.mode==="raw"&&S.raw){let E=S.options?.raw?.language;return{type:"raw",format:E==="xml"?"xml":E==="html"?"html":E==="javascript"?"javascript":E==="text"?"text":"json",content:S.raw}}if(S.mode==="urlencoded"&&Array.isArray(S.urlencoded))return{type:"x-www-form-urlencoded",content:S.urlencoded.map(E=>({key:E.key||"",value:E.value||"",enabled:E.disabled!==!0}))};if(S.mode==="formdata"&&Array.isArray(S.formdata))return{type:"form-data",content:S.formdata.map(E=>({key:E.key||"",value:E.value||"",type:E.type||"text",enabled:E.disabled!==!0}))};if(S.mode==="graphql"&&S.graphql){let E;if(S.graphql.variables)try{E=JSON.parse(S.graphql.variables)}catch{E=void 0}return{type:"graphql",content:{query:S.graphql.query||"",variables:E}}}if(S.mode==="binary")return{type:"binary",content:""}}})(),auth:r(m.auth),scripts:n(g.event),settings:i(g.protocolProfileBehavior)}}}),f={id:ut(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),items:u(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=lB(n),s=JSON.stringify(i,null,2);gt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Wn.join(r,Et(n.name));gt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Il(Wn.join(i,`${Et(n.name)}.env`),s),Bc(i,Et(n.name),n.scripts),np(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}};import*as Mr from"fs";import*as yn from"path";var Zt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"]},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null},Pl={config:"http-forge.config.json"},Xo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"};var kl=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=yn.join(e,Pl.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Mr.existsSync(this.configPath))return{...Zt};try{let e=Mr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${Pl.config}. Using default configuration.`),{...Zt}}}mergeWithDefaults(e){return{version:e.version??Zt.version,storage:{...Zt.storage,...e.storage},request:{...Zt.request,...e.request},scripts:{...Zt.scripts,...e.scripts},runner:{...Zt.runner,...e.runner},environments:{...Zt.environments,...e.environments},restClientExport:{...Zt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Zt.proxy,mcp:{...Zt.mcp,...e.mcp,cors:{...Zt.mcp.cors,...e.mcp?.cors}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,Pl.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return yn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??Zt.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return yn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return yn.join(this.getRootPath(),Xo.collections)}getEnvironmentsPath(){return yn.join(this.getRootPath(),Xo.environments)}getFlowsPath(){return yn.join(this.getRootPath(),Xo.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return yn.join(this.getRootPath(),Xo.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Mr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Zt,null,2);await Mr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Mr.existsSync(i)||await Mr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Mr.existsSync(i)||await Mr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Mr.promises.writeFile(yn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Mr.promises.writeFile(yn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await Mr.promises.writeFile(yn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}};var pB="httpForge.cookies",Wc=class{constructor(e,r=pB){this.store=e;this.storeKey=r;this.loadCookies()}store;storeKey;cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ct.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return ct.parseCookieHeaders(e,r)}isExpired(e){return ct.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return ct.domainMatches(e,r)}get count(){return this.cookies.size}};var Yc=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(u=>u.name===s.name&&u.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(ct.isExpired(s)||s.domain&&!ct.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ct.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}};import*as Ut from"fs";import*as Gr from"path";function ip(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let u of i){if(!u)continue;let f=u.key??u.name,h=typeof u.enabled=="boolean"?u.enabled:!0;f&&h!==!1&&(s[f]=u.value??u.initial??"")}else if(typeof i=="object"&&i!==null)for(let[u,f]of Object.entries(i))s[u]=String(f??"");let a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function mB(t,e){try{let r=await e.readFile(t);return ip(r)}catch{return null}}var Jc={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},zc=class{constructor(e,r,n,i){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;let s=n.getEnvironmentsPath();this.environmentsPath=s,this.sharedConfigPath=Gr.join(s,"_global.json"),this.localConfigPath=Gr.join(s,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(Jc.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Ut.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Ut.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(Jc.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}}getEnvOverridesStateKey(e){return`${Jc.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(r,n)}setEnvironmentVariable(e,r){let n=this.selectedEnvironment;this.localEnvironmentValues.has(n)||this.localEnvironmentValues.set(n,{}),this.localEnvironmentValues.get(n)[e]=String(r),this.persistEnvironmentOverrides(n)}deleteEnvironmentVariable(e){let r=this.selectedEnvironment,n=this.localEnvironmentValues.get(r);n&&(delete n[e],this.persistEnvironmentOverrides(r))}clearEnvironmentVariables(){let e=this.selectedEnvironment;this.localEnvironmentValues.set(e,{}),this.persistEnvironmentOverrides(e)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}async setSessionVariable(e,r){this.setEnvironmentVariable(e,r)}getSessionVariable(e){return this.getEnvironmentVariableLocal(e)}getSessionVariables(){return this.getEnvironmentVariableLocals()}async deleteSessionVariable(e){this.deleteEnvironmentVariable(e)}async clearSessionVariables(){this.clearEnvironmentVariables()}hasSessionVariable(e){return this.getEnvironmentVariableLocal(e)!==void 0}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],a=i?.credentials?.[r],u=i?.variables||{},f=a?.variables||{},h=a&&a.headers||{},g=Ku(n.defaultHeaders||{},h),m=this.localEnvironmentValues.get(r)||{},S={...n.globalVariables||{},...s.variables||{},...u,...f,...m};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:g,variables:S}}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let a=Gr.join(e,"globals.env");Il(a,s)}n.forEach(a=>{let u=i?.environments?.[a];if(!u)return;let f={...u.variables||{}};r&&(f={...s,...f});let h=Gr.join(e,`${Et(a)}.env`);Il(h,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Gr.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Ut.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Ut.readFileSync(e,"utf-8"),n=ip(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Gr.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=ec(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...this.getSessionVariables(),...r||{}};return new Mo({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},variables:{}})}saveFolderSharedConfig(e){Ut.existsSync(this.environmentsPath)||Ut.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Ut.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!mh(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=Gr.basename(s,".json");if(!i.has(a))try{Ut.unlinkSync(Gr.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let u={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(Gr.join(this.environmentsPath,`${s}.json`),u)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore.update(Jc.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore.update(Jc.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Ut.existsSync(e))return null;let r=Ut.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=Gr.dirname(e);Ut.existsSync(n)||Ut.mkdirSync(n,{recursive:!0}),Ut.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}};var Kc=class t{constructor(e,r,n,i,s,a,u,f,h,g,m,S){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=u;this.folderScriptsChain=f;this.onConsoleOutput=h;this.collectionName=g;this.iteration=m;this.iterationCount=S}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;iteration;iterationCount;async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),u=this.envConfigService.getResolvedEnvironment(this.environment);if(!u)throw new Error(`Environment "${this.environment}" not found or not configured`);let f={request:e,variables:{...r},environmentVariables:u.variables||{},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(m,S,E)=>{m==="set"&&S&&E!==void 0?this.envConfigService.setEnvironmentVariable(S,E):m==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S):m==="clear"&&this.envConfigService.clearEnvironmentVariables()}},h=this.scriptExecutor.createRequestSession(f),g=null;try{let m={...r},S={...e},E;if(s.length>0){let D=await h.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput),D.nextRequest!==void 0&&(E=D.nextRequest),D.skipRequest){let L={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:L,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:m,nextRequest:E}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(S.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(S.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(S.params=D.modifiedRequest.params),D.modifiedRequest.query&&(S.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(S.body=D.modifiedRequest.body)),D.modifiedVariables&&(m=D.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,u,m);let{url:x,headers:C,body:A,method:T}=g,B={};for(let D in C)Object.prototype.hasOwnProperty.call(C,D)&&(B[D.toUpperCase()]=C[D]);if(!B.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let L=this.cookieJar.getCookieHeader(x);L&&(B.COOKIE=L)}let Y={method:T,url:x,headers:B,body:A.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},H=await this.httpService.execute(Y);this.cookieJar&&H.headers&&await this.cookieJar.setCookiesFromResponse(x,H.headers);let K=Date.now()-i,X=[],k={},w;if(a.length>0){let D=0;if(H.body)if(typeof H.body=="string")D=Buffer.byteLength(H.body,"utf8");else if(Buffer.isBuffer(H.body))D=H.body.length;else try{D=Buffer.byteLength(JSON.stringify(H.body),"utf8")}catch{D=0}let L={};H.cookies&&Array.isArray(H.cookies)&&H.cookies.forEach(ae=>{ae.name&&(L[ae.name]=ae.value)});let z={executedRequest:g,status:H.status,statusText:H.statusText,headers:tb(H.headers||{}),body:H.body,cookies:L,responseTime:H.time,responseSize:D},Z=await h.executePostResponse(a,z);X=Z.testResults,k=Z.modifiedEnvironmentVariables||{},w=Z.visualizerData,Z.nextRequest!==void 0&&(E=Z.nextRequest),Z.consoleOutput&&Z.consoleOutput.length>0&&this.onConsoleOutput?.(Z.consoleOutput)}let P=X.length===0||X.every(D=>D.passed),N=X.length>0?P:H.status>=200&&H.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:B},response:{status:H.status,statusText:H.statusText,headers:H.headers||{},body:H.body,time:H.time||K,cookies:H.cookies||[]},duration:K,timestamp:Date.now(),passed:N,assertions:X,modifiedVariables:m,modifiedEnvironmentVariables:k,nextRequest:E,visualizerData:w}}catch(m){return this.handleError(e,g,m,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,a=r?.method||e.method,u=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),h=n?.stack?String(n.stack):"",g=this.errorBodyFormat,m,S;g==="html"||g==="both"?(m=t.formatErrorAsHtml(f,h),S={"content-type":"text/html; charset=utf-8"}):(m=f,S={});let E={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:u||"",method:a||"GET",headers:r?.headers||{},body:r?.body||E,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:S,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
226
226
|
<html>
|
|
227
227
|
<body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
|
|
228
228
|
<h2 style="margin-top:0;color:#a94442">Request Error</h2>
|
|
@@ -231,7 +231,7 @@ Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}fin
|
|
|
231
231
|
${n(r)}
|
|
232
232
|
</pre>`:""}
|
|
233
233
|
</body>
|
|
234
|
-
</html>`}};var
|
|
234
|
+
</html>`}};var Gc=class{constructor(e,r,n,i,s){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s}envConfigService;httpService;preprocessor;tokenManager;appInfo;async prepareRequest(e,r,n,i){let s=i&&Object.keys(i).length>0,a=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),u=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),f=Ku(n?.headers||{},e.headers||{}),h=s?this.envConfigService.resolveVariablesInObjectWithExtra(f,i,r):this.envConfigService.resolveVariablesInObject(f,r);if(h=this.preprocessor.sanitizeHeaders(h),!Object.keys(h).some(T=>T.toLowerCase()==="user-agent")){let T=this.appInfo?.version||"0.0.0",B=this.appInfo?.name||"HttpForge";h["User-Agent"]=`${B}/${T}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let T=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);h.Authorization=`Bearer ${T}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let T=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),B=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),Y=Buffer.from(`${T}:${B}`).toString("base64");h.Authorization=`Basic ${Y}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,h,u,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,h,r);let m=null;if(e.body&&e.body.type!=="none"){let T=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof T=="string")try{T=JSON.parse(T)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let B={type:e.body.type,format:e.body.format,content:T};m=this.preprocessor.encodeBody(B)}this.preprocessor.setContentTypeHeader(h,e.body,e.bodyContentType);let S=e.method||"GET",E=e.url||"",x=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(E,i,r):this.envConfigService.resolveVariables(E,r),C=this.httpService.buildUrl(x,a,u),A={type:e.body?.type||"none",format:e.body?.format,content:m};return{url:C,method:S,headers:h,body:A,params:a,query:u}}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),a=e.tokenPrefix||"Bearer";r.Authorization=`${a} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let a=s&&Object.keys(s).length>0,u=a?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),f=a?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[u]=f:r[u]=f}};var gB=`
|
|
235
235
|
query IntrospectionQuery {
|
|
236
236
|
__schema {
|
|
237
237
|
queryType { name }
|
|
@@ -259,58 +259,58 @@ fragment TypeRef on __Type {
|
|
|
259
259
|
kind name
|
|
260
260
|
ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }
|
|
261
261
|
}
|
|
262
|
-
`.trim(),
|
|
263
|
-
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&r.push({type:a[1],name:a[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(u=>this.parseField(u)),inputFields:(s.inputFields||[]).map(u=>this.parseArg(u)),enumValues:(s.enumValues||[]).map(u=>({name:u.name,description:u.description||void 0,isDeprecated:u.isDeprecated||!1,deprecationReason:u.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(u=>this.renderTypeRef(u)),possibleTypes:(s.possibleTypes||[]).map(u=>this.renderTypeRef(u))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}};import*as
|
|
264
|
-
`))return
|
|
265
|
-
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)
|
|
266
|
-
`)){try{let s=new URLSearchParams(i);for(let[a,u]of s)if(
|
|
267
|
-
`)){let f=new URLSearchParams(u);if(f.get(e)===n){f.set(e,i);let h=f.toString();s?s.content=h:t.body=h}return}return}typeof a=="object"&&a!==null&&NR(a,e,r||e,n,i)}}function NR(t,e,r,n,i){let s=r.split("."),a=t;for(let f=0;f<s.length-1;f++){let h=s[f],g=h.match(/^(.+)\[(\d+)\]$/);if(g?a=a?.[g[1]]?.[parseInt(g[2])]:a=a?.[h],a==null)return}let u=s[s.length-1];a&&a[u]===n&&(a[u]=i)}function eB(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Bc=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return $r.join(this.historyPath,xt(e))}getCollectionHistoryPath(e,r){return $r.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return $r.join(this.getCollectionHistoryPath(e,r),xt(n))}getSharedEnvironmentHistoryPath(e){return $r.join(this.sharedHistoryPath,xt(e))}getSharedCollectionHistoryPath(e,r){return $r.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return $r.join(this.getSharedCollectionHistoryPath(e,r),xt(n))}getHistoryFilePath(e,r,n){return $r.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return $r.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return $r.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return $r.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let a=this.loadHistory(e,r,n);a||(a={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let u=db({...s,method:i,id:rv(),timestamp:Date.now()});return a.requests.unshift(u),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),u}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveHistory(s);let u=this.getResponseFilePath(e,r,n,i);return ke.existsSync(u)&&ke.unlinkSync(u),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let u=this.getSharedResponseFilePath(e,r,n,i);return ke.existsSync(u)&&ke.unlinkSync(u),!0}return!1}shareEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadHistory(e,r,n);if(!u)return!1;let f=u.requests.findIndex(_=>_.id===i);if(f===-1)return!1;let[h]=u.requests.splice(f,1);this.saveHistory(u);let g=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:u.method,requests:[]};if(!g.requests.some(_=>_.id===i)){let _={...h,ticket:null,branch:a};g.requests.unshift(_),g.requests.length>100&&(g.requests=g.requests.slice(0,100)),this.saveSharedHistory(g)}let m=this.getResponseFilePath(e,r,n,i),S=this.getSharedResponseFilePath(e,r,n,i);if(ke.existsSync(m)){let _=$r.dirname(S);ke.existsSync(_)||ke.mkdirSync(_,{recursive:!0});try{ke.renameSync(m,S)}catch{try{ke.copyFileSync(m,S)}catch(x){return console.error(`Failed to copy full response from ${m} to ${S}:`,x),!0}try{ke.unlinkSync(m)}catch(x){console.warn(`Failed to remove original full response after copy: ${m}`,x)}}}return!0}moveSharedEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadSharedHistory(e,r,n);if(!u)return!1;let f=!1;return u.requests=u.requests.map(h=>h.id===i?(f=!0,{...h,ticket:null,branch:a}):h),f?(this.saveSharedHistory(u),!0):!1}renameSharedGroup(e,r,n,i,s){let a=(i||"").trim(),u=(s||"").trim();if(!a||!u||a===u)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let h=!1;return f.requests=f.requests.map(g=>!g.ticket&&g.branch===a?(h=!0,{...g,branch:u}):g),h?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let a of s)ke.unlinkSync($r.join(i,a));ke.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),u=this.getResponseFilePath(e,r,n,i);try{ke.existsSync(a)||ke.mkdirSync(a,{recursive:!0});let f=hb(s);ke.writeFileSync(u,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}};var Cl=class{constructor(e,r){this.historyService=e;this.inferrer=r}async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,r),u=this.historyService.loadSharedHistory(i,e,r),f=[...a?.requests||[],...u?.requests||[]];if(f.length===0)return{responses:{}};let h=f.slice(0,s),g=new Map;for(let S of h){let _=this.historyService.loadFullResponse(i,e,r,S.id);if(_||(_=this.historyService.loadSharedFullResponse(i,e,r,S.id)),_){let C=_.status;g.has(C)||g.set(C,[]),g.get(C).push(_)}}let m={};for(let[S,_]of g){let C=this.buildResponseDefinition(_);m[String(S)]=C}return{responses:m}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let u=1;u<e.length;u++){let f=this.inferBodySchema(e[u]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(r.schema=a),n.body!==void 0&&n.body!==null){let u=typeof n.body=="string"?this.tryParseJson(n.body):n.body;u!==void 0&&(r.examples={default:{summary:"Captured from history",value:u}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let u of e)for(let[f,h]of Object.entries(u.headers)){let g=f.toLowerCase();r.has(g)||(n.set(g,(n.get(g)||0)+1),i.has(g)||i.set(g,Array.isArray(h)?h.join(", "):h))}let s=Math.ceil(e.length/2),a={};for(let[u,f]of n)if(f>=s){let h=i.get(u);a[u]={schema:this.inferHeaderSchema(h)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}};var CP=tv(K0());var OY=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,PY=/^\d{4}-\d{2}-\d{2}$/,kY=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,AY=/^https?:\/\/[^\s]+$/,TY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,qY=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,$Y=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,to=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(OY.test(e))return"date-time";if(PY.test(e))return"date";if(kY.test(e))return"email";if(TY.test(e))return"uuid";if(AY.test(e))return"uri";if(qY.test(e))return"ipv4";if($Y.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=r.properties||{},u=new Set([...Object.keys(s),...Object.keys(a)]);for(let m of u)s[m]&&a[m]?i.properties[m]=this.mergeSchemas(s[m],a[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...a[m]};let f=new Set(e.required||Object.keys(s)),h=new Set(r.required||Object.keys(a)),g=[...u].filter(m=>f.has(m)&&h.has(m));return g.length>0&&(i.required=g),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}};var MY=new Set(["content-type","authorization","accept","cookie","host","content-length"]),Nl=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new to}inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:h,scheme:g,requirement:m}=f;s.set(h,g),i.security=[m]}}let a=new Set,u=new Set;if(await this.processItems(n.items,i,s,a,u,void 0,n,r),this.augmentServersFromHostVars(u,i.servers,r),s.size>0)for(let[f,h]of s)i.components.securitySchemes[f]=h;else delete i.components.securitySchemes;return i.tags=[...a].map(f=>({name:f})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?CP.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),r.push({url:a,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,a,u,f){for(let h of e)if(h.type==="folder"){let g=h,m=a||g.name;i.add(m),g.items&&await this.processItems(g.items,r,n,i,s,m,u,f)}else{let g=h;await this.processRequest(g,r,n,i,s,a,u,f)}}async processRequest(e,r,n,i,s,a,u,f){let{path:h,hostVar:g}=this.normalizeUrl(e.url);g&&s.add(g);let m=(e.method||"GET").toLowerCase();r.paths[h]||(r.paths[h]={});let S={};S.operationId=this.generateOperationId(e,m,h,r),S.summary=this.cleanSummary(e.name),e.description&&(S.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(S.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(S.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(S.tags=[a]);let _=this.buildParameters(e);_.length>0&&(S.parameters=_);let C=await this.buildRequestBody(e,f);C&&(S.requestBody=C);let x=await this.buildResponses(e,u.id,f);S.responses=x;let A=this.buildOperationSecurity(e,u,n);A!==void 0&&(S.security=A);let T=r.paths[h][m];T?this.mergeOperation(T,S,e.name):r.paths[h][m]=S}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
262
|
+
`.trim(),Qc=class{constructor(e){this.httpClient=e}httpClient;schemaCache=new Map;async fetchSchema(e,r){let n={method:"POST",url:e,headers:{"Content-Type":"application/json",Accept:"application/json",...r||{}},body:JSON.stringify({query:gB,operationName:"IntrospectionQuery"})},i=await this.httpClient.send(n);if(i.status<200||i.status>=300)throw new Error(`Introspection query failed with status ${i.status}: ${i.statusText}`);let s=typeof i.body=="string"?JSON.parse(i.body):i.body;if(s.errors&&s.errors.length>0){let u=s.errors.map(f=>f.message).join("; ");throw new Error(`Introspection query returned errors: ${u}`)}if(!s.data?.__schema)throw new Error("Invalid introspection response: missing __schema");let a=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,a),a}getCachedSchema(e){return this.schemaCache.get(e)}extractOperations(e){let r=[],n=e.split(`
|
|
263
|
+
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&r.push({type:a[1],name:a[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(u=>this.parseField(u)),inputFields:(s.inputFields||[]).map(u=>this.parseArg(u)),enumValues:(s.enumValues||[]).map(u=>({name:u.name,description:u.description||void 0,isDeprecated:u.isDeprecated||!1,deprecationReason:u.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(u=>this.renderTypeRef(u)),possibleTypes:(s.possibleTypes||[]).map(u=>this.renderTypeRef(u))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}};import*as Oe from"fs";import*as Nr from"path";var Al="***",lb=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,vn=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;function Zc(t){let e={};for(let[r,n]of Object.entries(t))lb.test(r)?e[r]=Array.isArray(n)?n.map(()=>Al):Al:e[r]=n;return e}function ub(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)vn.test(n)&&(e.searchParams.set(n,Al),r=!0);return r?e.toString():t}catch{return t}}function ap(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>ap(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t))vn.test(r)?e[r]=Al:typeof n=="object"&&n!==null?e[r]=ap(n):e[r]=n;return e}function yB(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)vn.test(n)&&(e.set(n,Al),r=!0);return r?e.toString():t}catch{return t}}function cb(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return ap(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=ap(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
|
|
264
|
+
`))return yB(e)}return t}function fb(t){return{...t,sentRequest:{...t.sentRequest,url:ub(t.sentRequest.url),headers:Zc(t.sentRequest.headers),body:t.sentRequest.body!=null?cb(t.sentRequest.body):t.sentRequest.body}}}function db(t){return{...t,headers:Zc(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&vn.test(e.name)?{...e,value:Al}:e)}}function hb(t){return{...t,url:ub(t.url),request:{headers:Zc(t.request.headers),body:t.request.body!=null?cb(t.request.body):t.request.body},response:{headers:Zc(t.response.headers),body:t.response.body}}}var vB=/\{\{[^}]+\}\}/;function lr(t){return typeof t=="string"&&vB.test(t)}function SB(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)vn.test(n)&&i&&!lr(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)lb.test(n)&&i&&!lr(i)&&e.push({location:"header",field:n,message:`Header "${n}" contains a hardcoded value. Use a {{variable}} instead (e.g. {{${n.toLowerCase().replace(/[^a-z0-9]/g,"_")}}})`})}if(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)vn.test(n)&&i&&!lr(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!lr(r.bearerToken)&&e.push({location:"auth",field:"bearerToken",message:"Bearer token contains a hardcoded value. Store it in a {{variable}} in your .local.json environment file."}),r.basicAuth&&r.basicAuth.password&&!lr(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!lr(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&sp(r,e)}return e}function sp(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{sp(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
|
|
265
|
+
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)vn.test(i)&&s&&!lr(s)&&e.push({location:"body",field:i,message:`Form field "${i}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}return}return}if(Array.isArray(t)){t.forEach(r=>sp(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))vn.test(r)&&n&&typeof n=="string"&&!lr(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&sp(n,e)}}function ea(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function bB(t){let e=[],r=new Set;function n(i){let s=i,a=2;for(;r.has(s);)s=`${i}_${a++}`;return r.add(s),s}if(t.url)try{let i=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[s,a]of i.searchParams)vn.test(s)&&a&&!lr(a)&&e.push({location:"url",field:s,value:a,variableName:n(ea(s))})}catch{}if(t.headers){let i=Array.isArray(t.headers)?t.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.headers);for(let[s,a]of i)lb.test(s)&&a&&!lr(a)&&e.push({location:"header",field:s,value:a,variableName:n(ea(s))})}if(t.query){let i=Array.isArray(t.query)?t.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.query);for(let[s,a]of i)vn.test(s)&&a&&!lr(a)&&e.push({location:"query",field:s,value:a,variableName:n(ea(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!lr(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!lr(i.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",value:i.basicAuth.password,variableName:n("basic_auth_password")}),i.apikey||i.apiKey){let s=i.apikey||i.apiKey;s.value&&!lr(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(t.body){let i=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;i&&op(i,e,r,"")}return e}function op(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{op(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
|
|
266
|
+
`)){try{let s=new URLSearchParams(i);for(let[a,u]of s)if(vn.test(a)&&u&&!lr(u)){let f=ea(a),h=2;for(;r.has(f);)f=`${ea(a)}_${h++}`;r.add(f),e.push({location:"body",field:a,path:n?`${n}.${a}`:a,value:u,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>op(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let a=n?`${n}.${i}`:i;if(vn.test(i)&&s&&typeof s=="string"&&!lr(s)){let u=ea(i),f=2;for(;r.has(u);)u=`${ea(i)}_${f++}`;r.add(u),e.push({location:"body",field:i,path:a,value:s,variableName:u})}else typeof s=="object"&&s!==null&&op(s,e,r,a)}}}function _B(t,e){let r=JSON.parse(JSON.stringify(t));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":r.url&&(r.url=r.url.replace(new RegExp(`([?&])${EB(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.headers&&r.headers[n.field]===n.value&&(r.headers[n.field]=i);break;case"query":if(Array.isArray(r.query)){let s=r.query.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.query&&r.query[n.field]===n.value&&(r.query[n.field]=i);break;case"auth":if(r.auth){if(n.field==="bearerToken")r.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&r.auth.basicAuth)r.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=r.auth.apikey||r.auth.apiKey;s&&(s.value=i)}}break;case"body":wB(r,n.field,n.path,n.value,i);break}}return r}function wB(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,a=s?s.content:t.body;if(a){if(typeof a=="string"){let u=a.trim();if(u.startsWith("{")||u.startsWith("[")){try{let f=JSON.parse(u);BR(f,e,r||e,n,i);let h=JSON.stringify(f,null,2);s?s.content=h:t.body=h}catch{}return}if(u.includes("=")&&!u.includes(`
|
|
267
|
+
`)){let f=new URLSearchParams(u);if(f.get(e)===n){f.set(e,i);let h=f.toString();s?s.content=h:t.body=h}return}return}typeof a=="object"&&a!==null&&BR(a,e,r||e,n,i)}}function BR(t,e,r,n,i){let s=r.split("."),a=t;for(let f=0;f<s.length-1;f++){let h=s[f],g=h.match(/^(.+)\[(\d+)\]$/);if(g?a=a?.[g[1]]?.[parseInt(g[2])]:a=a?.[h],a==null)return}let u=s[s.length-1];a&&a[u]===n&&(a[u]=i)}function EB(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Xc=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Nr.join(this.historyPath,Et(e))}getCollectionHistoryPath(e,r){return Nr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Nr.join(this.getCollectionHistoryPath(e,r),Et(n))}getSharedEnvironmentHistoryPath(e){return Nr.join(this.sharedHistoryPath,Et(e))}getSharedCollectionHistoryPath(e,r){return Nr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Nr.join(this.getSharedCollectionHistoryPath(e,r),Et(n))}getHistoryFilePath(e,r,n){return Nr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Nr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Nr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Nr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!Oe.existsSync(i))return null;let s=Oe.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!Oe.existsSync(i))return null;let s=Oe.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Oe.existsSync(r)||Oe.mkdirSync(r,{recursive:!0}),Oe.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Oe.existsSync(r)||Oe.mkdirSync(r,{recursive:!0}),Oe.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let a=this.loadHistory(e,r,n);a||(a={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let u=fb({...s,method:i,id:tv(),timestamp:Date.now()});return a.requests.unshift(u),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),u}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveHistory(s);let u=this.getResponseFilePath(e,r,n,i);return Oe.existsSync(u)&&Oe.unlinkSync(u),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let u=this.getSharedResponseFilePath(e,r,n,i);return Oe.existsSync(u)&&Oe.unlinkSync(u),!0}return!1}shareEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadHistory(e,r,n);if(!u)return!1;let f=u.requests.findIndex(E=>E.id===i);if(f===-1)return!1;let[h]=u.requests.splice(f,1);this.saveHistory(u);let g=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:u.method,requests:[]};if(!g.requests.some(E=>E.id===i)){let E={...h,ticket:null,branch:a};g.requests.unshift(E),g.requests.length>100&&(g.requests=g.requests.slice(0,100)),this.saveSharedHistory(g)}let m=this.getResponseFilePath(e,r,n,i),S=this.getSharedResponseFilePath(e,r,n,i);if(Oe.existsSync(m)){let E=Nr.dirname(S);Oe.existsSync(E)||Oe.mkdirSync(E,{recursive:!0});try{Oe.renameSync(m,S)}catch{try{Oe.copyFileSync(m,S)}catch(C){return console.error(`Failed to copy full response from ${m} to ${S}:`,C),!0}try{Oe.unlinkSync(m)}catch(C){console.warn(`Failed to remove original full response after copy: ${m}`,C)}}}return!0}moveSharedEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadSharedHistory(e,r,n);if(!u)return!1;let f=!1;return u.requests=u.requests.map(h=>h.id===i?(f=!0,{...h,ticket:null,branch:a}):h),f?(this.saveSharedHistory(u),!0):!1}renameSharedGroup(e,r,n,i,s){let a=(i||"").trim(),u=(s||"").trim();if(!a||!u||a===u)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let h=!1;return f.requests=f.requests.map(g=>!g.ticket&&g.branch===a?(h=!0,{...g,branch:u}):g),h?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(Oe.existsSync(i)){let s=Oe.readdirSync(i);for(let a of s)Oe.unlinkSync(Nr.join(i,a));Oe.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),u=this.getResponseFilePath(e,r,n,i);try{Oe.existsSync(a)||Oe.mkdirSync(a,{recursive:!0});let f=db(s);Oe.writeFileSync(u,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!Oe.existsSync(s))return null;let a=Oe.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!Oe.existsSync(s))return null;let a=Oe.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}};var Tl=class{constructor(e,r){this.historyService=e;this.inferrer=r}historyService;inferrer;async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,r),u=this.historyService.loadSharedHistory(i,e,r),f=[...a?.requests||[],...u?.requests||[]];if(f.length===0)return{responses:{}};let h=f.slice(0,s),g=new Map;for(let S of h){let E=this.historyService.loadFullResponse(i,e,r,S.id);if(E||(E=this.historyService.loadSharedFullResponse(i,e,r,S.id)),E){let x=E.status;g.has(x)||g.set(x,[]),g.get(x).push(E)}}let m={};for(let[S,E]of g){let x=this.buildResponseDefinition(E);m[String(S)]=x}return{responses:m}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let u=1;u<e.length;u++){let f=this.inferBodySchema(e[u]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(r.schema=a),n.body!==void 0&&n.body!==null){let u=typeof n.body=="string"?this.tryParseJson(n.body):n.body;u!==void 0&&(r.examples={default:{summary:"Captured from history",value:u}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let u of e)for(let[f,h]of Object.entries(u.headers)){let g=f.toLowerCase();r.has(g)||(n.set(g,(n.get(g)||0)+1),i.has(g)||i.set(g,Array.isArray(h)?h.join(", "):h))}let s=Math.ceil(e.length/2),a={};for(let[u,f]of n)if(f>=s){let h=i.get(u);a[u]={schema:this.inferHeaderSchema(h)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}};var AP=ev(z0());var QY=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,ZY=/^\d{4}-\d{2}-\d{2}$/,XY=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,eJ=/^https?:\/\/[^\s]+$/,tJ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,rJ=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,nJ=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,Ys=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(QY.test(e))return"date-time";if(ZY.test(e))return"date";if(XY.test(e))return"email";if(tJ.test(e))return"uuid";if(eJ.test(e))return"uri";if(rJ.test(e))return"ipv4";if(nJ.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=r.properties||{},u=new Set([...Object.keys(s),...Object.keys(a)]);for(let m of u)s[m]&&a[m]?i.properties[m]=this.mergeSchemas(s[m],a[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...a[m]};let f=new Set(e.required||Object.keys(s)),h=new Set(r.required||Object.keys(a)),g=[...u].filter(m=>f.has(m)&&h.has(m));return g.length>0&&(i.required=g),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}};var iJ=new Set(["content-type","authorization","accept","cookie","host","content-length"]),Vl=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new Ys}collectionService;envConfigService;inferenceService;inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:h,scheme:g,requirement:m}=f;s.set(h,g),i.security=[m]}}let a=new Set,u=new Set;if(await this.processItems(n.items,i,s,a,u,void 0,n,r),this.augmentServersFromHostVars(u,i.servers,r),s.size>0)for(let[f,h]of s)i.components.securitySchemes[f]=h;else delete i.components.securitySchemes;return i.tags=[...a].map(f=>({name:f})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?AP.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),r.push({url:a,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,a,u,f){for(let h of e)if(h.type==="folder"){let g=h,m=a||g.name;i.add(m),g.items&&await this.processItems(g.items,r,n,i,s,m,u,f)}else{let g=h;await this.processRequest(g,r,n,i,s,a,u,f)}}async processRequest(e,r,n,i,s,a,u,f){let{path:h,hostVar:g}=this.normalizeUrl(e.url);g&&s.add(g);let m=(e.method||"GET").toLowerCase();r.paths[h]||(r.paths[h]={});let S={};S.operationId=this.generateOperationId(e,m,h,r),S.summary=this.cleanSummary(e.name),e.description&&(S.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(S.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(S.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(S.tags=[a]);let E=this.buildParameters(e);E.length>0&&(S.parameters=E);let x=await this.buildRequestBody(e,f);x&&(S.requestBody=x);let C=await this.buildResponses(e,u.id,f);S.responses=C;let A=this.buildOperationSecurity(e,u,n);A!==void 0&&(S.security=A);let T=r.paths[h][m];T?this.mergeOperation(T,S,e.name):r.paths[h][m]=S}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
268
268
|
|
|
269
|
-
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},a=this.getConstraintKind(i),u=this.getConstraintKind(s);if(a==="none"&&u==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(u==="none")this.widenType(i,s);else if(a===u)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(h=>JSON.stringify(h)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),h=this.buildVariantSchema(s);i.oneOf=[f,h]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.has(s)){let u=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+u.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||MY.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),u=i.substring(s+1).trim();r.push({name:a,in:"cookie",schema:{type:"string"},example:u})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,u,f;if(e.bodySchema){if(e.bodySchema.content){for(let[m,S]of Object.entries(e.bodySchema.content)){let _={};S.schema&&(_.schema=S.schema),S.examples&&(_.examples=S.examples),S.encoding&&(_.encoding=S.encoding),i.content[m]=_}let g=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(g&&n.content){let m=this.tryParseBodyContent(n);m!==void 0&&i.content[g]&&(i.content[g].example=m)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,u=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let g=this.tryParseBodyContent(n);g!==void 0?(a=this.inferrer.inferFromValue(g),u=g):a={type:"string"}}else a={type:"string"},u=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u=this.tryParseBodyContent(n);break}default:return null}let h={};return a&&(h.schema=a),u!==void 0&&(h.example=u),f&&(h.encoding=f),i.content[s]=h,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let u={description:a.description||`Status ${s}`};if(a.content){u.content={};for(let[f,h]of Object.entries(a.content)){let g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),u.content[f]=g}}else if(a.schema){let f=a.contentType||"application/json",h={schema:a.schema};a.examples&&(h.examples=a.examples),u.content={[f]:h}}if(a.headers){u.headers={};for(let[f,h]of Object.entries(a.headers))u.headers[f]={...h.description&&{description:h.description},schema:h.schema}}i[s]=u}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:u}=i;return n.set(s,a),[u]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,u]of Object.entries(s)){let f=u;if(f.responses){for(let[h,g]of Object.entries(f.responses))if(g.content)for(let m of Object.values(g.content))m.schema&&this.trackSchema(m.schema,`${a}${i}Response${h}`,r,n)}if(f.requestBody?.content)for(let h of Object.values(f.requestBody.content))h.schema&&this.trackSchema(h.schema,`${a}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let u=this.sanitizeComponentName(s.name);e.components.schemas[u]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${u}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let u of Object.values(a.responses))if(u.content)for(let f of Object.values(u.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let u of Object.values(a.requestBody.content))u.schema&&JSON.stringify(u.schema)===i&&(u.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let u=`{{${a}}}`,f=!1;for(let h of s){let g=this.envConfigService.resolveVariables(u,h);g&&g!==u&&!i.has(g)&&(r.push({url:g,description:h}),i.add(g),f=!0)}if(!f){let h=`{${a}}`;i.has(h)||(r.push({url:h,variables:{[a]:{default:""}}}),i.add(h))}}}};var Zk=tv(K0());import*as Qk from"fs";var Dl=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let u=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;u.properties&&Object.assign(i.properties,u.properties),u.required&&(i.required=[...i.required||[],...u.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}};var Mm=tv(Gk()),Zl=class{async resolve(e){try{return await Mm.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await Mm.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Mm.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}};var _4=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Xl=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new Dl,this.refResolver=new Zl}exampleGenerator;refResolver;async import(e,r){let n=await Qk.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=Zk.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:at(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(f.auth=m)}let h=new Map;if(i.tags)for(let m of i.tags){let S={type:"folder",id:at(m.name),name:m.name,description:m.description,items:[]};h.set(m.name,S),f.items.push(S)}if(i.paths)for(let[m,S]of Object.entries(i.paths))for(let _ of["get","post","put","patch","delete","head","options","trace"]){let C=S[_];if(!C)continue;let x=this.processOperation(_,m,C,S,i,s),A=C.tags?.[0];if(A&&h.has(A))h.get(A).items.push(x);else if(A){let T={type:"folder",id:at(A),name:A,items:[x]};h.set(A,T),f.items.push(T)}else f.items.push(x)}await this.collectionService.saveCollection(f);let g;return r?.environmentName&&i.servers&&(g=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:g}}processOperation(e,r,n,i,s,a){let u=at(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,h=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,g=n.deprecated===!0;g&&(h=`[DEPRECATED] ${h}`);let m={type:"request",id:u,name:h,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:g},S=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,S,a),n.requestBody&&this.processRequestBody(m,n.requestBody,a),n.responses&&(m.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let _=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);_&&(m.auth=_)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},u=[];for(let f of r){let h=f.name,g=f.in,m=f.schema||{},S=f.example!==void 0?String(f.example):this.generateExampleForParam(m,n),_=f.deprecated===!0;switch(g){case"path":{if(f.description||m.type||m.format||m.enum||_||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let x={value:S};m.oneOf?(x.oneOf=m.oneOf,this.applyOneOfHints(x,m.oneOf)):(m.type&&(x.type=m.type),m.format&&(x.format=m.format),m.enum&&(x.enum=m.enum.map(String)),m.pattern&&(x.pattern=m.pattern),m.minimum!==void 0&&(x.minimum=m.minimum),m.maximum!==void 0&&(x.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(x.multipleOf=m.multipleOf),m.minLength!==void 0&&(x.minLength=m.minLength),m.maxLength!==void 0&&(x.maxLength=m.maxLength),m.minItems!==void 0&&(x.minItems=m.minItems),m.maxItems!==void 0&&(x.maxItems=m.maxItems),m.uniqueItems&&(x.uniqueItems=!0),m.nullable&&(x.nullable=!0)),f.description&&(x.description=f.description),_&&(x.deprecated=!0),a[h]=x}else a[h]=S;break}case"query":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,_),s.push(C);break}case"header":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,_),i.push(C);break}case"cookie":{u.push(`${h}={{${h}}}`);break}}}u.length>0&&i.push({key:"Cookie",value:u.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=r.content[s],{bodyType:u,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:u,...f&&{format:f},content:""},a){let g=this.generateBodyContent(a,s,n);g!==void 0&&(e.body.content=typeof g=="string"?g:JSON.stringify(g,null,2)),u==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),u==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let h=this.buildBodySchema(r,s,n);h&&(e.bodySchema=h)}selectPrimaryContentType(e){for(let i of _4)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,u]of Object.entries(i)){let f=u,h=f.type==="string"&&f.format==="binary",g={key:a,value:h?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:h?"file":"text",enabled:!0};n.push(g)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let h=e.content[f],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),h.encoding&&(g.encoding=h.encoding),a.content[f]=g}}s.encoding&&(a.encoding=s.encoding);let u=this.extractUsedComponents(s.schema,n);return Object.keys(u).length>0&&(a.components=u),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let u=a,f={description:u.description||`Status ${s}`};if(u.content){let h=Object.keys(u.content);if(h.length===1){let g=h[0],m=u.content[g];f.contentType=g,m.schema&&(f.schema=m.schema),m.examples&&(f.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{f.content={};for(let g of h){let m=u.content[g],S={};m.schema&&(S.schema=m.schema),m.examples&&(S.examples=m.examples),f.content[g]=S,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(u.headers){f.headers={};for(let[h,g]of Object.entries(u.headers)){let m=g;f.headers[h]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},u="client_credentials";return s.authorizationCode?u="authorization_code":s.password?u="password":s.implicit&&(u="implicit"),{type:"oauth2",oauth2:{grantType:u,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}};var eu=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,u;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),u="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),u="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),u="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},u="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},u=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},u="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:u,schema:a}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],a=s.endsWith("[]"),u=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,h=r.slice(1);if(!e.properties[u])if(a)e.properties[u]={type:"array",items:{type:"object"}};else if(h.length>0)e.properties[u]={type:"object",properties:{}};else{let g=n.typeHints[f];e.properties[u]={type:g||"string"};return}if(h.length>0){let g=a?e.properties[u].items:e.properties[u];g&&this.ensureFieldPath(g,h,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}};var Xk=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,eA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(?:a|an)\(['"](\w+)['"]\)/g,tA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.(?:equal|eql)\((.+?)\)/g,rA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,nA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(true|false)/g,iA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.have\.(?:lengthOf|length\.above|length\.below)/g,tu=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(Xk.source,Xk.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(eA.source,eA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(tA.source,tA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let u=this.parseAssertionValue(a);u!==void 0&&(r.valueHints[s]=u,typeof u=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof u=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(u)?"integer":"number"):typeof u=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(nA.source,nA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(iA.source,iA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(rA.source,rA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}};var ne={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter")};var w4={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}};function oA(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:u,browserService:f,applicationInfo:h,consoleService:g}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new wl(r,n,i)),t.registerSingleton(ne.Console,()=>g??w4),t.registerSingleton(ne.EnvironmentConfig,S=>new Dc(r,s,S.resolve(ne.Config),n)),t.registerSingleton(ne.Cookie,()=>new $c(a)),t.registerSingleton(ne.Collection,S=>new qc(r,S.resolve(ne.Config),n)),t.registerSingleton(ne.HttpClient,()=>new Do),t.registerSingleton(ne.UrlBuilder,()=>new Dn),t.registerSingleton(ne.InterceptorChain,()=>new Yi),t.registerSingleton(ne.HttpRequest,S=>new Wi(S.resolve(ne.UrlBuilder),S.resolve(ne.InterceptorChain),S.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new zo),t.registerSingleton(ne.RequestHistory,S=>{let _=S.resolve(ne.EnvironmentConfig);return new Bc(_.getHistoriesPath(),sA.join(_.getRootPath(),"shared-histories"))}),u&&f&&t.registerSingleton(ne.OAuth2TokenManager,S=>new kc(u,f,S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,S=>new jc(S.resolve(ne.HttpClient)));let m=h??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,S=>new Lc(S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest),S.resolve(ne.RequestPreprocessor),S.resolve(ne.OAuth2TokenManager),m)),t.registerSingleton(ne.ScriptExecutor,S=>{let _=S.resolve(ne.Config);return new Zi(S.resolve(ne.HttpRequest),_.getModulePaths())}),t.registerSingleton(ne.DataFileParser,()=>new Go),t.registerSingleton(ne.CollectionRequestExecutor,S=>new Fc(S.resolve(ne.HttpRequest),S.resolve(ne.ScriptExecutor),S.resolve(ne.EnvironmentConfig),S.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,S=>new Mc(S.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new to),t.registerSingleton(ne.HistoryAnalyzer,S=>new Cl(S.resolve(ne.RequestHistory),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new tu),t.registerSingleton(ne.SchemaInferenceService,S=>new eu(S.resolve(ne.HistoryAnalyzer),S.resolve(ne.ScriptAnalyzer),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,S=>new Nl(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig),S.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,S=>new Xl(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig)))}var Nf=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.resolve(ne.OAuth2TokenManager)}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}};function aA(){return Nf.instance}var uw=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())lt.isExpired(n)||(!n.domain||lt.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!lt.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())lt.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=lt.extractDomain(e),i=lt.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=lt.extractDomain(e),n=lt.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return lt.formatCookieHeader(s)}clear(){this.cookies.clear()}};function E4(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=T4(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(q4(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let u=a.match(/\.\.\.\s+on\s+(\w*)$/);if(u)return{contextType:"fragment_type",fieldPath:[],prefix:u[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&lA(a)){let m=cw(a,r),S=m.length>0?m[m.length-1]:void 0,_=uA(a);return{contextType:"argument_value",fieldPath:m,parentType:S,prefix:f[2]||"",currentArg:f[1],currentField:_||void 0}}if(lA(a)){let m=cw(a,r),S=m.length>0?m[m.length-1]:void 0,_=uA(a);return{contextType:"argument",fieldPath:m,parentType:S,prefix:s,currentField:_||void 0}}if(fw(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let g=cw(a,r);return{contextType:"selection_set",fieldPath:g,parentType:g.length>0?g[g.length-1]:void 0,prefix:s}}function C4(t,e){switch(e.contextType){case"root":return x4(t,e.prefix);case"selection_set":return R4(t,e);case"argument":return I4(t,e);case"argument_value":return O4(t,e);case"directive":return P4(t,e.prefix);case"fragment_type":return k4(t,e.prefix);case"variable_def":return A4(t,e.prefix);default:return[]}}function x4(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
269
|
+
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},a=this.getConstraintKind(i),u=this.getConstraintKind(s);if(a==="none"&&u==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(u==="none")this.widenType(i,s);else if(a===u)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(h=>JSON.stringify(h)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),h=this.buildVariantSchema(s);i.oneOf=[f,h]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.has(s)){let u=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+u.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||iJ.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),u=i.substring(s+1).trim();r.push({name:a,in:"cookie",schema:{type:"string"},example:u})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,u,f;if(e.bodySchema){if(e.bodySchema.content){for(let[m,S]of Object.entries(e.bodySchema.content)){let E={};S.schema&&(E.schema=S.schema),S.examples&&(E.examples=S.examples),S.encoding&&(E.encoding=S.encoding),i.content[m]=E}let g=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(g&&n.content){let m=this.tryParseBodyContent(n);m!==void 0&&i.content[g]&&(i.content[g].example=m)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,u=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let g=this.tryParseBodyContent(n);g!==void 0?(a=this.inferrer.inferFromValue(g),u=g):a={type:"string"}}else a={type:"string"},u=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u=this.tryParseBodyContent(n);break}default:return null}let h={};return a&&(h.schema=a),u!==void 0&&(h.example=u),f&&(h.encoding=f),i.content[s]=h,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let u={description:a.description||`Status ${s}`};if(a.content){u.content={};for(let[f,h]of Object.entries(a.content)){let g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),u.content[f]=g}}else if(a.schema){let f=a.contentType||"application/json",h={schema:a.schema};a.examples&&(h.examples=a.examples),u.content={[f]:h}}if(a.headers){u.headers={};for(let[f,h]of Object.entries(a.headers))u.headers[f]={...h.description&&{description:h.description},schema:h.schema}}i[s]=u}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:u}=i;return n.set(s,a),[u]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,u]of Object.entries(s)){let f=u;if(f.responses){for(let[h,g]of Object.entries(f.responses))if(g.content)for(let m of Object.values(g.content))m.schema&&this.trackSchema(m.schema,`${a}${i}Response${h}`,r,n)}if(f.requestBody?.content)for(let h of Object.values(f.requestBody.content))h.schema&&this.trackSchema(h.schema,`${a}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let u=this.sanitizeComponentName(s.name);e.components.schemas[u]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${u}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let u of Object.values(a.responses))if(u.content)for(let f of Object.values(u.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let u of Object.values(a.requestBody.content))u.schema&&JSON.stringify(u.schema)===i&&(u.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let u=`{{${a}}}`,f=!1;for(let h of s){let g=this.envConfigService.resolveVariables(u,h);g&&g!==u&&!i.has(g)&&(r.push({url:g,description:h}),i.add(g),f=!0)}if(!f){let h=`{${a}}`;i.has(h)||(r.push({url:h,variables:{[a]:{default:""}}}),i.add(h))}}}};var lA=ev(z0());import*as aA from"fs";var Wl=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let u=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;u.properties&&Object.assign(i.properties,u.properties),u.required&&(i.required=[...i.required||[],...u.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}};var $m=ev(oA()),ou=class{async resolve(e){try{return await $m.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await $m.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await $m.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}};var z4=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],au=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new Wl,this.refResolver=new ou}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await aA.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=lA.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:ut(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(f.auth=m)}let h=new Map;if(i.tags)for(let m of i.tags){let S={type:"folder",id:ut(m.name),name:m.name,description:m.description,items:[]};h.set(m.name,S),f.items.push(S)}if(i.paths)for(let[m,S]of Object.entries(i.paths))for(let E of["get","post","put","patch","delete","head","options","trace"]){let x=S[E];if(!x)continue;let C=this.processOperation(E,m,x,S,i,s),A=x.tags?.[0];if(A&&h.has(A))h.get(A).items.push(C);else if(A){let T={type:"folder",id:ut(A),name:A,items:[C]};h.set(A,T),f.items.push(T)}else f.items.push(C)}await this.collectionService.saveCollection(f);let g;return r?.environmentName&&i.servers&&(g=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:g}}processOperation(e,r,n,i,s,a){let u=ut(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,h=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,g=n.deprecated===!0;g&&(h=`[DEPRECATED] ${h}`);let m={type:"request",id:u,name:h,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:g},S=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,S,a),n.requestBody&&this.processRequestBody(m,n.requestBody,a),n.responses&&(m.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let E=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);E&&(m.auth=E)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},u=[];for(let f of r){let h=f.name,g=f.in,m=f.schema||{},S=f.example!==void 0?String(f.example):this.generateExampleForParam(m,n),E=f.deprecated===!0;switch(g){case"path":{if(f.description||m.type||m.format||m.enum||E||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let C={value:S};m.oneOf?(C.oneOf=m.oneOf,this.applyOneOfHints(C,m.oneOf)):(m.type&&(C.type=m.type),m.format&&(C.format=m.format),m.enum&&(C.enum=m.enum.map(String)),m.pattern&&(C.pattern=m.pattern),m.minimum!==void 0&&(C.minimum=m.minimum),m.maximum!==void 0&&(C.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(C.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(C.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(C.multipleOf=m.multipleOf),m.minLength!==void 0&&(C.minLength=m.minLength),m.maxLength!==void 0&&(C.maxLength=m.maxLength),m.minItems!==void 0&&(C.minItems=m.minItems),m.maxItems!==void 0&&(C.maxItems=m.maxItems),m.uniqueItems&&(C.uniqueItems=!0),m.nullable&&(C.nullable=!0)),f.description&&(C.description=f.description),E&&(C.deprecated=!0),a[h]=C}else a[h]=S;break}case"query":{let x={key:h,value:S};this.applySchemaConstraints(x,m,f,E),s.push(x);break}case"header":{let x={key:h,value:S};this.applySchemaConstraints(x,m,f,E),i.push(x);break}case"cookie":{u.push(`${h}={{${h}}}`);break}}}u.length>0&&i.push({key:"Cookie",value:u.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=r.content[s],{bodyType:u,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:u,...f&&{format:f},content:""},a){let g=this.generateBodyContent(a,s,n);g!==void 0&&(e.body.content=typeof g=="string"?g:JSON.stringify(g,null,2)),u==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),u==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let h=this.buildBodySchema(r,s,n);h&&(e.bodySchema=h)}selectPrimaryContentType(e){for(let i of z4)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,u]of Object.entries(i)){let f=u,h=f.type==="string"&&f.format==="binary",g={key:a,value:h?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:h?"file":"text",enabled:!0};n.push(g)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let h=e.content[f],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),h.encoding&&(g.encoding=h.encoding),a.content[f]=g}}s.encoding&&(a.encoding=s.encoding);let u=this.extractUsedComponents(s.schema,n);return Object.keys(u).length>0&&(a.components=u),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let u=a,f={description:u.description||`Status ${s}`};if(u.content){let h=Object.keys(u.content);if(h.length===1){let g=h[0],m=u.content[g];f.contentType=g,m.schema&&(f.schema=m.schema),m.examples&&(f.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{f.content={};for(let g of h){let m=u.content[g],S={};m.schema&&(S.schema=m.schema),m.examples&&(S.examples=m.examples),f.content[g]=S,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(u.headers){f.headers={};for(let[h,g]of Object.entries(u.headers)){let m=g;f.headers[h]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},u="client_credentials";return s.authorizationCode?u="authorization_code":s.password?u="password":s.implicit&&(u="implicit"),{type:"oauth2",oauth2:{grantType:u,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}};var lu=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,u;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),u="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),u="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),u="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},u="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},u=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},u="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:u,schema:a}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],a=s.endsWith("[]"),u=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,h=r.slice(1);if(!e.properties[u])if(a)e.properties[u]={type:"array",items:{type:"object"}};else if(h.length>0)e.properties[u]={type:"object",properties:{}};else{let g=n.typeHints[f];e.properties[u]={type:g||"string"};return}if(h.length>0){let g=a?e.properties[u].items:e.properties[u];g&&this.ensureFieldPath(g,h,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}};var uA=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,cA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(?:a|an)\(['"](\w+)['"]\)/g,fA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.(?:equal|eql)\((.+?)\)/g,dA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,hA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(true|false)/g,pA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.have\.(?:lengthOf|length\.above|length\.below)/g,uu=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(uA.source,uA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(cA.source,cA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(fA.source,fA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let u=this.parseAssertionValue(a);u!==void 0&&(r.valueHints[s]=u,typeof u=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof u=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(u)?"integer":"number"):typeof u=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(hA.source,hA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(pA.source,pA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(dA.source,dA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}};var ne={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter")};var K4={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}};function gA(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:u,browserService:f,applicationInfo:h,consoleService:g}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new kl(r,n,i)),t.registerSingleton(ne.Console,()=>g??K4),t.registerSingleton(ne.EnvironmentConfig,S=>new zc(r,s,S.resolve(ne.Config),n)),t.registerSingleton(ne.Cookie,()=>new Wc(a)),t.registerSingleton(ne.Collection,S=>new Vc(r,S.resolve(ne.Config),n)),t.registerSingleton(ne.HttpClient,()=>new Do),t.registerSingleton(ne.UrlBuilder,()=>new Ln),t.registerSingleton(ne.InterceptorChain,()=>new Bi),t.registerSingleton(ne.HttpRequest,S=>new Ui(S.resolve(ne.UrlBuilder),S.resolve(ne.InterceptorChain),S.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new Ko),t.registerSingleton(ne.RequestHistory,S=>{let E=S.resolve(ne.EnvironmentConfig);return new Xc(E.getHistoriesPath(),mA.join(E.getRootPath(),"shared-histories"))}),u&&f&&t.registerSingleton(ne.OAuth2TokenManager,S=>new Uc(u,f,S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,S=>new Qc(S.resolve(ne.HttpClient)));let m=h??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,S=>new Gc(S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest),S.resolve(ne.RequestPreprocessor),S.resolve(ne.OAuth2TokenManager),m)),t.registerSingleton(ne.ScriptExecutor,S=>{let E=S.resolve(ne.Config);return new Ji(S.resolve(ne.HttpRequest),E.getModulePaths())}),t.registerSingleton(ne.DataFileParser,()=>new Qo),t.registerSingleton(ne.CollectionRequestExecutor,S=>new Kc(S.resolve(ne.HttpRequest),S.resolve(ne.ScriptExecutor),S.resolve(ne.EnvironmentConfig),S.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,S=>new Yc(S.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new Ys),t.registerSingleton(ne.HistoryAnalyzer,S=>new Tl(S.resolve(ne.RequestHistory),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new uu),t.registerSingleton(ne.SchemaInferenceService,S=>new lu(S.resolve(ne.HistoryAnalyzer),S.resolve(ne.ScriptAnalyzer),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,S=>new Vl(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig),S.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,S=>new au(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig)))}var Jf=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.resolve(ne.OAuth2TokenManager)}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}};function yA(){return Jf.instance}var lw=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())ct.isExpired(n)||(!n.domain||ct.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!ct.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())ct.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=ct.extractDomain(e),i=ct.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=ct.extractDomain(e),n=ct.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return ct.formatCookieHeader(s)}clear(){this.cookies.clear()}};function G4(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=s3(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(o3(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let u=a.match(/\.\.\.\s+on\s+(\w*)$/);if(u)return{contextType:"fragment_type",fieldPath:[],prefix:u[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&vA(a)){let m=uw(a,r),S=m.length>0?m[m.length-1]:void 0,E=SA(a);return{contextType:"argument_value",fieldPath:m,parentType:S,prefix:f[2]||"",currentArg:f[1],currentField:E||void 0}}if(vA(a)){let m=uw(a,r),S=m.length>0?m[m.length-1]:void 0,E=SA(a);return{contextType:"argument",fieldPath:m,parentType:S,prefix:s,currentField:E||void 0}}if(cw(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let g=uw(a,r);return{contextType:"selection_set",fieldPath:g,parentType:g.length>0?g[g.length-1]:void 0,prefix:s}}function Q4(t,e){switch(e.contextType){case"root":return Z4(t,e.prefix);case"selection_set":return X4(t,e);case"argument":return e3(t,e);case"argument_value":return t3(t,e);case"directive":return r3(t,e.prefix);case"fragment_type":return n3(t,e.prefix);case"variable_def":return i3(t,e.prefix);default:return[]}}function Z4(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
270
270
|
$0
|
|
271
271
|
}`},{label:"mutation",detail:"Mutation operation",insertText:`mutation \${1:OperationName} {
|
|
272
272
|
$0
|
|
273
273
|
}`},{label:"subscription",detail:"Subscription operation",insertText:`subscription \${1:OperationName} {
|
|
274
274
|
$0
|
|
275
|
-
}`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push(
|
|
275
|
+
}`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push(bA(s,1,t));return r}function X4(t,e){let r=[],n=e.parentType;if(!n)return r;let i=t.types.get(n);if(!i)return r;if(i.kind==="OBJECT"||i.kind==="INTERFACE"){for(let s of i.fields)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push(bA(s,0,t));(!e.prefix||"__typename".startsWith(e.prefix.toLowerCase()))&&r.push({label:"__typename",kind:"field",detail:"String!",description:"The name of the current object type",sortOrder:10})}if(i.kind==="UNION"||i.kind==="INTERFACE")for(let s of i.possibleTypes){let a=s.replace(/[!\[\]]/g,"");(!e.prefix||a.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:`... on ${a}`,kind:"snippet",detail:`Inline fragment on ${a}`,insertText:`... on ${a} {
|
|
276
276
|
$0
|
|
277
|
-
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function
|
|
277
|
+
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function e3(t,e){if(!e.currentField||!e.parentType)return[];let r=t.types.get(e.parentType);if(!r)return[];let n=r.fields.find(s=>s.name===e.currentField);if(!n)return[];let i=[];for(let s of n.args)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&i.push({label:s.name,kind:"argument",detail:s.type,description:s.description,insertText:`${s.name}: `,sortOrder:0});return i}function t3(t,e){if(!e.currentArg||!e.currentField||!e.parentType)return[];let r=[],n=t.types.get(e.parentType);if(!n)return r;let i=n.fields.find(f=>f.name===e.currentField);if(!i)return r;let s=i.args.find(f=>f.name===e.currentArg);if(!s)return r;let a=s.type.replace(/[!\[\]]/g,""),u=t.types.get(a);if(u&&u.kind==="ENUM")for(let f of u.enumValues)(!e.prefix||f.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:f.name,kind:"enum",detail:u.name,description:f.description,deprecated:f.isDeprecated,sortOrder:0});else if(a==="Boolean")for(let f of["true","false"])(!e.prefix||f.startsWith(e.prefix.toLowerCase()))&&r.push({label:f,kind:"keyword",detail:"Boolean",sortOrder:0});return r}function r3(t,e){let r=[];for(let n of t.directives)if(!e||n.name.toLowerCase().startsWith(e.toLowerCase())){let i=n.args.length>0?`(${n.args.map(s=>`${s.name}: ${s.type}`).join(", ")})`:"";r.push({label:`@${n.name}`,kind:"directive",detail:i||void 0,description:n.description,insertText:n.args.length>0?`@${n.name}($1)`:`@${n.name}`,sortOrder:0})}return r}function n3(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="OBJECT"||i.kind==="INTERFACE"||i.kind==="UNION")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function i3(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="SCALAR"||i.kind==="INPUT_OBJECT"||i.kind==="ENUM")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function bA(t,e,r){let n=t.type.replace(/[!\[\]]/g,""),i=!1;if(r){let a=r.types.get(n);i=!!a&&(a.kind==="OBJECT"||a.kind==="INTERFACE"||a.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=t.name;if(t.args.length>0){let a=t.args.filter(u=>u.type.endsWith("!"));if(a.length>0){let u=a.map((f,h)=>`${f.name}: \${${h+1}}`).join(", ");s=`${t.name}(${u})`}}return i&&(s+=` {
|
|
278
278
|
$0
|
|
279
|
-
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function
|
|
279
|
+
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function s3(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function cw(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function vA(t){return cw(t,"(",")")>0}function o3(t){if(cw(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function SA(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function uw(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=a3(t),a=e.types.get(n);for(let u=0;u<s.length;u++){let f=s[u];if(f!=="{"){if(f==="}"){r.pop(),a=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(u+1<s.length&&(s[u+1]==="{"||s[u+1]==="(")){let h=u+1;if(s[h]==="("){let g=1;for(h++;h<s.length&&g>0;)s[h]==="("?g++:s[h]===")"&&g--,h++}if(h<s.length&&s[h]==="{"&&a){let g=a.fields.find(m=>m.name===f);if(g){let m=g.type.replace(/[!\[\]]/g,"");r.push(m),a=e.types.get(m)}}}}}return r}function a3(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}import*as du from"fs/promises";import*as fu from"path";var fw={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},zf={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"};function _A(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function l3(t){return{index:t.i,iteration:t.it,name:t.n,method:zf[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:_A(t.i,t.it,t.r),error:t.e}}function Qr(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function cu(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function dw(t){try{return new Date(t).toLocaleString()}catch{return t}}function wA(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function EA(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function xA(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}var Kf=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=fu.join(this.basePath,e,r),i=JSON.parse(await du.readFile(fu.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),a=await this.loadFailedDetails(n,s),u=this.buildHtml(i,s,a),f=fu.join(n,"report.html");return await du.writeFile(f,u,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=fu.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let a=JSON.parse(await du.readFile(s,"utf-8"));n.push(...a.summaries)}catch{}}return n}async loadFailedDetails(e,r){let n=new Map,i=r.filter(s=>!s.p);for(let s of i){let a=String(s.i).padStart(6,"0"),u=String(s.it).padStart(4,"0"),f=`result-${a}-iter-${u}-${s.r}.json`,h=`${s.i}-${s.it}`;try{let g=JSON.parse(await du.readFile(fu.join(e,"results",f),"utf-8"));n.set(h,g)}catch{}}return n}buildHtml(e,r,n){let i=EA(e.stats.passed,e.stats.totalRequests),s=cu(e.stats.totalDuration),a=e.stats.failed===0,u=Object.entries(e.requestStats).map(([,m])=>{let S=EA(m.passed,m.count);return`
|
|
280
280
|
<tr${m.failed>0?' class="row-fail"':""}>
|
|
281
|
-
<td>${
|
|
281
|
+
<td>${Qr(m.name)}</td>
|
|
282
282
|
<td>${m.count}</td>
|
|
283
283
|
<td class="pass">${m.passed}</td>
|
|
284
284
|
<td class="${m.failed>0?"fail":""}">${m.failed}</td>
|
|
285
|
-
<td>${
|
|
286
|
-
<td>${m.p90!==void 0?
|
|
287
|
-
<td>${m.p99!==void 0?
|
|
285
|
+
<td>${cu(m.avgDuration)}</td>
|
|
286
|
+
<td>${m.p90!==void 0?cu(m.p90):"\u2014"}</td>
|
|
287
|
+
<td>${m.p99!==void 0?cu(m.p99):"\u2014"}</td>
|
|
288
288
|
<td class="${m.failed>0?"fail":"pass"}">${S}</td>
|
|
289
|
-
</tr>`}).join(""),f=Math.max(...r.map(m=>m.d),1),h=r.map(m=>{let S=
|
|
289
|
+
</tr>`}).join(""),f=Math.max(...r.map(m=>m.d),1),h=r.map(m=>{let S=zf[m.m]??"GET",E=Math.max(2,Math.round(m.d/f*100)),x=m.p?"bar-pass":"bar-fail";return`
|
|
290
290
|
<tr${m.p?"":' class="row-fail"'}>
|
|
291
291
|
<td>${m.it}</td>
|
|
292
292
|
<td><span class="method method-${S.toLowerCase()}">${S}</span></td>
|
|
293
|
-
<td>${
|
|
294
|
-
<td class="${
|
|
295
|
-
<td>${
|
|
296
|
-
<td><div class="bar-wrap"><div class="${
|
|
293
|
+
<td>${Qr(m.n)}</td>
|
|
294
|
+
<td class="${wA(m.s)}">${m.s}</td>
|
|
295
|
+
<td>${cu(m.d)}</td>
|
|
296
|
+
<td><div class="bar-wrap"><div class="${x}" style="width:${E}%"></div></div></td>
|
|
297
297
|
<td class="${m.p?"pass":"fail"}">${m.p?"\u2713":"\u2717"}</td>
|
|
298
|
-
</tr>`}).join(""),g=r.filter(m=>!m.p).map(m=>{let S=`${m.i}-${m.it}`,
|
|
298
|
+
</tr>`}).join(""),g=r.filter(m=>!m.p).map(m=>{let S=`${m.i}-${m.it}`,E=n.get(S),x=zf[m.m]??"GET",C=E?.assertions?.map(Y=>`
|
|
299
299
|
<li class="${Y.passed?"pass":"fail"}">
|
|
300
|
-
${Y.passed?"\u2713":"\u2717"} ${
|
|
301
|
-
${Y.message?`<span class="assert-msg">\u2014 ${
|
|
302
|
-
</li>`).join("")??"",A=
|
|
300
|
+
${Y.passed?"\u2713":"\u2717"} ${Qr(Y.name)}
|
|
301
|
+
${Y.message?`<span class="assert-msg">\u2014 ${Qr(Y.message)}</span>`:""}
|
|
302
|
+
</li>`).join("")??"",A=E?.request?.body!==void 0?`<pre class="code">${Qr(xA(E.request.body))}</pre>`:"",T=E?.response?.body!==void 0?`<pre class="code">${Qr(xA(E.response.body))}</pre>`:"",B=E?.error?`<div class="error-box">${Qr(E.error)}</div>`:"";return`
|
|
303
303
|
<details class="fail-detail">
|
|
304
304
|
<summary>
|
|
305
|
-
<span class="method method-${
|
|
306
|
-
<strong>${
|
|
307
|
-
<span class="${
|
|
308
|
-
<span class="dim">iter ${m.it} \xB7 ${
|
|
305
|
+
<span class="method method-${x.toLowerCase()}">${x}</span>
|
|
306
|
+
<strong>${Qr(m.n)}</strong>
|
|
307
|
+
<span class="${wA(m.s)}">${m.s}</span>
|
|
308
|
+
<span class="dim">iter ${m.it} \xB7 ${cu(m.d)}</span>
|
|
309
309
|
</summary>
|
|
310
310
|
<div class="detail-body">
|
|
311
|
-
${
|
|
312
|
-
${
|
|
313
|
-
${
|
|
311
|
+
${B}
|
|
312
|
+
${E?`<p class="detail-url">${Qr(E.url)}</p>`:""}
|
|
313
|
+
${C?`<ul class="assert-list">${C}</ul>`:""}
|
|
314
314
|
${A?`<h4>Request Body</h4>${A}`:""}
|
|
315
315
|
${T?`<h4>Response Body</h4>${T}`:""}
|
|
316
316
|
</div>
|
|
@@ -319,7 +319,7 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
319
319
|
<head>
|
|
320
320
|
<meta charset="UTF-8">
|
|
321
321
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
322
|
-
<title>HTTP Forge \u2014 ${
|
|
322
|
+
<title>HTTP Forge \u2014 ${Qr(e.suiteName)}</title>
|
|
323
323
|
<style>
|
|
324
324
|
*{box-sizing:border-box;margin:0;padding:0}
|
|
325
325
|
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
|
|
@@ -405,12 +405,12 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
405
405
|
<div class="header">
|
|
406
406
|
<div class="header-top">
|
|
407
407
|
<div>
|
|
408
|
-
<div class="suite-name">${
|
|
408
|
+
<div class="suite-name">${Qr(e.suiteName)}</div>
|
|
409
409
|
<div class="meta">
|
|
410
|
-
Environment: <strong>${
|
|
411
|
-
Run ID: <code>${
|
|
412
|
-
${
|
|
413
|
-
${e.endTime?` \u2192 ${
|
|
410
|
+
Environment: <strong>${Qr(e.environment)}</strong> \xB7
|
|
411
|
+
Run ID: <code>${Qr(e.runId)}</code> \xB7
|
|
412
|
+
${dw(e.startTime)}
|
|
413
|
+
${e.endTime?` \u2192 ${dw(e.endTime)}`:""}
|
|
414
414
|
\xB7 Iterations: ${e.config.iterations}
|
|
415
415
|
</div>
|
|
416
416
|
</div>
|
|
@@ -492,7 +492,7 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
492
492
|
</div>`:""}
|
|
493
493
|
|
|
494
494
|
<p class="dim" style="margin-top:16px;text-align:center">
|
|
495
|
-
Generated by HTTP Forge \xB7 ${
|
|
495
|
+
Generated by HTTP Forge \xB7 ${dw(new Date().toISOString())}
|
|
496
496
|
</p>
|
|
497
497
|
</div>
|
|
498
498
|
<script>
|
|
@@ -505,4 +505,4 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
505
505
|
}
|
|
506
506
|
</script>
|
|
507
507
|
</body>
|
|
508
|
-
</html>`}};var Nm={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1};import*as Lt from"fs/promises";import*as Lr from"path";function Dm(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var pw=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Lr.join(this.basePath,e,s),await Lt.mkdir(Lr.join(this.currentRunPath,"results"),{recursive:!0}),await Lt.mkdir(Lr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=xt(r.requestId),u=`result-${s}-iter-${i}-${a}.json`,f=Lr.join(this.currentRunPath,"results",u),h={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{headers:r.executedRequest.headers,body:r.executedRequest.body.content},response:{headers:r.response.headers,body:r.response.body},assertions:r.assertions.map(_=>({name:_.name,passed:_.passed,message:_.message||null})),error:r.error||null};await Lt.writeFile(f,JSON.stringify(pb(h),null,2),"utf-8");let g=r.assertions.filter(_=>_.passed).length,m=r.assertions.filter(_=>!_.passed).length,S={i:this.resultIndex,it:e,n:r.name,m:dw[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:g,af:m,r:r.requestId,e:r.passed?null:r.error||null};return this.currentIndexPage.push(S),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:u}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),S}async finalizeRun(e="completed"){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let a in this.currentManifest.requestStats){let u=this.currentManifest.requestStats[a],f=this.requestDurations[a]||[];u.count>0&&(u.avgDuration=Math.round(u.totalDuration/u.count)),u.minDuration===Number.MAX_SAFE_INTEGER&&(u.minDuration=0),f.length>0&&(f.sort((h,g)=>h-g),u.p50=Dm(f,50),u.p90=Dm(f,90),u.p95=Dm(f,95),u.p99=Dm(f,99))}this.requestDurations={},await this.saveManifest();let r=null,n=this.currentRunPath,i=this.currentSuiteId,s=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,i&&s&&n)try{r=await new Ff(this.basePath).generate(i,s)}catch(a){console.warn("[ResultStorage] HTML report generation failed:",a)}return r}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=Lr.join(this.basePath,e,r,"results",n),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Lr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Lr.join(this.basePath,e,r,"manifest.json"),i=await Lt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Lr.join(this.basePath,e);try{let n=await Lt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Lt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Lr.join(this.basePath,e,r);await Lt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,a=await this.listSuites();for(let u of a){let f=await this.listRuns(u);for(let h of f)if(new Date(h.startTime)<n){let g=Lr.join(this.basePath,u,h.runId),m=await this.getDirectorySize(g);await Lt.rm(g,{recursive:!0,force:!0}),i++,s+=m}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Lr.join(this.currentRunPath,"manifest.json");await Lt.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=Lr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Lt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await Lt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Lr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await Lt.stat(s);r+=a.size}}}catch{}return r}};function Fm(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function mw(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function mA(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=Fm(e,50),t.p90=Fm(e,90),t.p95=Fm(e,95),t.p99=Fm(e,99)}var gw=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=mw("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=mw("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,mw(e));let u=this.byRequest.get(e);if(u.count++,n?u.passed++:u.failed++,u.durations.push(r),mA(u),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),mA(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};import*as Ot from"fs";import*as lo from"path";var yw=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){Ot.existsSync(this.suitesDir)||Ot.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Ot.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!Ot.existsSync(this.suitesDir))return;let e=Ot.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=lo.join(this.suitesDir,r),i=Ot.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:at(e),name:e,requests:r,config:{...Nm},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(u=>({...u})));i.config={...n.config},i.description=n.description;let s=lo.join(this.suitesDir,e),a=lo.join(this.suitesDir,i.id);return Ot.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Ot.existsSync(r)||Ot.mkdirSync(r,{recursive:!0});for(let n of Ot.readdirSync(e,{withFileTypes:!0})){let i=lo.join(e,n.name),s=lo.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Ot.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=lo.join(this.suitesDir,n);try{return Ot.existsSync(i)&&Ot.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Nm},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:at(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=lo.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Ot.writeFileSync(n,i,"utf-8")}};import*as os from"fs";import*as pa from"path";var vw=class{constructor(e){this.collectionService=e}suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=pa.join(this.suiteDir,e,"request.json");if(os.existsSync(r))try{let n=JSON.parse(os.readFileSync(r,"utf-8")),i=pa.join(this.suiteDir,e,"scripts"),s=fh(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=pa.join(this.suiteDir,e);os.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,os.writeFileSync(pa.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=pa.join(n,"scripts");dh(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:os.existsSync(pa.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,a=[];if(n){s=n.scripts;let u=this.findRequestInCollection(n,e.requestId);u&&(a=u.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,u=this.searchItems(s.items||[],r,a);if(u)return u}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=Bi(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(u=>u.collectionId===i&&u.requestId===s);if(a){let u=this.resolveRequest(a);u&&r.push(u)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=Bi(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};export{FE as BODY_FILE_MAP,_l as CONFIG_FILES,Za as CollectionLoader,Tc as CollectionLoaderFactory,Fc as CollectionRequestExecutor,qc as CollectionService,wl as ConfigService,Bu as CookieJar,$c as CookieService,lt as CookieUtils,er as DEFAULT_CONFIG,Fn as DEFAULT_REQUEST_SETTINGS,Nm as DEFAULT_SUITE_CONFIG,KE as DYNAMIC_VARIABLES,Go as DataFileParser,Dc as EnvironmentConfigService,Hi as EnvironmentResolver,Dl as ExampleGenerator,Oc as FetchHttpClient,ju as FolderCollectionLoader,$s as FolderCollectionStore,ob as ForgeContainer,Ns as ForgeEnv,jc as GraphQLSchemaService,dw as HTTP_METHOD_MAP,Df as HTTP_METHOD_REVERSE,Cl as HistoryAnalyzer,Ff as HtmlReportGenerator,Ko as HttpForgeParser,Wi as HttpRequestService,uw as InMemoryCookieJar,Yi as InterceptorChain,bl as JsonCollectionLoader,fv as LoggingRequestInterceptor,yr as METADATA_FILES,rp as ModuleLoader,Pc as NodeFileSystem,Do as NodeHttpClient,kc as OAuth2TokenManager,Nl as OpenApiExporter,Xl as OpenApiImporter,Uu as ParserRegistry,Mc as PersistentCookieJar,Zo as ROOT_DIRECTORIES,Zl as RefResolver,gl as RequestExecutor,Bc as RequestHistoryService,Ic as RequestHistoryStore,Lc as RequestPreparer,zo as RequestPreprocessor,Rc as RequestScriptSession,pw as ResultStorageService,hv as RetryErrorInterceptor,Lu as SCHEMA_FILES,cn as SCRIPTS_DIR,ch as SCRIPT_FILES,eu as SchemaInferenceService,to as SchemaInferrer,tu as ScriptAnalyzer,Zi as ScriptExecutor,Nf as ServiceContainer,ne as ServiceIdentifiers,gw as StatisticsService,yw as TestSuiteService,vw as TestSuiteStore,dv as TimingResponseInterceptor,Dn as UrlBuilder,No as VariableInterpolator,Mo as VariableResolver,ZU as applyExtractionPlan,Yu as applyFilterChain,To as augmentWithDynamicVars,QU as buildExtractionPlan,fA as buildResultFileName,UE as cleanupOldBodyFiles,ip as concatenateScripts,Cc as createExpectChain,PR as createLodashShim,XS as createModuleLoader,np as createMomentShim,eb as createResponseObject,OU as createScriptConsole,tb as createTestFunction,ZN as createVariableResolver,vN as deepClone,iv as deleteItemFromTree,GU as detectSensitiveData,$o as evaluateExpression,M4 as expandSummary,NU as exportCollectionToRestClient,nv as findItemById,_N as formatBytes,sp as formatConsoleOutput,wN as formatDuration,at as generateId,Bi as generateSlug,rv as generateUUID,C4 as getCompletions,MU as getRestClientExportFolder,aA as getServiceContainer,xc as hasChanged,qo as isExpression,SN as isPlainObject,ph as isSystemEnvironmentFile,Hu as loadEnvironmentsFromFolder,Fu as mergeHeadersCaseInsensitive,cv as mergeRequestSettings,rb as normalizeHeaders,Wu as parseFilterChain,ap as parsePostmanEnvironment,YU as parsePostmanEnvironmentFile,E4 as parseQueryContext,jE as prepareBodyForSave,LE as readBodyFromDir,BE as readSchemaFile,fh as readScriptsFromDir,fb as redactBody,hb as redactFullResponse,pb as redactFullResultDetails,Uc as redactHeaders,db as redactHistoryEntry,cb as redactUrl,oA as registerCoreServices,Vi as resolveDynamicVariable,VN as resolveDynamicVariablesInString,bN as safeJsonParse,xt as sanitizeName,sv as searchForItemPath,VE as sortItemsByOrder,Sl as writeEnvFile,op as writeFolderItems,HE as writeSchemaFiles,Ac as writeScriptFile,dh as writeScriptsToDir};
|
|
508
|
+
</html>`}};var Mm={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1};import*as Dt from"fs/promises";import*as Ur from"path";function Nm(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var hw=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}configService;basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Ur.join(this.basePath,e,s),await Dt.mkdir(Ur.join(this.currentRunPath,"results"),{recursive:!0}),await Dt.mkdir(Ur.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=Et(r.requestId),u=`result-${s}-iter-${i}-${a}.json`,f=Ur.join(this.currentRunPath,"results",u),h={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{headers:r.executedRequest.headers,body:r.executedRequest.body.content},response:{headers:r.response.headers,body:r.response.body},assertions:r.assertions.map(E=>({name:E.name,passed:E.passed,message:E.message||null})),error:r.error||null};await Dt.writeFile(f,JSON.stringify(hb(h),null,2),"utf-8");let g=r.assertions.filter(E=>E.passed).length,m=r.assertions.filter(E=>!E.passed).length,S={i:this.resultIndex,it:e,n:r.name,m:fw[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:g,af:m,r:r.requestId,e:r.passed?null:r.error||null};return this.currentIndexPage.push(S),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:u}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),S}async finalizeRun(e="completed"){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let a in this.currentManifest.requestStats){let u=this.currentManifest.requestStats[a],f=this.requestDurations[a]||[];u.count>0&&(u.avgDuration=Math.round(u.totalDuration/u.count)),u.minDuration===Number.MAX_SAFE_INTEGER&&(u.minDuration=0),f.length>0&&(f.sort((h,g)=>h-g),u.p50=Nm(f,50),u.p90=Nm(f,90),u.p95=Nm(f,95),u.p99=Nm(f,99))}this.requestDurations={},await this.saveManifest();let r=null,n=this.currentRunPath,i=this.currentSuiteId,s=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,i&&s&&n)try{r=await new Kf(this.basePath).generate(i,s)}catch(a){console.warn("[ResultStorage] HTML report generation failed:",a)}return r}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=Ur.join(this.basePath,e,r,"results",n),s=await Dt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Ur.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Dt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Ur.join(this.basePath,e,r,"manifest.json"),i=await Dt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Ur.join(this.basePath,e);try{let n=await Dt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Dt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Ur.join(this.basePath,e,r);await Dt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,a=await this.listSuites();for(let u of a){let f=await this.listRuns(u);for(let h of f)if(new Date(h.startTime)<n){let g=Ur.join(this.basePath,u,h.runId),m=await this.getDirectorySize(g);await Dt.rm(g,{recursive:!0,force:!0}),i++,s+=m}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Ur.join(this.currentRunPath,"manifest.json");await Dt.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=Ur.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Dt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await Dt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Ur.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await Dt.stat(s);r+=a.size}}}catch{}return r}};function Dm(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function pw(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function CA(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=Dm(e,50),t.p90=Dm(e,90),t.p95=Dm(e,95),t.p99=Dm(e,99)}var mw=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=pw("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=pw("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,pw(e));let u=this.byRequest.get(e);if(u.count++,n?u.passed++:u.failed++,u.durations.push(r),CA(u),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),CA(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};import*as Rt from"fs";import*as Zs from"path";var gw=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}collectionService;configService;suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){Rt.existsSync(this.suitesDir)||Rt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Rt.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!Rt.existsSync(this.suitesDir))return;let e=Rt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=Zs.join(this.suitesDir,r),i=Rt.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:ut(e),name:e,requests:r,config:{...Mm},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(u=>({...u})));i.config={...n.config},i.description=n.description;let s=Zs.join(this.suitesDir,e),a=Zs.join(this.suitesDir,i.id);return Rt.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Rt.existsSync(r)||Rt.mkdirSync(r,{recursive:!0});for(let n of Rt.readdirSync(e,{withFileTypes:!0})){let i=Zs.join(e,n.name),s=Zs.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Rt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=Zs.join(this.suitesDir,n);try{return Rt.existsSync(i)&&Rt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Mm},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:ut(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=Zs.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Rt.writeFileSync(n,i,"utf-8")}};import*as rs from"fs";import*as pa from"path";var yw=class{constructor(e){this.collectionService=e}collectionService;suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=pa.join(this.suiteDir,e,"request.json");if(rs.existsSync(r))try{let n=JSON.parse(rs.readFileSync(r,"utf-8")),i=pa.join(this.suiteDir,e,"scripts"),s=dh(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=pa.join(this.suiteDir,e);rs.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,rs.writeFileSync(pa.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=pa.join(n,"scripts");hh(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:rs.existsSync(pa.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,a=[];if(n){s=n.scripts;let u=this.findRequestInCollection(n,e.requestId);u&&(a=u.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,u=this.searchItems(s.items||[],r,a);if(u)return u}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=Fi(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(u=>u.collectionId===i&&u.requestId===s);if(a){let u=this.resolveRequest(a);u&&r.push(u)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=Fi(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};export{LE as BODY_FILE_MAP,Pl as CONFIG_FILES,il as CollectionLoader,Hc as CollectionLoaderFactory,Kc as CollectionRequestExecutor,Vc as CollectionService,kl as ConfigService,Xu as CookieJar,Wc as CookieService,ct as CookieUtils,Zt as DEFAULT_CONFIG,jn as DEFAULT_REQUEST_SETTINGS,Mm as DEFAULT_SUITE_CONFIG,GE as DYNAMIC_VARIABLES,Qo as DataFileParser,zc as EnvironmentConfigService,Li as EnvironmentResolver,Wl as ExampleGenerator,Lc as FetchHttpClient,Qu as FolderCollectionLoader,Cs as FolderCollectionStore,sb as ForgeContainer,Is as ForgeEnv,Qc as GraphQLSchemaService,fw as HTTP_METHOD_MAP,zf as HTTP_METHOD_REVERSE,Tl as HistoryAnalyzer,Kf as HtmlReportGenerator,Go as HttpForgeParser,Ui as HttpRequestService,lw as InMemoryCookieJar,Bi as InterceptorChain,Ol as JsonCollectionLoader,uv as LoggingRequestInterceptor,br as METADATA_FILES,Xh as ModuleLoader,jc as NodeFileSystem,Do as NodeHttpClient,Uc as OAuth2TokenManager,Vl as OpenApiExporter,au as OpenApiImporter,Zu as ParserRegistry,Yc as PersistentCookieJar,Xo as ROOT_DIRECTORIES,ou as RefResolver,xl as RequestExecutor,Xc as RequestHistoryService,Fc as RequestHistoryStore,Gc as RequestPreparer,Ko as RequestPreprocessor,Dc as RequestScriptSession,hw as ResultStorageService,fv as RetryErrorInterceptor,Gu as SCHEMA_FILES,dn as SCRIPTS_DIR,fh as SCRIPT_FILES,lu as SchemaInferenceService,Ys as SchemaInferrer,uu as ScriptAnalyzer,Ji as ScriptExecutor,Jf as ServiceContainer,ne as ServiceIdentifiers,mw as StatisticsService,gw as TestSuiteService,yw as TestSuiteStore,cv as TimingResponseInterceptor,Ln as UrlBuilder,No as VariableInterpolator,Mo as VariableResolver,_B as applyExtractionPlan,nc as applyFilterChain,To as augmentWithDynamicVars,bB as buildExtractionPlan,_A as buildResultFileName,BE as cleanupOldBodyFiles,tp as concatenateScripts,Mc as createExpectChain,MR as createLodashShim,ZS as createModuleLoader,ep as createMomentShim,XS as createResponseObject,QU as createScriptConsole,eb as createTestFunction,lD as createVariableResolver,IN as deepClone,nv as deleteItemFromTree,SB as detectSensitiveData,$o as evaluateExpression,l3 as expandSummary,sB as exportCollectionToRestClient,rv as findItemById,kN as formatBytes,rp as formatConsoleOutput,AN as formatDuration,ut as generateId,Fi as generateSlug,tv as generateUUID,Q4 as getCompletions,iB as getRestClientExportFolder,yA as getServiceContainer,Nc as hasChanged,qo as isExpression,ON as isPlainObject,mh as isSystemEnvironmentFile,ec as loadEnvironmentsFromFolder,Ku as mergeHeadersCaseInsensitive,lv as mergeRequestSettings,tb as normalizeHeaders,rc as parseFilterChain,ip as parsePostmanEnvironment,mB as parsePostmanEnvironmentFile,G4 as parseQueryContext,UE as prepareBodyForSave,jE as readBodyFromDir,HE as readSchemaFile,dh as readScriptsFromDir,cb as redactBody,db as redactFullResponse,hb as redactFullResultDetails,Zc as redactHeaders,fb as redactHistoryEntry,ub as redactUrl,gA as registerCoreServices,ji as resolveDynamicVariable,XN as resolveDynamicVariablesInString,PN as safeJsonParse,Et as sanitizeName,iv as searchForItemPath,WE as sortItemsByOrder,Il as writeEnvFile,np as writeFolderItems,VE as writeSchemaFiles,Bc as writeScriptFile,hh as writeScriptsToDir};
|