@cyberskill/shared 1.210.0 → 1.211.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/config/commitlint/index.cjs +1 -0
- package/dist/config/config.type.cjs +1 -0
- package/dist/config/config.util.cjs +1 -0
- package/dist/config/config.util.js +35 -26
- package/dist/config/env/env.constant.cjs +1 -0
- package/dist/config/env/env.util.cjs +1 -0
- package/dist/config/env/index.cjs +1 -0
- package/dist/config/eslint/index.cjs +1 -0
- package/dist/config/eslint/index.js +12 -4
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js +33 -28
- package/dist/config/graphql-codegen/index.cjs +1 -0
- package/dist/config/index.cjs +1 -0
- package/dist/config/lint-staged/index.cjs +1 -0
- package/dist/config/vitest/index.cjs +1 -0
- package/dist/config/vitest/vitest.e2e.cjs +1 -0
- package/dist/config/vitest/vitest.e2e.js +16 -9
- package/dist/config/vitest/vitest.unit.cjs +1 -0
- package/dist/config/vitest/vitest.unit.js +18 -11
- package/dist/constant/common.cjs +1 -0
- package/dist/constant/common.js +1 -1
- package/dist/constant/index.cjs +1 -0
- package/dist/constant/response-status.cjs +1 -0
- package/dist/node/apollo-server/apollo-server.util.cjs +1 -0
- package/dist/node/apollo-server/apollo-server.util.js +48 -21
- package/dist/node/apollo-server/index.cjs +1 -0
- package/dist/node/cli/index.cjs +6 -0
- package/dist/node/cli/index.js +140 -90
- package/dist/node/command/command.type.cjs +1 -0
- package/dist/node/command/command.util.cjs +2 -0
- package/dist/node/command/command.util.js +148 -117
- package/dist/node/command/index.cjs +1 -0
- package/dist/node/express/express.util.cjs +1 -0
- package/dist/node/express/express.util.js +70 -37
- package/dist/node/express/index.cjs +1 -0
- package/dist/node/fs/fs.util.cjs +1 -0
- package/dist/node/fs/fs.util.js +55 -40
- package/dist/node/fs/index.cjs +1 -0
- package/dist/node/log/index.cjs +1 -0
- package/dist/node/log/log.type.cjs +1 -0
- package/dist/node/log/log.util.cjs +1 -0
- package/dist/node/log/log.util.js +31 -30
- package/dist/node/mongo/index.cjs +1 -0
- package/dist/node/mongo/mongo.constant.cjs +1 -0
- package/dist/node/mongo/mongo.type.cjs +1 -0
- package/dist/node/mongo/mongo.util.cjs +5 -0
- package/dist/node/mongo/mongo.util.js +433 -365
- package/dist/node/package/index.cjs +1 -0
- package/dist/node/package/package.type.cjs +1 -0
- package/dist/node/package/package.util.cjs +1 -0
- package/dist/node/package/package.util.js +224 -195
- package/dist/node/path/index.cjs +1 -0
- package/dist/node/path/path.constant.cjs +1 -0
- package/dist/node/path/path.constant.js +205 -183
- package/dist/node/path/path.util.cjs +1 -0
- package/dist/node/storage/index.cjs +1 -0
- package/dist/node/storage/storage.util.cjs +1 -0
- package/dist/node/storage/storage.util.js +70 -40
- package/dist/node/upload/index.cjs +1 -0
- package/dist/node/upload/upload.type.cjs +1 -0
- package/dist/node/upload/upload.util.cjs +1 -0
- package/dist/node/upload/upload.util.js +119 -91
- package/dist/node/ws/index.cjs +1 -0
- package/dist/node/ws/ts.util.cjs +1 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.13_@vitest_browser@3.2.4_jiti@2.4.2_j_cac3da623d5688a51c0b1a2270e144db/node_modules/vitest/dist/config.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.constant.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.context.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.util.js +74 -64
- package/dist/react/apollo-client/index.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +18 -11
- package/dist/react/apollo-client-nextjs/index.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.component.js +6 -6
- package/dist/react/apollo-error/apollo-error.context.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.hook.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.provider.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.util.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.util.js +1 -1
- package/dist/react/apollo-error/index.cjs +1 -0
- package/dist/react/i18next/i18next.hook.cjs +1 -0
- package/dist/react/i18next/i18next.util.cjs +1 -0
- package/dist/react/i18next/index.cjs +1 -0
- package/dist/react/loading/index.cjs +1 -0
- package/dist/react/loading/loading.component.cjs +6 -0
- package/dist/react/loading/loading.component.js +36 -19
- package/dist/react/loading/loading.context.cjs +1 -0
- package/dist/react/loading/loading.hook.cjs +1 -0
- package/dist/react/loading/loading.module.scss.cjs +1 -0
- package/dist/react/loading/loading.provider.cjs +1 -0
- package/dist/react/log/index.cjs +1 -0
- package/dist/react/log/log.util.cjs +1 -0
- package/dist/react/log/log.util.js +4 -4
- package/dist/react/next-intl/index.cjs +1 -0
- package/dist/react/next-intl/next-intl.constant.cjs +1 -0
- package/dist/react/next-intl/next-intl.context.cjs +1 -0
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -0
- package/dist/react/next-intl/next-intl.hoc.js +23 -14
- package/dist/react/next-intl/next-intl.hook.cjs +1 -0
- package/dist/react/next-intl/next-intl.provider.cjs +1 -0
- package/dist/react/next-intl/next-intl.provider.js +7 -7
- package/dist/react/storage/index.cjs +1 -0
- package/dist/react/storage/storage.hook.cjs +1 -0
- package/dist/react/storage/storage.hook.js +57 -41
- package/dist/react/storage/storage.util.cjs +1 -0
- package/dist/react/storage/storage.util.js +50 -25
- package/dist/react/toast/index.cjs +1 -0
- package/dist/react/userback/index.cjs +1 -0
- package/dist/react/userback/userback.component.cjs +1 -0
- package/dist/react/userback/userback.component.js +42 -18
- package/dist/style.css +1 -1
- package/dist/typescript/common.type.cjs +1 -0
- package/dist/typescript/index.cjs +1 -0
- package/dist/util/common/common.util.cjs +1 -0
- package/dist/util/common/common.util.js +37 -29
- package/dist/util/common/index.cjs +1 -0
- package/dist/util/index.cjs +1 -0
- package/dist/util/object/index.cjs +1 -0
- package/dist/util/object/object.util.cjs +1 -0
- package/dist/util/object/object.util.js +55 -49
- package/dist/util/serializer/index.cjs +1 -0
- package/dist/util/serializer/serializer.util.cjs +1 -0
- package/dist/util/string/index.cjs +1 -0
- package/dist/util/string/string.util.cjs +1 -0
- package/dist/util/string/string.util.js +46 -36
- package/dist/util/validate/index.cjs +1 -0
- package/dist/util/validate/validate.util.cjs +1 -0
- package/package.json +69 -35
|
@@ -1,34 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import m from "clsx";
|
|
2
|
+
import a, { useEffect as d } from "react";
|
|
3
|
+
import l from "./loading.module.scss.js";
|
|
4
|
+
var _ = Object.defineProperty, o = Object.getOwnPropertySymbols, v = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable, f = (e, r, t) => r in e ? _(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, y = (e, r) => {
|
|
5
|
+
for (var t in r || (r = {}))
|
|
6
|
+
v.call(r, t) && f(e, t, r[t]);
|
|
7
|
+
if (o)
|
|
8
|
+
for (var t of o(r))
|
|
9
|
+
u.call(r, t) && f(e, t, r[t]);
|
|
10
|
+
return e;
|
|
11
|
+
}, E = (e, r) => {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var n in e)
|
|
14
|
+
v.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
15
|
+
if (e != null && o)
|
|
16
|
+
for (var n of o(e))
|
|
17
|
+
r.indexOf(n) < 0 && u.call(e, n) && (t[n] = e[n]);
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
function N() {
|
|
5
21
|
if (document.getElementById("noscroll-style"))
|
|
6
22
|
return;
|
|
7
|
-
const
|
|
8
|
-
|
|
23
|
+
const e = document.createElement("style");
|
|
24
|
+
e.id = "noscroll-style", e.innerHTML = `
|
|
9
25
|
.noscroll {
|
|
10
26
|
overflow: hidden !important;
|
|
11
27
|
height: 100vh !important;
|
|
12
28
|
}
|
|
13
|
-
`, document.head.appendChild(
|
|
29
|
+
`, document.head.appendChild(e);
|
|
14
30
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
31
|
+
function b(e) {
|
|
32
|
+
var r = e, { full: t = !1, className: n = "", message: s = "Loading" } = r, p = E(r, ["full", "className", "message"]);
|
|
33
|
+
d(() => {
|
|
34
|
+
if (t) {
|
|
18
35
|
document.body.classList.add("noscroll");
|
|
19
|
-
const
|
|
20
|
-
return document.addEventListener("contextmenu",
|
|
21
|
-
document.body.classList.remove("noscroll"), document.removeEventListener("contextmenu",
|
|
36
|
+
const c = (g) => g.preventDefault();
|
|
37
|
+
return document.addEventListener("contextmenu", c), () => {
|
|
38
|
+
document.body.classList.remove("noscroll"), document.removeEventListener("contextmenu", c);
|
|
22
39
|
};
|
|
23
40
|
}
|
|
24
|
-
}, [
|
|
25
|
-
|
|
41
|
+
}, [t]), d(() => {
|
|
42
|
+
N();
|
|
26
43
|
}, []);
|
|
27
|
-
function
|
|
28
|
-
return /* @__PURE__ */
|
|
44
|
+
function i() {
|
|
45
|
+
return /* @__PURE__ */ a.createElement("div", y({ className: l.container }, p), /* @__PURE__ */ a.createElement("div", { className: l.ring }), /* @__PURE__ */ a.createElement("div", { className: l.ring }), /* @__PURE__ */ a.createElement("div", { className: l.ring }), /* @__PURE__ */ a.createElement("div", { className: l.ring }), s && /* @__PURE__ */ a.createElement("div", { className: l.message }, s));
|
|
29
46
|
}
|
|
30
|
-
return
|
|
47
|
+
return t ? /* @__PURE__ */ a.createElement("div", { className: m(l.full, n) }, i()) : /* @__PURE__ */ a.createElement("div", { className: m(l.block, n) }, i());
|
|
31
48
|
}
|
|
32
49
|
export {
|
|
33
|
-
|
|
50
|
+
b as Loading
|
|
34
51
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),e=t.createContext(void 0);exports.LoadingContext=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),o=require("./loading.context.cjs");function n(){const e=t.use(o.LoadingContext);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}exports.useLoading=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_full_b1d9o_1",o="_block_b1d9o_2",n="_container_b1d9o_40",l="_ring_b1d9o_50",s="_message_b1d9o_74",t={full:e,block:o,container:n,ring:l,message:s};exports.block=o;exports.container=n;exports.default=t;exports.full=e;exports.message=s;exports.ring=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),d=require("./loading.component.cjs"),u=require("./loading.context.cjs");function g({children:l}){const[o,a]=e.useState(!1),[t,n]=e.useState(!1),s=e.useCallback((c=!1)=>{a(!0),n(c)},[]),i=e.useCallback(()=>{a(!1),n(!1)},[]),r=e.useMemo(()=>({isLoading:o,isGlobalLoading:t,showLoading:s,hideLoading:i}),[o,t,s,i]);return e.createElement(u.LoadingContext,{value:r},o?e.createElement(d.Loading,{full:t}):l)}exports.LoadingProvider=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./log.util.cjs");exports.catchError=r.catchError;exports.log=r.log;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("consola/browser"),t=require("../../constant/response-status.cjs"),n={silent:o.consola.silent,level:o.consola.level,fatal:o.consola.fatal,error:o.consola.error,warn:o.consola.warn,log:o.consola.log,info:o.consola.info,success:o.consola.success,ready:o.consola.ready,start:o.consola.start,box:o.consola.box,debug:o.consola.debug,trace:o.consola.trace,verbose:o.consola.verbose};function u(e,a){const{shouldLog:l=!0,returnValue:c,callback:s}=a!=null?a:{},r=e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error");return l&&n.error(r.message),s&&typeof s=="function"&&s(r),c||{success:!1,message:r.message,code:t.RESPONSE_STATUS.INTERNAL_SERVER_ERROR.CODE}}exports.catchError=u;exports.log=n;
|
|
@@ -16,15 +16,15 @@ const l = {
|
|
|
16
16
|
trace: e.trace,
|
|
17
17
|
verbose: e.verbose
|
|
18
18
|
};
|
|
19
|
-
function
|
|
20
|
-
const { shouldLog: n = !0, returnValue:
|
|
21
|
-
return n && l.error(s.message), o && typeof o == "function" && o(s),
|
|
19
|
+
function u(r, t) {
|
|
20
|
+
const { shouldLog: n = !0, returnValue: a, callback: o } = t != null ? t : {}, s = r instanceof Error ? r : new Error(typeof r == "string" ? r : "Unknown error");
|
|
21
|
+
return n && l.error(s.message), o && typeof o == "function" && o(s), a || {
|
|
22
22
|
success: !1,
|
|
23
23
|
message: s.message,
|
|
24
24
|
code: c.INTERNAL_SERVER_ERROR.CODE
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
u as catchError,
|
|
29
29
|
l as log
|
|
30
30
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./next-intl.constant.cjs"),n=require("./next-intl.context.cjs"),r=require("./next-intl.hoc.cjs"),t=require("./next-intl.hook.cjs"),l=require("./next-intl.provider.cjs");exports.NEXT_INTL_DEFAULT_LANGUAGE=e.NEXT_INTL_DEFAULT_LANGUAGE;exports.NextIntlContext=n.NextIntlContext;exports.withNextIntl=r.withNextIntl;exports.useNextIntl=t.useNextIntl;exports.useTranslateNextIntl=t.useTranslateNextIntl;exports.NextIntlProvider=l.NextIntlProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("date-fns/locale"),r={label:"English",value:"en",flag:"🇺🇸",adapterLocale:e.enUS,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};exports.NEXT_INTL_DEFAULT_LANGUAGE=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),e=t.createContext(void 0);exports.NextIntlContext=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("next-intl"),i=require("react"),m=require("./next-intl.constant.cjs"),p=require("./next-intl.hook.cjs"),I=require("../log/log.util.cjs");var N=Object.defineProperty,s=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,c=(r,e,t)=>e in r?N(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,w=(r,e)=>{for(var t in e||(e={}))y.call(e,t)&&c(r,t,e[t]);if(s)for(var t of s(e))P.call(e,t)&&c(r,t,e[t]);return r};function O(r){const e=t=>{var a,o;const{currentLanguage:n}=p.useNextIntl(),{messages:u,languages:g}=t,l="en",v=u[(n==null?void 0:n.value)||l],_=(o=(a=g.find(d=>d.value===(n==null?void 0:n.value)))==null?void 0:a.timezone)!=null?o:m.NEXT_INTL_DEFAULT_LANGUAGE.timezone;return u?i.createElement(f.NextIntlClientProvider,{locale:(n==null?void 0:n.value)||l,messages:v||null,timeZone:_},i.createElement(r,w({},t))):(I.log.warn(`Missing messages for language: ${(n==null?void 0:n.value)||l}`),null)};return e.displayName=`withNextIntl(${r.displayName||r.name||"Component"})`,e}exports.withNextIntl=O;
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import { NextIntlClientProvider as g } from "next-intl";
|
|
2
|
-
import
|
|
3
|
-
import { NEXT_INTL_DEFAULT_LANGUAGE as
|
|
4
|
-
import { useNextIntl as
|
|
2
|
+
import u from "react";
|
|
3
|
+
import { NEXT_INTL_DEFAULT_LANGUAGE as _ } from "./next-intl.constant.js";
|
|
4
|
+
import { useNextIntl as d } from "./next-intl.hook.js";
|
|
5
5
|
import { log as N } from "../log/log.util.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
var P = Object.defineProperty, s = Object.getOwnPropertySymbols, w = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable, m = (t, e, r) => e in t ? P(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, I = (t, e) => {
|
|
7
|
+
for (var r in e || (e = {}))
|
|
8
|
+
w.call(e, r) && m(t, r, e[r]);
|
|
9
|
+
if (s)
|
|
10
|
+
for (var r of s(e))
|
|
11
|
+
y.call(e, r) && m(t, r, e[r]);
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
function b(t) {
|
|
15
|
+
const e = (r) => {
|
|
16
|
+
var a, o;
|
|
17
|
+
const { currentLanguage: n } = d(), { messages: i, languages: f } = r, l = "en", c = i[(n == null ? void 0 : n.value) || l], p = (o = (a = f.find((v) => v.value === (n == null ? void 0 : n.value))) == null ? void 0 : a.timezone) != null ? o : _.timezone;
|
|
18
|
+
return i ? /* @__PURE__ */ u.createElement(
|
|
10
19
|
g,
|
|
11
20
|
{
|
|
12
|
-
locale:
|
|
13
|
-
messages:
|
|
14
|
-
timeZone:
|
|
21
|
+
locale: (n == null ? void 0 : n.value) || l,
|
|
22
|
+
messages: c || null,
|
|
23
|
+
timeZone: p
|
|
15
24
|
},
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
) : (N.warn(`Missing messages for language: ${
|
|
25
|
+
/* @__PURE__ */ u.createElement(t, I({}, r))
|
|
26
|
+
) : (N.warn(`Missing messages for language: ${(n == null ? void 0 : n.value) || l}`), null);
|
|
18
27
|
};
|
|
19
|
-
return
|
|
28
|
+
return e.displayName = `withNextIntl(${t.displayName || t.name || "Component"})`, e;
|
|
20
29
|
}
|
|
21
30
|
export {
|
|
22
|
-
|
|
31
|
+
b as withNextIntl
|
|
23
32
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("next-intl"),n=require("react"),r=require("./next-intl.context.cjs");function s(){const t=n.use(r.NextIntlContext);if(!t)throw new Error("useNextIntl must be used within a NextIntlProvider");return t}const u=e.useTranslations;exports.useNextIntl=s;exports.useTranslateNextIntl=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),l=require("./next-intl.constant.cjs"),c=require("./next-intl.context.cjs"),i=require("./next-intl.hoc.cjs"),s=require("../storage/storage.hook.cjs");function x({children:n}){return e.createElement(e.Fragment,null,n)}const g=i.withNextIntl(x);function I({children:n,languages:t,messages:u}){const{value:r,set:o}=s.useStorage("lang",t[0]),a=e.useMemo(()=>({languages:t,currentLanguage:r!=null?r:l.NEXT_INTL_DEFAULT_LANGUAGE,setCurrentLanguage:o}),[t,o,r]);return e.createElement(c.NextIntlContext,{value:a},e.createElement(g,{languages:t,messages:u},n))}exports.NextIntlProvider=I;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import t, { useMemo as u } from "react";
|
|
2
2
|
import { NEXT_INTL_DEFAULT_LANGUAGE as c } from "./next-intl.constant.js";
|
|
3
|
-
import { NextIntlContext as
|
|
4
|
-
import { withNextIntl as
|
|
5
|
-
import { useStorage as
|
|
3
|
+
import { NextIntlContext as l } from "./next-intl.context.js";
|
|
4
|
+
import { withNextIntl as p } from "./next-intl.hoc.js";
|
|
5
|
+
import { useStorage as i } from "../storage/storage.hook.js";
|
|
6
6
|
function f({ children: r }) {
|
|
7
7
|
return /* @__PURE__ */ t.createElement(t.Fragment, null, r);
|
|
8
8
|
}
|
|
9
|
-
const L =
|
|
9
|
+
const L = p(f);
|
|
10
10
|
function I({
|
|
11
11
|
children: r,
|
|
12
12
|
languages: e,
|
|
13
13
|
messages: a
|
|
14
14
|
}) {
|
|
15
|
-
const { value: n, set: o } =
|
|
16
|
-
() => ({ languages: e, currentLanguage: n
|
|
15
|
+
const { value: n, set: o } = i("lang", e[0]), m = u(
|
|
16
|
+
() => ({ languages: e, currentLanguage: n != null ? n : c, setCurrentLanguage: o }),
|
|
17
17
|
[e, o, n]
|
|
18
18
|
);
|
|
19
|
-
return /* @__PURE__ */ t.createElement(
|
|
19
|
+
return /* @__PURE__ */ t.createElement(l, { value: m }, /* @__PURE__ */ t.createElement(L, { languages: e, messages: a }, r));
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
22
|
I as NextIntlProvider
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./storage.hook.cjs"),r=require("./storage.util.cjs");exports.useStorage=e.useStorage;exports.storage=r.storage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),v=require("./storage.util.cjs"),p=require("../../util/serializer/serializer.util.cjs"),y=require("../log/log.util.cjs");var g=(r,l,t)=>new Promise((u,s)=>{var i=o=>{try{n(t.next(o))}catch(e){s(e)}},d=o=>{try{n(t.throw(o))}catch(e){s(e)}},n=o=>o.done?u(o.value):Promise.resolve(o.value).then(i,d);n((t=t.apply(r,l)).next())});function S(r,l,t=p.serializer){const[u,s]=a.useState(l),[i,d]=a.useState(!1);a.useEffect(()=>{let e=!0;return g(null,null,function*(){try{const f=yield v.storage.get(r);if(e)if(f!==null){const h=t.deserialize(f);s(h)}else if(l!==void 0){const h=t.serialize(l);yield v.storage.set(r,h),s(l)}else s(void 0)}catch(f){y.catchError(f),e&&s(l)}finally{e&&d(!0)}}),()=>{e=!1,d(!1)}},[r,l,t]),a.useEffect(()=>{if(!i)return;g(null,null,function*(){try{if(u!==void 0){const c=t.serialize(u);yield v.storage.set(r,c)}}catch(c){y.catchError(c)}})},[u,r,t,i]);const n=a.useCallback(e=>{s(c=>typeof e=="function"?e(c):e)},[]),o=a.useCallback(()=>g(null,null,function*(){try{yield v.storage.remove(r),s(void 0)}catch(e){y.catchError(e)}}),[r]);return{value:u,set:n,remove:o}}exports.useStorage=S;
|
|
@@ -1,61 +1,77 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { storage as
|
|
3
|
-
import { serializer as
|
|
4
|
-
import { catchError as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { useState as h, useEffect as y, useCallback as z } from "react";
|
|
2
|
+
import { storage as i } from "./storage.util.js";
|
|
3
|
+
import { serializer as E } from "../../util/serializer/serializer.util.js";
|
|
4
|
+
import { catchError as m } from "../log/log.util.js";
|
|
5
|
+
var p = (o, l, t) => new Promise((c, r) => {
|
|
6
|
+
var a = (s) => {
|
|
7
|
+
try {
|
|
8
|
+
u(t.next(s));
|
|
9
|
+
} catch (e) {
|
|
10
|
+
r(e);
|
|
11
|
+
}
|
|
12
|
+
}, f = (s) => {
|
|
13
|
+
try {
|
|
14
|
+
u(t.throw(s));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
r(e);
|
|
17
|
+
}
|
|
18
|
+
}, u = (s) => s.done ? c(s.value) : Promise.resolve(s.value).then(a, f);
|
|
19
|
+
u((t = t.apply(o, l)).next());
|
|
20
|
+
});
|
|
21
|
+
function b(o, l, t = E) {
|
|
22
|
+
const [c, r] = h(l), [a, f] = h(!1);
|
|
23
|
+
y(() => {
|
|
24
|
+
let e = !0;
|
|
25
|
+
return p(null, null, function* () {
|
|
10
26
|
try {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
if (
|
|
14
|
-
const
|
|
15
|
-
r(
|
|
16
|
-
} else if (
|
|
17
|
-
const
|
|
18
|
-
|
|
27
|
+
const d = yield i.get(o);
|
|
28
|
+
if (e)
|
|
29
|
+
if (d !== null) {
|
|
30
|
+
const v = t.deserialize(d);
|
|
31
|
+
r(v);
|
|
32
|
+
} else if (l !== void 0) {
|
|
33
|
+
const v = t.serialize(l);
|
|
34
|
+
yield i.set(o, v), r(l);
|
|
19
35
|
} else
|
|
20
36
|
r(void 0);
|
|
21
|
-
} catch (
|
|
22
|
-
|
|
37
|
+
} catch (d) {
|
|
38
|
+
m(d), e && r(l);
|
|
23
39
|
} finally {
|
|
24
|
-
|
|
40
|
+
e && f(!0);
|
|
25
41
|
}
|
|
26
|
-
})
|
|
27
|
-
|
|
42
|
+
}), () => {
|
|
43
|
+
e = !1, f(!1);
|
|
28
44
|
};
|
|
29
|
-
}, [
|
|
30
|
-
if (!
|
|
45
|
+
}, [o, l, t]), y(() => {
|
|
46
|
+
if (!a)
|
|
31
47
|
return;
|
|
32
|
-
(
|
|
48
|
+
p(null, null, function* () {
|
|
33
49
|
try {
|
|
34
50
|
if (c !== void 0) {
|
|
35
|
-
const
|
|
36
|
-
|
|
51
|
+
const n = t.serialize(c);
|
|
52
|
+
yield i.set(o, n);
|
|
37
53
|
}
|
|
38
|
-
} catch (
|
|
39
|
-
|
|
54
|
+
} catch (n) {
|
|
55
|
+
m(n);
|
|
40
56
|
}
|
|
41
|
-
})
|
|
42
|
-
}, [c,
|
|
43
|
-
const
|
|
44
|
-
(
|
|
57
|
+
});
|
|
58
|
+
}, [c, o, t, a]);
|
|
59
|
+
const u = z(
|
|
60
|
+
(e) => {
|
|
45
61
|
r(
|
|
46
|
-
(
|
|
62
|
+
(n) => typeof e == "function" ? e(n) : e
|
|
47
63
|
);
|
|
48
64
|
},
|
|
49
65
|
[]
|
|
50
|
-
),
|
|
66
|
+
), s = z(() => p(null, null, function* () {
|
|
51
67
|
try {
|
|
52
|
-
|
|
53
|
-
} catch (
|
|
54
|
-
|
|
68
|
+
yield i.remove(o), r(void 0);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
m(e);
|
|
55
71
|
}
|
|
56
|
-
}, [
|
|
57
|
-
return { value: c, set:
|
|
72
|
+
}), [o]);
|
|
73
|
+
return { value: c, set: u, remove: s };
|
|
58
74
|
}
|
|
59
75
|
export {
|
|
60
|
-
|
|
76
|
+
b as useStorage
|
|
61
77
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("localforage"),u=require("../log/log.util.cjs");var c=(r,e,n)=>new Promise((s,i)=>{var y=t=>{try{o(n.next(t))}catch(a){i(a)}},h=t=>{try{o(n.throw(t))}catch(a){i(a)}},o=t=>t.done?s(t.value):Promise.resolve(t.value).then(y,h);o((n=n.apply(r,e)).next())});const v={get(r){return c(this,null,function*(){try{return yield l.getItem(r)}catch(e){return u.catchError(e,{returnValue:null})}})},set(r,e){return c(this,null,function*(){try{yield l.setItem(r,e)}catch(n){u.catchError(n)}})},remove(r){return c(this,null,function*(){try{yield l.removeItem(r)}catch(e){u.catchError(e)}})},keys(){return c(this,null,function*(){try{const r=yield l.keys();return r!=null?r:[]}catch(r){return u.catchError(r,{returnValue:[]})}})}};exports.storage=v;
|
|
@@ -1,35 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { catchError as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import l from "localforage";
|
|
2
|
+
import { catchError as u } from "../log/log.util.js";
|
|
3
|
+
var o = (r, e, n) => new Promise((s, i) => {
|
|
4
|
+
var y = (t) => {
|
|
5
5
|
try {
|
|
6
|
-
|
|
7
|
-
} catch (
|
|
8
|
-
|
|
6
|
+
c(n.next(t));
|
|
7
|
+
} catch (a) {
|
|
8
|
+
i(a);
|
|
9
9
|
}
|
|
10
|
-
},
|
|
11
|
-
async set(r, t) {
|
|
10
|
+
}, h = (t) => {
|
|
12
11
|
try {
|
|
13
|
-
|
|
14
|
-
} catch (
|
|
15
|
-
a
|
|
12
|
+
c(n.throw(t));
|
|
13
|
+
} catch (a) {
|
|
14
|
+
i(a);
|
|
16
15
|
}
|
|
16
|
+
}, c = (t) => t.done ? s(t.value) : Promise.resolve(t.value).then(y, h);
|
|
17
|
+
c((n = n.apply(r, e)).next());
|
|
18
|
+
});
|
|
19
|
+
const f = {
|
|
20
|
+
get(r) {
|
|
21
|
+
return o(this, null, function* () {
|
|
22
|
+
try {
|
|
23
|
+
return yield l.getItem(r);
|
|
24
|
+
} catch (e) {
|
|
25
|
+
return u(e, { returnValue: null });
|
|
26
|
+
}
|
|
27
|
+
});
|
|
17
28
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
set(r, e) {
|
|
30
|
+
return o(this, null, function* () {
|
|
31
|
+
try {
|
|
32
|
+
yield l.setItem(r, e);
|
|
33
|
+
} catch (n) {
|
|
34
|
+
u(n);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
24
37
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
remove(r) {
|
|
39
|
+
return o(this, null, function* () {
|
|
40
|
+
try {
|
|
41
|
+
yield l.removeItem(r);
|
|
42
|
+
} catch (e) {
|
|
43
|
+
u(e);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
keys() {
|
|
48
|
+
return o(this, null, function* () {
|
|
49
|
+
try {
|
|
50
|
+
const r = yield l.keys();
|
|
51
|
+
return r != null ? r : [];
|
|
52
|
+
} catch (r) {
|
|
53
|
+
return u(r, { returnValue: [] });
|
|
54
|
+
}
|
|
55
|
+
});
|
|
31
56
|
}
|
|
32
57
|
};
|
|
33
58
|
export {
|
|
34
|
-
|
|
59
|
+
f as storage
|
|
35
60
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react-hot-toast");Object.defineProperty(exports,"Toaster",{enumerable:!0,get:()=>e.Toaster});Object.defineProperty(exports,"toast",{enumerable:!0,get:()=>e.toast});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./userback.component.cjs");exports.Userback=e.Userback;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@userback/widget"),v=require("react");var s=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,y=(e,a)=>{var r={};for(var t in e)b.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&s)for(var t of s(e))a.indexOf(t)<0&&d.call(e,t)&&(r[t]=e[t]);return r},h=(e,a,r)=>new Promise((t,c)=>{var n=l=>{try{o(r.next(l))}catch(u){c(u)}},i=l=>{try{o(r.throw(l))}catch(u){c(u)}},o=l=>l.done?t(l.value):Promise.resolve(l.value).then(n,i);o((r=r.apply(e,a)).next())});function m({token:e,options:a}){return v.useEffect(()=>{if(!e)return;let r;return h(null,null,function*(){const c=a||{},{hide:n}=c,i=y(c,["hide"]);yield f(e,i),n&&n.length>0&&n.forEach(o=>{document.querySelectorAll(o).forEach(l=>l.remove())}),r=new MutationObserver(()=>{n&&n.length>0&&n.forEach(o=>{document.querySelectorAll(o).forEach(l=>l.remove())})}),r.observe(document.body,{childList:!0,subtree:!0})}),()=>{r==null||r.disconnect()}},[e,a]),null}exports.Userback=m;
|
|
@@ -1,27 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useEffect as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import v from "@userback/widget";
|
|
2
|
+
import { useEffect as s } from "react";
|
|
3
|
+
var u = Object.getOwnPropertySymbols, d = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable, h = (e, o) => {
|
|
4
|
+
var r = {};
|
|
5
|
+
for (var t in e)
|
|
6
|
+
d.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
|
|
7
|
+
if (e != null && u)
|
|
8
|
+
for (var t of u(e))
|
|
9
|
+
o.indexOf(t) < 0 && b.call(e, t) && (r[t] = e[t]);
|
|
10
|
+
return r;
|
|
11
|
+
}, m = (e, o, r) => new Promise((t, c) => {
|
|
12
|
+
var n = (l) => {
|
|
13
|
+
try {
|
|
14
|
+
a(r.next(l));
|
|
15
|
+
} catch (f) {
|
|
16
|
+
c(f);
|
|
17
|
+
}
|
|
18
|
+
}, i = (l) => {
|
|
19
|
+
try {
|
|
20
|
+
a(r.throw(l));
|
|
21
|
+
} catch (f) {
|
|
22
|
+
c(f);
|
|
23
|
+
}
|
|
24
|
+
}, a = (l) => l.done ? t(l.value) : Promise.resolve(l.value).then(n, i);
|
|
25
|
+
a((r = r.apply(e, o)).next());
|
|
26
|
+
});
|
|
27
|
+
function _({ token: e, options: o }) {
|
|
28
|
+
return s(() => {
|
|
29
|
+
if (!e)
|
|
6
30
|
return;
|
|
7
|
-
let
|
|
8
|
-
return (
|
|
9
|
-
const { hide:
|
|
10
|
-
|
|
11
|
-
document.querySelectorAll(
|
|
12
|
-
}),
|
|
13
|
-
|
|
14
|
-
document.querySelectorAll(
|
|
31
|
+
let r;
|
|
32
|
+
return m(null, null, function* () {
|
|
33
|
+
const c = o || {}, { hide: n } = c, i = h(c, ["hide"]);
|
|
34
|
+
yield v(e, i), n && n.length > 0 && n.forEach((a) => {
|
|
35
|
+
document.querySelectorAll(a).forEach((l) => l.remove());
|
|
36
|
+
}), r = new MutationObserver(() => {
|
|
37
|
+
n && n.length > 0 && n.forEach((a) => {
|
|
38
|
+
document.querySelectorAll(a).forEach((l) => l.remove());
|
|
15
39
|
});
|
|
16
|
-
}),
|
|
40
|
+
}), r.observe(document.body, {
|
|
17
41
|
childList: !0,
|
|
18
42
|
subtree: !0
|
|
19
43
|
});
|
|
20
|
-
})
|
|
21
|
-
|
|
44
|
+
}), () => {
|
|
45
|
+
r == null || r.disconnect();
|
|
22
46
|
};
|
|
23
|
-
}, [
|
|
47
|
+
}, [e, o]), null;
|
|
24
48
|
}
|
|
25
49
|
export {
|
|
26
|
-
|
|
50
|
+
_ as Userback
|
|
27
51
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3)
|
|
1
|
+
._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3);backdrop-filter:blur(20px) saturate(200%);display:flex;justify-content:center;align-items:center;width:100%;height:100%;animation:_overlay-fade-in_b1d9o_1 .5s ease-out;border:1.5px solid rgba(255,255,255,.35);box-shadow:0 4px 32px #1f26872e,inset 0 1.5px 8px #ffffff40}._full_b1d9o_1,._block_b1d9o_2{pointer-events:none}._full_b1d9o_1{position:fixed;inset:0}._block_b1d9o_2{position:absolute;width:100%;height:100%;left:50%;top:50%;transform:translate(-50%,-50%);background:#ffffff1a;backdrop-filter:blur(4px)}._container_b1d9o_40{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;padding:1rem;gap:1.5rem;text-align:center}._container_b1d9o_40 ._ring_b1d9o_50{width:clamp(60px,10vw,150px);height:clamp(60px,10vw,150px);border:2px solid transparent;border-radius:50%;position:absolute;transition:transform .3s ease}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(1){border-bottom:8px solid hsl(315,90%,60%);animation:_rotate1_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(2){border-bottom:8px solid hsl(345,90%,50%);animation:_rotate2_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(3){border-bottom:8px solid hsl(180,80%,40%);animation:_rotate3_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(4){border-bottom:8px solid hsl(40,100%,45%);animation:_rotate4_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._message_b1d9o_74{font-weight:700;color:#2f2f37;text-shadow:0 1px 2px rgba(255,255,255,.8);animation:_text-fade_b1d9o_1 2s ease-in-out infinite alternate;word-break:break-word;hyphens:auto}@keyframes _rotate1_b1d9o_1{0%{transform:rotateX(50deg) rotate(110deg)}to{transform:rotateX(50deg) rotate(470deg)}}@keyframes _rotate2_b1d9o_1{0%{transform:rotateX(20deg) rotateY(50deg) rotate(20deg)}to{transform:rotateX(20deg) rotateY(50deg) rotate(380deg)}}@keyframes _rotate3_b1d9o_1{0%{transform:rotateX(40deg) rotateY(130deg) rotate(450deg)}to{transform:rotateX(40deg) rotateY(130deg) rotate(90deg)}}@keyframes _rotate4_b1d9o_1{0%{transform:rotateX(70deg) rotate(270deg)}to{transform:rotateX(70deg) rotate(630deg)}}@keyframes _text-fade_b1d9o_1{0%{opacity:.6}to{opacity:1}}@keyframes _overlay-fade-in_b1d9o_1{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){._ring_b1d9o_50,._message_b1d9o_74,._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{animation:none!important}}._modal-backdrop_8fveh_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22:hover{color:#f87171}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36{font-size:1.75rem;font-weight:700;margin-bottom:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._main_8fveh_72{color:#fca5a5}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._network_8fveh_75{color:#fde68a}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._extra_8fveh_78{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 ul{padding-left:1rem;color:#fda4af;list-style:disc}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.E_Environment=(e=>(e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e))(exports.E_Environment||{});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./common.type.cjs");Object.defineProperty(exports,"E_Environment",{enumerable:!0,get:()=>e.E_Environment});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("unorm"),t=require("../../typescript/common.type.cjs");var m=Object.defineProperty,c=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,a=(e,n,r)=>n in e?m(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,p=(e,n)=>{for(var r in n||(n={}))_.call(n,r)&&a(e,r,n[r]);if(c)for(var r of c(n))O.call(n,r)&&a(e,r,n[r]);return e};const u={a:["à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["è","é","ẹ","ẻ","ẽ","ê","ề","ế","ệ","ể","ễ"],i:["ì","í","ị","ỉ","ĩ"],o:["ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","ý","ỵ","ỷ","ỹ"],d:["đ"]},f=Object.entries(u).reduce((e,[n,r])=>(e[n.toUpperCase()]=r.map(o=>o.toUpperCase()),e),{});function v(e){e=s.nfkc(e);const n=p(p({},u),f);for(const[r,o]of Object.entries(n)){const i=`[${r}${o.join("")}]`,E=`(${[r,...o].join("|")})`;e=e.replace(new RegExp(i,"g"),E)}return e}function l(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}function D(e,n){if(!n)return Array.from(new Set(e));const r=new Set,o=[];for(const i of e){const E=n(i);r.has(E)||(r.add(E),o.push(i))}return o}function N(e){const{NODE_ENV:n=t.E_Environment.DEVELOPMENT,NODE_ENV_MODE:r=t.E_Environment.DEVELOPMENT}=e,o=n===t.E_Environment.DEVELOPMENT&&r===t.E_Environment.DEVELOPMENT,i=n===t.E_Environment.PRODUCTION&&r===t.E_Environment.STAGING,E=n===t.E_Environment.PRODUCTION&&r===t.E_Environment.PRODUCTION;if(n===t.E_Environment.PRODUCTION&&r===t.E_Environment.DEVELOPMENT)throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");return{IS_DEV:o,IS_STAG:i,IS_PROD:E}}exports.mapEnvironment=N;exports.regexSearchMapper=v;exports.removeAccent=l;exports.uniqueArray=D;
|