@qlover/scripts-context 0.2.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1,4679 @@
1
- import{cosmiconfigSync as r}from"cosmiconfig";import t from"chalk";import{exec as n}from"child_process";import{Logger as e,ConsoleHandler as o}from"@qlover/logger";var u,i,c,a,f,s,l,p,v,h,g,d,y,_,b,m,j,w,O,P,x,$,A,R,C,S,z,E,F,T,k,U,N,B,M,I,q,D,L,V,G,J,W,H,K,Q,X,Y,Z,rr,tr,nr,er,or,ur,ir,cr,ar,fr,sr,lr,pr,vr,hr,gr,dr,yr,_r,br,mr,jr,wr,Or,Pr,xr,$r,Ar,Rr,Cr,Sr,zr,Er,Fr,Tr,kr,Ur,Nr,Br,Mr,Ir,qr,Dr,Lr,Vr,Gr,Jr,Wr,Hr,Kr,Qr,Xr,Yr,Zr,rt,tt,nt,et,ot,ut,it,ct,at,ft,st,lt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function pt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function vt(){if(i)return u;return i=1,u=function(r,t,n){switch(n.length){case 0:return r.call(t);case 1:return r.call(t,n[0]);case 2:return r.call(t,n[0],n[1]);case 3:return r.call(t,n[0],n[1],n[2])}return r.apply(t,n)}}function ht(){if(a)return c;return a=1,c=function(r){return r}}function gt(){if(s)return f;s=1;var r=vt(),t=Math.max;return f=function(n,e,o){return e=t(void 0===e?n.length-1:e,0),function(){for(var u=arguments,i=-1,c=t(u.length-e,0),a=Array(c);++i<c;)a[i]=u[e+i];i=-1;for(var f=Array(e+1);++i<e;)f[i]=u[i];return f[e]=o(a),r(n,this,f)}},f}function dt(){if(p)return l;return p=1,l=function(r){return function(){return r}}}function yt(){if(h)return v;h=1;var r="object"==typeof lt&&lt&&lt.Object===Object&&lt;return v=r}function _t(){if(d)return g;d=1;var r=yt(),t="object"==typeof self&&self&&self.Object===Object&&self,n=r||t||Function("return this")();return g=n}function bt(){if(_)return y;_=1;var r=_t().Symbol;return y=r}function mt(){if(m)return b;m=1;var r=bt(),t=Object.prototype,n=t.hasOwnProperty,e=t.toString,o=r?r.toStringTag:void 0;return b=function(r){var t=n.call(r,o),u=r[o];try{r[o]=void 0;var i=!0}catch(r){}var c=e.call(r);return i&&(t?r[o]=u:delete r[o]),c}}function jt(){if(w)return j;w=1;var r=Object.prototype.toString;return j=function(t){return r.call(t)}}function wt(){if(P)return O;P=1;var r=bt(),t=mt(),n=jt(),e=r?r.toStringTag:void 0;return O=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":e&&e in Object(r)?t(r):n(r)}}function Ot(){if($)return x;return $=1,x=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)}}function Pt(){if(R)return A;R=1;var r=wt(),t=Ot();return A=function(n){if(!t(n))return!1;var e=r(n);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}function xt(){if(S)return C;S=1;var r=_t()["__core-js_shared__"];return C=r}function $t(){if(E)return z;E=1;var r,t=xt(),n=(r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";return z=function(r){return!!n&&n in r}}function At(){if(T)return F;T=1;var r=Function.prototype.toString;return F=function(t){if(null!=t){try{return r.call(t)}catch(r){}try{return t+""}catch(r){}}return""}}function Rt(){if(U)return k;U=1;var r=Pt(),t=$t(),n=Ot(),e=At(),o=/^\[object .+?Constructor\]$/,u=Function.prototype,i=Object.prototype,c=u.toString,a=i.hasOwnProperty,f=RegExp("^"+c.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return k=function(u){return!(!n(u)||t(u))&&(r(u)?f:o).test(e(u))}}function Ct(){if(B)return N;return B=1,N=function(r,t){return null==r?void 0:r[t]}}function St(){if(I)return M;I=1;var r=Rt(),t=Ct();return M=function(n,e){var o=t(n,e);return r(o)?o:void 0}}function zt(){if(D)return q;D=1;var r=St(),t=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return q=t}function Et(){if(V)return L;V=1;var r=dt(),t=zt();return L=t?function(n,e){return t(n,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:ht()}function Ft(){if(J)return G;J=1;var r=Date.now;return G=function(t){var n=0,e=0;return function(){var o=r(),u=16-(o-e);if(e=o,u>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},G}function Tt(){if(H)return W;H=1;var r=Et(),t=Ft()(r);return W=t}function kt(){if(Q)return K;Q=1;var r=ht(),t=gt(),n=Tt();return K=function(e,o){return n(t(e,o,r),e+"")}}function Ut(){if(Y)return X;return Y=1,X=function(){this.__data__=[],this.size=0}}function Nt(){if(rr)return Z;return rr=1,Z=function(r,t){return r===t||r!=r&&t!=t}}function Bt(){if(nr)return tr;nr=1;var r=Nt();return tr=function(t,n){for(var e=t.length;e--;)if(r(t[e][0],n))return e;return-1}}function Mt(){if(or)return er;or=1;var r=Bt(),t=Array.prototype.splice;return er=function(n){var e=this.__data__,o=r(e,n);return!(o<0)&&(o==e.length-1?e.pop():t.call(e,o,1),--this.size,!0)}}function It(){if(ir)return ur;ir=1;var r=Bt();return ur=function(t){var n=this.__data__,e=r(n,t);return e<0?void 0:n[e][1]}}function qt(){if(ar)return cr;ar=1;var r=Bt();return cr=function(t){return r(this.__data__,t)>-1}}function Dt(){if(sr)return fr;sr=1;var r=Bt();return fr=function(t,n){var e=this.__data__,o=r(e,t);return o<0?(++this.size,e.push([t,n])):e[o][1]=n,this}}function Lt(){if(pr)return lr;pr=1;var r=Ut(),t=Mt(),n=It(),e=qt(),o=Dt();function u(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return u.prototype.clear=r,u.prototype.delete=t,u.prototype.get=n,u.prototype.has=e,u.prototype.set=o,lr=u}function Vt(){if(hr)return vr;hr=1;var r=Lt();return vr=function(){this.__data__=new r,this.size=0}}function Gt(){if(dr)return gr;return dr=1,gr=function(r){var t=this.__data__,n=t.delete(r);return this.size=t.size,n}}function Jt(){if(_r)return yr;return _r=1,yr=function(r){return this.__data__.get(r)}}function Wt(){if(mr)return br;return mr=1,br=function(r){return this.__data__.has(r)}}function Ht(){if(wr)return jr;wr=1;var r=St()(_t(),"Map");return jr=r}function Kt(){if(Pr)return Or;Pr=1;var r=St()(Object,"create");return Or=r}function Qt(){if($r)return xr;$r=1;var r=Kt();return xr=function(){this.__data__=r?r(null):{},this.size=0}}function Xt(){if(Rr)return Ar;return Rr=1,Ar=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}}function Yt(){if(Sr)return Cr;Sr=1;var r=Kt(),t=Object.prototype.hasOwnProperty;return Cr=function(n){var e=this.__data__;if(r){var o=e[n];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(e,n)?e[n]:void 0}}function Zt(){if(Er)return zr;Er=1;var r=Kt(),t=Object.prototype.hasOwnProperty;return zr=function(n){var e=this.__data__;return r?void 0!==e[n]:t.call(e,n)}}function rn(){if(Tr)return Fr;Tr=1;var r=Kt();return Fr=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=r&&void 0===n?"__lodash_hash_undefined__":n,this}}function tn(){if(Ur)return kr;Ur=1;var r=Qt(),t=Xt(),n=Yt(),e=Zt(),o=rn();function u(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return u.prototype.clear=r,u.prototype.delete=t,u.prototype.get=n,u.prototype.has=e,u.prototype.set=o,kr=u}function nn(){if(Br)return Nr;Br=1;var r=tn(),t=Lt(),n=Ht();return Nr=function(){this.size=0,this.__data__={hash:new r,map:new(n||t),string:new r}}}function en(){if(Ir)return Mr;return Ir=1,Mr=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r}}function on(){if(Dr)return qr;Dr=1;var r=en();return qr=function(t,n){var e=t.__data__;return r(n)?e["string"==typeof n?"string":"hash"]:e.map}}function un(){if(Vr)return Lr;Vr=1;var r=on();return Lr=function(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}function cn(){if(Jr)return Gr;Jr=1;var r=on();return Gr=function(t){return r(this,t).get(t)}}function an(){if(Hr)return Wr;Hr=1;var r=on();return Wr=function(t){return r(this,t).has(t)}}function fn(){if(Qr)return Kr;Qr=1;var r=on();return Kr=function(t,n){var e=r(this,t),o=e.size;return e.set(t,n),this.size+=e.size==o?0:1,this}}function sn(){if(Yr)return Xr;Yr=1;var r=nn(),t=un(),n=cn(),e=an(),o=fn();function u(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return u.prototype.clear=r,u.prototype.delete=t,u.prototype.get=n,u.prototype.has=e,u.prototype.set=o,Xr=u}function ln(){if(rt)return Zr;rt=1;var r=Lt(),t=Ht(),n=sn();return Zr=function(e,o){var u=this.__data__;if(u instanceof r){var i=u.__data__;if(!t||i.length<199)return i.push([e,o]),this.size=++u.size,this;u=this.__data__=new n(i)}return u.set(e,o),this.size=u.size,this}}function pn(){if(nt)return tt;nt=1;var r=Lt(),t=Vt(),n=Gt(),e=Jt(),o=Wt(),u=ln();function i(t){var n=this.__data__=new r(t);this.size=n.size}return i.prototype.clear=t,i.prototype.delete=n,i.prototype.get=e,i.prototype.has=o,i.prototype.set=u,tt=i}function vn(){if(ot)return et;ot=1;var r=zt();return et=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}}function hn(){if(it)return ut;it=1;var r=vn(),t=Nt();return ut=function(n,e,o){(void 0!==o&&!t(n[e],o)||void 0===o&&!(e in n))&&r(n,e,o)}}function gn(){if(at)return ct;return at=1,ct=function(r){return function(t,n,e){for(var o=-1,u=Object(t),i=e(t),c=i.length;c--;){var a=i[r?c:++o];if(!1===n(u[a],a,u))break}return t}}}function dn(){if(st)return ft;st=1;var r=gn()();return ft=r}var yn,_n,bn,mn,jn,wn,On,Pn,xn,$n,An,Rn,Cn,Sn,zn,En,Fn,Tn,kn,Un,Nn,Bn,Mn,In,qn,Dn,Ln,Vn,Gn,Jn,Wn,Hn,Kn,Qn={exports:{}};function Xn(){return yn||(yn=1,r=Qn,t=Qn.exports,n=_t(),e=t&&!t.nodeType&&t,o=e&&r&&!r.nodeType&&r,u=o&&o.exports===e?n.Buffer:void 0,i=u?u.allocUnsafe:void 0,r.exports=function(r,t){if(t)return r.slice();var n=r.length,e=i?i(n):new r.constructor(n);return r.copy(e),e}),Qn.exports;var r,t,n,e,o,u,i}function Yn(){if(bn)return _n;bn=1;var r=_t().Uint8Array;return _n=r}function Zn(){if(jn)return mn;jn=1;var r=Yn();return mn=function(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}}function re(){if(On)return wn;On=1;var r=Zn();return wn=function(t,n){var e=n?r(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}}function te(){if(xn)return Pn;return xn=1,Pn=function(r,t){var n=-1,e=r.length;for(t||(t=Array(e));++n<e;)t[n]=r[n];return t}}function ne(){if(An)return $n;An=1;var r=Ot(),t=Object.create,n=function(){function n(){}return function(e){if(!r(e))return{};if(t)return t(e);n.prototype=e;var o=new n;return n.prototype=void 0,o}}();return $n=n}function ee(){if(Cn)return Rn;return Cn=1,Rn=function(r,t){return function(n){return r(t(n))}}}function oe(){if(zn)return Sn;zn=1;var r=ee()(Object.getPrototypeOf,Object);return Sn=r}function ue(){if(Fn)return En;Fn=1;var r=Object.prototype;return En=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||r)}}function ie(){if(kn)return Tn;kn=1;var r=ne(),t=oe(),n=ue();return Tn=function(e){return"function"!=typeof e.constructor||n(e)?{}:r(t(e))}}function ce(){if(Nn)return Un;return Nn=1,Un=function(r){return null!=r&&"object"==typeof r}}function ae(){if(Mn)return Bn;Mn=1;var r=wt(),t=ce();return Bn=function(n){return t(n)&&"[object Arguments]"==r(n)}}function fe(){if(qn)return In;qn=1;var r=ae(),t=ce(),n=Object.prototype,e=n.hasOwnProperty,o=n.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(r){return t(r)&&e.call(r,"callee")&&!o.call(r,"callee")};return In=u}function se(){if(Ln)return Dn;Ln=1;var r=Array.isArray;return Dn=r}function le(){if(Gn)return Vn;Gn=1;return Vn=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}}function pe(){if(Wn)return Jn;Wn=1;var r=Pt(),t=le();return Jn=function(n){return null!=n&&t(n.length)&&!r(n)}}function ve(){if(Kn)return Hn;Kn=1;var r=pe(),t=ce();return Hn=function(n){return t(n)&&r(n)}}var he,ge,de,ye,_e,be,me,je,we,Oe={exports:{}};function Pe(){if(ge)return he;return ge=1,he=function(){return!1}}function xe(){return de||(de=1,function(r,t){var n=_t(),e=Pe(),o=t&&!t.nodeType&&t,u=o&&r&&!r.nodeType&&r,i=u&&u.exports===o?n.Buffer:void 0,c=(i?i.isBuffer:void 0)||e;r.exports=c}(Oe,Oe.exports)),Oe.exports}function $e(){if(_e)return ye;_e=1;var r=wt(),t=oe(),n=ce(),e=Function.prototype,o=Object.prototype,u=e.toString,i=o.hasOwnProperty,c=u.call(Object);return ye=function(e){if(!n(e)||"[object Object]"!=r(e))return!1;var o=t(e);if(null===o)return!0;var a=i.call(o,"constructor")&&o.constructor;return"function"==typeof a&&a instanceof a&&u.call(a)==c}}function Ae(){if(me)return be;me=1;var r=wt(),t=le(),n=ce(),e={};return e["[object Float32Array]"]=e["[object Float64Array]"]=e["[object Int8Array]"]=e["[object Int16Array]"]=e["[object Int32Array]"]=e["[object Uint8Array]"]=e["[object Uint8ClampedArray]"]=e["[object Uint16Array]"]=e["[object Uint32Array]"]=!0,e["[object Arguments]"]=e["[object Array]"]=e["[object ArrayBuffer]"]=e["[object Boolean]"]=e["[object DataView]"]=e["[object Date]"]=e["[object Error]"]=e["[object Function]"]=e["[object Map]"]=e["[object Number]"]=e["[object Object]"]=e["[object RegExp]"]=e["[object Set]"]=e["[object String]"]=e["[object WeakMap]"]=!1,be=function(o){return n(o)&&t(o.length)&&!!e[r(o)]}}function Re(){if(we)return je;return we=1,je=function(r){return function(t){return r(t)}}}var Ce,Se,ze,Ee,Fe,Te,ke,Ue,Ne,Be,Me,Ie,qe,De,Le,Ve,Ge,Je,We,He,Ke,Qe,Xe,Ye,Ze,ro,to,no,eo,oo,uo,io,co,ao,fo,so,lo,po={exports:{}};function vo(){return Ce||(Ce=1,r=po,t=po.exports,n=yt(),e=t&&!t.nodeType&&t,o=e&&r&&!r.nodeType&&r,u=o&&o.exports===e&&n.process,i=function(){try{var r=o&&o.require&&o.require("util").types;return r||u&&u.binding&&u.binding("util")}catch(r){}}(),r.exports=i),po.exports;var r,t,n,e,o,u,i}function ho(){if(ze)return Se;ze=1;var r=Ae(),t=Re(),n=vo(),e=n&&n.isTypedArray,o=e?t(e):r;return Se=o}function go(){if(Fe)return Ee;return Fe=1,Ee=function(r,t){if(("constructor"!==t||"function"!=typeof r[t])&&"__proto__"!=t)return r[t]}}function yo(){if(ke)return Te;ke=1;var r=vn(),t=Nt(),n=Object.prototype.hasOwnProperty;return Te=function(e,o,u){var i=e[o];n.call(e,o)&&t(i,u)&&(void 0!==u||o in e)||r(e,o,u)}}function _o(){if(Ne)return Ue;Ne=1;var r=yo(),t=vn();return Ue=function(n,e,o,u){var i=!o;o||(o={});for(var c=-1,a=e.length;++c<a;){var f=e[c],s=u?u(o[f],n[f],f,o,n):void 0;void 0===s&&(s=n[f]),i?t(o,f,s):r(o,f,s)}return o}}function bo(){if(Me)return Be;return Me=1,Be=function(r,t){for(var n=-1,e=Array(r);++n<r;)e[n]=t(n);return e}}function mo(){if(qe)return Ie;qe=1;var r=/^(?:0|[1-9]\d*)$/;return Ie=function(t,n){var e=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==e||"symbol"!=e&&r.test(t))&&t>-1&&t%1==0&&t<n}}function jo(){if(Le)return De;Le=1;var r=bo(),t=fe(),n=se(),e=xe(),o=mo(),u=ho(),i=Object.prototype.hasOwnProperty;return De=function(c,a){var f=n(c),s=!f&&t(c),l=!f&&!s&&e(c),p=!f&&!s&&!l&&u(c),v=f||s||l||p,h=v?r(c.length,String):[],g=h.length;for(var d in c)!a&&!i.call(c,d)||v&&("length"==d||l&&("offset"==d||"parent"==d)||p&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||o(d,g))||h.push(d);return h}}function wo(){if(Ge)return Ve;return Ge=1,Ve=function(r){var t=[];if(null!=r)for(var n in Object(r))t.push(n);return t}}function Oo(){if(We)return Je;We=1;var r=Ot(),t=ue(),n=wo(),e=Object.prototype.hasOwnProperty;return Je=function(o){if(!r(o))return n(o);var u=t(o),i=[];for(var c in o)("constructor"!=c||!u&&e.call(o,c))&&i.push(c);return i}}function Po(){if(Ke)return He;Ke=1;var r=jo(),t=Oo(),n=pe();return He=function(e){return n(e)?r(e,!0):t(e)}}function xo(){if(Xe)return Qe;Xe=1;var r=_o(),t=Po();return Qe=function(n){return r(n,t(n))}}function $o(){if(Ze)return Ye;Ze=1;var r=hn(),t=Xn(),n=re(),e=te(),o=ie(),u=fe(),i=se(),c=ve(),a=xe(),f=Pt(),s=Ot(),l=$e(),p=ho(),v=go(),h=xo();return Ye=function(g,d,y,_,b,m,j){var w=v(g,y),O=v(d,y),P=j.get(O);if(P)r(g,y,P);else{var x=m?m(w,O,y+"",g,d,j):void 0,$=void 0===x;if($){var A=i(O),R=!A&&a(O),C=!A&&!R&&p(O);x=O,A||R||C?i(w)?x=w:c(w)?x=e(w):R?($=!1,x=t(O,!0)):C?($=!1,x=n(O,!0)):x=[]:l(O)||u(O)?(x=w,u(w)?x=h(w):s(w)&&!f(w)||(x=o(O))):$=!1}$&&(j.set(O,x),b(x,O,_,m,j),j.delete(O)),r(g,y,x)}}}function Ao(){if(to)return ro;to=1;var r=pn(),t=hn(),n=dn(),e=$o(),o=Ot(),u=Po(),i=go();return ro=function c(a,f,s,l,p){a!==f&&n(f,(function(n,u){if(p||(p=new r),o(n))e(a,f,u,s,c,l,p);else{var v=l?l(i(a,u),n,u+"",a,f,p):void 0;void 0===v&&(v=n),t(a,u,v)}}),u)},ro}function Ro(){if(eo)return no;eo=1;var r=Ao(),t=Ot();return no=function n(e,o,u,i,c,a){return t(e)&&t(o)&&(a.set(o,e),r(e,o,void 0,n,a),a.delete(o)),e},no}function Co(){if(uo)return oo;uo=1;var r=Nt(),t=pe(),n=mo(),e=Ot();return oo=function(o,u,i){if(!e(i))return!1;var c=typeof u;return!!("number"==c?t(i)&&n(u,i.length):"string"==c&&u in i)&&r(i[u],o)}}function So(){if(co)return io;co=1;var r=kt(),t=Co();return io=function(n){return r((function(r,e){var o=-1,u=e.length,i=u>1?e[u-1]:void 0,c=u>2?e[2]:void 0;for(i=n.length>3&&"function"==typeof i?(u--,i):void 0,c&&t(e[0],e[1],c)&&(i=u<3?void 0:i,u=1),r=Object(r);++o<u;){var a=e[o];a&&n(r,a,o,i)}return r}))}}function zo(){if(fo)return ao;fo=1;var r=Ao(),t=So()((function(t,n,e,o){r(t,n,e,o)}));return ao=t}function Eo(){if(lo)return so;lo=1;var r=vt(),t=kt(),n=Ro(),e=zo(),o=t((function(t){return t.push(void 0,n),r(e,void 0,t)}));return so=o}var Fo=pt(Eo()),To=pt($e());class ko{name;searchPlaces;_config;loaders;searchCache;constructor(r){const{name:t,searchPlaces:n,defaultConfig:e,loaders:o}=r;if(!t&&!n)throw new Error("searchPlaces or name is required");this.name=t,this.searchPlaces=n||function(r){const t=["json","js","ts","cjs","yaml","yml"];return["package.json",...t.map((t=>`${r}.${t}`)),...t.map((t=>`.${r}.${t}`))]}(t),this._config=e||{},this.loaders=o}get config(){return Fo({},this.search(),this._config)}getSearchPlaces(){return this.searchPlaces}get(t={}){const{file:n,dir:e=process.cwd()}=t,o={};if(!1===n)return o;const u=r(this.name,{searchPlaces:this.searchPlaces,loaders:this.loaders}),i=n?u.load(n):u.search(e);if(i&&"string"==typeof i.config)throw new Error(`Invalid configuration file at ${i.filepath}`);return i&&To(i.config)?i.config:o}search(){return this.searchCache?this.searchCache:this.searchCache=this.get({})}}const Uo={protectedBranches:["master","develop","main"],cleanFiles:["dist","node_modules","yarn.lock","package-lock.json",".eslintcache","*.log"],commitlint:{extends:["@commitlint/config-conventional"]},release:{publishPath:"",autoMergeReleasePR:!1,autoMergeType:"squash",branchName:"release-${pkgName}-${tagName}",PRTitle:"[${pkgName} Release] Branch:${branch}, Tag:${tagName}, Env:${env}",PRBody:"## Publish Details\n\n- 🏷️ Version: ${tagName}\n- 🌲 Branch: ${branch}\n- 🔧 Environment: ${env}\n\n## Changelog\n\n${changelog}\n\n## Notes\n\n- [ ] Please check if the version number is correct\n- [ ] Please confirm all tests have passed\n- [ ] Please confirm the documentation has been updated\n\n> This PR is auto created by release process, please contact the frontend team if there are any questions.",label:{color:"1A7F37",description:"Release PR",name:"CI-Release"},packagesDirectories:[],changePackagesLabel:"changes:${name}"},envOrder:[".env.local",".env.production",".env"]};var No,Bo,Mo,Io,qo,Do,Lo,Vo,Go,Jo,Wo,Ho,Ko,Qo,Xo,Yo,Zo,ru,tu,nu,eu,ou,uu,iu,cu,au,fu,su,lu,pu,vu,hu,gu,du,yu,_u,bu,mu,ju,wu,Ou,Pu;function xu(){if(Bo)return No;Bo=1;var r=_o(),t=So(),n=Po(),e=t((function(t,e,o,u){r(e,n(e),t,u)}));return No=e}function $u(){if(Io)return Mo;Io=1;var r=wt(),t=ce(),n=$e();return Mo=function(e){if(!t(e))return!1;var o=r(e);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof e.message&&"string"==typeof e.name&&!n(e)}}function Au(){if(Do)return qo;Do=1;var r=vt(),t=kt(),n=$u(),e=t((function(t,e){try{return r(t,void 0,e)}catch(r){return n(r)?r:new Error(r)}}));return qo=e}function Ru(){if(Vo)return Lo;return Vo=1,Lo=function(r,t){for(var n=-1,e=null==r?0:r.length,o=Array(e);++n<e;)o[n]=t(r[n],n,r);return o}}function Cu(){if(Jo)return Go;Jo=1;var r=Ru();return Go=function(t,n){return r(n,(function(r){return t[r]}))}}function Su(){if(Ho)return Wo;Ho=1;var r=Nt(),t=Object.prototype,n=t.hasOwnProperty;return Wo=function(e,o,u,i){return void 0===e||r(e,t[u])&&!n.call(i,u)?o:e}}function zu(){if(Qo)return Ko;Qo=1;var r={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return Ko=function(t){return"\\"+r[t]}}function Eu(){if(Yo)return Xo;Yo=1;var r=ee()(Object.keys,Object);return Xo=r}function Fu(){if(ru)return Zo;ru=1;var r=ue(),t=Eu(),n=Object.prototype.hasOwnProperty;return Zo=function(e){if(!r(e))return t(e);var o=[];for(var u in Object(e))n.call(e,u)&&"constructor"!=u&&o.push(u);return o}}function Tu(){if(nu)return tu;nu=1;var r=jo(),t=Fu(),n=pe();return tu=function(e){return n(e)?r(e):t(e)}}function ku(){if(ou)return eu;ou=1;return eu=/<%=([\s\S]+?)%>/g}function Uu(){if(iu)return uu;return iu=1,uu=function(r){return function(t){return null==r?void 0:r[t]}}}function Nu(){if(au)return cu;au=1;var r=Uu()({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});return cu=r}function Bu(){if(su)return fu;su=1;var r=wt(),t=ce();return fu=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==r(n)}}function Mu(){if(pu)return lu;pu=1;var r=bt(),t=Ru(),n=se(),e=Bu(),o=r?r.prototype:void 0,u=o?o.toString:void 0;return lu=function r(o){if("string"==typeof o)return o;if(n(o))return t(o,r)+"";if(e(o))return u?u.call(o):"";var i=o+"";return"0"==i&&1/o==-1/0?"-0":i},lu}function Iu(){if(hu)return vu;hu=1;var r=Mu();return vu=function(t){return null==t?"":r(t)}}function qu(){if(du)return gu;du=1;var r=Nu(),t=Iu(),n=/[&<>"']/g,e=RegExp(n.source);return gu=function(o){return(o=t(o))&&e.test(o)?o.replace(n,r):o}}function Du(){if(_u)return yu;_u=1;return yu=/<%-([\s\S]+?)%>/g}function Lu(){if(mu)return bu;mu=1;return bu=/<%([\s\S]+?)%>/g}function Vu(){if(wu)return ju;wu=1;var r=qu();return ju={escape:Du(),evaluate:Lu(),interpolate:ku(),variable:"",imports:{_:{escape:r}}}}function Gu(){if(Pu)return Ou;Pu=1;var r=xu(),t=Au(),n=Cu(),e=Su(),o=zu(),u=$u(),i=Co(),c=Tu(),a=ku(),f=Vu(),s=Iu(),l=/\b__p \+= '';/g,p=/\b(__p \+=) '' \+/g,v=/(__e\(.*?\)|\b__t\)) \+\n'';/g,h=/[()=,{}\[\]\/\s]/,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,d=/($^)/,y=/['\n\r\u2028\u2029\\]/g,_=Object.prototype.hasOwnProperty;return Ou=function(b,m,j){var w=f.imports._.templateSettings||f;j&&i(b,m,j)&&(m=void 0),b=s(b),m=r({},m,w,e);var O,P,x=r({},m.imports,w.imports,e),$=c(x),A=n(x,$),R=0,C=m.interpolate||d,S="__p += '",z=RegExp((m.escape||d).source+"|"+C.source+"|"+(C===a?g:d).source+"|"+(m.evaluate||d).source+"|$","g"),E=_.call(m,"sourceURL")?"//# sourceURL="+(m.sourceURL+"").replace(/\s/g," ")+"\n":"";b.replace(z,(function(r,t,n,e,u,i){return n||(n=e),S+=b.slice(R,i).replace(y,o),t&&(O=!0,S+="' +\n__e("+t+") +\n'"),u&&(P=!0,S+="';\n"+u+";\n__p += '"),n&&(S+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),R=i+r.length,r})),S+="';\n";var F=_.call(m,"variable")&&m.variable;if(F){if(h.test(F))throw new Error("Invalid `variable` option passed into `_.template`")}else S="with (obj) {\n"+S+"\n}\n";S=(P?S.replace(l,""):S).replace(p,"$1").replace(v,"$1;"),S="function("+(F||"obj")+") {\n"+(F?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(O?", __e = _.escape":"")+(P?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+S+"return __p\n}";var T=t((function(){return Function($,E+"return "+S).apply(void 0,A)}));if(T.source=S,u(T))throw T;return T}}var Ju,Wu,Hu=pt(Gu());class Ku{config;cache;constructor(r,t=new Map){this.config=r,this.cache=t}get logger(){return this.config.logger}static format(r="",t={}){return Hu(r)(t)}format(r="",t={}){try{return Ku.format(r,t)}catch(n){throw this.logger.error(`Unable to render template with context:\n${r}\n${JSON.stringify(t)}`),this.logger.error(n),n}}exec(r,t={}){const{context:n,...e}=t;return"string"==typeof r?this.execFormattedCommand(this.format(r,n||{}),e):this.execFormattedCommand(r,e)}run(r,t={}){return this.exec(r,{silent:!0,...t})}async execFormattedCommand(r,t={}){const n=this.config.execPromise;if(!n)throw new Error("execPromise is not defined");const{dryRunResult:e,silent:o,dryRun:u,isCache:i}=t,c=void 0!==u?u:this.config.dryRun,a=void 0!==i?!!i:!!this.config.isCache,f="string"==typeof r?r:r.join(" "),s=a&&this.cache.has(f);if(o||this.logger.debug(r),c)return Promise.resolve(e);if(s)return this.cache.get(f);const l=n(r,t);return this.cache.has(f)||this.cache.set(f,l),l}}function Qu(){if(Wu)return Ju;Wu=1;var r=Ao(),t=So()((function(t,n,e){r(t,n,e)}));return Ju=t}var Xu=pt(Qu());class Yu{levelColors;constructor(r={fatal:t.bgRed.white.bold,error:t.red.bold,warn:t.yellow.bold,info:t.blue,debug:t.green,trace:t.gray,log:t.white}){this.levelColors=r}format(r){const{level:n,args:e}=r,o=this.levelColors[n]||t.white;return["function"==typeof o?o(n.toUpperCase()):n.toUpperCase(),...e]}}const Zu=(r,t)=>{const e=Array.isArray(r)?r.join(" "):r;return new Promise(((r,o)=>{n(e,{encoding:"utf-8",...t},((t,n,e)=>{let u;u=t?void 0===t.code?1:t.code:0,0===u?r(n.trim()):o(new Error(e||n))}))}))};function ri(r){return new ko({name:"fe-config",defaultConfig:Xu({},Uo,r)})}class ti{logger;shell;feConfig;dryRun;verbose;options;constructor(r){const{logger:t,shell:n,feConfig:u,dryRun:i,verbose:c,options:a}=r||{},f=a||{};this.logger=t||new e({level:c?"debug":void 0,name:"scripts",handlers:new o(new Yu)}),this.shell=n||new Ku({logger:this.logger,dryRun:i,execPromise:f.execPromise||Zu}),this.feConfig=ri(u).config,this.dryRun=!!i,this.verbose=!!c,this.options=f}}export{Yu as ColorFormatter,ko as ConfigSearch,ti as FeScriptContext,Ku as Shell,Uo as defaultFeConfig,ri as getFeConfigSearch};
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_apply.js
28
+ var require_apply = __commonJS({
29
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_apply.js"(exports, module) {
30
+ "use strict";
31
+ function apply(func, thisArg, args) {
32
+ switch (args.length) {
33
+ case 0:
34
+ return func.call(thisArg);
35
+ case 1:
36
+ return func.call(thisArg, args[0]);
37
+ case 2:
38
+ return func.call(thisArg, args[0], args[1]);
39
+ case 3:
40
+ return func.call(thisArg, args[0], args[1], args[2]);
41
+ }
42
+ return func.apply(thisArg, args);
43
+ }
44
+ module.exports = apply;
45
+ }
46
+ });
47
+
48
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/identity.js
49
+ var require_identity = __commonJS({
50
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/identity.js"(exports, module) {
51
+ "use strict";
52
+ function identity(value) {
53
+ return value;
54
+ }
55
+ module.exports = identity;
56
+ }
57
+ });
58
+
59
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overRest.js
60
+ var require_overRest = __commonJS({
61
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overRest.js"(exports, module) {
62
+ "use strict";
63
+ var apply = require_apply();
64
+ var nativeMax = Math.max;
65
+ function overRest(func, start, transform) {
66
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
67
+ return function() {
68
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
69
+ while (++index < length) {
70
+ array[index] = args[start + index];
71
+ }
72
+ index = -1;
73
+ var otherArgs = Array(start + 1);
74
+ while (++index < start) {
75
+ otherArgs[index] = args[index];
76
+ }
77
+ otherArgs[start] = transform(array);
78
+ return apply(func, this, otherArgs);
79
+ };
80
+ }
81
+ module.exports = overRest;
82
+ }
83
+ });
84
+
85
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/constant.js
86
+ var require_constant = __commonJS({
87
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/constant.js"(exports, module) {
88
+ "use strict";
89
+ function constant(value) {
90
+ return function() {
91
+ return value;
92
+ };
93
+ }
94
+ module.exports = constant;
95
+ }
96
+ });
97
+
98
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js
99
+ var require_freeGlobal = __commonJS({
100
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js"(exports, module) {
101
+ "use strict";
102
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
103
+ module.exports = freeGlobal;
104
+ }
105
+ });
106
+
107
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js
108
+ var require_root = __commonJS({
109
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js"(exports, module) {
110
+ "use strict";
111
+ var freeGlobal = require_freeGlobal();
112
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
113
+ var root = freeGlobal || freeSelf || Function("return this")();
114
+ module.exports = root;
115
+ }
116
+ });
117
+
118
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js
119
+ var require_Symbol = __commonJS({
120
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js"(exports, module) {
121
+ "use strict";
122
+ var root = require_root();
123
+ var Symbol2 = root.Symbol;
124
+ module.exports = Symbol2;
125
+ }
126
+ });
127
+
128
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js
129
+ var require_getRawTag = __commonJS({
130
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js"(exports, module) {
131
+ "use strict";
132
+ var Symbol2 = require_Symbol();
133
+ var objectProto = Object.prototype;
134
+ var hasOwnProperty = objectProto.hasOwnProperty;
135
+ var nativeObjectToString = objectProto.toString;
136
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
137
+ function getRawTag(value) {
138
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
139
+ try {
140
+ value[symToStringTag] = void 0;
141
+ var unmasked = true;
142
+ } catch (e) {
143
+ }
144
+ var result = nativeObjectToString.call(value);
145
+ if (unmasked) {
146
+ if (isOwn) {
147
+ value[symToStringTag] = tag;
148
+ } else {
149
+ delete value[symToStringTag];
150
+ }
151
+ }
152
+ return result;
153
+ }
154
+ module.exports = getRawTag;
155
+ }
156
+ });
157
+
158
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js
159
+ var require_objectToString = __commonJS({
160
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js"(exports, module) {
161
+ "use strict";
162
+ var objectProto = Object.prototype;
163
+ var nativeObjectToString = objectProto.toString;
164
+ function objectToString(value) {
165
+ return nativeObjectToString.call(value);
166
+ }
167
+ module.exports = objectToString;
168
+ }
169
+ });
170
+
171
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js
172
+ var require_baseGetTag = __commonJS({
173
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js"(exports, module) {
174
+ "use strict";
175
+ var Symbol2 = require_Symbol();
176
+ var getRawTag = require_getRawTag();
177
+ var objectToString = require_objectToString();
178
+ var nullTag = "[object Null]";
179
+ var undefinedTag = "[object Undefined]";
180
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
181
+ function baseGetTag(value) {
182
+ if (value == null) {
183
+ return value === void 0 ? undefinedTag : nullTag;
184
+ }
185
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
186
+ }
187
+ module.exports = baseGetTag;
188
+ }
189
+ });
190
+
191
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js
192
+ var require_isObject = __commonJS({
193
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js"(exports, module) {
194
+ "use strict";
195
+ function isObject(value) {
196
+ var type = typeof value;
197
+ return value != null && (type == "object" || type == "function");
198
+ }
199
+ module.exports = isObject;
200
+ }
201
+ });
202
+
203
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isFunction.js
204
+ var require_isFunction = __commonJS({
205
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isFunction.js"(exports, module) {
206
+ "use strict";
207
+ var baseGetTag = require_baseGetTag();
208
+ var isObject = require_isObject();
209
+ var asyncTag = "[object AsyncFunction]";
210
+ var funcTag = "[object Function]";
211
+ var genTag = "[object GeneratorFunction]";
212
+ var proxyTag = "[object Proxy]";
213
+ function isFunction(value) {
214
+ if (!isObject(value)) {
215
+ return false;
216
+ }
217
+ var tag = baseGetTag(value);
218
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
219
+ }
220
+ module.exports = isFunction;
221
+ }
222
+ });
223
+
224
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_coreJsData.js
225
+ var require_coreJsData = __commonJS({
226
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_coreJsData.js"(exports, module) {
227
+ "use strict";
228
+ var root = require_root();
229
+ var coreJsData = root["__core-js_shared__"];
230
+ module.exports = coreJsData;
231
+ }
232
+ });
233
+
234
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isMasked.js
235
+ var require_isMasked = __commonJS({
236
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isMasked.js"(exports, module) {
237
+ "use strict";
238
+ var coreJsData = require_coreJsData();
239
+ var maskSrcKey = function() {
240
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
241
+ return uid ? "Symbol(src)_1." + uid : "";
242
+ }();
243
+ function isMasked(func) {
244
+ return !!maskSrcKey && maskSrcKey in func;
245
+ }
246
+ module.exports = isMasked;
247
+ }
248
+ });
249
+
250
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toSource.js
251
+ var require_toSource = __commonJS({
252
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toSource.js"(exports, module) {
253
+ "use strict";
254
+ var funcProto = Function.prototype;
255
+ var funcToString = funcProto.toString;
256
+ function toSource(func) {
257
+ if (func != null) {
258
+ try {
259
+ return funcToString.call(func);
260
+ } catch (e) {
261
+ }
262
+ try {
263
+ return func + "";
264
+ } catch (e) {
265
+ }
266
+ }
267
+ return "";
268
+ }
269
+ module.exports = toSource;
270
+ }
271
+ });
272
+
273
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsNative.js
274
+ var require_baseIsNative = __commonJS({
275
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsNative.js"(exports, module) {
276
+ "use strict";
277
+ var isFunction = require_isFunction();
278
+ var isMasked = require_isMasked();
279
+ var isObject = require_isObject();
280
+ var toSource = require_toSource();
281
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
282
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
283
+ var funcProto = Function.prototype;
284
+ var objectProto = Object.prototype;
285
+ var funcToString = funcProto.toString;
286
+ var hasOwnProperty = objectProto.hasOwnProperty;
287
+ var reIsNative = RegExp(
288
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
289
+ );
290
+ function baseIsNative(value) {
291
+ if (!isObject(value) || isMasked(value)) {
292
+ return false;
293
+ }
294
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
295
+ return pattern.test(toSource(value));
296
+ }
297
+ module.exports = baseIsNative;
298
+ }
299
+ });
300
+
301
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getValue.js
302
+ var require_getValue = __commonJS({
303
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getValue.js"(exports, module) {
304
+ "use strict";
305
+ function getValue(object, key) {
306
+ return object == null ? void 0 : object[key];
307
+ }
308
+ module.exports = getValue;
309
+ }
310
+ });
311
+
312
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getNative.js
313
+ var require_getNative = __commonJS({
314
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getNative.js"(exports, module) {
315
+ "use strict";
316
+ var baseIsNative = require_baseIsNative();
317
+ var getValue = require_getValue();
318
+ function getNative(object, key) {
319
+ var value = getValue(object, key);
320
+ return baseIsNative(value) ? value : void 0;
321
+ }
322
+ module.exports = getNative;
323
+ }
324
+ });
325
+
326
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_defineProperty.js
327
+ var require_defineProperty = __commonJS({
328
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_defineProperty.js"(exports, module) {
329
+ "use strict";
330
+ var getNative = require_getNative();
331
+ var defineProperty = function() {
332
+ try {
333
+ var func = getNative(Object, "defineProperty");
334
+ func({}, "", {});
335
+ return func;
336
+ } catch (e) {
337
+ }
338
+ }();
339
+ module.exports = defineProperty;
340
+ }
341
+ });
342
+
343
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseSetToString.js
344
+ var require_baseSetToString = __commonJS({
345
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseSetToString.js"(exports, module) {
346
+ "use strict";
347
+ var constant = require_constant();
348
+ var defineProperty = require_defineProperty();
349
+ var identity = require_identity();
350
+ var baseSetToString = !defineProperty ? identity : function(func, string) {
351
+ return defineProperty(func, "toString", {
352
+ "configurable": true,
353
+ "enumerable": false,
354
+ "value": constant(string),
355
+ "writable": true
356
+ });
357
+ };
358
+ module.exports = baseSetToString;
359
+ }
360
+ });
361
+
362
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_shortOut.js
363
+ var require_shortOut = __commonJS({
364
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_shortOut.js"(exports, module) {
365
+ "use strict";
366
+ var HOT_COUNT = 800;
367
+ var HOT_SPAN = 16;
368
+ var nativeNow = Date.now;
369
+ function shortOut(func) {
370
+ var count = 0, lastCalled = 0;
371
+ return function() {
372
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
373
+ lastCalled = stamp;
374
+ if (remaining > 0) {
375
+ if (++count >= HOT_COUNT) {
376
+ return arguments[0];
377
+ }
378
+ } else {
379
+ count = 0;
380
+ }
381
+ return func.apply(void 0, arguments);
382
+ };
383
+ }
384
+ module.exports = shortOut;
385
+ }
386
+ });
387
+
388
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setToString.js
389
+ var require_setToString = __commonJS({
390
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setToString.js"(exports, module) {
391
+ "use strict";
392
+ var baseSetToString = require_baseSetToString();
393
+ var shortOut = require_shortOut();
394
+ var setToString = shortOut(baseSetToString);
395
+ module.exports = setToString;
396
+ }
397
+ });
398
+
399
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRest.js
400
+ var require_baseRest = __commonJS({
401
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRest.js"(exports, module) {
402
+ "use strict";
403
+ var identity = require_identity();
404
+ var overRest = require_overRest();
405
+ var setToString = require_setToString();
406
+ function baseRest(func, start) {
407
+ return setToString(overRest(func, start, identity), func + "");
408
+ }
409
+ module.exports = baseRest;
410
+ }
411
+ });
412
+
413
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js
414
+ var require_listCacheClear = __commonJS({
415
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"(exports, module) {
416
+ "use strict";
417
+ function listCacheClear() {
418
+ this.__data__ = [];
419
+ this.size = 0;
420
+ }
421
+ module.exports = listCacheClear;
422
+ }
423
+ });
424
+
425
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js
426
+ var require_eq = __commonJS({
427
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js"(exports, module) {
428
+ "use strict";
429
+ function eq(value, other) {
430
+ return value === other || value !== value && other !== other;
431
+ }
432
+ module.exports = eq;
433
+ }
434
+ });
435
+
436
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js
437
+ var require_assocIndexOf = __commonJS({
438
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js"(exports, module) {
439
+ "use strict";
440
+ var eq = require_eq();
441
+ function assocIndexOf(array, key) {
442
+ var length = array.length;
443
+ while (length--) {
444
+ if (eq(array[length][0], key)) {
445
+ return length;
446
+ }
447
+ }
448
+ return -1;
449
+ }
450
+ module.exports = assocIndexOf;
451
+ }
452
+ });
453
+
454
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js
455
+ var require_listCacheDelete = __commonJS({
456
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"(exports, module) {
457
+ "use strict";
458
+ var assocIndexOf = require_assocIndexOf();
459
+ var arrayProto = Array.prototype;
460
+ var splice = arrayProto.splice;
461
+ function listCacheDelete(key) {
462
+ var data = this.__data__, index = assocIndexOf(data, key);
463
+ if (index < 0) {
464
+ return false;
465
+ }
466
+ var lastIndex = data.length - 1;
467
+ if (index == lastIndex) {
468
+ data.pop();
469
+ } else {
470
+ splice.call(data, index, 1);
471
+ }
472
+ --this.size;
473
+ return true;
474
+ }
475
+ module.exports = listCacheDelete;
476
+ }
477
+ });
478
+
479
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js
480
+ var require_listCacheGet = __commonJS({
481
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"(exports, module) {
482
+ "use strict";
483
+ var assocIndexOf = require_assocIndexOf();
484
+ function listCacheGet(key) {
485
+ var data = this.__data__, index = assocIndexOf(data, key);
486
+ return index < 0 ? void 0 : data[index][1];
487
+ }
488
+ module.exports = listCacheGet;
489
+ }
490
+ });
491
+
492
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js
493
+ var require_listCacheHas = __commonJS({
494
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"(exports, module) {
495
+ "use strict";
496
+ var assocIndexOf = require_assocIndexOf();
497
+ function listCacheHas(key) {
498
+ return assocIndexOf(this.__data__, key) > -1;
499
+ }
500
+ module.exports = listCacheHas;
501
+ }
502
+ });
503
+
504
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js
505
+ var require_listCacheSet = __commonJS({
506
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js"(exports, module) {
507
+ "use strict";
508
+ var assocIndexOf = require_assocIndexOf();
509
+ function listCacheSet(key, value) {
510
+ var data = this.__data__, index = assocIndexOf(data, key);
511
+ if (index < 0) {
512
+ ++this.size;
513
+ data.push([key, value]);
514
+ } else {
515
+ data[index][1] = value;
516
+ }
517
+ return this;
518
+ }
519
+ module.exports = listCacheSet;
520
+ }
521
+ });
522
+
523
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_ListCache.js
524
+ var require_ListCache = __commonJS({
525
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_ListCache.js"(exports, module) {
526
+ "use strict";
527
+ var listCacheClear = require_listCacheClear();
528
+ var listCacheDelete = require_listCacheDelete();
529
+ var listCacheGet = require_listCacheGet();
530
+ var listCacheHas = require_listCacheHas();
531
+ var listCacheSet = require_listCacheSet();
532
+ function ListCache(entries) {
533
+ var index = -1, length = entries == null ? 0 : entries.length;
534
+ this.clear();
535
+ while (++index < length) {
536
+ var entry = entries[index];
537
+ this.set(entry[0], entry[1]);
538
+ }
539
+ }
540
+ ListCache.prototype.clear = listCacheClear;
541
+ ListCache.prototype["delete"] = listCacheDelete;
542
+ ListCache.prototype.get = listCacheGet;
543
+ ListCache.prototype.has = listCacheHas;
544
+ ListCache.prototype.set = listCacheSet;
545
+ module.exports = ListCache;
546
+ }
547
+ });
548
+
549
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackClear.js
550
+ var require_stackClear = __commonJS({
551
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackClear.js"(exports, module) {
552
+ "use strict";
553
+ var ListCache = require_ListCache();
554
+ function stackClear() {
555
+ this.__data__ = new ListCache();
556
+ this.size = 0;
557
+ }
558
+ module.exports = stackClear;
559
+ }
560
+ });
561
+
562
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackDelete.js
563
+ var require_stackDelete = __commonJS({
564
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackDelete.js"(exports, module) {
565
+ "use strict";
566
+ function stackDelete(key) {
567
+ var data = this.__data__, result = data["delete"](key);
568
+ this.size = data.size;
569
+ return result;
570
+ }
571
+ module.exports = stackDelete;
572
+ }
573
+ });
574
+
575
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackGet.js
576
+ var require_stackGet = __commonJS({
577
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackGet.js"(exports, module) {
578
+ "use strict";
579
+ function stackGet(key) {
580
+ return this.__data__.get(key);
581
+ }
582
+ module.exports = stackGet;
583
+ }
584
+ });
585
+
586
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackHas.js
587
+ var require_stackHas = __commonJS({
588
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackHas.js"(exports, module) {
589
+ "use strict";
590
+ function stackHas(key) {
591
+ return this.__data__.has(key);
592
+ }
593
+ module.exports = stackHas;
594
+ }
595
+ });
596
+
597
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Map.js
598
+ var require_Map = __commonJS({
599
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Map.js"(exports, module) {
600
+ "use strict";
601
+ var getNative = require_getNative();
602
+ var root = require_root();
603
+ var Map2 = getNative(root, "Map");
604
+ module.exports = Map2;
605
+ }
606
+ });
607
+
608
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeCreate.js
609
+ var require_nativeCreate = __commonJS({
610
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeCreate.js"(exports, module) {
611
+ "use strict";
612
+ var getNative = require_getNative();
613
+ var nativeCreate = getNative(Object, "create");
614
+ module.exports = nativeCreate;
615
+ }
616
+ });
617
+
618
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashClear.js
619
+ var require_hashClear = __commonJS({
620
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashClear.js"(exports, module) {
621
+ "use strict";
622
+ var nativeCreate = require_nativeCreate();
623
+ function hashClear() {
624
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
625
+ this.size = 0;
626
+ }
627
+ module.exports = hashClear;
628
+ }
629
+ });
630
+
631
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashDelete.js
632
+ var require_hashDelete = __commonJS({
633
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashDelete.js"(exports, module) {
634
+ "use strict";
635
+ function hashDelete(key) {
636
+ var result = this.has(key) && delete this.__data__[key];
637
+ this.size -= result ? 1 : 0;
638
+ return result;
639
+ }
640
+ module.exports = hashDelete;
641
+ }
642
+ });
643
+
644
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashGet.js
645
+ var require_hashGet = __commonJS({
646
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashGet.js"(exports, module) {
647
+ "use strict";
648
+ var nativeCreate = require_nativeCreate();
649
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
650
+ var objectProto = Object.prototype;
651
+ var hasOwnProperty = objectProto.hasOwnProperty;
652
+ function hashGet(key) {
653
+ var data = this.__data__;
654
+ if (nativeCreate) {
655
+ var result = data[key];
656
+ return result === HASH_UNDEFINED ? void 0 : result;
657
+ }
658
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
659
+ }
660
+ module.exports = hashGet;
661
+ }
662
+ });
663
+
664
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashHas.js
665
+ var require_hashHas = __commonJS({
666
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashHas.js"(exports, module) {
667
+ "use strict";
668
+ var nativeCreate = require_nativeCreate();
669
+ var objectProto = Object.prototype;
670
+ var hasOwnProperty = objectProto.hasOwnProperty;
671
+ function hashHas(key) {
672
+ var data = this.__data__;
673
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
674
+ }
675
+ module.exports = hashHas;
676
+ }
677
+ });
678
+
679
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashSet.js
680
+ var require_hashSet = __commonJS({
681
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashSet.js"(exports, module) {
682
+ "use strict";
683
+ var nativeCreate = require_nativeCreate();
684
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
685
+ function hashSet(key, value) {
686
+ var data = this.__data__;
687
+ this.size += this.has(key) ? 0 : 1;
688
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
689
+ return this;
690
+ }
691
+ module.exports = hashSet;
692
+ }
693
+ });
694
+
695
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Hash.js
696
+ var require_Hash = __commonJS({
697
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Hash.js"(exports, module) {
698
+ "use strict";
699
+ var hashClear = require_hashClear();
700
+ var hashDelete = require_hashDelete();
701
+ var hashGet = require_hashGet();
702
+ var hashHas = require_hashHas();
703
+ var hashSet = require_hashSet();
704
+ function Hash(entries) {
705
+ var index = -1, length = entries == null ? 0 : entries.length;
706
+ this.clear();
707
+ while (++index < length) {
708
+ var entry = entries[index];
709
+ this.set(entry[0], entry[1]);
710
+ }
711
+ }
712
+ Hash.prototype.clear = hashClear;
713
+ Hash.prototype["delete"] = hashDelete;
714
+ Hash.prototype.get = hashGet;
715
+ Hash.prototype.has = hashHas;
716
+ Hash.prototype.set = hashSet;
717
+ module.exports = Hash;
718
+ }
719
+ });
720
+
721
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js
722
+ var require_mapCacheClear = __commonJS({
723
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js"(exports, module) {
724
+ "use strict";
725
+ var Hash = require_Hash();
726
+ var ListCache = require_ListCache();
727
+ var Map2 = require_Map();
728
+ function mapCacheClear() {
729
+ this.size = 0;
730
+ this.__data__ = {
731
+ "hash": new Hash(),
732
+ "map": new (Map2 || ListCache)(),
733
+ "string": new Hash()
734
+ };
735
+ }
736
+ module.exports = mapCacheClear;
737
+ }
738
+ });
739
+
740
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKeyable.js
741
+ var require_isKeyable = __commonJS({
742
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKeyable.js"(exports, module) {
743
+ "use strict";
744
+ function isKeyable(value) {
745
+ var type = typeof value;
746
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
747
+ }
748
+ module.exports = isKeyable;
749
+ }
750
+ });
751
+
752
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMapData.js
753
+ var require_getMapData = __commonJS({
754
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMapData.js"(exports, module) {
755
+ "use strict";
756
+ var isKeyable = require_isKeyable();
757
+ function getMapData(map, key) {
758
+ var data = map.__data__;
759
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
760
+ }
761
+ module.exports = getMapData;
762
+ }
763
+ });
764
+
765
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js
766
+ var require_mapCacheDelete = __commonJS({
767
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js"(exports, module) {
768
+ "use strict";
769
+ var getMapData = require_getMapData();
770
+ function mapCacheDelete(key) {
771
+ var result = getMapData(this, key)["delete"](key);
772
+ this.size -= result ? 1 : 0;
773
+ return result;
774
+ }
775
+ module.exports = mapCacheDelete;
776
+ }
777
+ });
778
+
779
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js
780
+ var require_mapCacheGet = __commonJS({
781
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js"(exports, module) {
782
+ "use strict";
783
+ var getMapData = require_getMapData();
784
+ function mapCacheGet(key) {
785
+ return getMapData(this, key).get(key);
786
+ }
787
+ module.exports = mapCacheGet;
788
+ }
789
+ });
790
+
791
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js
792
+ var require_mapCacheHas = __commonJS({
793
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js"(exports, module) {
794
+ "use strict";
795
+ var getMapData = require_getMapData();
796
+ function mapCacheHas(key) {
797
+ return getMapData(this, key).has(key);
798
+ }
799
+ module.exports = mapCacheHas;
800
+ }
801
+ });
802
+
803
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js
804
+ var require_mapCacheSet = __commonJS({
805
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js"(exports, module) {
806
+ "use strict";
807
+ var getMapData = require_getMapData();
808
+ function mapCacheSet(key, value) {
809
+ var data = getMapData(this, key), size = data.size;
810
+ data.set(key, value);
811
+ this.size += data.size == size ? 0 : 1;
812
+ return this;
813
+ }
814
+ module.exports = mapCacheSet;
815
+ }
816
+ });
817
+
818
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js
819
+ var require_MapCache = __commonJS({
820
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js"(exports, module) {
821
+ "use strict";
822
+ var mapCacheClear = require_mapCacheClear();
823
+ var mapCacheDelete = require_mapCacheDelete();
824
+ var mapCacheGet = require_mapCacheGet();
825
+ var mapCacheHas = require_mapCacheHas();
826
+ var mapCacheSet = require_mapCacheSet();
827
+ function MapCache(entries) {
828
+ var index = -1, length = entries == null ? 0 : entries.length;
829
+ this.clear();
830
+ while (++index < length) {
831
+ var entry = entries[index];
832
+ this.set(entry[0], entry[1]);
833
+ }
834
+ }
835
+ MapCache.prototype.clear = mapCacheClear;
836
+ MapCache.prototype["delete"] = mapCacheDelete;
837
+ MapCache.prototype.get = mapCacheGet;
838
+ MapCache.prototype.has = mapCacheHas;
839
+ MapCache.prototype.set = mapCacheSet;
840
+ module.exports = MapCache;
841
+ }
842
+ });
843
+
844
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackSet.js
845
+ var require_stackSet = __commonJS({
846
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackSet.js"(exports, module) {
847
+ "use strict";
848
+ var ListCache = require_ListCache();
849
+ var Map2 = require_Map();
850
+ var MapCache = require_MapCache();
851
+ var LARGE_ARRAY_SIZE = 200;
852
+ function stackSet(key, value) {
853
+ var data = this.__data__;
854
+ if (data instanceof ListCache) {
855
+ var pairs = data.__data__;
856
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
857
+ pairs.push([key, value]);
858
+ this.size = ++data.size;
859
+ return this;
860
+ }
861
+ data = this.__data__ = new MapCache(pairs);
862
+ }
863
+ data.set(key, value);
864
+ this.size = data.size;
865
+ return this;
866
+ }
867
+ module.exports = stackSet;
868
+ }
869
+ });
870
+
871
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Stack.js
872
+ var require_Stack = __commonJS({
873
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Stack.js"(exports, module) {
874
+ "use strict";
875
+ var ListCache = require_ListCache();
876
+ var stackClear = require_stackClear();
877
+ var stackDelete = require_stackDelete();
878
+ var stackGet = require_stackGet();
879
+ var stackHas = require_stackHas();
880
+ var stackSet = require_stackSet();
881
+ function Stack(entries) {
882
+ var data = this.__data__ = new ListCache(entries);
883
+ this.size = data.size;
884
+ }
885
+ Stack.prototype.clear = stackClear;
886
+ Stack.prototype["delete"] = stackDelete;
887
+ Stack.prototype.get = stackGet;
888
+ Stack.prototype.has = stackHas;
889
+ Stack.prototype.set = stackSet;
890
+ module.exports = Stack;
891
+ }
892
+ });
893
+
894
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js
895
+ var require_baseAssignValue = __commonJS({
896
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js"(exports, module) {
897
+ "use strict";
898
+ var defineProperty = require_defineProperty();
899
+ function baseAssignValue(object, key, value) {
900
+ if (key == "__proto__" && defineProperty) {
901
+ defineProperty(object, key, {
902
+ "configurable": true,
903
+ "enumerable": true,
904
+ "value": value,
905
+ "writable": true
906
+ });
907
+ } else {
908
+ object[key] = value;
909
+ }
910
+ }
911
+ module.exports = baseAssignValue;
912
+ }
913
+ });
914
+
915
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignMergeValue.js
916
+ var require_assignMergeValue = __commonJS({
917
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignMergeValue.js"(exports, module) {
918
+ "use strict";
919
+ var baseAssignValue = require_baseAssignValue();
920
+ var eq = require_eq();
921
+ function assignMergeValue(object, key, value) {
922
+ if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
923
+ baseAssignValue(object, key, value);
924
+ }
925
+ }
926
+ module.exports = assignMergeValue;
927
+ }
928
+ });
929
+
930
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createBaseFor.js
931
+ var require_createBaseFor = __commonJS({
932
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createBaseFor.js"(exports, module) {
933
+ "use strict";
934
+ function createBaseFor(fromRight) {
935
+ return function(object, iteratee, keysFunc) {
936
+ var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
937
+ while (length--) {
938
+ var key = props[fromRight ? length : ++index];
939
+ if (iteratee(iterable[key], key, iterable) === false) {
940
+ break;
941
+ }
942
+ }
943
+ return object;
944
+ };
945
+ }
946
+ module.exports = createBaseFor;
947
+ }
948
+ });
949
+
950
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseFor.js
951
+ var require_baseFor = __commonJS({
952
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseFor.js"(exports, module) {
953
+ "use strict";
954
+ var createBaseFor = require_createBaseFor();
955
+ var baseFor = createBaseFor();
956
+ module.exports = baseFor;
957
+ }
958
+ });
959
+
960
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_cloneBuffer.js
961
+ var require_cloneBuffer = __commonJS({
962
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_cloneBuffer.js"(exports, module) {
963
+ "use strict";
964
+ var root = require_root();
965
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
966
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
967
+ var moduleExports = freeModule && freeModule.exports === freeExports;
968
+ var Buffer2 = moduleExports ? root.Buffer : void 0;
969
+ var allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
970
+ function cloneBuffer(buffer, isDeep) {
971
+ if (isDeep) {
972
+ return buffer.slice();
973
+ }
974
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
975
+ buffer.copy(result);
976
+ return result;
977
+ }
978
+ module.exports = cloneBuffer;
979
+ }
980
+ });
981
+
982
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Uint8Array.js
983
+ var require_Uint8Array = __commonJS({
984
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Uint8Array.js"(exports, module) {
985
+ "use strict";
986
+ var root = require_root();
987
+ var Uint8Array2 = root.Uint8Array;
988
+ module.exports = Uint8Array2;
989
+ }
990
+ });
991
+
992
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_cloneArrayBuffer.js
993
+ var require_cloneArrayBuffer = __commonJS({
994
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_cloneArrayBuffer.js"(exports, module) {
995
+ "use strict";
996
+ var Uint8Array2 = require_Uint8Array();
997
+ function cloneArrayBuffer(arrayBuffer) {
998
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
999
+ new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
1000
+ return result;
1001
+ }
1002
+ module.exports = cloneArrayBuffer;
1003
+ }
1004
+ });
1005
+
1006
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_cloneTypedArray.js
1007
+ var require_cloneTypedArray = __commonJS({
1008
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_cloneTypedArray.js"(exports, module) {
1009
+ "use strict";
1010
+ var cloneArrayBuffer = require_cloneArrayBuffer();
1011
+ function cloneTypedArray(typedArray, isDeep) {
1012
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1013
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1014
+ }
1015
+ module.exports = cloneTypedArray;
1016
+ }
1017
+ });
1018
+
1019
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_copyArray.js
1020
+ var require_copyArray = __commonJS({
1021
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_copyArray.js"(exports, module) {
1022
+ "use strict";
1023
+ function copyArray(source, array) {
1024
+ var index = -1, length = source.length;
1025
+ array || (array = Array(length));
1026
+ while (++index < length) {
1027
+ array[index] = source[index];
1028
+ }
1029
+ return array;
1030
+ }
1031
+ module.exports = copyArray;
1032
+ }
1033
+ });
1034
+
1035
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseCreate.js
1036
+ var require_baseCreate = __commonJS({
1037
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseCreate.js"(exports, module) {
1038
+ "use strict";
1039
+ var isObject = require_isObject();
1040
+ var objectCreate = Object.create;
1041
+ var baseCreate = /* @__PURE__ */ function() {
1042
+ function object() {
1043
+ }
1044
+ return function(proto) {
1045
+ if (!isObject(proto)) {
1046
+ return {};
1047
+ }
1048
+ if (objectCreate) {
1049
+ return objectCreate(proto);
1050
+ }
1051
+ object.prototype = proto;
1052
+ var result = new object();
1053
+ object.prototype = void 0;
1054
+ return result;
1055
+ };
1056
+ }();
1057
+ module.exports = baseCreate;
1058
+ }
1059
+ });
1060
+
1061
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overArg.js
1062
+ var require_overArg = __commonJS({
1063
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overArg.js"(exports, module) {
1064
+ "use strict";
1065
+ function overArg(func, transform) {
1066
+ return function(arg) {
1067
+ return func(transform(arg));
1068
+ };
1069
+ }
1070
+ module.exports = overArg;
1071
+ }
1072
+ });
1073
+
1074
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getPrototype.js
1075
+ var require_getPrototype = __commonJS({
1076
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getPrototype.js"(exports, module) {
1077
+ "use strict";
1078
+ var overArg = require_overArg();
1079
+ var getPrototype = overArg(Object.getPrototypeOf, Object);
1080
+ module.exports = getPrototype;
1081
+ }
1082
+ });
1083
+
1084
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isPrototype.js
1085
+ var require_isPrototype = __commonJS({
1086
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isPrototype.js"(exports, module) {
1087
+ "use strict";
1088
+ var objectProto = Object.prototype;
1089
+ function isPrototype(value) {
1090
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
1091
+ return value === proto;
1092
+ }
1093
+ module.exports = isPrototype;
1094
+ }
1095
+ });
1096
+
1097
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_initCloneObject.js
1098
+ var require_initCloneObject = __commonJS({
1099
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_initCloneObject.js"(exports, module) {
1100
+ "use strict";
1101
+ var baseCreate = require_baseCreate();
1102
+ var getPrototype = require_getPrototype();
1103
+ var isPrototype = require_isPrototype();
1104
+ function initCloneObject(object) {
1105
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
1106
+ }
1107
+ module.exports = initCloneObject;
1108
+ }
1109
+ });
1110
+
1111
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js
1112
+ var require_isObjectLike = __commonJS({
1113
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js"(exports, module) {
1114
+ "use strict";
1115
+ function isObjectLike(value) {
1116
+ return value != null && typeof value == "object";
1117
+ }
1118
+ module.exports = isObjectLike;
1119
+ }
1120
+ });
1121
+
1122
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js
1123
+ var require_baseIsArguments = __commonJS({
1124
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js"(exports, module) {
1125
+ "use strict";
1126
+ var baseGetTag = require_baseGetTag();
1127
+ var isObjectLike = require_isObjectLike();
1128
+ var argsTag = "[object Arguments]";
1129
+ function baseIsArguments(value) {
1130
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1131
+ }
1132
+ module.exports = baseIsArguments;
1133
+ }
1134
+ });
1135
+
1136
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArguments.js
1137
+ var require_isArguments = __commonJS({
1138
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArguments.js"(exports, module) {
1139
+ "use strict";
1140
+ var baseIsArguments = require_baseIsArguments();
1141
+ var isObjectLike = require_isObjectLike();
1142
+ var objectProto = Object.prototype;
1143
+ var hasOwnProperty = objectProto.hasOwnProperty;
1144
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
1145
+ var isArguments = baseIsArguments(/* @__PURE__ */ function() {
1146
+ return arguments;
1147
+ }()) ? baseIsArguments : function(value) {
1148
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1149
+ };
1150
+ module.exports = isArguments;
1151
+ }
1152
+ });
1153
+
1154
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js
1155
+ var require_isArray = __commonJS({
1156
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js"(exports, module) {
1157
+ "use strict";
1158
+ var isArray = Array.isArray;
1159
+ module.exports = isArray;
1160
+ }
1161
+ });
1162
+
1163
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isLength.js
1164
+ var require_isLength = __commonJS({
1165
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isLength.js"(exports, module) {
1166
+ "use strict";
1167
+ var MAX_SAFE_INTEGER = 9007199254740991;
1168
+ function isLength(value) {
1169
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1170
+ }
1171
+ module.exports = isLength;
1172
+ }
1173
+ });
1174
+
1175
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArrayLike.js
1176
+ var require_isArrayLike = __commonJS({
1177
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArrayLike.js"(exports, module) {
1178
+ "use strict";
1179
+ var isFunction = require_isFunction();
1180
+ var isLength = require_isLength();
1181
+ function isArrayLike(value) {
1182
+ return value != null && isLength(value.length) && !isFunction(value);
1183
+ }
1184
+ module.exports = isArrayLike;
1185
+ }
1186
+ });
1187
+
1188
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArrayLikeObject.js
1189
+ var require_isArrayLikeObject = __commonJS({
1190
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArrayLikeObject.js"(exports, module) {
1191
+ "use strict";
1192
+ var isArrayLike = require_isArrayLike();
1193
+ var isObjectLike = require_isObjectLike();
1194
+ function isArrayLikeObject(value) {
1195
+ return isObjectLike(value) && isArrayLike(value);
1196
+ }
1197
+ module.exports = isArrayLikeObject;
1198
+ }
1199
+ });
1200
+
1201
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/stubFalse.js
1202
+ var require_stubFalse = __commonJS({
1203
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/stubFalse.js"(exports, module) {
1204
+ "use strict";
1205
+ function stubFalse() {
1206
+ return false;
1207
+ }
1208
+ module.exports = stubFalse;
1209
+ }
1210
+ });
1211
+
1212
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isBuffer.js
1213
+ var require_isBuffer = __commonJS({
1214
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isBuffer.js"(exports, module) {
1215
+ "use strict";
1216
+ var root = require_root();
1217
+ var stubFalse = require_stubFalse();
1218
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
1219
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
1220
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1221
+ var Buffer2 = moduleExports ? root.Buffer : void 0;
1222
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
1223
+ var isBuffer = nativeIsBuffer || stubFalse;
1224
+ module.exports = isBuffer;
1225
+ }
1226
+ });
1227
+
1228
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js
1229
+ var require_isPlainObject = __commonJS({
1230
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js"(exports, module) {
1231
+ "use strict";
1232
+ var baseGetTag = require_baseGetTag();
1233
+ var getPrototype = require_getPrototype();
1234
+ var isObjectLike = require_isObjectLike();
1235
+ var objectTag = "[object Object]";
1236
+ var funcProto = Function.prototype;
1237
+ var objectProto = Object.prototype;
1238
+ var funcToString = funcProto.toString;
1239
+ var hasOwnProperty = objectProto.hasOwnProperty;
1240
+ var objectCtorString = funcToString.call(Object);
1241
+ function isPlainObject2(value) {
1242
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
1243
+ return false;
1244
+ }
1245
+ var proto = getPrototype(value);
1246
+ if (proto === null) {
1247
+ return true;
1248
+ }
1249
+ var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
1250
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
1251
+ }
1252
+ module.exports = isPlainObject2;
1253
+ }
1254
+ });
1255
+
1256
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsTypedArray.js
1257
+ var require_baseIsTypedArray = __commonJS({
1258
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsTypedArray.js"(exports, module) {
1259
+ "use strict";
1260
+ var baseGetTag = require_baseGetTag();
1261
+ var isLength = require_isLength();
1262
+ var isObjectLike = require_isObjectLike();
1263
+ var argsTag = "[object Arguments]";
1264
+ var arrayTag = "[object Array]";
1265
+ var boolTag = "[object Boolean]";
1266
+ var dateTag = "[object Date]";
1267
+ var errorTag = "[object Error]";
1268
+ var funcTag = "[object Function]";
1269
+ var mapTag = "[object Map]";
1270
+ var numberTag = "[object Number]";
1271
+ var objectTag = "[object Object]";
1272
+ var regexpTag = "[object RegExp]";
1273
+ var setTag = "[object Set]";
1274
+ var stringTag = "[object String]";
1275
+ var weakMapTag = "[object WeakMap]";
1276
+ var arrayBufferTag = "[object ArrayBuffer]";
1277
+ var dataViewTag = "[object DataView]";
1278
+ var float32Tag = "[object Float32Array]";
1279
+ var float64Tag = "[object Float64Array]";
1280
+ var int8Tag = "[object Int8Array]";
1281
+ var int16Tag = "[object Int16Array]";
1282
+ var int32Tag = "[object Int32Array]";
1283
+ var uint8Tag = "[object Uint8Array]";
1284
+ var uint8ClampedTag = "[object Uint8ClampedArray]";
1285
+ var uint16Tag = "[object Uint16Array]";
1286
+ var uint32Tag = "[object Uint32Array]";
1287
+ var typedArrayTags = {};
1288
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
1289
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
1290
+ function baseIsTypedArray(value) {
1291
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1292
+ }
1293
+ module.exports = baseIsTypedArray;
1294
+ }
1295
+ });
1296
+
1297
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseUnary.js
1298
+ var require_baseUnary = __commonJS({
1299
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseUnary.js"(exports, module) {
1300
+ "use strict";
1301
+ function baseUnary(func) {
1302
+ return function(value) {
1303
+ return func(value);
1304
+ };
1305
+ }
1306
+ module.exports = baseUnary;
1307
+ }
1308
+ });
1309
+
1310
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nodeUtil.js
1311
+ var require_nodeUtil = __commonJS({
1312
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nodeUtil.js"(exports, module) {
1313
+ "use strict";
1314
+ var freeGlobal = require_freeGlobal();
1315
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
1316
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
1317
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1318
+ var freeProcess = moduleExports && freeGlobal.process;
1319
+ var nodeUtil = function() {
1320
+ try {
1321
+ var types = freeModule && freeModule.require && freeModule.require("util").types;
1322
+ if (types) {
1323
+ return types;
1324
+ }
1325
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
1326
+ } catch (e) {
1327
+ }
1328
+ }();
1329
+ module.exports = nodeUtil;
1330
+ }
1331
+ });
1332
+
1333
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isTypedArray.js
1334
+ var require_isTypedArray = __commonJS({
1335
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isTypedArray.js"(exports, module) {
1336
+ "use strict";
1337
+ var baseIsTypedArray = require_baseIsTypedArray();
1338
+ var baseUnary = require_baseUnary();
1339
+ var nodeUtil = require_nodeUtil();
1340
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1341
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1342
+ module.exports = isTypedArray;
1343
+ }
1344
+ });
1345
+
1346
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_safeGet.js
1347
+ var require_safeGet = __commonJS({
1348
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_safeGet.js"(exports, module) {
1349
+ "use strict";
1350
+ function safeGet(object, key) {
1351
+ if (key === "constructor" && typeof object[key] === "function") {
1352
+ return;
1353
+ }
1354
+ if (key == "__proto__") {
1355
+ return;
1356
+ }
1357
+ return object[key];
1358
+ }
1359
+ module.exports = safeGet;
1360
+ }
1361
+ });
1362
+
1363
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignValue.js
1364
+ var require_assignValue = __commonJS({
1365
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignValue.js"(exports, module) {
1366
+ "use strict";
1367
+ var baseAssignValue = require_baseAssignValue();
1368
+ var eq = require_eq();
1369
+ var objectProto = Object.prototype;
1370
+ var hasOwnProperty = objectProto.hasOwnProperty;
1371
+ function assignValue(object, key, value) {
1372
+ var objValue = object[key];
1373
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
1374
+ baseAssignValue(object, key, value);
1375
+ }
1376
+ }
1377
+ module.exports = assignValue;
1378
+ }
1379
+ });
1380
+
1381
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_copyObject.js
1382
+ var require_copyObject = __commonJS({
1383
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_copyObject.js"(exports, module) {
1384
+ "use strict";
1385
+ var assignValue = require_assignValue();
1386
+ var baseAssignValue = require_baseAssignValue();
1387
+ function copyObject(source, props, object, customizer) {
1388
+ var isNew = !object;
1389
+ object || (object = {});
1390
+ var index = -1, length = props.length;
1391
+ while (++index < length) {
1392
+ var key = props[index];
1393
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
1394
+ if (newValue === void 0) {
1395
+ newValue = source[key];
1396
+ }
1397
+ if (isNew) {
1398
+ baseAssignValue(object, key, newValue);
1399
+ } else {
1400
+ assignValue(object, key, newValue);
1401
+ }
1402
+ }
1403
+ return object;
1404
+ }
1405
+ module.exports = copyObject;
1406
+ }
1407
+ });
1408
+
1409
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTimes.js
1410
+ var require_baseTimes = __commonJS({
1411
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTimes.js"(exports, module) {
1412
+ "use strict";
1413
+ function baseTimes(n, iteratee) {
1414
+ var index = -1, result = Array(n);
1415
+ while (++index < n) {
1416
+ result[index] = iteratee(index);
1417
+ }
1418
+ return result;
1419
+ }
1420
+ module.exports = baseTimes;
1421
+ }
1422
+ });
1423
+
1424
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js
1425
+ var require_isIndex = __commonJS({
1426
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js"(exports, module) {
1427
+ "use strict";
1428
+ var MAX_SAFE_INTEGER = 9007199254740991;
1429
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1430
+ function isIndex(value, length) {
1431
+ var type = typeof value;
1432
+ length = length == null ? MAX_SAFE_INTEGER : length;
1433
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
1434
+ }
1435
+ module.exports = isIndex;
1436
+ }
1437
+ });
1438
+
1439
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayLikeKeys.js
1440
+ var require_arrayLikeKeys = __commonJS({
1441
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayLikeKeys.js"(exports, module) {
1442
+ "use strict";
1443
+ var baseTimes = require_baseTimes();
1444
+ var isArguments = require_isArguments();
1445
+ var isArray = require_isArray();
1446
+ var isBuffer = require_isBuffer();
1447
+ var isIndex = require_isIndex();
1448
+ var isTypedArray = require_isTypedArray();
1449
+ var objectProto = Object.prototype;
1450
+ var hasOwnProperty = objectProto.hasOwnProperty;
1451
+ function arrayLikeKeys(value, inherited) {
1452
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
1453
+ for (var key in value) {
1454
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
1455
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
1456
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
1457
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
1458
+ isIndex(key, length)))) {
1459
+ result.push(key);
1460
+ }
1461
+ }
1462
+ return result;
1463
+ }
1464
+ module.exports = arrayLikeKeys;
1465
+ }
1466
+ });
1467
+
1468
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeKeysIn.js
1469
+ var require_nativeKeysIn = __commonJS({
1470
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeKeysIn.js"(exports, module) {
1471
+ "use strict";
1472
+ function nativeKeysIn(object) {
1473
+ var result = [];
1474
+ if (object != null) {
1475
+ for (var key in Object(object)) {
1476
+ result.push(key);
1477
+ }
1478
+ }
1479
+ return result;
1480
+ }
1481
+ module.exports = nativeKeysIn;
1482
+ }
1483
+ });
1484
+
1485
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseKeysIn.js
1486
+ var require_baseKeysIn = __commonJS({
1487
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseKeysIn.js"(exports, module) {
1488
+ "use strict";
1489
+ var isObject = require_isObject();
1490
+ var isPrototype = require_isPrototype();
1491
+ var nativeKeysIn = require_nativeKeysIn();
1492
+ var objectProto = Object.prototype;
1493
+ var hasOwnProperty = objectProto.hasOwnProperty;
1494
+ function baseKeysIn(object) {
1495
+ if (!isObject(object)) {
1496
+ return nativeKeysIn(object);
1497
+ }
1498
+ var isProto = isPrototype(object), result = [];
1499
+ for (var key in object) {
1500
+ if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
1501
+ result.push(key);
1502
+ }
1503
+ }
1504
+ return result;
1505
+ }
1506
+ module.exports = baseKeysIn;
1507
+ }
1508
+ });
1509
+
1510
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/keysIn.js
1511
+ var require_keysIn = __commonJS({
1512
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/keysIn.js"(exports, module) {
1513
+ "use strict";
1514
+ var arrayLikeKeys = require_arrayLikeKeys();
1515
+ var baseKeysIn = require_baseKeysIn();
1516
+ var isArrayLike = require_isArrayLike();
1517
+ function keysIn(object) {
1518
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1519
+ }
1520
+ module.exports = keysIn;
1521
+ }
1522
+ });
1523
+
1524
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toPlainObject.js
1525
+ var require_toPlainObject = __commonJS({
1526
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toPlainObject.js"(exports, module) {
1527
+ "use strict";
1528
+ var copyObject = require_copyObject();
1529
+ var keysIn = require_keysIn();
1530
+ function toPlainObject(value) {
1531
+ return copyObject(value, keysIn(value));
1532
+ }
1533
+ module.exports = toPlainObject;
1534
+ }
1535
+ });
1536
+
1537
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseMergeDeep.js
1538
+ var require_baseMergeDeep = __commonJS({
1539
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseMergeDeep.js"(exports, module) {
1540
+ "use strict";
1541
+ var assignMergeValue = require_assignMergeValue();
1542
+ var cloneBuffer = require_cloneBuffer();
1543
+ var cloneTypedArray = require_cloneTypedArray();
1544
+ var copyArray = require_copyArray();
1545
+ var initCloneObject = require_initCloneObject();
1546
+ var isArguments = require_isArguments();
1547
+ var isArray = require_isArray();
1548
+ var isArrayLikeObject = require_isArrayLikeObject();
1549
+ var isBuffer = require_isBuffer();
1550
+ var isFunction = require_isFunction();
1551
+ var isObject = require_isObject();
1552
+ var isPlainObject2 = require_isPlainObject();
1553
+ var isTypedArray = require_isTypedArray();
1554
+ var safeGet = require_safeGet();
1555
+ var toPlainObject = require_toPlainObject();
1556
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
1557
+ var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
1558
+ if (stacked) {
1559
+ assignMergeValue(object, key, stacked);
1560
+ return;
1561
+ }
1562
+ var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
1563
+ var isCommon = newValue === void 0;
1564
+ if (isCommon) {
1565
+ var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
1566
+ newValue = srcValue;
1567
+ if (isArr || isBuff || isTyped) {
1568
+ if (isArray(objValue)) {
1569
+ newValue = objValue;
1570
+ } else if (isArrayLikeObject(objValue)) {
1571
+ newValue = copyArray(objValue);
1572
+ } else if (isBuff) {
1573
+ isCommon = false;
1574
+ newValue = cloneBuffer(srcValue, true);
1575
+ } else if (isTyped) {
1576
+ isCommon = false;
1577
+ newValue = cloneTypedArray(srcValue, true);
1578
+ } else {
1579
+ newValue = [];
1580
+ }
1581
+ } else if (isPlainObject2(srcValue) || isArguments(srcValue)) {
1582
+ newValue = objValue;
1583
+ if (isArguments(objValue)) {
1584
+ newValue = toPlainObject(objValue);
1585
+ } else if (!isObject(objValue) || isFunction(objValue)) {
1586
+ newValue = initCloneObject(srcValue);
1587
+ }
1588
+ } else {
1589
+ isCommon = false;
1590
+ }
1591
+ }
1592
+ if (isCommon) {
1593
+ stack.set(srcValue, newValue);
1594
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
1595
+ stack["delete"](srcValue);
1596
+ }
1597
+ assignMergeValue(object, key, newValue);
1598
+ }
1599
+ module.exports = baseMergeDeep;
1600
+ }
1601
+ });
1602
+
1603
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseMerge.js
1604
+ var require_baseMerge = __commonJS({
1605
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseMerge.js"(exports, module) {
1606
+ "use strict";
1607
+ var Stack = require_Stack();
1608
+ var assignMergeValue = require_assignMergeValue();
1609
+ var baseFor = require_baseFor();
1610
+ var baseMergeDeep = require_baseMergeDeep();
1611
+ var isObject = require_isObject();
1612
+ var keysIn = require_keysIn();
1613
+ var safeGet = require_safeGet();
1614
+ function baseMerge(object, source, srcIndex, customizer, stack) {
1615
+ if (object === source) {
1616
+ return;
1617
+ }
1618
+ baseFor(source, function(srcValue, key) {
1619
+ stack || (stack = new Stack());
1620
+ if (isObject(srcValue)) {
1621
+ baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1622
+ } else {
1623
+ var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
1624
+ if (newValue === void 0) {
1625
+ newValue = srcValue;
1626
+ }
1627
+ assignMergeValue(object, key, newValue);
1628
+ }
1629
+ }, keysIn);
1630
+ }
1631
+ module.exports = baseMerge;
1632
+ }
1633
+ });
1634
+
1635
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_customDefaultsMerge.js
1636
+ var require_customDefaultsMerge = __commonJS({
1637
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_customDefaultsMerge.js"(exports, module) {
1638
+ "use strict";
1639
+ var baseMerge = require_baseMerge();
1640
+ var isObject = require_isObject();
1641
+ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
1642
+ if (isObject(objValue) && isObject(srcValue)) {
1643
+ stack.set(srcValue, objValue);
1644
+ baseMerge(objValue, srcValue, void 0, customDefaultsMerge, stack);
1645
+ stack["delete"](srcValue);
1646
+ }
1647
+ return objValue;
1648
+ }
1649
+ module.exports = customDefaultsMerge;
1650
+ }
1651
+ });
1652
+
1653
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIterateeCall.js
1654
+ var require_isIterateeCall = __commonJS({
1655
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIterateeCall.js"(exports, module) {
1656
+ "use strict";
1657
+ var eq = require_eq();
1658
+ var isArrayLike = require_isArrayLike();
1659
+ var isIndex = require_isIndex();
1660
+ var isObject = require_isObject();
1661
+ function isIterateeCall(value, index, object) {
1662
+ if (!isObject(object)) {
1663
+ return false;
1664
+ }
1665
+ var type = typeof index;
1666
+ if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
1667
+ return eq(object[index], value);
1668
+ }
1669
+ return false;
1670
+ }
1671
+ module.exports = isIterateeCall;
1672
+ }
1673
+ });
1674
+
1675
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createAssigner.js
1676
+ var require_createAssigner = __commonJS({
1677
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createAssigner.js"(exports, module) {
1678
+ "use strict";
1679
+ var baseRest = require_baseRest();
1680
+ var isIterateeCall = require_isIterateeCall();
1681
+ function createAssigner(assigner) {
1682
+ return baseRest(function(object, sources) {
1683
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
1684
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
1685
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
1686
+ customizer = length < 3 ? void 0 : customizer;
1687
+ length = 1;
1688
+ }
1689
+ object = Object(object);
1690
+ while (++index < length) {
1691
+ var source = sources[index];
1692
+ if (source) {
1693
+ assigner(object, source, index, customizer);
1694
+ }
1695
+ }
1696
+ return object;
1697
+ });
1698
+ }
1699
+ module.exports = createAssigner;
1700
+ }
1701
+ });
1702
+
1703
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/mergeWith.js
1704
+ var require_mergeWith = __commonJS({
1705
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/mergeWith.js"(exports, module) {
1706
+ "use strict";
1707
+ var baseMerge = require_baseMerge();
1708
+ var createAssigner = require_createAssigner();
1709
+ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
1710
+ baseMerge(object, source, srcIndex, customizer);
1711
+ });
1712
+ module.exports = mergeWith;
1713
+ }
1714
+ });
1715
+
1716
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaultsDeep.js
1717
+ var require_defaultsDeep = __commonJS({
1718
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaultsDeep.js"(exports, module) {
1719
+ "use strict";
1720
+ var apply = require_apply();
1721
+ var baseRest = require_baseRest();
1722
+ var customDefaultsMerge = require_customDefaultsMerge();
1723
+ var mergeWith = require_mergeWith();
1724
+ var defaultsDeep2 = baseRest(function(args) {
1725
+ args.push(void 0, customDefaultsMerge);
1726
+ return apply(mergeWith, void 0, args);
1727
+ });
1728
+ module.exports = defaultsDeep2;
1729
+ }
1730
+ });
1731
+
1732
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/merge.js
1733
+ var require_merge = __commonJS({
1734
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/merge.js"(exports, module) {
1735
+ "use strict";
1736
+ var baseMerge = require_baseMerge();
1737
+ var createAssigner = require_createAssigner();
1738
+ var merge3 = createAssigner(function(object, source, srcIndex) {
1739
+ baseMerge(object, source, srcIndex);
1740
+ });
1741
+ module.exports = merge3;
1742
+ }
1743
+ });
1744
+
1745
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js
1746
+ var require_isSymbol = __commonJS({
1747
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js"(exports, module) {
1748
+ "use strict";
1749
+ var baseGetTag = require_baseGetTag();
1750
+ var isObjectLike = require_isObjectLike();
1751
+ var symbolTag = "[object Symbol]";
1752
+ function isSymbol(value) {
1753
+ return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
1754
+ }
1755
+ module.exports = isSymbol;
1756
+ }
1757
+ });
1758
+
1759
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKey.js
1760
+ var require_isKey = __commonJS({
1761
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKey.js"(exports, module) {
1762
+ "use strict";
1763
+ var isArray = require_isArray();
1764
+ var isSymbol = require_isSymbol();
1765
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
1766
+ var reIsPlainProp = /^\w*$/;
1767
+ function isKey(value, object) {
1768
+ if (isArray(value)) {
1769
+ return false;
1770
+ }
1771
+ var type = typeof value;
1772
+ if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
1773
+ return true;
1774
+ }
1775
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
1776
+ }
1777
+ module.exports = isKey;
1778
+ }
1779
+ });
1780
+
1781
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js
1782
+ var require_memoize = __commonJS({
1783
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js"(exports, module) {
1784
+ "use strict";
1785
+ var MapCache = require_MapCache();
1786
+ var FUNC_ERROR_TEXT = "Expected a function";
1787
+ function memoize(func, resolver) {
1788
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") {
1789
+ throw new TypeError(FUNC_ERROR_TEXT);
1790
+ }
1791
+ var memoized = function() {
1792
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
1793
+ if (cache.has(key)) {
1794
+ return cache.get(key);
1795
+ }
1796
+ var result = func.apply(this, args);
1797
+ memoized.cache = cache.set(key, result) || cache;
1798
+ return result;
1799
+ };
1800
+ memoized.cache = new (memoize.Cache || MapCache)();
1801
+ return memoized;
1802
+ }
1803
+ memoize.Cache = MapCache;
1804
+ module.exports = memoize;
1805
+ }
1806
+ });
1807
+
1808
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_memoizeCapped.js
1809
+ var require_memoizeCapped = __commonJS({
1810
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_memoizeCapped.js"(exports, module) {
1811
+ "use strict";
1812
+ var memoize = require_memoize();
1813
+ var MAX_MEMOIZE_SIZE = 500;
1814
+ function memoizeCapped(func) {
1815
+ var result = memoize(func, function(key) {
1816
+ if (cache.size === MAX_MEMOIZE_SIZE) {
1817
+ cache.clear();
1818
+ }
1819
+ return key;
1820
+ });
1821
+ var cache = result.cache;
1822
+ return result;
1823
+ }
1824
+ module.exports = memoizeCapped;
1825
+ }
1826
+ });
1827
+
1828
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stringToPath.js
1829
+ var require_stringToPath = __commonJS({
1830
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stringToPath.js"(exports, module) {
1831
+ "use strict";
1832
+ var memoizeCapped = require_memoizeCapped();
1833
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1834
+ var reEscapeChar = /\\(\\)?/g;
1835
+ var stringToPath = memoizeCapped(function(string) {
1836
+ var result = [];
1837
+ if (string.charCodeAt(0) === 46) {
1838
+ result.push("");
1839
+ }
1840
+ string.replace(rePropName, function(match, number, quote, subString) {
1841
+ result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
1842
+ });
1843
+ return result;
1844
+ });
1845
+ module.exports = stringToPath;
1846
+ }
1847
+ });
1848
+
1849
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js
1850
+ var require_arrayMap = __commonJS({
1851
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js"(exports, module) {
1852
+ "use strict";
1853
+ function arrayMap(array, iteratee) {
1854
+ var index = -1, length = array == null ? 0 : array.length, result = Array(length);
1855
+ while (++index < length) {
1856
+ result[index] = iteratee(array[index], index, array);
1857
+ }
1858
+ return result;
1859
+ }
1860
+ module.exports = arrayMap;
1861
+ }
1862
+ });
1863
+
1864
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js
1865
+ var require_baseToString = __commonJS({
1866
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js"(exports, module) {
1867
+ "use strict";
1868
+ var Symbol2 = require_Symbol();
1869
+ var arrayMap = require_arrayMap();
1870
+ var isArray = require_isArray();
1871
+ var isSymbol = require_isSymbol();
1872
+ var INFINITY = 1 / 0;
1873
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
1874
+ var symbolToString = symbolProto ? symbolProto.toString : void 0;
1875
+ function baseToString(value) {
1876
+ if (typeof value == "string") {
1877
+ return value;
1878
+ }
1879
+ if (isArray(value)) {
1880
+ return arrayMap(value, baseToString) + "";
1881
+ }
1882
+ if (isSymbol(value)) {
1883
+ return symbolToString ? symbolToString.call(value) : "";
1884
+ }
1885
+ var result = value + "";
1886
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
1887
+ }
1888
+ module.exports = baseToString;
1889
+ }
1890
+ });
1891
+
1892
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js
1893
+ var require_toString = __commonJS({
1894
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js"(exports, module) {
1895
+ "use strict";
1896
+ var baseToString = require_baseToString();
1897
+ function toString(value) {
1898
+ return value == null ? "" : baseToString(value);
1899
+ }
1900
+ module.exports = toString;
1901
+ }
1902
+ });
1903
+
1904
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_castPath.js
1905
+ var require_castPath = __commonJS({
1906
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_castPath.js"(exports, module) {
1907
+ "use strict";
1908
+ var isArray = require_isArray();
1909
+ var isKey = require_isKey();
1910
+ var stringToPath = require_stringToPath();
1911
+ var toString = require_toString();
1912
+ function castPath(value, object) {
1913
+ if (isArray(value)) {
1914
+ return value;
1915
+ }
1916
+ return isKey(value, object) ? [value] : stringToPath(toString(value));
1917
+ }
1918
+ module.exports = castPath;
1919
+ }
1920
+ });
1921
+
1922
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toKey.js
1923
+ var require_toKey = __commonJS({
1924
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toKey.js"(exports, module) {
1925
+ "use strict";
1926
+ var isSymbol = require_isSymbol();
1927
+ var INFINITY = 1 / 0;
1928
+ function toKey(value) {
1929
+ if (typeof value == "string" || isSymbol(value)) {
1930
+ return value;
1931
+ }
1932
+ var result = value + "";
1933
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
1934
+ }
1935
+ module.exports = toKey;
1936
+ }
1937
+ });
1938
+
1939
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js
1940
+ var require_baseGet = __commonJS({
1941
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js"(exports, module) {
1942
+ "use strict";
1943
+ var castPath = require_castPath();
1944
+ var toKey = require_toKey();
1945
+ function baseGet(object, path) {
1946
+ path = castPath(path, object);
1947
+ var index = 0, length = path.length;
1948
+ while (object != null && index < length) {
1949
+ object = object[toKey(path[index++])];
1950
+ }
1951
+ return index && index == length ? object : void 0;
1952
+ }
1953
+ module.exports = baseGet;
1954
+ }
1955
+ });
1956
+
1957
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js
1958
+ var require_get = __commonJS({
1959
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js"(exports, module) {
1960
+ "use strict";
1961
+ var baseGet = require_baseGet();
1962
+ function get2(object, path, defaultValue) {
1963
+ var result = object == null ? void 0 : baseGet(object, path);
1964
+ return result === void 0 ? defaultValue : result;
1965
+ }
1966
+ module.exports = get2;
1967
+ }
1968
+ });
1969
+
1970
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/assignInWith.js
1971
+ var require_assignInWith = __commonJS({
1972
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/assignInWith.js"(exports, module) {
1973
+ "use strict";
1974
+ var copyObject = require_copyObject();
1975
+ var createAssigner = require_createAssigner();
1976
+ var keysIn = require_keysIn();
1977
+ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
1978
+ copyObject(source, keysIn(source), object, customizer);
1979
+ });
1980
+ module.exports = assignInWith;
1981
+ }
1982
+ });
1983
+
1984
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isError.js
1985
+ var require_isError = __commonJS({
1986
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isError.js"(exports, module) {
1987
+ "use strict";
1988
+ var baseGetTag = require_baseGetTag();
1989
+ var isObjectLike = require_isObjectLike();
1990
+ var isPlainObject2 = require_isPlainObject();
1991
+ var domExcTag = "[object DOMException]";
1992
+ var errorTag = "[object Error]";
1993
+ function isError(value) {
1994
+ if (!isObjectLike(value)) {
1995
+ return false;
1996
+ }
1997
+ var tag = baseGetTag(value);
1998
+ return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject2(value);
1999
+ }
2000
+ module.exports = isError;
2001
+ }
2002
+ });
2003
+
2004
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/attempt.js
2005
+ var require_attempt = __commonJS({
2006
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/attempt.js"(exports, module) {
2007
+ "use strict";
2008
+ var apply = require_apply();
2009
+ var baseRest = require_baseRest();
2010
+ var isError = require_isError();
2011
+ var attempt = baseRest(function(func, args) {
2012
+ try {
2013
+ return apply(func, void 0, args);
2014
+ } catch (e) {
2015
+ return isError(e) ? e : new Error(e);
2016
+ }
2017
+ });
2018
+ module.exports = attempt;
2019
+ }
2020
+ });
2021
+
2022
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseValues.js
2023
+ var require_baseValues = __commonJS({
2024
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseValues.js"(exports, module) {
2025
+ "use strict";
2026
+ var arrayMap = require_arrayMap();
2027
+ function baseValues(object, props) {
2028
+ return arrayMap(props, function(key) {
2029
+ return object[key];
2030
+ });
2031
+ }
2032
+ module.exports = baseValues;
2033
+ }
2034
+ });
2035
+
2036
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_customDefaultsAssignIn.js
2037
+ var require_customDefaultsAssignIn = __commonJS({
2038
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_customDefaultsAssignIn.js"(exports, module) {
2039
+ "use strict";
2040
+ var eq = require_eq();
2041
+ var objectProto = Object.prototype;
2042
+ var hasOwnProperty = objectProto.hasOwnProperty;
2043
+ function customDefaultsAssignIn(objValue, srcValue, key, object) {
2044
+ if (objValue === void 0 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
2045
+ return srcValue;
2046
+ }
2047
+ return objValue;
2048
+ }
2049
+ module.exports = customDefaultsAssignIn;
2050
+ }
2051
+ });
2052
+
2053
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_escapeStringChar.js
2054
+ var require_escapeStringChar = __commonJS({
2055
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_escapeStringChar.js"(exports, module) {
2056
+ "use strict";
2057
+ var stringEscapes = {
2058
+ "\\": "\\",
2059
+ "'": "'",
2060
+ "\n": "n",
2061
+ "\r": "r",
2062
+ "\u2028": "u2028",
2063
+ "\u2029": "u2029"
2064
+ };
2065
+ function escapeStringChar(chr) {
2066
+ return "\\" + stringEscapes[chr];
2067
+ }
2068
+ module.exports = escapeStringChar;
2069
+ }
2070
+ });
2071
+
2072
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeKeys.js
2073
+ var require_nativeKeys = __commonJS({
2074
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeKeys.js"(exports, module) {
2075
+ "use strict";
2076
+ var overArg = require_overArg();
2077
+ var nativeKeys = overArg(Object.keys, Object);
2078
+ module.exports = nativeKeys;
2079
+ }
2080
+ });
2081
+
2082
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseKeys.js
2083
+ var require_baseKeys = __commonJS({
2084
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseKeys.js"(exports, module) {
2085
+ "use strict";
2086
+ var isPrototype = require_isPrototype();
2087
+ var nativeKeys = require_nativeKeys();
2088
+ var objectProto = Object.prototype;
2089
+ var hasOwnProperty = objectProto.hasOwnProperty;
2090
+ function baseKeys(object) {
2091
+ if (!isPrototype(object)) {
2092
+ return nativeKeys(object);
2093
+ }
2094
+ var result = [];
2095
+ for (var key in Object(object)) {
2096
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
2097
+ result.push(key);
2098
+ }
2099
+ }
2100
+ return result;
2101
+ }
2102
+ module.exports = baseKeys;
2103
+ }
2104
+ });
2105
+
2106
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/keys.js
2107
+ var require_keys = __commonJS({
2108
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/keys.js"(exports, module) {
2109
+ "use strict";
2110
+ var arrayLikeKeys = require_arrayLikeKeys();
2111
+ var baseKeys = require_baseKeys();
2112
+ var isArrayLike = require_isArrayLike();
2113
+ function keys(object) {
2114
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
2115
+ }
2116
+ module.exports = keys;
2117
+ }
2118
+ });
2119
+
2120
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_reInterpolate.js
2121
+ var require_reInterpolate = __commonJS({
2122
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_reInterpolate.js"(exports, module) {
2123
+ "use strict";
2124
+ var reInterpolate = /<%=([\s\S]+?)%>/g;
2125
+ module.exports = reInterpolate;
2126
+ }
2127
+ });
2128
+
2129
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePropertyOf.js
2130
+ var require_basePropertyOf = __commonJS({
2131
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePropertyOf.js"(exports, module) {
2132
+ "use strict";
2133
+ function basePropertyOf(object) {
2134
+ return function(key) {
2135
+ return object == null ? void 0 : object[key];
2136
+ };
2137
+ }
2138
+ module.exports = basePropertyOf;
2139
+ }
2140
+ });
2141
+
2142
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_escapeHtmlChar.js
2143
+ var require_escapeHtmlChar = __commonJS({
2144
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_escapeHtmlChar.js"(exports, module) {
2145
+ "use strict";
2146
+ var basePropertyOf = require_basePropertyOf();
2147
+ var htmlEscapes = {
2148
+ "&": "&amp;",
2149
+ "<": "&lt;",
2150
+ ">": "&gt;",
2151
+ '"': "&quot;",
2152
+ "'": "&#39;"
2153
+ };
2154
+ var escapeHtmlChar = basePropertyOf(htmlEscapes);
2155
+ module.exports = escapeHtmlChar;
2156
+ }
2157
+ });
2158
+
2159
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/escape.js
2160
+ var require_escape = __commonJS({
2161
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/escape.js"(exports, module) {
2162
+ "use strict";
2163
+ var escapeHtmlChar = require_escapeHtmlChar();
2164
+ var toString = require_toString();
2165
+ var reUnescapedHtml = /[&<>"']/g;
2166
+ var reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
2167
+ function escape(string) {
2168
+ string = toString(string);
2169
+ return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
2170
+ }
2171
+ module.exports = escape;
2172
+ }
2173
+ });
2174
+
2175
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_reEscape.js
2176
+ var require_reEscape = __commonJS({
2177
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_reEscape.js"(exports, module) {
2178
+ "use strict";
2179
+ var reEscape = /<%-([\s\S]+?)%>/g;
2180
+ module.exports = reEscape;
2181
+ }
2182
+ });
2183
+
2184
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_reEvaluate.js
2185
+ var require_reEvaluate = __commonJS({
2186
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_reEvaluate.js"(exports, module) {
2187
+ "use strict";
2188
+ var reEvaluate = /<%([\s\S]+?)%>/g;
2189
+ module.exports = reEvaluate;
2190
+ }
2191
+ });
2192
+
2193
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/templateSettings.js
2194
+ var require_templateSettings = __commonJS({
2195
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/templateSettings.js"(exports, module) {
2196
+ "use strict";
2197
+ var escape = require_escape();
2198
+ var reEscape = require_reEscape();
2199
+ var reEvaluate = require_reEvaluate();
2200
+ var reInterpolate = require_reInterpolate();
2201
+ var templateSettings = {
2202
+ /**
2203
+ * Used to detect `data` property values to be HTML-escaped.
2204
+ *
2205
+ * @memberOf _.templateSettings
2206
+ * @type {RegExp}
2207
+ */
2208
+ "escape": reEscape,
2209
+ /**
2210
+ * Used to detect code to be evaluated.
2211
+ *
2212
+ * @memberOf _.templateSettings
2213
+ * @type {RegExp}
2214
+ */
2215
+ "evaluate": reEvaluate,
2216
+ /**
2217
+ * Used to detect `data` property values to inject.
2218
+ *
2219
+ * @memberOf _.templateSettings
2220
+ * @type {RegExp}
2221
+ */
2222
+ "interpolate": reInterpolate,
2223
+ /**
2224
+ * Used to reference the data object in the template text.
2225
+ *
2226
+ * @memberOf _.templateSettings
2227
+ * @type {string}
2228
+ */
2229
+ "variable": "",
2230
+ /**
2231
+ * Used to import variables into the compiled template.
2232
+ *
2233
+ * @memberOf _.templateSettings
2234
+ * @type {Object}
2235
+ */
2236
+ "imports": {
2237
+ /**
2238
+ * A reference to the `lodash` function.
2239
+ *
2240
+ * @memberOf _.templateSettings.imports
2241
+ * @type {Function}
2242
+ */
2243
+ "_": { "escape": escape }
2244
+ }
2245
+ };
2246
+ module.exports = templateSettings;
2247
+ }
2248
+ });
2249
+
2250
+ // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/template.js
2251
+ var require_template = __commonJS({
2252
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/template.js"(exports, module) {
2253
+ "use strict";
2254
+ var assignInWith = require_assignInWith();
2255
+ var attempt = require_attempt();
2256
+ var baseValues = require_baseValues();
2257
+ var customDefaultsAssignIn = require_customDefaultsAssignIn();
2258
+ var escapeStringChar = require_escapeStringChar();
2259
+ var isError = require_isError();
2260
+ var isIterateeCall = require_isIterateeCall();
2261
+ var keys = require_keys();
2262
+ var reInterpolate = require_reInterpolate();
2263
+ var templateSettings = require_templateSettings();
2264
+ var toString = require_toString();
2265
+ var INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
2266
+ var reEmptyStringLeading = /\b__p \+= '';/g;
2267
+ var reEmptyStringMiddle = /\b(__p \+=) '' \+/g;
2268
+ var reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
2269
+ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
2270
+ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
2271
+ var reNoMatch = /($^)/;
2272
+ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
2273
+ var objectProto = Object.prototype;
2274
+ var hasOwnProperty = objectProto.hasOwnProperty;
2275
+ function template(string, options, guard) {
2276
+ var settings = templateSettings.imports._.templateSettings || templateSettings;
2277
+ if (guard && isIterateeCall(string, options, guard)) {
2278
+ options = void 0;
2279
+ }
2280
+ string = toString(string);
2281
+ options = assignInWith({}, options, settings, customDefaultsAssignIn);
2282
+ var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
2283
+ var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
2284
+ var reDelimiters = RegExp(
2285
+ (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
2286
+ "g"
2287
+ );
2288
+ var sourceURL = hasOwnProperty.call(options, "sourceURL") ? "//# sourceURL=" + (options.sourceURL + "").replace(/\s/g, " ") + "\n" : "";
2289
+ string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
2290
+ interpolateValue || (interpolateValue = esTemplateValue);
2291
+ source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
2292
+ if (escapeValue) {
2293
+ isEscaping = true;
2294
+ source += "' +\n__e(" + escapeValue + ") +\n'";
2295
+ }
2296
+ if (evaluateValue) {
2297
+ isEvaluating = true;
2298
+ source += "';\n" + evaluateValue + ";\n__p += '";
2299
+ }
2300
+ if (interpolateValue) {
2301
+ source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
2302
+ }
2303
+ index = offset + match.length;
2304
+ return match;
2305
+ });
2306
+ source += "';\n";
2307
+ var variable = hasOwnProperty.call(options, "variable") && options.variable;
2308
+ if (!variable) {
2309
+ source = "with (obj) {\n" + source + "\n}\n";
2310
+ } else if (reForbiddenIdentifierChars.test(variable)) {
2311
+ throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
2312
+ }
2313
+ source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
2314
+ source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
2315
+ var result = attempt(function() {
2316
+ return Function(importsKeys, sourceURL + "return " + source).apply(void 0, importsValues);
2317
+ });
2318
+ result.source = source;
2319
+ if (isError(result)) {
2320
+ throw result;
2321
+ }
2322
+ return result;
2323
+ }
2324
+ module.exports = template;
2325
+ }
2326
+ });
2327
+
2328
+ // src/feConfig.ts
2329
+ var defaultFeConfig = {
2330
+ protectedBranches: ["master", "develop", "main"],
2331
+ cleanFiles: [
2332
+ "dist",
2333
+ "node_modules",
2334
+ "yarn.lock",
2335
+ "package-lock.json",
2336
+ ".eslintcache",
2337
+ "*.log"
2338
+ ],
2339
+ commitlint: {
2340
+ extends: ["@commitlint/config-conventional"]
2341
+ },
2342
+ release: {
2343
+ publishPath: "",
2344
+ autoMergeReleasePR: false,
2345
+ autoMergeType: "squash",
2346
+ branchName: "release-${pkgName}-${tagName}",
2347
+ PRTitle: "[${pkgName} Release] Branch:${branch}, Tag:${tagName}, Env:${env}",
2348
+ PRBody: "## Publish Details\n\n- \u{1F3F7}\uFE0F Version: ${tagName}\n- \u{1F332} Branch: ${branch}\n- \u{1F527} Environment: ${env}\n\n## Changelog\n\n${changelog}\n\n## Notes\n\n- [ ] Please check if the version number is correct\n- [ ] Please confirm all tests have passed\n- [ ] Please confirm the documentation has been updated\n\n> This PR is auto created by release process, please contact the frontend team if there are any questions.",
2349
+ label: {
2350
+ color: "1A7F37",
2351
+ description: "Release PR",
2352
+ name: "CI-Release"
2353
+ },
2354
+ packagesDirectories: [],
2355
+ changePackagesLabel: "changes:${name}"
2356
+ },
2357
+ envOrder: [".env.local", ".env.production", ".env"]
2358
+ };
2359
+
2360
+ // src/implement/ColorFormatter.ts
2361
+ import chalk from "chalk";
2362
+ var ColorFormatter = class {
2363
+ /**
2364
+ * Create a new color formatter with optional custom level colors
2365
+ *
2366
+ * @param levelColors - Custom color mapping for log levels
2367
+ * - Keys: Log level names (fatal, error, warn, info, debug, trace, log)
2368
+ * - Values: Chalk color functions or string color names
2369
+ * - Unknown levels fallback to white color
2370
+ * - Supports both function references and string values
2371
+ *
2372
+ * @example Default colors
2373
+ * ```typescript
2374
+ * const formatter = new ColorFormatter();
2375
+ * ```
2376
+ *
2377
+ * @example Custom colors
2378
+ * ```typescript
2379
+ * const formatter = new ColorFormatter({
2380
+ * error: chalk.red.underline,
2381
+ * warn: chalk.orange.bold,
2382
+ * info: chalk.blue.italic
2383
+ * });
2384
+ * ```
2385
+ */
2386
+ constructor(levelColors = {
2387
+ fatal: chalk.bgRed.white.bold,
2388
+ error: chalk.red.bold,
2389
+ warn: chalk.yellow.bold,
2390
+ info: chalk.blue,
2391
+ debug: chalk.green,
2392
+ trace: chalk.gray,
2393
+ log: chalk.white
2394
+ }) {
2395
+ this.levelColors = levelColors;
2396
+ }
2397
+ /**
2398
+ * Format log event by applying color to the level and preserving original arguments
2399
+ *
2400
+ * Processing steps:
2401
+ * 1. Extract level and arguments from the log event
2402
+ * 2. Look up the appropriate color function for the log level
2403
+ * 3. Apply color function to uppercase level text
2404
+ * 4. Return colored level followed by original arguments
2405
+ *
2406
+ * Color application:
2407
+ * - Uses chalk color functions for consistent cross-platform support
2408
+ * - Converts level to uppercase for better visibility
2409
+ * - Preserves all original log arguments unchanged
2410
+ * - Handles both function and string color values
2411
+ *
2412
+ * @param event - Log event containing level and arguments
2413
+ * @returns Array with colored level text followed by original arguments
2414
+ *
2415
+ * @example Error level formatting
2416
+ * ```typescript
2417
+ * const result = formatter.format({
2418
+ * level: 'error',
2419
+ * args: ['Connection failed', { retryCount: 3 }]
2420
+ * });
2421
+ * // Returns: [chalk.red.bold('ERROR'), 'Connection failed', { retryCount: 3 }]
2422
+ * ```
2423
+ *
2424
+ * @example Unknown level fallback
2425
+ * ```typescript
2426
+ * const result = formatter.format({
2427
+ * level: 'unknown',
2428
+ * args: ['Custom message']
2429
+ * });
2430
+ * // Returns: [chalk.white('UNKNOWN'), 'Custom message']
2431
+ * ```
2432
+ */
2433
+ format(event) {
2434
+ const { level, args } = event;
2435
+ const colorFunction = this.levelColors[level] || chalk.white;
2436
+ const coloredLevel = typeof colorFunction === "function" ? colorFunction(level.toUpperCase()) : level.toUpperCase();
2437
+ return [coloredLevel, ...args];
2438
+ }
2439
+ };
2440
+
2441
+ // src/implement/ConfigSearch.ts
2442
+ var import_defaultsDeep = __toESM(require_defaultsDeep(), 1);
2443
+ var import_isPlainObject = __toESM(require_isPlainObject(), 1);
2444
+ import { cosmiconfigSync } from "cosmiconfig";
2445
+ function getDefaultSearchPlaces(name) {
2446
+ const exts = ["json", "js", "ts", "cjs", "yaml", "yml"];
2447
+ return [
2448
+ "package.json",
2449
+ ...exts.map((ext) => `${name}.${ext}`),
2450
+ ...exts.map((ext) => `.${name}.${ext}`)
2451
+ ];
2452
+ }
2453
+ var ConfigSearch = class {
2454
+ /**
2455
+ * Base name for configuration files
2456
+ *
2457
+ * Used to generate default search patterns and as the cosmiconfig
2458
+ * module name for package.json configuration discovery.
2459
+ */
2460
+ name;
2461
+ /**
2462
+ * Search locations for configuration files
2463
+ *
2464
+ * Array of file patterns to search for, in priority order.
2465
+ * Can be either default patterns generated from name or
2466
+ * custom patterns provided in constructor options.
2467
+ */
2468
+ searchPlaces;
2469
+ /**
2470
+ * Default configuration object
2471
+ *
2472
+ * Provides fallback values that are merged with discovered
2473
+ * configuration using lodash defaultsDeep.
2474
+ */
2475
+ _config;
2476
+ /**
2477
+ * Custom file loaders for extended format support
2478
+ *
2479
+ * Extends cosmiconfig's built-in loaders with custom file
2480
+ * format support (e.g., TOML, INI, etc.).
2481
+ */
2482
+ loaders;
2483
+ /**
2484
+ * Cache for search results
2485
+ *
2486
+ * Stores the result of the last search operation to avoid
2487
+ * repeated file system access. Simple implementation that
2488
+ * caches the entire search result.
2489
+ */
2490
+ searchCache;
2491
+ /**
2492
+ * Creates a ConfigSearch instance with specified options
2493
+ *
2494
+ * Core concept:
2495
+ * Initializes a configuration search utility with the specified
2496
+ * options, setting up file discovery patterns and default values.
2497
+ *
2498
+ * Validation rules:
2499
+ * - Either name or searchPlaces must be provided
2500
+ * - Name is used to generate default search patterns if searchPlaces not provided
2501
+ * - Default configuration provides fallback values
2502
+ * - Custom loaders extend cosmiconfig's built-in support
2503
+ *
2504
+ * Initialization process:
2505
+ * 1. Validates that either name or searchPlaces is provided
2506
+ * 2. Sets up search patterns (custom or generated from name)
2507
+ * 3. Initializes default configuration object
2508
+ * 4. Stores custom loaders for extended format support
2509
+ *
2510
+ * @param options - Configuration search options
2511
+ * @throws {Error} When neither name nor searchPlaces is provided
2512
+ *
2513
+ * @example Using name (generates default search patterns)
2514
+ * ```typescript
2515
+ * const search = new ConfigSearch({
2516
+ * name: 'myapp',
2517
+ * defaultConfig: { debug: true }
2518
+ * });
2519
+ * ```
2520
+ *
2521
+ * @example Using custom search places
2522
+ * ```typescript
2523
+ * const search = new ConfigSearch({
2524
+ * searchPlaces: ['custom.config.js'],
2525
+ * defaultConfig: { port: 8080 }
2526
+ * });
2527
+ * ```
2528
+ *
2529
+ * @example With custom loaders
2530
+ * ```typescript
2531
+ * const search = new ConfigSearch({
2532
+ * name: 'myapp',
2533
+ * loaders: {
2534
+ * '.toml': (filepath) => parseTOML(readFileSync(filepath, 'utf8'))
2535
+ * }
2536
+ * });
2537
+ * ```
2538
+ */
2539
+ constructor(options) {
2540
+ const { name, searchPlaces, defaultConfig, loaders } = options;
2541
+ if (!name && !searchPlaces) {
2542
+ throw new Error("searchPlaces or name is required");
2543
+ }
2544
+ this.name = name;
2545
+ this.searchPlaces = searchPlaces || getDefaultSearchPlaces(name);
2546
+ this._config = defaultConfig || {};
2547
+ this.loaders = loaders;
2548
+ }
2549
+ /**
2550
+ * Gets the effective configuration with deep merging
2551
+ *
2552
+ * Core concept:
2553
+ * Retrieves the complete configuration by merging default values
2554
+ * with discovered configuration files, providing a unified
2555
+ * configuration object for the application.
2556
+ *
2557
+ * Merging strategy:
2558
+ * - Default configuration provides base values
2559
+ * - Discovered configuration overrides defaults
2560
+ * - Uses lodash defaultsDeep for nested object merging
2561
+ * - Returns a new object to prevent mutation
2562
+ * - Handles complex nested structures properly
2563
+ *
2564
+ * Merging behavior:
2565
+ * - Primitive values: Discovered values override defaults
2566
+ * - Objects: Deep merge, preserving both default and discovered properties
2567
+ * - Arrays: Discovered arrays replace default arrays (not merged)
2568
+ * - Undefined values: Default values are preserved
2569
+ * - Null values: Treated as explicit values (override defaults)
2570
+ *
2571
+ * Performance considerations:
2572
+ * - Uses cached search results when available
2573
+ * - Performs deep merge only when necessary
2574
+ * - Returns new object to prevent external mutation
2575
+ *
2576
+ * @returns Merged configuration object
2577
+ *
2578
+ * @example Basic merging
2579
+ * ```typescript
2580
+ * const configSearch = new ConfigSearch({
2581
+ * name: 'myapp',
2582
+ * defaultConfig: {
2583
+ * server: { port: 3000, host: 'localhost' },
2584
+ * debug: false
2585
+ * }
2586
+ * });
2587
+ *
2588
+ * // If myapp.config.js contains: { server: { port: 8080 }, log: true }
2589
+ * const config = configSearch.config;
2590
+ * // Result: { server: { port: 8080, host: 'localhost' }, debug: false, log: true }
2591
+ * ```
2592
+ *
2593
+ * @example Complex nested merging
2594
+ * ```typescript
2595
+ * const configSearch = new ConfigSearch({
2596
+ * name: 'myapp',
2597
+ * defaultConfig: {
2598
+ * database: {
2599
+ * host: 'localhost',
2600
+ * options: { timeout: 5000, retries: 3 }
2601
+ * }
2602
+ * }
2603
+ * });
2604
+ *
2605
+ * // If config file contains: { database: { port: 5432, options: { timeout: 10000 } } }
2606
+ * const config = configSearch.config;
2607
+ * // Result: {
2608
+ * // database: {
2609
+ * // host: 'localhost',
2610
+ * // port: 5432,
2611
+ * // options: { timeout: 10000, retries: 3 }
2612
+ * // }
2613
+ * // }
2614
+ * ```
2615
+ */
2616
+ get config() {
2617
+ return (0, import_defaultsDeep.default)({}, this.search(), this._config);
2618
+ }
2619
+ /**
2620
+ * Gets the configured search locations for debugging and verification
2621
+ *
2622
+ * Core concept:
2623
+ * Provides access to the search patterns used by this ConfigSearch
2624
+ * instance, useful for debugging configuration discovery issues
2625
+ * and understanding the search behavior.
2626
+ *
2627
+ * Use cases:
2628
+ * - Debug configuration discovery issues
2629
+ * - Verify search patterns are correct
2630
+ * - Document expected configuration file locations
2631
+ * - Understand search priority order
2632
+ * - Validate custom search place configurations
2633
+ *
2634
+ * Search pattern information:
2635
+ * - Returns the exact patterns used for file discovery
2636
+ * - Patterns are in priority order (first match wins)
2637
+ * - Includes both custom and generated patterns
2638
+ * - Useful for troubleshooting missing configuration files
2639
+ *
2640
+ * @returns Array of search locations in priority order
2641
+ *
2642
+ * @example Basic usage
2643
+ * ```typescript
2644
+ * const configSearch = new ConfigSearch({ name: 'myapp' });
2645
+ * const places = configSearch.getSearchPlaces();
2646
+ * console.log('Searching for config in:', places);
2647
+ * // ['package.json', 'myapp.json', 'myapp.js', 'myapp.ts', ...]
2648
+ * ```
2649
+ *
2650
+ * @example Debugging missing configuration
2651
+ * ```typescript
2652
+ * const configSearch = new ConfigSearch({
2653
+ * searchPlaces: ['custom.config.js', 'config/app.js']
2654
+ * });
2655
+ *
2656
+ * const places = configSearch.getSearchPlaces();
2657
+ * console.log('Expected config files:', places);
2658
+ * // ['custom.config.js', 'config/app.js']
2659
+ * ```
2660
+ */
2661
+ getSearchPlaces() {
2662
+ return this.searchPlaces;
2663
+ }
2664
+ /**
2665
+ * Loads configuration from a specific location with validation
2666
+ *
2667
+ * Core concept:
2668
+ * Performs targeted configuration loading from specific files or
2669
+ * directories, with comprehensive validation and error handling.
2670
+ *
2671
+ * Loading process:
2672
+ * 1. Creates cosmiconfig instance with configured options
2673
+ * 2. Loads from specific file or searches in directory
2674
+ * 3. Validates configuration is a plain object
2675
+ * 4. Returns empty object for invalid configurations
2676
+ * 5. Handles various error conditions gracefully
2677
+ *
2678
+ * File loading behavior:
2679
+ * - Specific file: Loads configuration from the exact file path
2680
+ * - Directory search: Searches for configuration files in the directory
2681
+ * - Skip loading: Returns empty object when file is false
2682
+ * - Validation: Ensures configuration is a valid plain object
2683
+ *
2684
+ * Error handling:
2685
+ * - Throws error for invalid configuration files (string configs)
2686
+ * - Returns empty object for missing or invalid configurations
2687
+ * - Logs warnings for non-object configurations
2688
+ * - Handles file system errors gracefully
2689
+ * - Validates configuration structure and format
2690
+ *
2691
+ * Validation rules:
2692
+ * - Configuration must be a plain object (not string, array, etc.)
2693
+ * - File must exist and be readable
2694
+ * - File must contain valid configuration data
2695
+ * - Custom loaders must return valid objects
2696
+ *
2697
+ * @param options - Search options for configuration loading
2698
+ * @returns Configuration object from specified location
2699
+ * @throws {Error} When configuration file contains invalid data
2700
+ *
2701
+ * @example Load from specific file
2702
+ * ```typescript
2703
+ * const configSearch = new ConfigSearch({ name: 'myapp' });
2704
+ * const config = configSearch.get({ file: 'custom.config.js' });
2705
+ * ```
2706
+ *
2707
+ * @example Search in current directory
2708
+ * ```typescript
2709
+ * const configSearch = new ConfigSearch({ name: 'myapp' });
2710
+ * const config = configSearch.get({ dir: process.cwd() });
2711
+ * ```
2712
+ *
2713
+ * @example Skip file loading
2714
+ * ```typescript
2715
+ * const configSearch = new ConfigSearch({ name: 'myapp' });
2716
+ * const config = configSearch.get({ file: false }); // Returns {}
2717
+ * ```
2718
+ *
2719
+ * @example Search in specific directory
2720
+ * ```typescript
2721
+ * const configSearch = new ConfigSearch({ name: 'myapp' });
2722
+ * const config = configSearch.get({ dir: '/path/to/project' });
2723
+ * ```
2724
+ */
2725
+ get(options = {}) {
2726
+ const { file, dir = process.cwd() } = options;
2727
+ const localConfig = {};
2728
+ if (file === false) return localConfig;
2729
+ const explorer = cosmiconfigSync(this.name, {
2730
+ searchPlaces: this.searchPlaces,
2731
+ loaders: this.loaders
2732
+ });
2733
+ const result = file ? explorer.load(file) : explorer.search(dir);
2734
+ if (result && typeof result.config === "string") {
2735
+ throw new Error(`Invalid configuration file at ${result.filepath}`);
2736
+ }
2737
+ return result && (0, import_isPlainObject.default)(result.config) ? result.config : localConfig;
2738
+ }
2739
+ /**
2740
+ * Searches for configuration with caching for performance optimization
2741
+ *
2742
+ * Core concept:
2743
+ * Performs configuration file discovery with intelligent caching
2744
+ * to optimize performance for repeated configuration access.
2745
+ *
2746
+ * Caching strategy:
2747
+ * - Caches search results to avoid repeated file system operations
2748
+ * - Cache is invalidated on each search call (simple implementation)
2749
+ * - Improves performance for repeated configuration access
2750
+ * - Reduces file system I/O in build tools and CLI applications
2751
+ *
2752
+ * Performance benefits:
2753
+ * - Reduces file system I/O operations
2754
+ * - Avoids repeated cosmiconfig initialization
2755
+ * - Particularly beneficial in build tools and CLI applications
2756
+ * - Minimizes configuration loading overhead
2757
+ * - Improves application startup time
2758
+ *
2759
+ * Cache behavior:
2760
+ * - First call: Performs full file system search
2761
+ * - Subsequent calls: Returns cached result
2762
+ * - Cache is shared across all method calls
2763
+ * - Simple cache invalidation strategy
2764
+ *
2765
+ * Search process:
2766
+ * 1. Check if cached result exists
2767
+ * 2. If cached, return cached result
2768
+ * 3. If not cached, perform file system search
2769
+ * 4. Cache the search result
2770
+ * 5. Return the discovered configuration
2771
+ *
2772
+ * @returns Cached configuration object from search
2773
+ *
2774
+ * @example Basic usage
2775
+ * ```typescript
2776
+ * const configSearch = new ConfigSearch({ name: 'myapp' });
2777
+ *
2778
+ * // First call performs file system search
2779
+ * const config1 = configSearch.search();
2780
+ *
2781
+ * // Subsequent calls use cached result
2782
+ * const config2 = configSearch.search(); // No file system access
2783
+ *
2784
+ * // Both return the same configuration object
2785
+ * console.log(config1 === config2); // true
2786
+ * ```
2787
+ *
2788
+ * @example Performance optimization
2789
+ * ```typescript
2790
+ * const configSearch = new ConfigSearch({ name: 'myapp' });
2791
+ *
2792
+ * // In a build tool or CLI application
2793
+ * for (let i = 0; i < 100; i++) {
2794
+ * const config = configSearch.search(); // Only first call hits file system
2795
+ * // Use configuration...
2796
+ * }
2797
+ * ```
2798
+ */
2799
+ search() {
2800
+ if (this.searchCache) {
2801
+ return this.searchCache;
2802
+ }
2803
+ return this.searchCache = this.get({});
2804
+ }
2805
+ };
2806
+
2807
+ // src/implement/ScriptContext.ts
2808
+ var import_merge = __toESM(require_merge(), 1);
2809
+ var import_get = __toESM(require_get(), 1);
2810
+ import { Env } from "@qlover/env-loader";
2811
+
2812
+ // ../logger/dist/index.js
2813
+ var LogEvent = class {
2814
+ constructor(level, args, loggerName, context) {
2815
+ this.level = level;
2816
+ this.args = args;
2817
+ this.loggerName = loggerName;
2818
+ this.context = context;
2819
+ this.timestamp = Date.now();
2820
+ }
2821
+ timestamp;
2822
+ };
2823
+ var LogContext = class {
2824
+ constructor(value) {
2825
+ this.value = value;
2826
+ }
2827
+ };
2828
+ var defaultLevels = {
2829
+ fatal: 0,
2830
+ error: 10,
2831
+ warn: 20,
2832
+ info: 30,
2833
+ debug: 40,
2834
+ trace: 50,
2835
+ log: 60
2836
+ };
2837
+ var Logger = class {
2838
+ /**
2839
+ * Creates a new Logger instance
2840
+ *
2841
+ * @param options - Configuration options for the logger
2842
+ *
2843
+ * @note If no name is provided, a timestamp-based name will be generated
2844
+ * @note If no levels are provided, defaultLevels will be used
2845
+ * @note If no handlers are provided, an empty array will be used (silent logging)
2846
+ */
2847
+ constructor(options = {}) {
2848
+ this.options = options;
2849
+ options.name = options.name || Date.now().toString();
2850
+ options.levels = options.levels || defaultLevels;
2851
+ options.handlers = Array.isArray(options.handlers) ? options.handlers : options.handlers ? [options.handlers] : [];
2852
+ }
2853
+ /**
2854
+ * Adds a new log handler to the logger
2855
+ *
2856
+ * Handlers are responsible for actually outputting log messages (to console, files, etc.)
2857
+ * Multiple handlers can be registered to send logs to different destinations simultaneously.
2858
+ *
2859
+ * @override Implementation of LoggerInterface
2860
+ * @param appender - Handler instance to add
2861
+ *
2862
+ * @example
2863
+ * logger.addAppender(new ConsoleHandler());
2864
+ * logger.addAppender(new FileAppender('./logs/errors.log', { level: 'error' }));
2865
+ *
2866
+ * @note Handlers are processed in the order they are added
2867
+ * @important This method is named 'addAppender' for legacy/compatibility reasons,
2868
+ * but it works with any object implementing HandlerInterface
2869
+ */
2870
+ addAppender(appender) {
2871
+ this.options.handlers.push(appender);
2872
+ }
2873
+ /**
2874
+ * Creates a new LogContext instance
2875
+ *
2876
+ * @override
2877
+ * @since 0.1.0
2878
+ * @param value - Optional value to be stored in the context
2879
+ * @returns A new LogContext instance with the provided value
2880
+ */
2881
+ context(value) {
2882
+ return new LogContext(value);
2883
+ }
2884
+ /**
2885
+ * Internal method to process and distribute log events
2886
+ *
2887
+ * This method:
2888
+ * 1. Checks if logging is silenced
2889
+ * 2. Extracts context from arguments if present
2890
+ * 3. Applies level filtering based on configured threshold
2891
+ * 4. Creates a LogEvent and distributes it to all handlers
2892
+ *
2893
+ * @protected
2894
+ * @param level - Log level name (e.g., "info", "error")
2895
+ * @param args - Log message arguments (message content and optional context)
2896
+ *
2897
+ * @example context
2898
+ * ```ts
2899
+ * logger.info('message with context', logger.context({ user: 'testUser', requestId: '123' }));
2900
+ * logger.info('message with context', logger.context([1,2,3]));
2901
+ * logger.info('message with context', logger.context(1));
2902
+ * logger.info('message with context', logger.context('1'));
2903
+ * logger.info('message with context', logger.context(true));
2904
+ * logger.info('message with context', logger.context());
2905
+ * ```
2906
+ *
2907
+ * **But context only support last argument and must be a non-null object**
2908
+ *
2909
+ * @note Context object must be the last argument and must be a non-null object
2910
+ * @note Context can override the log level via a 'level' property
2911
+ * @important This method is not meant to be called directly - use the specific level methods instead
2912
+ */
2913
+ print(level, args) {
2914
+ const { levels, level: indexLevel, silent, handlers } = this.options;
2915
+ if (silent) {
2916
+ return;
2917
+ }
2918
+ let ctx = args.slice(-1)[0];
2919
+ const hasCtx = args.length > 1 && ctx instanceof LogContext;
2920
+ ctx = hasCtx ? ctx : void 0;
2921
+ args = hasCtx ? args.slice(0, -1) : args;
2922
+ level = ctx?.value?.level ?? level;
2923
+ if (indexLevel && levels) {
2924
+ const target = levels[indexLevel];
2925
+ const current = levels[level];
2926
+ if (target != null && current != null && current > target) {
2927
+ return;
2928
+ }
2929
+ }
2930
+ const logEvent = new LogEvent(level, args, this.options.name, ctx);
2931
+ for (const handler of handlers) {
2932
+ handler.append(logEvent);
2933
+ }
2934
+ }
2935
+ /**
2936
+ * Logs a message with "info" level
2937
+ * Alias for info() method
2938
+ *
2939
+ * General purpose logging method, categorized as "info" level
2940
+ *
2941
+ * @param args - Message content followed by optional context object
2942
+ *
2943
+ * @example
2944
+ * // Simple usage
2945
+ * logger.log('User logged in');
2946
+ *
2947
+ * @example
2948
+ * // With context object
2949
+ * logger.log('User logged in', { userId: 123, timestamp: Date.now() });
2950
+ *
2951
+ * @note This method uses 'info' level internally, but appears as 'log' in default levels
2952
+ */
2953
+ log(...args) {
2954
+ this.print("info", args);
2955
+ }
2956
+ /**
2957
+ * Logs a critical error message with "fatal" level
2958
+ *
2959
+ * Use for severe errors that lead to application termination or require immediate attention
2960
+ * This is the highest severity level and will always be logged unless silent mode is enabled
2961
+ *
2962
+ * @param args - Message content followed by optional context object
2963
+ *
2964
+ * @example
2965
+ * logger.fatal('Database connection failed, application cannot continue');
2966
+ *
2967
+ * @example
2968
+ * try {
2969
+ * // Critical operation
2970
+ * } catch (error) {
2971
+ * logger.fatal('Critical system failure', { error, stack: error.stack });
2972
+ * process.exit(1);
2973
+ * }
2974
+ *
2975
+ * @important Fatal logs typically indicate that the application cannot continue to function
2976
+ */
2977
+ fatal(...args) {
2978
+ this.print("fatal", args);
2979
+ }
2980
+ /**
2981
+ * Logs an error message with "error" level
2982
+ *
2983
+ * Use for runtime errors, exceptions, and error conditions that don't necessarily
2984
+ * cause application termination but indicate a failure
2985
+ *
2986
+ * @param args - Message content followed by optional context object
2987
+ *
2988
+ * @example
2989
+ * // Simple error logging
2990
+ * logger.error('Failed to process payment');
2991
+ *
2992
+ * @example
2993
+ * // Error with exception details
2994
+ * try {
2995
+ * // Some operation
2996
+ * } catch (err) {
2997
+ * logger.error('Operation failed', {
2998
+ * error: err.message,
2999
+ * stack: err.stack,
3000
+ * code: err.code
3001
+ * });
3002
+ * }
3003
+ *
3004
+ * @note Error logs should provide enough context to diagnose the problem
3005
+ */
3006
+ error(...args) {
3007
+ this.print("error", args);
3008
+ }
3009
+ /**
3010
+ * Logs a warning message with "warn" level
3011
+ *
3012
+ * Use for potentially problematic situations, deprecated features usage,
3013
+ * or unexpected conditions that don't cause failures but might lead to issues
3014
+ *
3015
+ * @param args - Message content followed by optional context object
3016
+ *
3017
+ * @example
3018
+ * // Simple warning
3019
+ * logger.warn('Deprecated API being used');
3020
+ *
3021
+ * @example
3022
+ * // Warning with context
3023
+ * logger.warn('High memory usage detected', {
3024
+ * memoryUsage: process.memoryUsage().heapUsed,
3025
+ * threshold: maxMemoryThreshold
3026
+ * });
3027
+ *
3028
+ * @note Warnings shouldn't be ignored in production systems as they often indicate future problems
3029
+ */
3030
+ warn(...args) {
3031
+ this.print("warn", args);
3032
+ }
3033
+ /**
3034
+ * Logs an informational message with "info" level
3035
+ *
3036
+ * Use for general application state, notable events in application flow,
3037
+ * startup messages, configuration details, or business process completions
3038
+ *
3039
+ * @param args - Message content followed by optional context object
3040
+ *
3041
+ * @example
3042
+ * // Simple info message
3043
+ * logger.info('Server started on port 3000');
3044
+ *
3045
+ * @example
3046
+ * // Info with context
3047
+ * logger.info('User registration complete', {
3048
+ * userId: user.id,
3049
+ * email: user.email,
3050
+ * registrationTime: new Date().toISOString()
3051
+ * });
3052
+ *
3053
+ * @note Info level is typically the default level in production environments
3054
+ */
3055
+ info(...args) {
3056
+ this.print("info", args);
3057
+ }
3058
+ /**
3059
+ * Logs a debug message with "debug" level
3060
+ *
3061
+ * Use for detailed information useful during development and troubleshooting
3062
+ * Such as variable values, function calls, or internal application state
3063
+ *
3064
+ * @param args - Message content followed by optional context object
3065
+ *
3066
+ * @example
3067
+ * // Simple debug message
3068
+ * logger.debug('Processing request payload');
3069
+ *
3070
+ * @example
3071
+ * // Debug with detailed context
3072
+ * logger.debug('API request received', {
3073
+ * method: req.method,
3074
+ * path: req.path,
3075
+ * params: req.params,
3076
+ * query: req.query,
3077
+ * headers: req.headers,
3078
+ * body: req.body
3079
+ * });
3080
+ *
3081
+ * @note Debug logs are typically disabled in production environments
3082
+ * @important Debug logs can contain sensitive information, use caution in production
3083
+ */
3084
+ debug(...args) {
3085
+ this.print("debug", args);
3086
+ }
3087
+ /**
3088
+ * Logs a trace message with "trace" level
3089
+ *
3090
+ * Use for the most detailed diagnostic information
3091
+ * Such as function entry/exit points, variable transformations, or method call tracing
3092
+ *
3093
+ * @param args - Message content followed by optional context object
3094
+ *
3095
+ * @example
3096
+ * // Function entry tracing
3097
+ * logger.trace('Entering validateUser function', { username });
3098
+ *
3099
+ * @example
3100
+ * // Detailed algorithmic tracing
3101
+ * logger.trace('Processing array element', {
3102
+ * index: i,
3103
+ * value: array[i],
3104
+ * transformedValue: processedValue,
3105
+ * processingTime: endTime - startTime
3106
+ * });
3107
+ *
3108
+ * @note Trace is the most verbose level and should only be enabled temporarily for debugging
3109
+ * @important Trace logs can significantly impact performance and generate large volumes of data
3110
+ */
3111
+ trace(...args) {
3112
+ this.print("trace", args);
3113
+ }
3114
+ };
3115
+ var ConsoleHandler = class {
3116
+ constructor(formatter = null) {
3117
+ this.formatter = formatter;
3118
+ }
3119
+ /**
3120
+ * Set formatter
3121
+ *
3122
+ * @override
3123
+ * @param formatter
3124
+ */
3125
+ setFormatter(formatter) {
3126
+ this.formatter = formatter;
3127
+ }
3128
+ /**
3129
+ * Append log event
3130
+ *
3131
+ * @override
3132
+ * @param event
3133
+ */
3134
+ append(event) {
3135
+ const { level, args } = event;
3136
+ const formattedArgs = this.formatter ? this.formatter.format(event) : args;
3137
+ (console[level] || console.log)(...Array.isArray(formattedArgs) ? formattedArgs : [formattedArgs]);
3138
+ }
3139
+ };
3140
+ var defaultLocaleOptions = {
3141
+ hour: "2-digit",
3142
+ minute: "2-digit",
3143
+ second: "2-digit",
3144
+ hour12: false,
3145
+ timeZone: "UTC"
3146
+ };
3147
+ var TimestampFormatter = class {
3148
+ constructor(options = {}) {
3149
+ this.options = options;
3150
+ }
3151
+ replacePrefix(template, vars) {
3152
+ return template.replace(/\{([^{}]+)\}/g, (match, p1) => vars[p1] || match);
3153
+ }
3154
+ format({ timestamp, level, args, context, loggerName }) {
3155
+ const {
3156
+ locale = "zh-CN",
3157
+ localeOptions,
3158
+ prefixTemplate = "[{formattedTimestamp} {level}]"
3159
+ } = this.options;
3160
+ const formatType = context?.formatType ?? "datetime";
3161
+ const dateFormatMethod = formatType === "date" ? "toLocaleDateString" : formatType === "time" ? "toLocaleTimeString" : "toLocaleString";
3162
+ const formattedTimestamp = new Date(timestamp)[dateFormatMethod](locale, {
3163
+ ...defaultLocaleOptions,
3164
+ ...localeOptions
3165
+ });
3166
+ return [
3167
+ this.replacePrefix(prefixTemplate, {
3168
+ ...context,
3169
+ timestamp: timestamp.toString(),
3170
+ level,
3171
+ loggerName,
3172
+ formattedTimestamp,
3173
+ locale
3174
+ }),
3175
+ ...args
3176
+ ];
3177
+ }
3178
+ };
3179
+
3180
+ // src/implement/Shell.ts
3181
+ var import_template = __toESM(require_template(), 1);
3182
+ var Shell = class _Shell {
3183
+ /**
3184
+ * Creates a new Shell instance with the specified configuration
3185
+ *
3186
+ * Core concept:
3187
+ * Initializes a Shell instance with logging, execution, and
3188
+ * caching capabilities based on the provided configuration.
3189
+ *
3190
+ * Initialization process:
3191
+ * 1. Validates and stores configuration parameters
3192
+ * 2. Initializes command cache for performance optimization
3193
+ * 3. Sets up logging integration for command tracking
3194
+ * 4. Prepares template formatting capabilities
3195
+ *
3196
+ * Configuration validation:
3197
+ * - Logger is required for command logging and error reporting
3198
+ * - Execution function is optional but required for actual command execution
3199
+ * - Cache is initialized as an empty Map for command result storage
3200
+ * - All ShellExecOptions are inherited and validated
3201
+ *
3202
+ * Cache initialization:
3203
+ * - Uses Map for efficient key-value storage
3204
+ * - Stores Promise<string> for command results
3205
+ * - Supports concurrent command execution
3206
+ * - Provides automatic memory management
3207
+ *
3208
+ * @param config - Shell configuration with logger and execution options
3209
+ * @param cache - Optional command cache map for result storage
3210
+ *
3211
+ * @example Basic initialization
3212
+ * ```typescript
3213
+ * const shell = new Shell({
3214
+ * logger: myLogger,
3215
+ * dryRun: false,
3216
+ * isCache: true
3217
+ * });
3218
+ * ```
3219
+ *
3220
+ * @example With custom cache
3221
+ * ```typescript
3222
+ * const customCache = new Map<string, Promise<string>>();
3223
+ * const shell = new Shell({ logger: myLogger }, customCache);
3224
+ * ```
3225
+ */
3226
+ constructor(config, cache = /* @__PURE__ */ new Map()) {
3227
+ this.config = config;
3228
+ this.cache = cache;
3229
+ }
3230
+ /**
3231
+ * Gets the logger instance for command logging and error reporting
3232
+ *
3233
+ * Core concept:
3234
+ * Provides access to the configured logger instance for
3235
+ * command execution tracking and error reporting.
3236
+ *
3237
+ * Logger usage:
3238
+ * - Command execution logging (debug level)
3239
+ * - Template formatting error reporting
3240
+ * - Command execution error logging
3241
+ * - Debug information for troubleshooting
3242
+ *
3243
+ * @returns Logger instance for command logging and error reporting
3244
+ *
3245
+ * @example Basic usage
3246
+ * ```typescript
3247
+ * const logger = shell.logger;
3248
+ * logger.info('Shell instance created');
3249
+ * ```
3250
+ */
3251
+ get logger() {
3252
+ return this.config.logger;
3253
+ }
3254
+ /**
3255
+ * Formats a template string with context using lodash template
3256
+ *
3257
+ * Core concept:
3258
+ * Provides static template formatting functionality using
3259
+ * lodash template for string interpolation with context data.
3260
+ *
3261
+ * Template features:
3262
+ * - Uses lodash template for powerful string interpolation
3263
+ * - Supports complex template expressions and logic
3264
+ * - Handles undefined and null context values gracefully
3265
+ * - Returns formatted string with context values substituted
3266
+ *
3267
+ * Template syntax:
3268
+ * - `<%= variable %>` for escaped output
3269
+ * - `<%- variable %>` for unescaped output
3270
+ * - `<% code %>` for JavaScript code execution
3271
+ * - Supports nested object access and function calls
3272
+ *
3273
+ * Context handling:
3274
+ * - Accepts any object with string/number/boolean values
3275
+ * - Handles undefined and null values safely
3276
+ * - Supports nested object property access
3277
+ * - Provides fallback for missing context values
3278
+ *
3279
+ * @param template - Template string with interpolation placeholders
3280
+ * @param context - Context object for template variable substitution
3281
+ * @returns Formatted string with context values substituted
3282
+ *
3283
+ * @example Basic template formatting
3284
+ * ```typescript
3285
+ * const result = Shell.format('Hello <%= name %>!', { name: 'World' });
3286
+ * // Returns: 'Hello World!'
3287
+ * ```
3288
+ *
3289
+ * @example Complex template with nested objects
3290
+ * ```typescript
3291
+ * const result = Shell.format(
3292
+ * 'git clone <%= repo.url %> <%= repo.branch %>',
3293
+ * { repo: { url: 'https://github.com/user/repo.git', branch: 'main' } }
3294
+ * );
3295
+ * // Returns: 'git clone https://github.com/user/repo.git main'
3296
+ * ```
3297
+ *
3298
+ * @example Template with conditional logic
3299
+ * ```typescript
3300
+ * const result = Shell.format(
3301
+ * 'npm install<% if (dev) { %> --save-dev<% } %>',
3302
+ * { dev: true }
3303
+ * );
3304
+ * // Returns: 'npm install --save-dev'
3305
+ * ```
3306
+ */
3307
+ static format(template = "", context = {}) {
3308
+ return (0, import_template.default)(template)(context);
3309
+ }
3310
+ /**
3311
+ * Formats a template string with context and comprehensive error handling
3312
+ *
3313
+ * Core concept:
3314
+ * Provides instance-based template formatting with detailed
3315
+ * error logging and exception handling for debugging and
3316
+ * troubleshooting template issues.
3317
+ *
3318
+ * Error handling:
3319
+ * - Catches template compilation errors
3320
+ * - Logs detailed error information including template and context
3321
+ * - Provides stack trace information for debugging
3322
+ * - Re-throws errors for proper error propagation
3323
+ *
3324
+ * Logging features:
3325
+ * - Logs template content for debugging
3326
+ * - Logs context object for variable inspection
3327
+ * - Logs error details and stack traces
3328
+ * - Uses error level for template failures
3329
+ *
3330
+ * Debugging support:
3331
+ * - Provides template content in error messages
3332
+ * - Includes context object for variable inspection
3333
+ * - Logs complete error information for troubleshooting
3334
+ * - Maintains error stack traces for debugging
3335
+ *
3336
+ * @param template - Template string with interpolation placeholders
3337
+ * @param context - Context object for template variable substitution
3338
+ * @returns Formatted string with context values substituted
3339
+ * @throws Error if template formatting fails with detailed logging
3340
+ *
3341
+ * @example Basic formatting
3342
+ * ```typescript
3343
+ * const result = shell.format('Hello <%= name %>!', { name: 'World' });
3344
+ * // Returns: 'Hello World!'
3345
+ * ```
3346
+ *
3347
+ * @example Error handling
3348
+ * ```typescript
3349
+ * try {
3350
+ * const result = shell.format('Hello <%= name %>!', {});
3351
+ * } catch (error) {
3352
+ * // Error is logged with template and context information
3353
+ * console.error('Template formatting failed:', error.message);
3354
+ * }
3355
+ * ```
3356
+ */
3357
+ format(template = "", context = {}) {
3358
+ try {
3359
+ return _Shell.format(template, context);
3360
+ } catch (error) {
3361
+ this.logger.error(
3362
+ `Unable to render template with context:
3363
+ ${template}
3364
+ ${JSON.stringify(context)}`
3365
+ );
3366
+ this.logger.error(error);
3367
+ throw error;
3368
+ }
3369
+ }
3370
+ /**
3371
+ * Executes a command with template formatting and execution options
3372
+ *
3373
+ * Core concept:
3374
+ * Provides the main command execution interface with template
3375
+ * formatting support, allowing dynamic command generation
3376
+ * based on context variables.
3377
+ *
3378
+ * Execution process:
3379
+ * 1. Extracts context from options for template formatting
3380
+ * 2. Formats command string with context if command is a string
3381
+ * 3. Passes formatted command to execution engine
3382
+ * 4. Handles both string and array command formats
3383
+ * 5. Applies execution options for customization
3384
+ *
3385
+ * Template formatting:
3386
+ * - Only applies to string commands (not arrays)
3387
+ * - Uses context object for variable substitution
3388
+ * - Handles template formatting errors gracefully
3389
+ * - Supports complex template expressions
3390
+ *
3391
+ * Command handling:
3392
+ * - String commands: Formatted with context before execution
3393
+ * - Array commands: Passed directly to execution engine
3394
+ * - Mixed formats: Handled appropriately based on type
3395
+ * - Options: Applied consistently across all command types
3396
+ *
3397
+ * @param command - Command string (with template) or array of command parts
3398
+ * @param options - Execution options including context for template formatting
3399
+ * @returns Promise resolving to command output
3400
+ *
3401
+ * @example String command with template
3402
+ * ```typescript
3403
+ * const output = await shell.exec('git clone <%= repo %>', {
3404
+ * context: { repo: 'https://github.com/user/repo.git' }
3405
+ * });
3406
+ * ```
3407
+ *
3408
+ * @example Array command
3409
+ * ```typescript
3410
+ * const output = await shell.exec(['git', 'clone', 'https://github.com/user/repo.git']);
3411
+ * ```
3412
+ *
3413
+ * @example With execution options
3414
+ * ```typescript
3415
+ * const output = await shell.exec('npm install', {
3416
+ * cwd: '/path/to/project',
3417
+ * silent: true,
3418
+ * dryRun: false
3419
+ * });
3420
+ * ```
3421
+ */
3422
+ exec(command, options = {}) {
3423
+ const { context, ...execOptions } = options;
3424
+ return typeof command === "string" ? this.execFormattedCommand(
3425
+ this.format(command, context || {}),
3426
+ execOptions
3427
+ ) : this.execFormattedCommand(command, execOptions);
3428
+ }
3429
+ /**
3430
+ * Executes a command silently (deprecated)
3431
+ *
3432
+ * Core concept:
3433
+ * Legacy method for silent command execution, now deprecated
3434
+ * in favor of the more flexible `exec` method with silent option.
3435
+ *
3436
+ * Deprecation notice:
3437
+ * - This method is deprecated and will be removed in future versions
3438
+ * - Use `exec` method with `silent: true` option instead
3439
+ * - Provides backward compatibility for existing code
3440
+ * - Maintains same functionality through `exec` method
3441
+ *
3442
+ * Silent execution:
3443
+ * - Suppresses command logging output
3444
+ * - Maintains error logging for debugging
3445
+ * - Useful for quiet command execution
3446
+ * - Reduces log noise in automated scripts
3447
+ *
3448
+ * @param command - Command string or array
3449
+ * @param options - Execution options (silent mode is automatically enabled)
3450
+ * @returns Promise resolving to command output
3451
+ * @deprecated Use `exec` method with `silent: true` option instead
3452
+ *
3453
+ * @example Deprecated usage
3454
+ * ```typescript
3455
+ * const output = await shell.run('npm install');
3456
+ * ```
3457
+ *
3458
+ * @example Recommended replacement
3459
+ * ```typescript
3460
+ * const output = await shell.exec('npm install', { silent: true });
3461
+ * ```
3462
+ */
3463
+ run(command, options = {}) {
3464
+ return this.exec(command, { silent: true, ...options });
3465
+ }
3466
+ /**
3467
+ * Executes a formatted command with caching and dry run support
3468
+ *
3469
+ * Core concept:
3470
+ * Core execution engine that handles command execution with
3471
+ * caching, dry run support, and comprehensive logging.
3472
+ *
3473
+ * Execution flow:
3474
+ * 1. Validates execution function availability
3475
+ * 2. Determines dry run and caching settings
3476
+ * 3. Logs command for debugging (unless silent)
3477
+ * 4. Returns dry run result or cached result if available
3478
+ * 5. Executes command and caches result if caching enabled
3479
+ * 6. Returns command execution result
3480
+ *
3481
+ * Caching behavior:
3482
+ * - Uses command string as cache key
3483
+ * - Caches Promise<string> for concurrent access
3484
+ * - Respects per-command and global cache settings
3485
+ * - Provides performance optimization for repeated commands
3486
+ * - Handles cache misses gracefully
3487
+ *
3488
+ * Dry run support:
3489
+ * - Returns predefined result without execution
3490
+ * - Supports both global and per-command dry run
3491
+ * - Useful for command validation and testing
3492
+ * - Maintains logging for debugging
3493
+ *
3494
+ * Error handling:
3495
+ * - Validates execution function availability
3496
+ * - Handles cache access errors gracefully
3497
+ * - Propagates execution errors to caller
3498
+ * - Provides detailed logging for debugging
3499
+ *
3500
+ * @param command - Formatted command string or array
3501
+ * @param options - Execution options for customization
3502
+ * @returns Promise resolving to command output
3503
+ * @throws Error if execution function is not available
3504
+ *
3505
+ * @example Basic execution
3506
+ * ```typescript
3507
+ * const output = await shell.execFormattedCommand('npm install');
3508
+ * ```
3509
+ *
3510
+ * @example With caching
3511
+ * ```typescript
3512
+ * const output1 = await shell.execFormattedCommand('npm install', { isCache: true });
3513
+ * const output2 = await shell.execFormattedCommand('npm install', { isCache: true });
3514
+ * // Second call uses cached result
3515
+ * ```
3516
+ *
3517
+ * @example Dry run mode
3518
+ * ```typescript
3519
+ * const output = await shell.execFormattedCommand('rm -rf /', {
3520
+ * dryRun: true,
3521
+ * dryRunResult: 'Would delete all files'
3522
+ * });
3523
+ * // Returns 'Would delete all files' without execution
3524
+ * ```
3525
+ */
3526
+ async execFormattedCommand(command, options = {}) {
3527
+ const execPromise = this.config.execPromise;
3528
+ if (!execPromise) {
3529
+ throw new Error("execPromise is not defined");
3530
+ }
3531
+ const { dryRunResult, silent, dryRun, isCache } = options;
3532
+ const isDryRun = dryRun !== void 0 ? dryRun : this.config.dryRun;
3533
+ const _isCache = isCache !== void 0 ? !!isCache : !!this.config.isCache;
3534
+ const cacheKey = typeof command === "string" ? command : command.join(" ");
3535
+ const isCached = _isCache && this.cache.has(cacheKey);
3536
+ if (!silent) {
3537
+ this.logger.debug(command);
3538
+ }
3539
+ if (isDryRun) {
3540
+ return Promise.resolve(dryRunResult);
3541
+ }
3542
+ if (isCached) {
3543
+ return this.cache.get(cacheKey);
3544
+ }
3545
+ const result = execPromise(command, options);
3546
+ if (!this.cache.has(cacheKey)) {
3547
+ this.cache.set(cacheKey, result);
3548
+ }
3549
+ return result;
3550
+ }
3551
+ };
3552
+
3553
+ // src/implement/ScriptContext.ts
3554
+ import { exec } from "child_process";
3555
+ var defatuls = {
3556
+ /**
3557
+ * Executes a shell command with proper error handling and output processing
3558
+ *
3559
+ * Core concept:
3560
+ * Wraps Node.js child_process.exec with enhanced error handling and
3561
+ * consistent return values, providing a reliable interface for
3562
+ * executing shell commands in script contexts.
3563
+ *
3564
+ * Execution process:
3565
+ * 1. Converts command array to string if necessary
3566
+ * 2. Executes command with UTF-8 encoding
3567
+ * 3. Handles process completion and error conditions
3568
+ * 4. Returns trimmed stdout on success
3569
+ * 5. Throws error with stderr or stdout on failure
3570
+ *
3571
+ * Error handling:
3572
+ * - Non-zero exit codes trigger error rejection
3573
+ * - Missing error codes default to code 1
3574
+ * - Error messages include stderr or stdout content
3575
+ * - Process errors are properly propagated
3576
+ *
3577
+ * Command processing:
3578
+ * - Arrays are joined with spaces for execution
3579
+ * - Strings are passed directly to exec
3580
+ * - Options are merged with default encoding
3581
+ * - Output is trimmed to remove trailing whitespace
3582
+ *
3583
+ * @param command - Command string or array of command parts
3584
+ * @param options - Shell execution options (merged with defaults)
3585
+ * @returns Promise resolving to command output (trimmed)
3586
+ * @throws Error with stderr or stdout on non-zero exit code
3587
+ *
3588
+ * @example Basic command execution
3589
+ * ```typescript
3590
+ * const output = await defatuls.exec('npm install', { cwd: '/project' });
3591
+ * console.log('Installation output:', output);
3592
+ * ```
3593
+ *
3594
+ * @example Command with arguments
3595
+ * ```typescript
3596
+ * const output = await defatuls.exec(['git', 'commit', '-m', 'Update docs'], {
3597
+ * cwd: '/project'
3598
+ * });
3599
+ * ```
3600
+ *
3601
+ * @example Error handling
3602
+ * ```typescript
3603
+ * try {
3604
+ * await defatuls.exec('invalid-command');
3605
+ * } catch (error) {
3606
+ * console.error('Command failed:', error.message);
3607
+ * }
3608
+ * ```
3609
+ */
3610
+ exec(command, options) {
3611
+ const commandString = Array.isArray(command) ? command.join(" ") : command;
3612
+ return new Promise((resolve, reject) => {
3613
+ exec(
3614
+ commandString,
3615
+ {
3616
+ encoding: "utf-8",
3617
+ ...options
3618
+ },
3619
+ (err, stdout, stderr) => {
3620
+ let code;
3621
+ if (!err) {
3622
+ code = 0;
3623
+ } else if (err.code === void 0) {
3624
+ code = 1;
3625
+ } else {
3626
+ code = err.code;
3627
+ }
3628
+ if (code === 0) {
3629
+ resolve(stdout.trim());
3630
+ } else {
3631
+ reject(new Error(stderr || stdout));
3632
+ }
3633
+ }
3634
+ );
3635
+ });
3636
+ },
3637
+ /**
3638
+ * Creates a configuration search instance with default settings
3639
+ *
3640
+ * Core concept:
3641
+ * Initializes a ConfigSearch instance specifically for fe-config
3642
+ * files, merging default configuration with custom overrides to
3643
+ * provide a unified configuration interface.
3644
+ *
3645
+ * Configuration merging:
3646
+ * - Uses lodash merge for deep object merging
3647
+ * - Default fe-config provides base values
3648
+ * - Custom overrides take precedence
3649
+ * - Maintains nested object structures
3650
+ *
3651
+ * Search behavior:
3652
+ * - Searches for 'fe-config' files in project directories
3653
+ * - Supports multiple file formats (JSON, JS, TS, YAML)
3654
+ * - Follows cosmiconfig search patterns
3655
+ * - Provides fallback to default configuration
3656
+ *
3657
+ * @param feConfig - Optional configuration overrides
3658
+ * @returns ConfigSearch instance with merged configuration
3659
+ *
3660
+ * @example Basic configuration
3661
+ * ```typescript
3662
+ * const config = defatuls.getConfig();
3663
+ * console.log('Default config:', config);
3664
+ * ```
3665
+ *
3666
+ * @example With custom overrides
3667
+ * ```typescript
3668
+ * const config = defatuls.getConfig({
3669
+ * build: { target: 'production' },
3670
+ * deploy: { region: 'us-east-1' }
3671
+ * });
3672
+ * ```
3673
+ */
3674
+ getConfig(feConfig) {
3675
+ return new ConfigSearch({
3676
+ name: "fe-config",
3677
+ defaultConfig: (0, import_merge.default)({}, defaultFeConfig, feConfig)
3678
+ });
3679
+ },
3680
+ /**
3681
+ * Creates a logger instance with timestamp formatting and console output
3682
+ *
3683
+ * Core concept:
3684
+ * Sets up a structured logger with timestamp formatting and
3685
+ * configurable verbosity levels, optimized for script execution
3686
+ * environments.
3687
+ *
3688
+ * Logger features:
3689
+ * - Timestamp formatting with Shanghai timezone
3690
+ * - Configurable log levels (debug/info based on verbosity)
3691
+ * - Console output with structured formatting
3692
+ * - Logger name identification for multi-script environments
3693
+ * - Consistent formatting across all log messages
3694
+ *
3695
+ * Format template:
3696
+ * - Includes logger name for identification
3697
+ * - Timestamp with timezone information
3698
+ * - Log level for message categorization
3699
+ * - Structured for easy parsing and filtering
3700
+ *
3701
+ * Verbosity control:
3702
+ * - true: Enables debug level logging (detailed information)
3703
+ * - false: Enables info level logging (essential information only)
3704
+ * - Affects both console output and log filtering
3705
+ *
3706
+ * @param name - Logger name for identification and filtering
3707
+ * @param verbose - Whether to enable debug level logging
3708
+ * @returns Configured logger instance with timestamp formatting
3709
+ *
3710
+ * @example Basic logger
3711
+ * ```typescript
3712
+ * const logger = defatuls.logger('build-script', false);
3713
+ * logger.info('Starting build process');
3714
+ * // Output: [build-script 2024-01-15 10:30:45 info] Starting build process
3715
+ * ```
3716
+ *
3717
+ * @example Verbose logger
3718
+ * ```typescript
3719
+ * const logger = defatuls.logger('deploy-script', true);
3720
+ * logger.debug('Loading configuration...');
3721
+ * logger.info('Deployment started');
3722
+ * // Both debug and info messages are output
3723
+ * ```
3724
+ */
3725
+ logger(name, verbose) {
3726
+ return new Logger({
3727
+ level: verbose ? "debug" : "info",
3728
+ name,
3729
+ handlers: new ConsoleHandler(
3730
+ new TimestampFormatter({
3731
+ prefixTemplate: "[{loggerName} {formattedTimestamp} {level}]",
3732
+ localeOptions: {
3733
+ timeZone: "Asia/Shanghai"
3734
+ }
3735
+ })
3736
+ )
3737
+ });
3738
+ },
3739
+ /**
3740
+ * Initializes script context options with proper defaults and type safety
3741
+ *
3742
+ * Core concept:
3743
+ * Creates a complete script context configuration by merging
3744
+ * provided options with sensible defaults, ensuring all required
3745
+ * components are properly initialized.
3746
+ *
3747
+ * Initialization process:
3748
+ * 1. Extracts and validates input options
3749
+ * 2. Creates logger with appropriate verbosity
3750
+ * 3. Sets up shell with dry run support
3751
+ * 4. Merges configuration with script-specific overrides
3752
+ * 5. Returns fully initialized context interface
3753
+ *
3754
+ * Component setup:
3755
+ * - Logger: Uses provided logger or creates new one with verbosity
3756
+ * - Shell: Uses provided shell or creates new one with dry run support
3757
+ * - Configuration: Merges fe-config with script-specific options
3758
+ * - Options: Preserves provided options with type safety
3759
+ *
3760
+ * Default behavior:
3761
+ * - Verbose mode defaults to false
3762
+ * - Dry run mode defaults to false
3763
+ * - Shell uses default exec function if not provided
3764
+ * - Configuration merges with default fe-config
3765
+ *
3766
+ * @param name - Script identifier for logging and configuration
3767
+ * @param ctxOpts - Context initialization options (partial)
3768
+ * @returns Fully initialized context options with defaults applied
3769
+ *
3770
+ * @example Basic initialization
3771
+ * ```typescript
3772
+ * const options = defatuls.options('build-script', {
3773
+ * verbose: true,
3774
+ * dryRun: false
3775
+ * });
3776
+ * ```
3777
+ *
3778
+ * @example With custom components
3779
+ * ```typescript
3780
+ * const options = defatuls.options('deploy-script', {
3781
+ * logger: customLogger,
3782
+ * shell: customShell,
3783
+ * feConfig: { target: 'production' }
3784
+ * });
3785
+ * ```
3786
+ */
3787
+ options(name, ctxOpts) {
3788
+ const { logger, shell, feConfig, dryRun, verbose, options } = ctxOpts;
3789
+ const _options = options || {};
3790
+ const _logger = logger || defatuls.logger(name, !!verbose);
3791
+ const _shell = shell || new Shell({
3792
+ logger: _logger,
3793
+ dryRun,
3794
+ execPromise: _options.execPromise || defatuls.exec
3795
+ });
3796
+ const _feConfig = (0, import_merge.default)({}, feConfig, { [name]: ctxOpts.options });
3797
+ return {
3798
+ options: _options,
3799
+ dryRun: !!dryRun,
3800
+ shell: _shell,
3801
+ logger: _logger,
3802
+ verbose: !!verbose,
3803
+ feConfig: defatuls.getConfig(_feConfig).config
3804
+ };
3805
+ }
3806
+ };
3807
+ var DEFAULT_ENV_ORDER = [".env.local", ".env"];
3808
+ var ScriptContext = class {
3809
+ /**
3810
+ * Creates a new ScriptContext instance with the specified configuration
3811
+ *
3812
+ * Core concept:
3813
+ * Initializes a complete script execution environment with
3814
+ * integrated configuration, logging, and shell capabilities.
3815
+ *
3816
+ * Initialization process:
3817
+ * 1. Validates script name requirement
3818
+ * 2. Sets up logger, shell, and configuration components
3819
+ * 3. Loads environment variables with configurable order
3820
+ * 4. Applies default options and environment integration
3821
+ * 5. Merges script-specific configuration with defaults
3822
+ *
3823
+ * Validation rules:
3824
+ * - Script name must be provided and be a non-empty string
3825
+ * - Options are optional and have sensible defaults
3826
+ * - Environment loading follows configurable priority order
3827
+ * - Configuration merging preserves type safety
3828
+ *
3829
+ * Component initialization:
3830
+ * - Logger: Created with timestamp formatting and verbosity control
3831
+ * - Shell: Set up with dry run support and integrated logging
3832
+ * - Configuration: Merged from fe-config with script-specific overrides
3833
+ * - Environment: Loaded from files with fallback to defaults
3834
+ *
3835
+ * @param name - Script identifier for logging and configuration
3836
+ * @param opts - Optional initialization options
3837
+ * @throws {Error} When script name is not provided or invalid
3838
+ *
3839
+ * @example Basic initialization
3840
+ * ```typescript
3841
+ * const context = new ScriptContext('build-script', {
3842
+ * verbose: true,
3843
+ * dryRun: false
3844
+ * });
3845
+ * ```
3846
+ *
3847
+ * @example With custom options
3848
+ * ```typescript
3849
+ * const context = new ScriptContext('deploy-script', {
3850
+ * feConfig: { target: 'production' },
3851
+ * options: { region: 'us-east-1' }
3852
+ * });
3853
+ * ```
3854
+ */
3855
+ constructor(name, opts = {}) {
3856
+ this.name = name;
3857
+ if (!name || typeof name !== "string") {
3858
+ throw new Error("ScriptContext name is required");
3859
+ }
3860
+ const { feConfig, logger, shell, dryRun, verbose, options } = defatuls.options(name, opts);
3861
+ this.feConfig = feConfig;
3862
+ this.logger = logger;
3863
+ this.shell = shell;
3864
+ this.dryRun = dryRun;
3865
+ this.verbose = verbose;
3866
+ this.options = this.getDefaultStore(name, feConfig);
3867
+ this.setOptions(this.getDefaultOptions(options));
3868
+ }
3869
+ /**
3870
+ * Logger instance for structured logging
3871
+ *
3872
+ * Provides timestamp-formatted logging with configurable
3873
+ * verbosity levels and script name identification.
3874
+ */
3875
+ logger;
3876
+ /**
3877
+ * Shell interface for command execution
3878
+ *
3879
+ * Handles command execution with dry run support,
3880
+ * error handling, and integrated logging.
3881
+ */
3882
+ shell;
3883
+ /**
3884
+ * Merged fe-configuration object
3885
+ *
3886
+ * Contains the complete configuration after merging
3887
+ * default fe-config with script-specific overrides.
3888
+ */
3889
+ feConfig;
3890
+ /**
3891
+ * Whether to run in dry run mode
3892
+ *
3893
+ * When true, commands are logged but not executed,
3894
+ * useful for testing and validation.
3895
+ */
3896
+ dryRun;
3897
+ /**
3898
+ * Whether to enable verbose logging
3899
+ *
3900
+ * Controls debug level logging output and
3901
+ * detailed information display.
3902
+ */
3903
+ verbose;
3904
+ /**
3905
+ * Script-specific options
3906
+ *
3907
+ * Contains all script configuration options
3908
+ * with defaults applied and environment integration.
3909
+ */
3910
+ options;
3911
+ /**
3912
+ * Environment instance for variable access and management
3913
+ *
3914
+ * Core concept:
3915
+ * Provides access to environment variables loaded from
3916
+ * configuration files with type-safe getter methods
3917
+ * and default value support.
3918
+ *
3919
+ * Environment features:
3920
+ * - Automatic file loading (.env.local, .env)
3921
+ * - Type-safe getter methods with defaults
3922
+ * - Configurable file loading order
3923
+ * - Integration with fe-config environment settings
3924
+ * - Lazy initialization for performance
3925
+ *
3926
+ * Loading behavior:
3927
+ * - Files are loaded in priority order (highest first)
3928
+ * - Missing files are silently ignored
3929
+ * - Variables are cached after first load
3930
+ * - Environment is shared across script instances
3931
+ *
3932
+ * Error handling:
3933
+ * - Throws error if environment is not initialized
3934
+ * - Provides clear error messages for debugging
3935
+ * - Graceful handling of missing environment files
3936
+ *
3937
+ * @returns Env instance for environment variable operations
3938
+ * @throws {Error} When environment is not properly initialized
3939
+ *
3940
+ * @example Basic usage
3941
+ * ```typescript
3942
+ * const apiKey = this.env.get('API_KEY');
3943
+ * const port = this.env.get('PORT', '3000');
3944
+ * ```
3945
+ *
3946
+ * @example With defaults
3947
+ * ```typescript
3948
+ * const databaseUrl = this.env.get('DATABASE_URL', 'localhost:5432');
3949
+ * const debug = this.env.get('DEBUG', 'false');
3950
+ * ```
3951
+ */
3952
+ get env() {
3953
+ if (!this.options.env) {
3954
+ throw new Error("Environment is not initialized");
3955
+ }
3956
+ return this.options.env;
3957
+ }
3958
+ /**
3959
+ * Extracts configuration store from feConfig based on script name
3960
+ *
3961
+ * Core concept:
3962
+ * Safely extracts script-specific configuration from the
3963
+ * merged fe-config object, handling various data types
3964
+ * and providing fallback values.
3965
+ *
3966
+ * Extraction process:
3967
+ * 1. Uses lodash get to safely access nested configuration
3968
+ * 2. Validates that the extracted value is an object
3969
+ * 3. Converts primitive values to empty objects
3970
+ * 4. Logs warnings for non-object configurations
3971
+ * 5. Returns type-safe configuration object
3972
+ *
3973
+ * Safety features:
3974
+ * - Safe nested property access with lodash get
3975
+ * - Null and undefined handling
3976
+ * - Type validation for configuration objects
3977
+ * - Warning logging for invalid configurations
3978
+ * - Fallback to empty object for primitives
3979
+ *
3980
+ * Configuration validation:
3981
+ * - Checks if extracted value is an object
3982
+ * - Warns when configuration is not an object
3983
+ * - Converts primitives to empty objects
3984
+ * - Maintains type safety through generic constraints
3985
+ *
3986
+ * @param scriptName - Script name or array of names for nested access
3987
+ * @param sources - Configuration source object (feConfig)
3988
+ * @returns Extracted configuration object with type safety
3989
+ *
3990
+ * @example Basic extraction
3991
+ * ```typescript
3992
+ * const config = this.getDefaultStore('build-script', feConfig);
3993
+ * // Returns configuration from feConfig['build-script']
3994
+ * ```
3995
+ *
3996
+ * @example Nested access
3997
+ * ```typescript
3998
+ * const config = this.getDefaultStore(['scripts', 'build'], feConfig);
3999
+ * // Returns configuration from feConfig.scripts.build
4000
+ * ```
4001
+ */
4002
+ getDefaultStore(scriptName, sources) {
4003
+ const rootProp = scriptName ? (0, import_get.default)(sources, scriptName) : sources;
4004
+ const isObject = typeof rootProp === "object" && rootProp !== null;
4005
+ const rootPropObject = isObject ? rootProp : {};
4006
+ if (!isObject) {
4007
+ this.logger.warn(
4008
+ `rootProp ${scriptName} is not an object, it will be overwritten by the default options`
4009
+ );
4010
+ }
4011
+ return rootPropObject;
4012
+ }
4013
+ /**
4014
+ * Applies default values to script options with environment integration
4015
+ *
4016
+ * Core concept:
4017
+ * Enhances provided options with sensible defaults and
4018
+ * environment variable integration, ensuring all required
4019
+ * configuration is available.
4020
+ *
4021
+ * Default logic:
4022
+ * 1. Uses existing environment or loads from files
4023
+ * 2. Sets rootPath to current working directory if not specified
4024
+ * 3. Determines sourceBranch from environment or defaults to 'master'
4025
+ * 4. Merges all options with proper precedence
4026
+ * 5. Ensures environment is properly initialized
4027
+ *
4028
+ * Environment variable priority:
4029
+ * 1. FE_RELEASE_BRANCH (primary environment variable)
4030
+ * 2. FE_RELEASE_SOURCE_BRANCH (fallback environment variable)
4031
+ * 3. 'master' (default value)
4032
+ * 4. Options.sourceBranch (if provided)
4033
+ *
4034
+ * Path handling:
4035
+ * - rootPath defaults to process.cwd() if not specified
4036
+ * - Supports both absolute and relative paths
4037
+ * - Maintains path consistency across environments
4038
+ * - Used for file operations and configuration loading
4039
+ *
4040
+ * Environment integration:
4041
+ * - Loads environment from files if not provided
4042
+ * - Uses configurable file loading order
4043
+ * - Integrates with fe-config environment settings
4044
+ * - Provides fallback to default environment
4045
+ *
4046
+ * @param options - Current options to enhance with defaults
4047
+ * @returns Options with default values and environment integration
4048
+ *
4049
+ * @example Basic defaults
4050
+ * ```typescript
4051
+ * const options = this.getDefaultOptions({});
4052
+ * // Returns: { rootPath: process.cwd(), sourceBranch: 'master', env: Env instance }
4053
+ * ```
4054
+ *
4055
+ * @example With environment variables
4056
+ * ```typescript
4057
+ * // If FE_RELEASE_BRANCH=develop
4058
+ * const options = this.getDefaultOptions({});
4059
+ * // Returns: { rootPath: process.cwd(), sourceBranch: 'develop', env: Env instance }
4060
+ * ```
4061
+ */
4062
+ getDefaultOptions(options) {
4063
+ const env = this.options.env;
4064
+ const rootPath = options.rootPath || process.cwd();
4065
+ const sourceBranch = options.sourceBranch || env?.get("FE_RELEASE_BRANCH") || env?.get("FE_RELEASE_SOURCE_BRANCH") || "master";
4066
+ const defaultOptions = {
4067
+ ...options,
4068
+ sourceBranch,
4069
+ rootPath,
4070
+ env: env || Env.searchEnv({
4071
+ logger: this.logger,
4072
+ preloadList: this.feConfig.envOrder || DEFAULT_ENV_ORDER
4073
+ })
4074
+ };
4075
+ return defaultOptions;
4076
+ }
4077
+ /**
4078
+ * Updates script options with deep merging support
4079
+ *
4080
+ * Core concept:
4081
+ * Merges new options with existing configuration using
4082
+ * lodash merge for deep object merging, preserving
4083
+ * existing options not specified in the update.
4084
+ *
4085
+ * Merging strategy:
4086
+ * - Uses lodash merge for deep object merging
4087
+ * - Preserves existing options not specified in update
4088
+ * - Supports nested object updates
4089
+ * - Maintains type safety through generic constraints
4090
+ * - Handles arrays and primitives appropriately
4091
+ *
4092
+ * Update behavior:
4093
+ * - New options override existing ones
4094
+ * - Nested objects are merged recursively
4095
+ * - Arrays are replaced (not merged)
4096
+ * - Primitives are replaced directly
4097
+ * - Undefined values are ignored
4098
+ *
4099
+ * Type safety:
4100
+ * - Maintains generic type constraints
4101
+ * - Preserves option structure
4102
+ * - Validates option types at runtime
4103
+ * - Supports partial option updates
4104
+ *
4105
+ * @param options - Partial options to merge with current configuration
4106
+ *
4107
+ * @example Basic update
4108
+ * ```typescript
4109
+ * this.setOptions({ debug: true });
4110
+ * // Merges debug: true with existing options
4111
+ * ```
4112
+ *
4113
+ * @example Nested update
4114
+ * ```typescript
4115
+ * this.setOptions({
4116
+ * build: { target: 'production', minify: true }
4117
+ * });
4118
+ * // Merges nested build configuration
4119
+ * ```
4120
+ */
4121
+ setOptions(options) {
4122
+ this.options = (0, import_merge.default)(this.options, options);
4123
+ }
4124
+ /**
4125
+ * Retrieves environment variable with optional default value
4126
+ *
4127
+ * Core concept:
4128
+ * Provides safe access to environment variables with
4129
+ * default value fallback, delegating to the underlying
4130
+ * Env.get method for consistent behavior.
4131
+ *
4132
+ * Access features:
4133
+ * - Safe access to environment variables
4134
+ * - Default value fallback when variable not found
4135
+ * - Delegates to Env.get method for consistency
4136
+ * - Handles undefined and null values gracefully
4137
+ * - Maintains environment variable type safety
4138
+ *
4139
+ * Default behavior:
4140
+ * - Returns undefined if variable not found and no default provided
4141
+ * - Returns default value if variable not found and default provided
4142
+ * - Returns actual value if variable exists
4143
+ * - Handles empty string values appropriately
4144
+ *
4145
+ * @param key - Environment variable name to retrieve
4146
+ * @param defaultValue - Optional default value if variable not found
4147
+ * @returns Environment variable value or default, undefined if not found
4148
+ *
4149
+ * @example Basic access
4150
+ * ```typescript
4151
+ * const apiKey = this.getEnv('API_KEY');
4152
+ * // Returns API_KEY value or undefined
4153
+ * ```
4154
+ *
4155
+ * @example With default
4156
+ * ```typescript
4157
+ * const port = this.getEnv('PORT', '3000');
4158
+ * // Returns PORT value or '3000' if not found
4159
+ * ```
4160
+ *
4161
+ * @example Boolean handling
4162
+ * ```typescript
4163
+ * const debug = this.getEnv('DEBUG', 'false');
4164
+ * const isDebug = debug === 'true';
4165
+ * ```
4166
+ */
4167
+ getEnv(key, defaultValue) {
4168
+ return this.env.get(key) ?? defaultValue;
4169
+ }
4170
+ /**
4171
+ * Retrieves configuration options with nested path support
4172
+ *
4173
+ * Core concept:
4174
+ * Provides safe access to configuration options using
4175
+ * lodash get for nested path support, with type-safe
4176
+ * return values and default value fallback.
4177
+ *
4178
+ * Access features:
4179
+ * - Safe nested object access using lodash get
4180
+ * - Type-safe return values with generic constraints
4181
+ * - Default value support for missing keys
4182
+ * - Full options object access when no key provided
4183
+ * - Support for both string and array path formats
4184
+ *
4185
+ * Path formats:
4186
+ * - String: 'build.target' for nested access
4187
+ * - Array: ['build', 'target'] for explicit path
4188
+ * - Empty: Returns full options object
4189
+ * - Invalid: Returns default value or undefined
4190
+ *
4191
+ * Type safety:
4192
+ * - Generic type parameter for return type
4193
+ * - Type inference from default values
4194
+ * - Runtime type validation
4195
+ * - Consistent return type handling
4196
+ *
4197
+ * @param key - Optional path to specific option (string or array)
4198
+ * @param defaultValue - Default value if option not found
4199
+ * @returns Option value or default, full options if no key provided
4200
+ *
4201
+ * @example Basic access
4202
+ * ```typescript
4203
+ * const debug = this.getOptions('debug', false);
4204
+ * // Returns debug option or false if not found
4205
+ * ```
4206
+ *
4207
+ * @example Nested access
4208
+ * ```typescript
4209
+ * const target = this.getOptions('build.target', 'development');
4210
+ * // Returns build.target or 'development' if not found
4211
+ * ```
4212
+ *
4213
+ * @example Array path
4214
+ * ```typescript
4215
+ * const region = this.getOptions(['deploy', 'region'], 'us-east-1');
4216
+ * // Returns deploy.region or 'us-east-1' if not found
4217
+ * ```
4218
+ *
4219
+ * @example Full options
4220
+ * ```typescript
4221
+ * const allOptions = this.getOptions();
4222
+ * // Returns the complete options object
4223
+ * ```
4224
+ */
4225
+ getOptions(key, defaultValue) {
4226
+ if (!key) {
4227
+ return this.options;
4228
+ }
4229
+ return (0, import_get.default)(this.options, key, defaultValue);
4230
+ }
4231
+ };
4232
+
4233
+ // src/implement/ScriptPlugin.ts
4234
+ var import_merge2 = __toESM(require_merge(), 1);
4235
+ var ScriptPlugin = class {
4236
+ /**
4237
+ * Creates a new script plugin instance
4238
+ *
4239
+ * Initialization Process:
4240
+ * 1. Stores context and plugin name references
4241
+ * 2. Merges configuration from multiple sources
4242
+ * 3. Sets up initial configuration state
4243
+ *
4244
+ * @param context - Script context providing environment and configuration
4245
+ * @param pluginName - Unique identifier for this plugin (used for config namespace)
4246
+ * @param props - Optional runtime configuration overrides
4247
+ *
4248
+ * @example
4249
+ * ```typescript
4250
+ * // Basic initialization
4251
+ * const plugin = new MyPlugin(context, 'my-plugin');
4252
+ *
4253
+ * // With runtime configuration
4254
+ * const plugin = new MyPlugin(context, 'build-plugin', {
4255
+ * outputDir: './custom-dist',
4256
+ * skip: false
4257
+ * });
4258
+ * ```
4259
+ */
4260
+ constructor(context, pluginName, props = {}) {
4261
+ this.context = context;
4262
+ this.pluginName = pluginName;
4263
+ this.props = props;
4264
+ this.setConfig(this.getInitialProps(props));
4265
+ }
4266
+ /** Ensures only one instance of this plugin can be registered */
4267
+ onlyOne = true;
4268
+ /**
4269
+ * Merges configuration from multiple sources with proper priority
4270
+ *
4271
+ * Configuration Sources (priority order):
4272
+ * 1. Constructor props (highest priority)
4273
+ * 2. Command line config (context.options[pluginName])
4274
+ * 3. File config (context.getOptions(pluginName))
4275
+ * 4. Empty object (fallback)
4276
+ *
4277
+ * @param props - Runtime configuration overrides
4278
+ * @returns Merged configuration object
4279
+ *
4280
+ * @example
4281
+ * ```typescript
4282
+ * // Get merged config from all sources
4283
+ * const config = this.getInitialProps({
4284
+ * outputDir: './runtime-dist' // This will override file config
4285
+ * });
4286
+ * ```
4287
+ */
4288
+ getInitialProps(props) {
4289
+ if (typeof this.context.options !== "object") {
4290
+ return {};
4291
+ }
4292
+ const pluginConfig = this.context.options[this.pluginName];
4293
+ const fileConfig = this.context.getOptions(this.pluginName);
4294
+ const baseConfig = pluginConfig || fileConfig;
4295
+ return props ? (0, import_merge2.default)({}, baseConfig, props) : baseConfig || {};
4296
+ }
4297
+ /**
4298
+ * Logger instance for structured logging
4299
+ *
4300
+ * Provides access to the context logger with proper type casting
4301
+ * for integration with the logging system.
4302
+ *
4303
+ * @returns LoggerInterface instance for logging operations
4304
+ *
4305
+ * @example
4306
+ * ```typescript
4307
+ * this.logger.info('Starting build process');
4308
+ * this.logger.error('Build failed', error);
4309
+ * this.logger.debug('Debug information', { config: this.options });
4310
+ * ```
4311
+ */
4312
+ get logger() {
4313
+ return this.context.logger;
4314
+ }
4315
+ /**
4316
+ * Shell interface for command execution
4317
+ *
4318
+ * Provides access to shell operations for executing commands,
4319
+ * managing processes, and file system operations.
4320
+ *
4321
+ * @returns ShellInterface instance for shell operations
4322
+ *
4323
+ * @example
4324
+ * ```typescript
4325
+ * // Execute a command
4326
+ * await this.shell.exec('npm run build');
4327
+ *
4328
+ * // Check if file exists
4329
+ * const exists = await this.shell.exists('./package.json');
4330
+ *
4331
+ * // Read file content
4332
+ * const content = await this.shell.readFile('./config.json');
4333
+ * ```
4334
+ */
4335
+ get shell() {
4336
+ return this.context.shell;
4337
+ }
4338
+ /**
4339
+ * Current plugin configuration options
4340
+ *
4341
+ * Retrieves the merged configuration for this plugin from the context.
4342
+ * This includes all configuration sources merged with proper priority.
4343
+ *
4344
+ * @returns Current plugin configuration object
4345
+ *
4346
+ * @example
4347
+ * ```typescript
4348
+ * // Access configuration
4349
+ * const { outputDir, verbose } = this.options;
4350
+ *
4351
+ * // Use in conditional logic
4352
+ * if (this.options.skip) {
4353
+ * this.logger.info('Plugin execution skipped');
4354
+ * return;
4355
+ * }
4356
+ * ```
4357
+ */
4358
+ get options() {
4359
+ return this.context.getOptions(this.pluginName, {});
4360
+ }
4361
+ /**
4362
+ * Determines whether a lifecycle method should be executed
4363
+ *
4364
+ * Skip Logic:
4365
+ * - Returns `false` if skip is `true` (skip all)
4366
+ * - Returns `false` if skip matches the lifecycle name (skip specific)
4367
+ * - Returns `true` otherwise (execute normally)
4368
+ *
4369
+ * @param _name - Name of the lifecycle method being checked
4370
+ * @param _context - Executor context (unused in base implementation)
4371
+ * @returns Whether the lifecycle method should be executed
4372
+ *
4373
+ * @example
4374
+ * ```typescript
4375
+ * // Skip all lifecycle methods
4376
+ * const plugin = new MyPlugin(context, 'my-plugin', { skip: true });
4377
+ * plugin.enabled('onBefore', context); // Returns false
4378
+ *
4379
+ * // Skip specific lifecycle method
4380
+ * const plugin = new MyPlugin(context, 'my-plugin', { skip: 'onBefore' });
4381
+ * plugin.enabled('onBefore', context); // Returns false
4382
+ * plugin.enabled('onExec', context); // Returns true
4383
+ * ```
4384
+ */
4385
+ enabled(_name, _context) {
4386
+ const skip = this.getConfig("skip");
4387
+ if (skip === true) {
4388
+ return false;
4389
+ }
4390
+ if (typeof skip === "string" && _name === skip) {
4391
+ return false;
4392
+ }
4393
+ return true;
4394
+ }
4395
+ /**
4396
+ * Retrieves configuration values with nested path support
4397
+ *
4398
+ * Features:
4399
+ * - Safe nested object access using lodash get
4400
+ * - Automatic plugin namespace prefixing
4401
+ * - Default value support for missing keys
4402
+ * - Type-safe return values
4403
+ *
4404
+ * @param keys - Optional path to specific configuration (string or array)
4405
+ * @param defaultValue - Default value if configuration not found
4406
+ * @returns Configuration value or default, full config if no keys provided
4407
+ *
4408
+ * @example
4409
+ * ```typescript
4410
+ * // Get full plugin configuration
4411
+ * const config = this.getConfig();
4412
+ *
4413
+ * // Get specific configuration value
4414
+ * const outputDir = this.getConfig('outputDir', './dist');
4415
+ *
4416
+ * // Get nested configuration
4417
+ * const buildMode = this.getConfig(['build', 'mode'], 'development');
4418
+ *
4419
+ * // Get with type safety
4420
+ * const port = this.getConfig<number>('port', 3000);
4421
+ *
4422
+ * // Get array configuration
4423
+ * const plugins = this.getConfig<string[]>('plugins', []);
4424
+ * ```
4425
+ */
4426
+ getConfig(keys, defaultValue) {
4427
+ if (!keys) {
4428
+ return this.context.getOptions(this.pluginName, defaultValue);
4429
+ }
4430
+ return this.context.getOptions(
4431
+ [this.pluginName, ...Array.isArray(keys) ? keys : [keys]],
4432
+ defaultValue
4433
+ );
4434
+ }
4435
+ /**
4436
+ * Updates plugin configuration with deep merging
4437
+ *
4438
+ * Merging Strategy:
4439
+ * - Uses lodash merge for deep object merging
4440
+ * - Preserves existing configuration not specified in update
4441
+ * - Updates configuration in the plugin's namespace
4442
+ * - Maintains type safety through generic constraints
4443
+ *
4444
+ * @param config - Partial configuration to merge with current settings
4445
+ *
4446
+ * @example
4447
+ * ```typescript
4448
+ * // Update single configuration
4449
+ * this.setConfig({ outputDir: '/new/path' });
4450
+ *
4451
+ * // Update multiple configurations
4452
+ * this.setConfig({
4453
+ * verbose: true,
4454
+ * buildMode: 'production'
4455
+ * });
4456
+ *
4457
+ * // Update nested configuration
4458
+ * this.setConfig({
4459
+ * build: {
4460
+ * minify: true,
4461
+ * sourcemap: false
4462
+ * }
4463
+ * });
4464
+ * ```
4465
+ */
4466
+ setConfig(config) {
4467
+ this.context.setOptions({
4468
+ [this.pluginName]: config
4469
+ });
4470
+ }
4471
+ /**
4472
+ * Lifecycle method called before script execution
4473
+ *
4474
+ * Override this method to perform setup tasks such as:
4475
+ * - Environment validation
4476
+ * - Configuration verification
4477
+ * - Resource preparation
4478
+ * - Pre-execution checks
4479
+ *
4480
+ * @param _context - Executor context containing execution state
4481
+ *
4482
+ * @example
4483
+ * ```typescript
4484
+ * async onBefore(context: ExecutorContext<MyContext>): Promise<void> {
4485
+ * // Validate required environment variables
4486
+ * const apiKey = this.context.getEnv('API_KEY');
4487
+ * if (!apiKey) {
4488
+ * throw new Error('API_KEY environment variable is required');
4489
+ * }
4490
+ *
4491
+ * // Check if output directory exists
4492
+ * const outputDir = this.getConfig('outputDir', './dist');
4493
+ * if (!(await this.shell.exists(outputDir))) {
4494
+ * await this.shell.mkdir(outputDir);
4495
+ * }
4496
+ * }
4497
+ * ```
4498
+ */
4499
+ onBefore(_context) {
4500
+ }
4501
+ /**
4502
+ * Lifecycle method called during script execution
4503
+ *
4504
+ * Override this method to implement the main plugin logic:
4505
+ * - Core functionality execution
4506
+ * - Business logic implementation
4507
+ * - Task orchestration
4508
+ * - Process management
4509
+ *
4510
+ * @param _context - Executor context containing execution state
4511
+ *
4512
+ * @example
4513
+ * ```typescript
4514
+ * async onExec(context: ExecutorContext<MyContext>): Promise<void> {
4515
+ * await this.step({
4516
+ * label: 'Building project',
4517
+ * task: async () => {
4518
+ * await this.shell.exec('npm run build');
4519
+ * return 'build completed';
4520
+ * }
4521
+ * });
4522
+ *
4523
+ * await this.step({
4524
+ * label: 'Running tests',
4525
+ * task: async () => {
4526
+ * await this.shell.exec('npm test');
4527
+ * return 'tests passed';
4528
+ * }
4529
+ * });
4530
+ * }
4531
+ * ```
4532
+ */
4533
+ onExec(_context) {
4534
+ }
4535
+ /**
4536
+ * Lifecycle method called after successful script execution
4537
+ *
4538
+ * Override this method to perform cleanup tasks such as:
4539
+ * - Resource cleanup
4540
+ * - Success notifications
4541
+ * - Result processing
4542
+ * - Post-execution reporting
4543
+ *
4544
+ * @param _context - Executor context containing execution state
4545
+ *
4546
+ * @example
4547
+ * ```typescript
4548
+ * async onSuccess(context: ExecutorContext<MyContext>): Promise<void> {
4549
+ * // Send success notification
4550
+ * await this.sendNotification('Build completed successfully');
4551
+ *
4552
+ * // Generate success report
4553
+ * await this.generateReport({
4554
+ * status: 'success',
4555
+ * timestamp: new Date(),
4556
+ * duration: context.duration
4557
+ * });
4558
+ *
4559
+ * // Clean up temporary files
4560
+ * await this.shell.rmdir('./temp');
4561
+ * }
4562
+ * ```
4563
+ */
4564
+ onSuccess(_context) {
4565
+ }
4566
+ /**
4567
+ * Lifecycle method called when script execution fails
4568
+ *
4569
+ * Override this method to handle errors such as:
4570
+ * - Error logging and reporting
4571
+ * - Resource cleanup on failure
4572
+ * - Error notifications
4573
+ * - Failure recovery attempts
4574
+ *
4575
+ * @param _context - Executor context containing execution state
4576
+ *
4577
+ * @example
4578
+ * ```typescript
4579
+ * async onError(context: ExecutorContext<MyContext>): Promise<void> {
4580
+ * // Log detailed error information
4581
+ * this.logger.error('Script execution failed', {
4582
+ * error: context.error,
4583
+ * duration: context.duration,
4584
+ * config: this.options
4585
+ * });
4586
+ *
4587
+ * // Send error notification
4588
+ * await this.sendNotification('Build failed', {
4589
+ * error: context.error.message
4590
+ * });
4591
+ *
4592
+ * // Clean up partial results
4593
+ * await this.shell.rmdir('./partial-build');
4594
+ * }
4595
+ * ```
4596
+ */
4597
+ onError(_context) {
4598
+ }
4599
+ /**
4600
+ * Executes a step with structured logging and error handling
4601
+ *
4602
+ * Features:
4603
+ * - Automatic step labeling in logs
4604
+ * - Structured success/failure logging
4605
+ * - Error propagation with context
4606
+ * - Visual separation in log output
4607
+ *
4608
+ * Step Execution Flow:
4609
+ * 1. Log step start with label
4610
+ * 2. Execute task function
4611
+ * 3. Log success or error
4612
+ * 4. Return task result or throw error
4613
+ *
4614
+ * @param options - Step configuration object
4615
+ * @param {string} options.label - Human-readable label for the step
4616
+ * @param {() => Promise<T>} options.task - Async function that performs the step work
4617
+ * @param {boolean} [options.enabled] - Whether the step should be executed (default: true)
4618
+ * @returns The result of the task execution
4619
+ *
4620
+ * @throws {Error} When the task function throws an error
4621
+ *
4622
+ * @example
4623
+ * ```typescript
4624
+ * // Basic step execution
4625
+ * const result = await this.step({
4626
+ * label: 'Installing dependencies',
4627
+ * task: async () => {
4628
+ * await this.shell.exec('npm install');
4629
+ * return 'dependencies installed';
4630
+ * }
4631
+ * });
4632
+ *
4633
+ * // Step with conditional logic
4634
+ * await this.step({
4635
+ * label: 'Running tests',
4636
+ * enabled: this.getConfig('runTests', true),
4637
+ * task: async () => {
4638
+ * await this.shell.exec('npm test');
4639
+ * return 'tests passed';
4640
+ * }
4641
+ * });
4642
+ *
4643
+ * // Step with complex logic
4644
+ * await this.step({
4645
+ * label: 'Building project',
4646
+ * task: async () => {
4647
+ * const buildMode = this.getConfig('buildMode', 'development');
4648
+ * const command = `npm run build:${buildMode}`;
4649
+ * await this.shell.exec(command);
4650
+ * return {
4651
+ * mode: buildMode,
4652
+ * outputDir: this.getConfig('outputDir', './dist')
4653
+ * };
4654
+ * }
4655
+ * });
4656
+ * ```
4657
+ */
4658
+ async step(options) {
4659
+ this.logger.log();
4660
+ this.logger.info(options.label);
4661
+ this.logger.log();
4662
+ try {
4663
+ const res = await options.task();
4664
+ this.logger.info(`${options.label} - success`);
4665
+ return res;
4666
+ } catch (e) {
4667
+ this.logger.error(e);
4668
+ throw e;
4669
+ }
4670
+ }
4671
+ };
4672
+ export {
4673
+ ColorFormatter,
4674
+ ConfigSearch,
4675
+ ScriptContext,
4676
+ ScriptPlugin,
4677
+ Shell,
4678
+ defaultFeConfig
4679
+ };