utilzify 1.1.3 → 1.1.4
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/lib/browser/bundle.iife.js +1 -1
- package/lib/browser/bundle.umd.js +1 -1
- package/lib/cjs/utils/clipboard.js +1 -1
- package/lib/cjs/utils/dom.js +1 -1
- package/lib/cjs/utils/extract-error-message.d.ts.map +1 -1
- package/lib/cjs/utils/extract-error-message.js +1 -1
- package/lib/cjs/utils/get-local-ip.js +1 -1
- package/lib/cjs/utils/run-command.js +1 -1
- package/lib/cjs/utils/save-file.js +1 -1
- package/lib/cjs/utils/styled-logger.js +1 -1
- package/lib/esm/utils/clipboard.js +1 -1
- package/lib/esm/utils/dom.js +1 -1
- package/lib/esm/utils/extract-error-message.d.ts.map +1 -1
- package/lib/esm/utils/extract-error-message.js +1 -1
- package/lib/esm/utils/get-local-ip.js +1 -1
- package/lib/esm/utils/run-command.js +1 -1
- package/lib/esm/utils/save-file.js +1 -1
- package/lib/esm/utils/styled-logger.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var apizum=function(t,e,r,n,o,a){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var c=i(e),s=i(r),u=i(o);const l=t=>t.replace(/<[^>]*>/g,"").trim();var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var p=Array.isArray,h="object"==typeof f&&f&&f.Object===Object&&f,v="object"==typeof self&&self&&self.Object===Object&&self,y=h||v||Function("return this")(),g=y.Symbol,m=g,b=Object.prototype,_=b.hasOwnProperty,w=b.toString,j=m?m.toStringTag:void 0;var S=function(t){var e=_.call(t,j),r=t[j];try{t[j]=void 0;var n=!0}catch(t){}var o=w.call(t);return n&&(e?t[j]=r:delete t[j]),o},C=Object.prototype.toString;var N=S,O=function(t){return C.call(t)},$=g?g.toStringTag:void 0;var T=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":$&&$ in Object(t)?N(t):O(t)};var x=T,E=function(t){return null!=t&&"object"==typeof t};var A=function(t){return"symbol"==typeof t||E(t)&&"[object Symbol]"==x(t)},M=p,P=A,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/;var I=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(k.test(t)||!z.test(t)||null!=e&&t in Object(e))};var F=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},L=T,U=F;var B,D=function(t){if(!U(t))return!1;var e=L(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},R=y["__core-js_shared__"],Y=(B=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"";var H=function(t){return!!Y&&Y in t},V=Function.prototype.toString;var G=D,q=H,Z=F,J=function(t){if(null!=t){try{return V.call(t)}catch(t){}try{return t+""}catch(t){}}return""},K=/^\[object .+?Constructor\]$/,Q=Function.prototype,W=Object.prototype,X=Q.toString,tt=W.hasOwnProperty,et=RegExp("^"+X.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var rt=function(t){return!(!Z(t)||q(t))&&(G(t)?et:K).test(J(t))},nt=function(t,e){return null==t?void 0:t[e]};var ot=function(t,e){var r=nt(t,e);return rt(r)?r:void 0},at=ot(Object,"create"),it=at;var ct=function(){this.__data__=it?it(null):{},this.size=0};var st=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ut=at,lt=Object.prototype.hasOwnProperty;var ft=function(t){var e=this.__data__;if(ut){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return lt.call(e,t)?e[t]:void 0},dt=at,pt=Object.prototype.hasOwnProperty;var ht=at;var vt=ct,yt=st,gt=ft,mt=function(t){var e=this.__data__;return dt?void 0!==e[t]:pt.call(e,t)},bt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ht&&void 0===e?"__lodash_hash_undefined__":e,this};function _t(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_t.prototype.clear=vt,_t.prototype.delete=yt,_t.prototype.get=gt,_t.prototype.has=mt,_t.prototype.set=bt;var wt=_t;var jt=function(){this.__data__=[],this.size=0};var St=function(t,e){return t===e||t!=t&&e!=e};var Ct=function(t,e){for(var r=t.length;r--;)if(St(t[r][0],e))return r;return-1},Nt=Ct,Ot=Array.prototype.splice;var $t=Ct;var Tt=Ct;var xt=Ct;var Et=jt,At=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Ot.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=$t(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return Tt(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=xt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function kt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}kt.prototype.clear=Et,kt.prototype.delete=At,kt.prototype.get=Mt,kt.prototype.has=Pt,kt.prototype.set=zt;var It=kt,Ft=ot(y,"Map"),Lt=wt,Ut=It,Bt=Ft;var Dt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Rt=function(t,e){var r=t.__data__;return Dt(e)?r["string"==typeof e?"string":"hash"]:r.map},Yt=Rt;var Ht=Rt;var Vt=Rt;var Gt=Rt;var qt=function(){this.size=0,this.__data__={hash:new Lt,map:new(Bt||Ut),string:new Lt}},Zt=function(t){var e=Yt(this,t).delete(t);return this.size-=e?1:0,e},Jt=function(t){return Ht(this,t).get(t)},Kt=function(t){return Vt(this,t).has(t)},Qt=function(t,e){var r=Gt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Wt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Wt.prototype.clear=qt,Wt.prototype.delete=Zt,Wt.prototype.get=Jt,Wt.prototype.has=Kt,Wt.prototype.set=Qt;var Xt=Wt;function te(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(te.Cache||Xt),r}te.Cache=Xt;var ee=te;var re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/\\(\\)?/g,oe=function(t){var e=ee(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(re,(function(t,r,n,o){e.push(n?o.replace(ne,"$1"):r||t)})),e}));var ae=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ie=p,ce=A,se=g?g.prototype:void 0,ue=se?se.toString:void 0;var le=function t(e){if("string"==typeof e)return e;if(ie(e))return ae(e,t)+"";if(ce(e))return ue?ue.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},fe=le;var de=p,pe=I,he=oe,ve=function(t){return null==t?"":fe(t)};var ye=A;var ge=function(t,e){return de(t)?t:pe(t,e)?[t]:he(ve(t))},me=function(t){if("string"==typeof t||ye(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var be=function(t,e){for(var r=0,n=(e=ge(e,t)).length;null!=t&&r<n;)t=t[me(e[r++])];return r&&r==n?t:void 0};var _e=d((function(t,e,r){var n=null==t?void 0:be(t,e);return void 0===n?r:n}));const we={columnIndexCache:new Map,columnNameCache:new Map};function je(t){const e=t.toUpperCase();if(we.columnIndexCache.has(e))return we.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return we.columnIndexCache.set(e,n),n}const Se={getStr(t=[],e,r=""){const n=_e(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=_e(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=_e(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Ce={getStr(t=[],e,r=""){const n=je(e),o=_e(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=je(e),o=_e(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=je(e);if(!Array.isArray(t))return r;const o=_e(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ne=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Oe=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),$e=t=>{const e=Ne(),r=Oe();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};return t.ColumnMapper=Ce,t.IndexMapper=Se,t.StyledLogger=class{static getStyle(t){switch(t){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(t,e="",...r){if(Ne())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=$e,t.convertDigitalSize=(t,e,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{$e("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";const n=t instanceof a.AxiosError&&"object"==typeof t,o=t instanceof Error&&"object"==typeof t;if(n){if(t.response?.data.errors)t.response.data.errors.forEach((t=>{t.message&&(r+=t.message+"\n")}));else{const e=t.response?.data,n="string"==typeof e?l(e):t.response?.data.error.message||t.message||"";r+=n?n+"\n":""}return r.trim()||e}if(o){const n=t.message||"";return r+=n?n+"\n":"",r.trim()||e}return"object"==typeof t?t.errors&&t.errors.forEach((t=>{t.message&&(r+=t.message+"\n")})):r+=l(String(t))+"\n",r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=je,t.getColumnName=function(t){if(we.columnNameCache.has(t))return we.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return we.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=c.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{$e("backend");const t=u.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=je(e);return _e(t,`[${n}]`,r)},t.isBrowser=Ne,t.isNode=Oe,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{$e("backend");const e=s.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if($e("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{$e("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=l,Object.defineProperty(t,"__esModule",{value:!0}),t}({},moment,util,child_process,os,axios);
|
|
1
|
+
var apizum=function(t,e,r,n,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=a(e),c=a(r),s=a(o);const u=t=>t.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=Array.isArray,p="object"==typeof l&&l&&l.Object===Object&&l,h="object"==typeof self&&self&&self.Object===Object&&self,v=p||h||Function("return this")(),y=v.Symbol,g=y,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=g?g.toStringTag:void 0;var j=function(t){var e=b.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=_.call(t);return n&&(e?t[w]=r:delete t[w]),o},S=Object.prototype.toString;var C=j,N=function(t){return S.call(t)},O=y?y.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?C(t):N(t)};var T=$,x=function(t){return null!=t&&"object"==typeof t};var E=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==T(t)},M=d,P=E,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var k=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(A.test(t)||!z.test(t)||null!=e&&t in Object(e))};var I=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=I;var U,B=function(t){if(!L(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=v["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var Y=function(t){return!!R&&R in t},H=Function.prototype.toString;var V=B,G=Y,q=I,Z=function(t){if(null!=t){try{return H.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,tt=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var et=function(t){return!(!q(t)||G(t))&&(V(t)?tt:J).test(Z(t))},rt=function(t,e){return null==t?void 0:t[e]};var nt=function(t,e){var r=rt(t,e);return et(r)?r:void 0},ot=nt(Object,"create"),at=ot;var it=function(){this.__data__=at?at(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},st=ot,ut=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(st){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ut.call(e,t)?e[t]:void 0},ft=ot,dt=Object.prototype.hasOwnProperty;var pt=ot;var ht=it,vt=ct,yt=lt,gt=function(t){var e=this.__data__;return ft?void 0!==e[t]:dt.call(e,t)},mt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=ht,bt.prototype.delete=vt,bt.prototype.get=yt,bt.prototype.has=gt,bt.prototype.set=mt;var _t=bt;var wt=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},Ct=St,Nt=Array.prototype.splice;var Ot=St;var $t=St;var Tt=St;var xt=wt,Et=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return $t(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function At(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}At.prototype.clear=xt,At.prototype.delete=Et,At.prototype.get=Mt,At.prototype.has=Pt,At.prototype.set=zt;var kt=At,It=nt(v,"Map"),Ft=_t,Lt=kt,Ut=It;var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Dt=function(t,e){var r=t.__data__;return Bt(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Dt;var Yt=Dt;var Ht=Dt;var Vt=Dt;var Gt=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ut||Lt),string:new Ft}},qt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},Zt=function(t){return Yt(this,t).get(t)},Jt=function(t){return Ht(this,t).has(t)},Kt=function(t,e){var r=Vt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Qt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qt.prototype.clear=Gt,Qt.prototype.delete=qt,Qt.prototype.get=Zt,Qt.prototype.has=Jt,Qt.prototype.set=Kt;var Wt=Qt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Xt.Cache||Wt),r}Xt.Cache=Wt;var te=Xt;var ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=function(t){var e=te(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ee,(function(t,r,n,o){e.push(n?o.replace(re,"$1"):r||t)})),e}));var oe=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ae=d,ie=E,ce=y?y.prototype:void 0,se=ce?ce.toString:void 0;var ue=function t(e){if("string"==typeof e)return e;if(ae(e))return oe(e,t)+"";if(ie(e))return se?se.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},le=ue;var fe=d,de=k,pe=ne,he=function(t){return null==t?"":le(t)};var ve=E;var ye=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ge=function(t){if("string"==typeof t||ve(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var me=function(t,e){for(var r=0,n=(e=ye(e,t)).length;null!=t&&r<n;)t=t[ge(e[r++])];return r&&r==n?t:void 0};var be=f((function(t,e,r){var n=null==t?void 0:me(t,e);return void 0===n?r:n}));const _e={columnIndexCache:new Map,columnNameCache:new Map};function we(t){const e=t.toUpperCase();if(_e.columnIndexCache.has(e))return _e.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return _e.columnIndexCache.set(e,n),n}const je={getStr(t=[],e,r=""){const n=be(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=be(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=be(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Se={getStr(t=[],e,r=""){const n=we(e),o=be(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=we(e),o=be(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=we(e);if(!Array.isArray(t))return r;const o=be(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ne=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Oe=t=>{const e=Ce(),r=Ne();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};return t.ColumnMapper=Se,t.IndexMapper=je,t.StyledLogger=class{static getStyle(t){switch(t){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(t,e="",...r){if(Ce())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Oe,t.convertDigitalSize=(t,e,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Oe("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";const n=t instanceof Error&&"object"==typeof t;if(n&&be(t,"response.data")&&"object"==typeof t){const n=be(t,"response.data.errors");if(n)(n||[]).forEach((t=>{t.message&&(r+=t.message+"\n")}));else{const e=be(t,"response.data"),n="string"==typeof e?u(e):be(t,"response.data.error.message")||t.message||"";r+=n?n+"\n":""}return r.trim()||e}if(n){const n=t.message||"";return r+=n?n+"\n":"",r.trim()||e}return"object"==typeof t?t.errors&&t.errors.forEach((t=>{t.message&&(r+=t.message+"\n")})):r+=u(String(t))+"\n",r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=we,t.getColumnName=function(t){if(_e.columnNameCache.has(t))return _e.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return _e.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Oe("backend");const t=s.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=we(e);return be(t,`[${n}]`,r)},t.isBrowser=Ce,t.isNode=Ne,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{Oe("backend");const e=c.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if(Oe("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Oe("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=u,Object.defineProperty(t,"__esModule",{value:!0}),t}({},moment,util,child_process,os);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("moment"),require("util"),require("child_process"),require("os"),require("axios")):"function"==typeof define&&define.amd?define(["exports","moment","util","child_process","os","axios"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).apizum={},e.moment,e.util,e.child_process,e.os,e.axios)}(this,(function(e,t,r,n,o,a){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=i(t),s=i(r),u=i(o);const l=e=>e.replace(/<[^>]*>/g,"").trim();var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p=Array.isArray,h="object"==typeof f&&f&&f.Object===Object&&f,y="object"==typeof self&&self&&self.Object===Object&&self,v=h||y||Function("return this")(),g=v.Symbol,m=g,b=Object.prototype,_=b.hasOwnProperty,w=b.toString,j=m?m.toStringTag:void 0;var S=function(e){var t=_.call(e,j),r=e[j];try{e[j]=void 0;var n=!0}catch(e){}var o=w.call(e);return n&&(t?e[j]=r:delete e[j]),o},C=Object.prototype.toString;var N=S,O=function(e){return C.call(e)},x=g?g.toStringTag:void 0;var $=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":x&&x in Object(e)?N(e):O(e)};var T=$,E=function(e){return null!=e&&"object"==typeof e};var A=function(e){return"symbol"==typeof e||E(e)&&"[object Symbol]"==T(e)},M=p,P=A,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/;var I=function(e,t){if(M(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!P(e))||(k.test(e)||!z.test(e)||null!=t&&e in Object(t))};var F=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},L=$,U=F;var B,D=function(e){if(!U(e))return!1;var t=L(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},R=v["__core-js_shared__"],q=(B=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"";var Y=function(e){return!!q&&q in e},H=Function.prototype.toString;var V=D,G=Y,Z=F,J=function(e){if(null!=e){try{return H.call(e)}catch(e){}try{return e+""}catch(e){}}return""},K=/^\[object .+?Constructor\]$/,Q=Function.prototype,W=Object.prototype,X=Q.toString,ee=W.hasOwnProperty,te=RegExp("^"+X.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var re=function(e){return!(!Z(e)||G(e))&&(V(e)?te:K).test(J(e))},ne=function(e,t){return null==e?void 0:e[t]};var oe=function(e,t){var r=ne(e,t);return re(r)?r:void 0},ae=oe(Object,"create"),ie=ae;var ce=function(){this.__data__=ie?ie(null):{},this.size=0};var se=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ue=ae,le=Object.prototype.hasOwnProperty;var fe=function(e){var t=this.__data__;if(ue){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return le.call(t,e)?t[e]:void 0},de=ae,pe=Object.prototype.hasOwnProperty;var he=ae;var ye=ce,ve=se,ge=fe,me=function(e){var t=this.__data__;return de?void 0!==t[e]:pe.call(t,e)},be=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=he&&void 0===t?"__lodash_hash_undefined__":t,this};function _e(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}_e.prototype.clear=ye,_e.prototype.delete=ve,_e.prototype.get=ge,_e.prototype.has=me,_e.prototype.set=be;var we=_e;var je=function(){this.__data__=[],this.size=0};var Se=function(e,t){return e===t||e!=e&&t!=t};var Ce=function(e,t){for(var r=e.length;r--;)if(Se(e[r][0],t))return r;return-1},Ne=Ce,Oe=Array.prototype.splice;var xe=Ce;var $e=Ce;var Te=Ce;var Ee=je,Ae=function(e){var t=this.__data__,r=Ne(t,e);return!(r<0)&&(r==t.length-1?t.pop():Oe.call(t,r,1),--this.size,!0)},Me=function(e){var t=this.__data__,r=xe(t,e);return r<0?void 0:t[r][1]},Pe=function(e){return $e(this.__data__,e)>-1},ze=function(e,t){var r=this.__data__,n=Te(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ke.prototype.clear=Ee,ke.prototype.delete=Ae,ke.prototype.get=Me,ke.prototype.has=Pe,ke.prototype.set=ze;var Ie=ke,Fe=oe(v,"Map"),Le=we,Ue=Ie,Be=Fe;var De=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Re=function(e,t){var r=e.__data__;return De(t)?r["string"==typeof t?"string":"hash"]:r.map},qe=Re;var Ye=Re;var He=Re;var Ve=Re;var Ge=function(){this.size=0,this.__data__={hash:new Le,map:new(Be||Ue),string:new Le}},Ze=function(e){var t=qe(this,e).delete(e);return this.size-=t?1:0,t},Je=function(e){return Ye(this,e).get(e)},Ke=function(e){return He(this,e).has(e)},Qe=function(e,t){var r=Ve(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function We(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}We.prototype.clear=Ge,We.prototype.delete=Ze,We.prototype.get=Je,We.prototype.has=Ke,We.prototype.set=Qe;var Xe=We;function et(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(et.Cache||Xe),r}et.Cache=Xe;var tt=et;var rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/\\(\\)?/g,ot=function(e){var t=tt(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rt,(function(e,r,n,o){t.push(n?o.replace(nt,"$1"):r||e)})),t}));var at=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},it=p,ct=A,st=g?g.prototype:void 0,ut=st?st.toString:void 0;var lt=function e(t){if("string"==typeof t)return t;if(it(t))return at(t,e)+"";if(ct(t))return ut?ut.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},ft=lt;var dt=p,pt=I,ht=ot,yt=function(e){return null==e?"":ft(e)};var vt=A;var gt=function(e,t){return dt(e)?e:pt(e,t)?[e]:ht(yt(e))},mt=function(e){if("string"==typeof e||vt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var bt=function(e,t){for(var r=0,n=(t=gt(t,e)).length;null!=e&&r<n;)e=e[mt(t[r++])];return r&&r==n?e:void 0};var _t=d((function(e,t,r){var n=null==e?void 0:bt(e,t);return void 0===n?r:n}));const wt={columnIndexCache:new Map,columnNameCache:new Map};function jt(e){const t=e.toUpperCase();if(wt.columnIndexCache.has(t))return wt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return wt.columnIndexCache.set(t,n),n}const St={getStr(e=[],t,r=""){const n=_t(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=_t(e,`[${t}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=_t(e,`[${t}]`,r);return"boolean"==typeof n?n:r}},Ct={getStr(e=[],t,r=""){const n=jt(t),o=_t(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=jt(t),o=_t(e,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(e=[],t,r=!1){const n=jt(t);if(!Array.isArray(e))return r;const o=_t(e,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Nt=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ot=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),xt=e=>{const t=Nt(),r=Ot();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r};e.ColumnMapper=Ct,e.IndexMapper=St,e.StyledLogger=class{static getStyle(e){switch(e){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(e,t="",...r){if(Nt())console.log(`%c[${e.toUpperCase()}] ${t}`,this.getStyle(e),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[e]}[${e.toUpperCase()}] ${t}[0m`,...r)}}static info(e,...t){this.log("info",e,...t)}static warn(e,...t){this.log("warn",e,...t)}static error(e,...t){this.log("error",e,...t)}static success(e,...t){this.log("success",e,...t)}static debug(e,...t){this.log("debug",e,...t)}},e.checkEnvironment=xt,e.convertDigitalSize=(e,t,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.copyToClipboard=async e=>{xt("frontend"),await navigator.clipboard.writeText(e)},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(e(...o))}),t),i&&a(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.extractErrorMessage=(e,t="Noma'lum xatolik")=>{if(!e)return t;let r="";const n=e instanceof a.AxiosError&&"object"==typeof e,o=e instanceof Error&&"object"==typeof e;if(n){if(e.response?.data.errors)e.response.data.errors.forEach((e=>{e.message&&(r+=e.message+"\n")}));else{const t=e.response?.data,n="string"==typeof t?l(t):e.response?.data.error.message||e.message||"";r+=n?n+"\n":""}return r.trim()||t}if(o){const n=e.message||"";return r+=n?n+"\n":"",r.trim()||t}return"object"==typeof e?e.errors&&e.errors.forEach((e=>{e.message&&(r+=e.message+"\n")})):r+=l(String(e))+"\n",r.trim()||t},e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatPrice=e=>e.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),e.formatStringToFloat=e=>{(e=(e=e.toString()).replace(/\s/g,"")).includes(",")&&e.includes(".")?e=e.replace(/,/g,""):e.includes(",")&&(e=e.replace(/,/g,"."));const t=Number(e);return isNaN(t)?0:t},e.getColumnIndex=jt,e.getColumnName=function(e){if(wt.columnNameCache.has(e))return wt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return wt.columnNameCache.set(e,t),t},e.getFormattedDate=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=c.default(e);return r.isValid()?r.format(t):""},e.getFunctionName=e=>e.name||null,e.getLocalIP=()=>{xt("backend");const e=u.default.networkInterfaces();for(const t in e)for(const r of e[t]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=jt(t);return _t(e,`[${n}]`,r)},e.isBrowser=Nt,e.isNode=Ot,e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.runCommand=async e=>{xt("backend");const t=s.default.promisify(n.exec),{stdout:r,stderr:o}=await t(e);if(o)throw new Error(o);return r.trim()},e.saveFile=(e,t)=>{if(xt("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},e.scrollToElement=e=>{xt("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=l,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("moment"),require("util"),require("child_process"),require("os")):"function"==typeof define&&define.amd?define(["exports","moment","util","child_process","os"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).apizum={},t.moment,t.util,t.child_process,t.os)}(this,(function(t,e,r,n,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=a(e),c=a(r),s=a(o);const u=t=>t.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=Array.isArray,p="object"==typeof l&&l&&l.Object===Object&&l,h="object"==typeof self&&self&&self.Object===Object&&self,y=p||h||Function("return this")(),v=y.Symbol,g=v,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=g?g.toStringTag:void 0;var j=function(t){var e=b.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=_.call(t);return n&&(e?t[w]=r:delete t[w]),o},S=Object.prototype.toString;var C=j,N=function(t){return S.call(t)},O=v?v.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?C(t):N(t)};var T=$,x=function(t){return null!=t&&"object"==typeof t};var E=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==T(t)},M=d,P=E,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var k=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(A.test(t)||!z.test(t)||null!=e&&t in Object(e))};var I=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=I;var U,B=function(t){if(!L(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=y["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var q=function(t){return!!R&&R in t},Y=Function.prototype.toString;var H=B,V=q,G=I,Z=function(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,tt=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var et=function(t){return!(!G(t)||V(t))&&(H(t)?tt:J).test(Z(t))},rt=function(t,e){return null==t?void 0:t[e]};var nt=function(t,e){var r=rt(t,e);return et(r)?r:void 0},ot=nt(Object,"create"),at=ot;var it=function(){this.__data__=at?at(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},st=ot,ut=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(st){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ut.call(e,t)?e[t]:void 0},ft=ot,dt=Object.prototype.hasOwnProperty;var pt=ot;var ht=it,yt=ct,vt=lt,gt=function(t){var e=this.__data__;return ft?void 0!==e[t]:dt.call(e,t)},mt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=ht,bt.prototype.delete=yt,bt.prototype.get=vt,bt.prototype.has=gt,bt.prototype.set=mt;var _t=bt;var wt=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},Ct=St,Nt=Array.prototype.splice;var Ot=St;var $t=St;var Tt=St;var xt=wt,Et=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return $t(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function At(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}At.prototype.clear=xt,At.prototype.delete=Et,At.prototype.get=Mt,At.prototype.has=Pt,At.prototype.set=zt;var kt=At,It=nt(y,"Map"),Ft=_t,Lt=kt,Ut=It;var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Dt=function(t,e){var r=t.__data__;return Bt(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Dt;var qt=Dt;var Yt=Dt;var Ht=Dt;var Vt=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ut||Lt),string:new Ft}},Gt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},Zt=function(t){return qt(this,t).get(t)},Jt=function(t){return Yt(this,t).has(t)},Kt=function(t,e){var r=Ht(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Qt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qt.prototype.clear=Vt,Qt.prototype.delete=Gt,Qt.prototype.get=Zt,Qt.prototype.has=Jt,Qt.prototype.set=Kt;var Wt=Qt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Xt.Cache||Wt),r}Xt.Cache=Wt;var te=Xt;var ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=function(t){var e=te(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ee,(function(t,r,n,o){e.push(n?o.replace(re,"$1"):r||t)})),e}));var oe=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ae=d,ie=E,ce=v?v.prototype:void 0,se=ce?ce.toString:void 0;var ue=function t(e){if("string"==typeof e)return e;if(ae(e))return oe(e,t)+"";if(ie(e))return se?se.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},le=ue;var fe=d,de=k,pe=ne,he=function(t){return null==t?"":le(t)};var ye=E;var ve=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ge=function(t){if("string"==typeof t||ye(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var me=function(t,e){for(var r=0,n=(e=ve(e,t)).length;null!=t&&r<n;)t=t[ge(e[r++])];return r&&r==n?t:void 0};var be=f((function(t,e,r){var n=null==t?void 0:me(t,e);return void 0===n?r:n}));const _e={columnIndexCache:new Map,columnNameCache:new Map};function we(t){const e=t.toUpperCase();if(_e.columnIndexCache.has(e))return _e.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return _e.columnIndexCache.set(e,n),n}const je={getStr(t=[],e,r=""){const n=be(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=be(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=be(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Se={getStr(t=[],e,r=""){const n=we(e),o=be(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=we(e),o=be(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=we(e);if(!Array.isArray(t))return r;const o=be(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ne=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Oe=t=>{const e=Ce(),r=Ne();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};t.ColumnMapper=Se,t.IndexMapper=je,t.StyledLogger=class{static getStyle(t){switch(t){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(t,e="",...r){if(Ce())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Oe,t.convertDigitalSize=(t,e,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Oe("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";const n=t instanceof Error&&"object"==typeof t;if(n&&be(t,"response.data")&&"object"==typeof t){const n=be(t,"response.data.errors");if(n)(n||[]).forEach((t=>{t.message&&(r+=t.message+"\n")}));else{const e=be(t,"response.data"),n="string"==typeof e?u(e):be(t,"response.data.error.message")||t.message||"";r+=n?n+"\n":""}return r.trim()||e}if(n){const n=t.message||"";return r+=n?n+"\n":"",r.trim()||e}return"object"==typeof t?t.errors&&t.errors.forEach((t=>{t.message&&(r+=t.message+"\n")})):r+=u(String(t))+"\n",r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=we,t.getColumnName=function(t){if(_e.columnNameCache.has(t))return _e.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return _e.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Oe("backend");const t=s.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=we(e);return be(t,`[${n}]`,r)},t.isBrowser=Ce,t.isNode=Ne,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{Oe("backend");const e=c.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if(Oe("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Oe("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=u,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("util"),require("child_process"),require("os");var e=require("./check-environment.js");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("util"),require("child_process"),require("os");var e=require("./check-environment.js");exports.copyToClipboard=async r=>{e.checkEnvironment("frontend"),await navigator.clipboard.writeText(r)};
|
package/lib/cjs/utils/dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("util"),require("child_process"),require("os");var e=require("./check-environment.js");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("util"),require("child_process"),require("os");var e=require("./check-environment.js");exports.scrollToElement=r=>{e.checkEnvironment("frontend");const o=document.querySelector(r);o&&o.scrollIntoView({behavior:"smooth"})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,
|
|
1
|
+
{"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,MA0C/F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash/get"),r=require("./tools.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(e);exports.extractErrorMessage=(e,t="Noma'lum xatolik")=>{if(!e)return t;let o="";const a=e instanceof Error&&"object"==typeof e;if(a&&s.default(e,"response.data")&&"object"==typeof e){const a=s.default(e,"response.data.errors");if(a)(a||[]).forEach((e=>{e.message&&(o+=e.message+"\n")}));else{const t=s.default(e,"response.data"),a="string"==typeof t?r.stripHtmlTags(t):s.default(e,"response.data.error.message")||e.message||"";o+=a?a+"\n":""}return o.trim()||t}if(a){const r=e.message||"";return o+=r?r+"\n":"",o.trim()||t}return"object"==typeof e?e.errors&&e.errors.forEach((e=>{e.message&&(o+=e.message+"\n")})):o+=r.stripHtmlTags(String(e))+"\n",o.trim()||t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("os");require("moment"),require("lodash/get"),require("util"),require("child_process");var r=require("./check-environment.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("os");require("moment"),require("lodash/get"),require("util"),require("child_process");var r=require("./check-environment.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);exports.getLocalIP=()=>{r.checkEnvironment("backend");const e=n.default.networkInterfaces();for(const r in e)for(const t of e[r]||[])if("IPv4"===t.family&&!t.internal)return t.address;return"127.0.0.1"};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("util"),r=require("child_process");require("moment"),require("lodash/get"),require("os");var t=require("./check-environment.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("util"),r=require("child_process");require("moment"),require("lodash/get"),require("os");var t=require("./check-environment.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=i(e);exports.runCommand=async e=>{t.checkEnvironment("backend");const i=n.default.promisify(r.exec),{stdout:o,stderr:u}=await i(e);if(u)throw new Error(u);return o.trim()};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("util"),require("child_process"),require("os");var e=require("./check-environment.js");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("util"),require("child_process"),require("os");var e=require("./check-environment.js");exports.saveFile=(r,o)=>{if(e.checkEnvironment("frontend"),window.navigator){const e=window.URL.createObjectURL(r),t=document.createElement("a");t.style.display="none",t.href=e,t.download=o,document.body.appendChild(t),t.click(),setTimeout((()=>{window.URL.revokeObjectURL(e),document.body.removeChild(t)}),1e3)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("util"),require("child_process"),require("os");var e=require("./check-environment.js");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("util"),require("child_process"),require("os");var e=require("./check-environment.js");exports.StyledLogger=class{static getStyle(e){switch(e){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(r,o="",...t){if(e.isBrowser())console.log(`%c[${r.toUpperCase()}] ${o}`,this.getStyle(r),...t);else{const e={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${e[r]}[${r.toUpperCase()}] ${o}[0m`,...t)}}static info(e,...r){this.log("info",e,...r)}static warn(e,...r){this.log("warn",e,...r)}static error(e,...r){this.log("error",e,...r)}static success(e,...r){this.log("success",e,...r)}static debug(e,...r){this.log("debug",e,...r)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"moment";import"lodash/get";import"util";import"child_process";import"os";import{checkEnvironment as o}from"./check-environment.js";
|
|
1
|
+
import"moment";import"lodash/get";import"util";import"child_process";import"os";import{checkEnvironment as o}from"./check-environment.js";const t=async t=>{o("frontend"),await navigator.clipboard.writeText(t)};export{t as copyToClipboard};
|
package/lib/esm/utils/dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"moment";import"lodash/get";import"util";import"child_process";import"os";import{checkEnvironment as o}from"./check-environment.js";
|
|
1
|
+
import"moment";import"lodash/get";import"util";import"child_process";import"os";import{checkEnvironment as o}from"./check-environment.js";const t=t=>{o("frontend");const r=document.querySelector(t);r&&r.scrollIntoView({behavior:"smooth"})};export{t as scrollToElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,
|
|
1
|
+
{"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,MA0C/F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"lodash/get";import{stripHtmlTags as r}from"./tools.js";const s=(s,o="Noma'lum xatolik")=>{if(!s)return o;let t="";const n=s instanceof Error&&"object"==typeof s;if(n&&e(s,"response.data")&&"object"==typeof s){const n=e(s,"response.data.errors");if(n)(n||[]).forEach((e=>{e.message&&(t+=e.message+"\n")}));else{const o=e(s,"response.data"),n="string"==typeof o?r(o):e(s,"response.data.error.message")||s.message||"";t+=n?n+"\n":""}return t.trim()||o}if(n){const e=s.message||"";return t+=e?e+"\n":"",t.trim()||o}return"object"==typeof s?s.errors&&s.errors.forEach((e=>{e.message&&(t+=e.message+"\n")})):t+=r(String(s))+"\n",t.trim()||o};export{s as extractErrorMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"os";import"moment";import"lodash/get";import"util";import"child_process";import{checkEnvironment as r}from"./check-environment.js";
|
|
1
|
+
import o from"os";import"moment";import"lodash/get";import"util";import"child_process";import{checkEnvironment as r}from"./check-environment.js";const t=()=>{r("backend");const t=o.networkInterfaces();for(const o in t)for(const r of t[o]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"};export{t as getLocalIP};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"util";import{exec as o}from"child_process";import"moment";import"lodash/get";import"os";import{checkEnvironment as t}from"./check-environment.js";const i=async i=>{t("backend");const m=r.promisify(o),{stdout:e,stderr:s}=await m(i);if(s)throw new Error(s);return e.trim()};export{i as runCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"moment";import"lodash/get";import"util";import"child_process";import"os";import{checkEnvironment as o}from"./check-environment.js";
|
|
1
|
+
import"moment";import"lodash/get";import"util";import"child_process";import"os";import{checkEnvironment as o}from"./check-environment.js";const e=(e,t)=>{if(o("frontend"),window.navigator){const o=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=o,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(o),document.body.removeChild(n)}),1e3)}};export{e as saveFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"moment";import"lodash/get";import"util";import"child_process";import"os";import{isBrowser as o}from"./check-environment.js";
|
|
1
|
+
import"moment";import"lodash/get";import"util";import"child_process";import"os";import{isBrowser as o}from"./check-environment.js";class t{static getStyle(o){switch(o){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(t,e="",...r){if(o())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const o={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${o[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(o,...t){this.log("info",o,...t)}static warn(o,...t){this.log("warn",o,...t)}static error(o,...t){this.log("error",o,...t)}static success(o,...t){this.log("success",o,...t)}static debug(o,...t){this.log("debug",o,...t)}}export{t as StyledLogger};
|