@cuemath/web-utils 1.0.18 → 1.0.19-beta.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.
@@ -0,0 +1,175 @@
1
+ export declare const CURRENCY_SYMBOL_MAP: {
2
+ AED: string;
3
+ AFN: string;
4
+ ALL: string;
5
+ AMD: string;
6
+ ANG: string;
7
+ AOA: string;
8
+ ARS: string;
9
+ AUD: string;
10
+ AWG: string;
11
+ AZN: string;
12
+ BAM: string;
13
+ BBD: string;
14
+ BDT: string;
15
+ BGN: string;
16
+ BHD: string;
17
+ BIF: string;
18
+ BMD: string;
19
+ BND: string;
20
+ BOB: string;
21
+ BRL: string;
22
+ BSD: string;
23
+ BTC: string;
24
+ BTN: string;
25
+ BWP: string;
26
+ BYR: string;
27
+ BYN: string;
28
+ BZD: string;
29
+ CAD: string;
30
+ CDF: string;
31
+ CHF: string;
32
+ CLP: string;
33
+ CNY: string;
34
+ COP: string;
35
+ CRC: string;
36
+ CUC: string;
37
+ CUP: string;
38
+ CVE: string;
39
+ CZK: string;
40
+ DJF: string;
41
+ DKK: string;
42
+ DOP: string;
43
+ DZD: string;
44
+ EEK: string;
45
+ EGP: string;
46
+ ERN: string;
47
+ ETB: string;
48
+ ETH: string;
49
+ EUR: string;
50
+ FJD: string;
51
+ FKP: string;
52
+ GBP: string;
53
+ GEL: string;
54
+ GGP: string;
55
+ GHC: string;
56
+ GHS: string;
57
+ GIP: string;
58
+ GMD: string;
59
+ GNF: string;
60
+ GTQ: string;
61
+ GYD: string;
62
+ HKD: string;
63
+ HNL: string;
64
+ HRK: string;
65
+ HTG: string;
66
+ HUF: string;
67
+ IDR: string;
68
+ ILS: string;
69
+ IMP: string;
70
+ INR: string;
71
+ IQD: string;
72
+ IRR: string;
73
+ ISK: string;
74
+ JEP: string;
75
+ JMD: string;
76
+ JOD: string;
77
+ JPY: string;
78
+ KES: string;
79
+ KGS: string;
80
+ KHR: string;
81
+ KMF: string;
82
+ KPW: string;
83
+ KRW: string;
84
+ KWD: string;
85
+ KYD: string;
86
+ KZT: string;
87
+ LAK: string;
88
+ LBP: string;
89
+ LKR: string;
90
+ LRD: string;
91
+ LSL: string;
92
+ LTC: string;
93
+ LTL: string;
94
+ LVL: string;
95
+ LYD: string;
96
+ MAD: string;
97
+ MDL: string;
98
+ MGA: string;
99
+ MKD: string;
100
+ MMK: string;
101
+ MNT: string;
102
+ MOP: string;
103
+ MRO: string;
104
+ MRU: string;
105
+ MUR: string;
106
+ MVR: string;
107
+ MWK: string;
108
+ MXN: string;
109
+ MYR: string;
110
+ MZN: string;
111
+ NAD: string;
112
+ NGN: string;
113
+ NIO: string;
114
+ NOK: string;
115
+ NPR: string;
116
+ NZD: string;
117
+ OMR: string;
118
+ PAB: string;
119
+ PEN: string;
120
+ PGK: string;
121
+ PHP: string;
122
+ PKR: string;
123
+ PLN: string;
124
+ PYG: string;
125
+ QAR: string;
126
+ RMB: string;
127
+ RON: string;
128
+ RSD: string;
129
+ RUB: string;
130
+ RWF: string;
131
+ SAR: string;
132
+ SBD: string;
133
+ SCR: string;
134
+ SDG: string;
135
+ SEK: string;
136
+ SGD: string;
137
+ SHP: string;
138
+ SLL: string;
139
+ SOS: string;
140
+ SRD: string;
141
+ SSP: string;
142
+ STD: string;
143
+ STN: string;
144
+ SVC: string;
145
+ SYP: string;
146
+ SZL: string;
147
+ THB: string;
148
+ TJS: string;
149
+ TMT: string;
150
+ TND: string;
151
+ TOP: string;
152
+ TRL: string;
153
+ TRY: string;
154
+ TTD: string;
155
+ TVD: string;
156
+ TWD: string;
157
+ TZS: string;
158
+ UAH: string;
159
+ UGX: string;
160
+ USD: string;
161
+ UYU: string;
162
+ UZS: string;
163
+ VEF: string;
164
+ VND: string;
165
+ VUV: string;
166
+ WST: string;
167
+ XAF: string;
168
+ XBT: string;
169
+ XCD: string;
170
+ XOF: string;
171
+ XPF: string;
172
+ YER: string;
173
+ ZAR: string;
174
+ ZWD: string;
175
+ };
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CURRENCY_SYMBOL_MAP = void 0;
4
+ exports.CURRENCY_SYMBOL_MAP = {
5
+ AED: 'د.إ',
6
+ AFN: '؋',
7
+ ALL: 'L',
8
+ AMD: '֏',
9
+ ANG: 'ƒ',
10
+ AOA: 'Kz',
11
+ ARS: 'AR$',
12
+ AUD: 'AU$',
13
+ AWG: 'ƒ',
14
+ AZN: '₼',
15
+ BAM: 'KM',
16
+ BBD: 'Bds$',
17
+ BDT: '৳',
18
+ BGN: 'лв',
19
+ BHD: '.د.ب',
20
+ BIF: 'FBu',
21
+ BMD: '$',
22
+ BND: 'BN$',
23
+ BOB: '$b',
24
+ BRL: 'R$',
25
+ BSD: 'B$',
26
+ BTC: '฿',
27
+ BTN: 'Nu.',
28
+ BWP: 'P',
29
+ BYR: 'Br',
30
+ BYN: 'Br',
31
+ BZD: 'BZ$',
32
+ CAD: 'CA$',
33
+ CDF: 'FC',
34
+ CHF: 'CHF',
35
+ CLP: '$',
36
+ CNY: '¥',
37
+ COP: 'COL$',
38
+ CRC: '₡',
39
+ CUC: '$',
40
+ CUP: '₱',
41
+ CVE: '$',
42
+ CZK: 'Kč',
43
+ DJF: 'Fdj',
44
+ DKK: 'kr',
45
+ DOP: 'RD$',
46
+ DZD: 'دج',
47
+ EEK: 'kr',
48
+ EGP: 'E£',
49
+ ERN: 'Nfk',
50
+ ETB: 'Br',
51
+ ETH: 'Ξ',
52
+ EUR: '€',
53
+ FJD: 'FJ$',
54
+ FKP: '£',
55
+ GBP: '£',
56
+ GEL: '₾',
57
+ GGP: '£',
58
+ GHC: '₵',
59
+ GHS: 'GH₵',
60
+ GIP: '£',
61
+ GMD: 'D',
62
+ GNF: 'FG',
63
+ GTQ: 'Q',
64
+ GYD: 'G$',
65
+ HKD: 'HK$',
66
+ HNL: 'L',
67
+ HRK: 'kn',
68
+ HTG: 'G',
69
+ HUF: 'Ft',
70
+ IDR: 'Rp',
71
+ ILS: '₪',
72
+ IMP: '£',
73
+ INR: '₹',
74
+ IQD: 'ع.د',
75
+ IRR: '﷼',
76
+ ISK: 'kr',
77
+ JEP: '£',
78
+ JMD: 'J$',
79
+ JOD: 'JD',
80
+ JPY: '¥',
81
+ KES: 'KSh',
82
+ KGS: 'лв',
83
+ KHR: '៛',
84
+ KMF: 'CF',
85
+ KPW: '₩',
86
+ KRW: '₩',
87
+ KWD: 'KD',
88
+ KYD: '$',
89
+ KZT: 'лв',
90
+ LAK: '₭',
91
+ LBP: 'ل.ل',
92
+ LKR: '₨',
93
+ LRD: 'L$',
94
+ LSL: 'M',
95
+ LTC: 'Ł',
96
+ LTL: 'Lt',
97
+ LVL: 'Ls',
98
+ LYD: 'LD',
99
+ MAD: 'MAD',
100
+ MDL: 'lei',
101
+ MGA: 'Ar',
102
+ MKD: 'ден',
103
+ MMK: 'K',
104
+ MNT: '₮',
105
+ MOP: 'MOP$',
106
+ MRO: 'UM',
107
+ MRU: 'UM',
108
+ MUR: '₨',
109
+ MVR: 'Rf',
110
+ MWK: 'MK',
111
+ MXN: 'MX$',
112
+ MYR: 'RM',
113
+ MZN: 'MT',
114
+ NAD: 'N$',
115
+ NGN: '₦',
116
+ NIO: 'C$',
117
+ NOK: 'kr',
118
+ NPR: '₨',
119
+ NZD: 'NZ$',
120
+ OMR: '﷼',
121
+ PAB: 'B/.',
122
+ PEN: 'S/',
123
+ PGK: 'K',
124
+ PHP: '₱',
125
+ PKR: '₨',
126
+ PLN: 'zł',
127
+ PYG: 'Gs',
128
+ QAR: 'ر.ق,',
129
+ RMB: '¥',
130
+ RON: 'lei',
131
+ RSD: 'Дин.',
132
+ RUB: '₽',
133
+ RWF: 'R₣',
134
+ SAR: '﷼',
135
+ SBD: '$',
136
+ SCR: '₨',
137
+ SDG: 'ج.س.',
138
+ SEK: 'kr',
139
+ SGD: 'S$',
140
+ SHP: '£',
141
+ SLL: 'Le',
142
+ SOS: 'Sh.so',
143
+ SRD: '$',
144
+ SSP: '£',
145
+ STD: 'Db',
146
+ STN: 'Db',
147
+ SVC: '₡',
148
+ SYP: '£',
149
+ SZL: 'L',
150
+ THB: '฿',
151
+ TJS: 'SM',
152
+ TMT: 'T',
153
+ TND: 'د.ت',
154
+ TOP: 'T$',
155
+ TRL: '₤',
156
+ TRY: '₺',
157
+ TTD: 'TT$',
158
+ TVD: '$',
159
+ TWD: 'NT$',
160
+ TZS: 'TSh',
161
+ UAH: '₴',
162
+ UGX: 'USh',
163
+ USD: '$',
164
+ UYU: '$U',
165
+ UZS: 'лв',
166
+ VEF: 'Bs',
167
+ VND: '₫',
168
+ VUV: 'VT',
169
+ WST: 'WS$',
170
+ XAF: 'FCFA',
171
+ XBT: 'Ƀ',
172
+ XCD: '$',
173
+ XOF: 'CFA',
174
+ XPF: '₣',
175
+ YER: '﷼',
176
+ ZAR: 'R',
177
+ ZWD: 'Z$',
178
+ };
179
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/constants/currency-symbols/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE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EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;CACV,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const getCookie: (name: string, cookie?: string) => string;
1
+ export declare const getCookie: (name: string, cookie?: string) => string | null;
2
2
  export declare function removeCookie(name: string, subdomain?: boolean): void;
3
3
  export declare function createCookie(name: string, value: string, days: number, subdomain?: boolean): void;
4
4
  export declare function createCookieWithMidnightExp(name: string, value: string): void;
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createCookieWithMidnightExp = exports.createCookie = exports.removeCookie = exports.getCookie = void 0;
4
4
  const getCookie = (name, cookie = document.cookie) => {
5
- if (!cookie) {
6
- return '';
5
+ const isServer = typeof window === 'undefined';
6
+ if (isServer && !cookie) {
7
+ return null;
7
8
  }
8
9
  const cookies = cookie.split('; ');
9
10
  for (let i = 0; i < cookies.length; i += 1) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cookie/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,SAAiB,QAAQ,CAAC,MAAM,EAAU,EAAE;IAClF,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,CAAC;KACX;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QAC1C,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;YACd,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAE3C,IAAI,GAAG,KAAK,IAAI,EAAE;gBAChB,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAlBW,QAAA,SAAS,aAkBpB;AAEF,SAAgB,YAAY,CAAC,IAAY,EAAE,SAAmB;IAC5D,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IAExB,2BAA2B;IAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAExD,SAAS;IACT,QAAQ,CAAC,MAAM,GAAG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AAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1D,OAAO,GAAG,aAAa,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;KAC7C;IACD,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,OAAO,WAC9D,SAAS,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,EACvC,EAAE,CAAC;AACL,CAAC;AAjBD,oCAiBC;AAED,SAAgB,2BAA2B,CAAC,IAAY,EAAE,KAAa;IACrE,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IAExB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,MAAM,OAAO,GAAG,aAAa,IAAI,EAAE,CAAC;IAEpC,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,IAAI,KAAK,GAAG,OAAO,UAAU,CAAC;AACzD,CAAC;AAPD,kEAOC"}
@@ -0,0 +1,2 @@
1
+ declare const loadScript: (url: string, id: string) => Promise<void>;
2
+ export { loadScript };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadScript = void 0;
4
+ const loadScript = (() => {
5
+ const promises = {};
6
+ return (url, id) => {
7
+ if (promises[id] !== null && promises[id] !== undefined) {
8
+ return promises[id];
9
+ }
10
+ promises[id] = new Promise((resolve, reject) => {
11
+ const existingElement = document.querySelector(`#${id}`);
12
+ const head = document.getElementsByTagName('head')[0];
13
+ const script = document.createElement('script');
14
+ script.type = 'text/javascript';
15
+ script.id = id;
16
+ script.src = url;
17
+ script.onload = () => {
18
+ resolve();
19
+ };
20
+ script.onerror = (event) => {
21
+ reject(new Error(`Failed to load ${typeof event === 'string'
22
+ ? event
23
+ : event?.target?.src}`));
24
+ };
25
+ if (existingElement !== null) {
26
+ existingElement.remove();
27
+ }
28
+ head.appendChild(script);
29
+ });
30
+ promises[id]
31
+ ?.then(() => {
32
+ promises[id] = null;
33
+ })
34
+ .catch(() => {
35
+ promises[id] = null;
36
+ });
37
+ return promises[id];
38
+ };
39
+ })();
40
+ exports.loadScript = loadScript;
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/script/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE;IACvB,MAAM,QAAQ,GAA2C,EAAE,CAAC;IAE5D,OAAO,CAAC,GAAW,EAAE,EAAU,EAAiB,EAAE;QAChD,IAAI,QAAQ,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,QAAQ,CAAC,EAAE,CAAC,KAAK,SAAS,EAAE;YACvD,OAAO,QAAQ,CAAC,EAAE,CAAkB,CAAC;SACtC;QAED,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC7C,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACzD,MAAM,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACtD,MAAM,MAAM,GAAsB,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAEnE,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC;YAChC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;YACf,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;YACjB,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE;gBACnB,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC;YACF,MAAM,CAAC,OAAO,GAAG,CAAC,KAAqB,EAAE,EAAE;gBACzC,MAAM,CACJ,IAAI,KAAK,CACP,kBACE,OAAO,KAAK,KAAK,QAAQ;oBACvB,CAAC,CAAC,KAAK;oBACP,CAAC,CAAE,KAAK,EAAE,MAA4B,EAAE,GAC5C,EAAE,CACH,CACF,CAAC;YACJ,CAAC,CAAC;YACF,IAAI,eAAe,KAAK,IAAI,EAAE;gBAC5B,eAAe,CAAC,MAAM,EAAE,CAAC;aAC1B;YAED,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,EAAE,CAAC;YACV,EAAE,IAAI,CAAC,GAAG,EAAE;YACV,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,CAAC;QAEL,OAAO,QAAQ,CAAC,EAAE,CAAkB,CAAC;IACvC,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAEI,gCAAU"}
@@ -0,0 +1,3 @@
1
+ export function parseURLParams(inpURL: any): {
2
+ [k: string]: string;
3
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseURLParams = void 0;
4
+ const parseURLParams = inpURL => {
5
+ const url = new URL(inpURL);
6
+ const params = new URLSearchParams(url.search);
7
+ return Object.fromEntries(params);
8
+ };
9
+ exports.parseURLParams = parseURLParams;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/url/index.js"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE;IACrC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE/C,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AALW,QAAA,cAAc,kBAKzB"}
@@ -0,0 +1,175 @@
1
+ export declare const CURRENCY_SYMBOL_MAP: {
2
+ AED: string;
3
+ AFN: string;
4
+ ALL: string;
5
+ AMD: string;
6
+ ANG: string;
7
+ AOA: string;
8
+ ARS: string;
9
+ AUD: string;
10
+ AWG: string;
11
+ AZN: string;
12
+ BAM: string;
13
+ BBD: string;
14
+ BDT: string;
15
+ BGN: string;
16
+ BHD: string;
17
+ BIF: string;
18
+ BMD: string;
19
+ BND: string;
20
+ BOB: string;
21
+ BRL: string;
22
+ BSD: string;
23
+ BTC: string;
24
+ BTN: string;
25
+ BWP: string;
26
+ BYR: string;
27
+ BYN: string;
28
+ BZD: string;
29
+ CAD: string;
30
+ CDF: string;
31
+ CHF: string;
32
+ CLP: string;
33
+ CNY: string;
34
+ COP: string;
35
+ CRC: string;
36
+ CUC: string;
37
+ CUP: string;
38
+ CVE: string;
39
+ CZK: string;
40
+ DJF: string;
41
+ DKK: string;
42
+ DOP: string;
43
+ DZD: string;
44
+ EEK: string;
45
+ EGP: string;
46
+ ERN: string;
47
+ ETB: string;
48
+ ETH: string;
49
+ EUR: string;
50
+ FJD: string;
51
+ FKP: string;
52
+ GBP: string;
53
+ GEL: string;
54
+ GGP: string;
55
+ GHC: string;
56
+ GHS: string;
57
+ GIP: string;
58
+ GMD: string;
59
+ GNF: string;
60
+ GTQ: string;
61
+ GYD: string;
62
+ HKD: string;
63
+ HNL: string;
64
+ HRK: string;
65
+ HTG: string;
66
+ HUF: string;
67
+ IDR: string;
68
+ ILS: string;
69
+ IMP: string;
70
+ INR: string;
71
+ IQD: string;
72
+ IRR: string;
73
+ ISK: string;
74
+ JEP: string;
75
+ JMD: string;
76
+ JOD: string;
77
+ JPY: string;
78
+ KES: string;
79
+ KGS: string;
80
+ KHR: string;
81
+ KMF: string;
82
+ KPW: string;
83
+ KRW: string;
84
+ KWD: string;
85
+ KYD: string;
86
+ KZT: string;
87
+ LAK: string;
88
+ LBP: string;
89
+ LKR: string;
90
+ LRD: string;
91
+ LSL: string;
92
+ LTC: string;
93
+ LTL: string;
94
+ LVL: string;
95
+ LYD: string;
96
+ MAD: string;
97
+ MDL: string;
98
+ MGA: string;
99
+ MKD: string;
100
+ MMK: string;
101
+ MNT: string;
102
+ MOP: string;
103
+ MRO: string;
104
+ MRU: string;
105
+ MUR: string;
106
+ MVR: string;
107
+ MWK: string;
108
+ MXN: string;
109
+ MYR: string;
110
+ MZN: string;
111
+ NAD: string;
112
+ NGN: string;
113
+ NIO: string;
114
+ NOK: string;
115
+ NPR: string;
116
+ NZD: string;
117
+ OMR: string;
118
+ PAB: string;
119
+ PEN: string;
120
+ PGK: string;
121
+ PHP: string;
122
+ PKR: string;
123
+ PLN: string;
124
+ PYG: string;
125
+ QAR: string;
126
+ RMB: string;
127
+ RON: string;
128
+ RSD: string;
129
+ RUB: string;
130
+ RWF: string;
131
+ SAR: string;
132
+ SBD: string;
133
+ SCR: string;
134
+ SDG: string;
135
+ SEK: string;
136
+ SGD: string;
137
+ SHP: string;
138
+ SLL: string;
139
+ SOS: string;
140
+ SRD: string;
141
+ SSP: string;
142
+ STD: string;
143
+ STN: string;
144
+ SVC: string;
145
+ SYP: string;
146
+ SZL: string;
147
+ THB: string;
148
+ TJS: string;
149
+ TMT: string;
150
+ TND: string;
151
+ TOP: string;
152
+ TRL: string;
153
+ TRY: string;
154
+ TTD: string;
155
+ TVD: string;
156
+ TWD: string;
157
+ TZS: string;
158
+ UAH: string;
159
+ UGX: string;
160
+ USD: string;
161
+ UYU: string;
162
+ UZS: string;
163
+ VEF: string;
164
+ VND: string;
165
+ VUV: string;
166
+ WST: string;
167
+ XAF: string;
168
+ XBT: string;
169
+ XCD: string;
170
+ XOF: string;
171
+ XPF: string;
172
+ YER: string;
173
+ ZAR: string;
174
+ ZWD: string;
175
+ };
@@ -0,0 +1,176 @@
1
+ export const CURRENCY_SYMBOL_MAP = {
2
+ AED: 'د.إ',
3
+ AFN: '؋',
4
+ ALL: 'L',
5
+ AMD: '֏',
6
+ ANG: 'ƒ',
7
+ AOA: 'Kz',
8
+ ARS: 'AR$',
9
+ AUD: 'AU$',
10
+ AWG: 'ƒ',
11
+ AZN: '₼',
12
+ BAM: 'KM',
13
+ BBD: 'Bds$',
14
+ BDT: '৳',
15
+ BGN: 'лв',
16
+ BHD: '.د.ب',
17
+ BIF: 'FBu',
18
+ BMD: '$',
19
+ BND: 'BN$',
20
+ BOB: '$b',
21
+ BRL: 'R$',
22
+ BSD: 'B$',
23
+ BTC: '฿',
24
+ BTN: 'Nu.',
25
+ BWP: 'P',
26
+ BYR: 'Br',
27
+ BYN: 'Br',
28
+ BZD: 'BZ$',
29
+ CAD: 'CA$',
30
+ CDF: 'FC',
31
+ CHF: 'CHF',
32
+ CLP: '$',
33
+ CNY: '¥',
34
+ COP: 'COL$',
35
+ CRC: '₡',
36
+ CUC: '$',
37
+ CUP: '₱',
38
+ CVE: '$',
39
+ CZK: 'Kč',
40
+ DJF: 'Fdj',
41
+ DKK: 'kr',
42
+ DOP: 'RD$',
43
+ DZD: 'دج',
44
+ EEK: 'kr',
45
+ EGP: 'E£',
46
+ ERN: 'Nfk',
47
+ ETB: 'Br',
48
+ ETH: 'Ξ',
49
+ EUR: '€',
50
+ FJD: 'FJ$',
51
+ FKP: '£',
52
+ GBP: '£',
53
+ GEL: '₾',
54
+ GGP: '£',
55
+ GHC: '₵',
56
+ GHS: 'GH₵',
57
+ GIP: '£',
58
+ GMD: 'D',
59
+ GNF: 'FG',
60
+ GTQ: 'Q',
61
+ GYD: 'G$',
62
+ HKD: 'HK$',
63
+ HNL: 'L',
64
+ HRK: 'kn',
65
+ HTG: 'G',
66
+ HUF: 'Ft',
67
+ IDR: 'Rp',
68
+ ILS: '₪',
69
+ IMP: '£',
70
+ INR: '₹',
71
+ IQD: 'ع.د',
72
+ IRR: '﷼',
73
+ ISK: 'kr',
74
+ JEP: '£',
75
+ JMD: 'J$',
76
+ JOD: 'JD',
77
+ JPY: '¥',
78
+ KES: 'KSh',
79
+ KGS: 'лв',
80
+ KHR: '៛',
81
+ KMF: 'CF',
82
+ KPW: '₩',
83
+ KRW: '₩',
84
+ KWD: 'KD',
85
+ KYD: '$',
86
+ KZT: 'лв',
87
+ LAK: '₭',
88
+ LBP: 'ل.ل',
89
+ LKR: '₨',
90
+ LRD: 'L$',
91
+ LSL: 'M',
92
+ LTC: 'Ł',
93
+ LTL: 'Lt',
94
+ LVL: 'Ls',
95
+ LYD: 'LD',
96
+ MAD: 'MAD',
97
+ MDL: 'lei',
98
+ MGA: 'Ar',
99
+ MKD: 'ден',
100
+ MMK: 'K',
101
+ MNT: '₮',
102
+ MOP: 'MOP$',
103
+ MRO: 'UM',
104
+ MRU: 'UM',
105
+ MUR: '₨',
106
+ MVR: 'Rf',
107
+ MWK: 'MK',
108
+ MXN: 'MX$',
109
+ MYR: 'RM',
110
+ MZN: 'MT',
111
+ NAD: 'N$',
112
+ NGN: '₦',
113
+ NIO: 'C$',
114
+ NOK: 'kr',
115
+ NPR: '₨',
116
+ NZD: 'NZ$',
117
+ OMR: '﷼',
118
+ PAB: 'B/.',
119
+ PEN: 'S/',
120
+ PGK: 'K',
121
+ PHP: '₱',
122
+ PKR: '₨',
123
+ PLN: 'zł',
124
+ PYG: 'Gs',
125
+ QAR: 'ر.ق,',
126
+ RMB: '¥',
127
+ RON: 'lei',
128
+ RSD: 'Дин.',
129
+ RUB: '₽',
130
+ RWF: 'R₣',
131
+ SAR: '﷼',
132
+ SBD: '$',
133
+ SCR: '₨',
134
+ SDG: 'ج.س.',
135
+ SEK: 'kr',
136
+ SGD: 'S$',
137
+ SHP: '£',
138
+ SLL: 'Le',
139
+ SOS: 'Sh.so',
140
+ SRD: '$',
141
+ SSP: '£',
142
+ STD: 'Db',
143
+ STN: 'Db',
144
+ SVC: '₡',
145
+ SYP: '£',
146
+ SZL: 'L',
147
+ THB: '฿',
148
+ TJS: 'SM',
149
+ TMT: 'T',
150
+ TND: 'د.ت',
151
+ TOP: 'T$',
152
+ TRL: '₤',
153
+ TRY: '₺',
154
+ TTD: 'TT$',
155
+ TVD: '$',
156
+ TWD: 'NT$',
157
+ TZS: 'TSh',
158
+ UAH: '₴',
159
+ UGX: 'USh',
160
+ USD: '$',
161
+ UYU: '$U',
162
+ UZS: 'лв',
163
+ VEF: 'Bs',
164
+ VND: '₫',
165
+ VUV: 'VT',
166
+ WST: 'WS$',
167
+ XAF: 'FCFA',
168
+ XBT: 'Ƀ',
169
+ XCD: '$',
170
+ XOF: 'CFA',
171
+ XPF: '₣',
172
+ YER: '﷼',
173
+ ZAR: 'R',
174
+ ZWD: 'Z$',
175
+ };
176
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/constants/currency-symbols/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,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GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;CACV,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const getCookie: (name: string, cookie?: string) => string;
1
+ export declare const getCookie: (name: string, cookie?: string) => string | null;
2
2
  export declare function removeCookie(name: string, subdomain?: boolean): void;
3
3
  export declare function createCookie(name: string, value: string, days: number, subdomain?: boolean): void;
4
4
  export declare function createCookieWithMidnightExp(name: string, value: string): void;
@@ -1,6 +1,7 @@
1
1
  export const getCookie = (name, cookie = document.cookie) => {
2
- if (!cookie) {
3
- return '';
2
+ const isServer = typeof window === 'undefined';
3
+ if (isServer && !cookie) {
4
+ return null;
4
5
  }
5
6
  const cookies = cookie.split('; ');
6
7
  for (let i = 0; i < cookies.length; i += 1) {
@@ -1 +1 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rE,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IAExB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,MAAM,OAAO,GAAG,aAAa,IAAI,EAAE,CAAC;IAEpC,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,IAAI,KAAK,GAAG,OAAO,UAAU,CAAC;AACzD,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare const loadScript: (url: string, id: string) => Promise<void>;
2
+ export { loadScript };
@@ -0,0 +1,38 @@
1
+ const loadScript = (() => {
2
+ const promises = {};
3
+ return (url, id) => {
4
+ var _a;
5
+ if (promises[id] !== null && promises[id] !== undefined) {
6
+ return promises[id];
7
+ }
8
+ promises[id] = new Promise((resolve, reject) => {
9
+ const existingElement = document.querySelector(`#${id}`);
10
+ const head = document.getElementsByTagName('head')[0];
11
+ const script = document.createElement('script');
12
+ script.type = 'text/javascript';
13
+ script.id = id;
14
+ script.src = url;
15
+ script.onload = () => {
16
+ resolve();
17
+ };
18
+ script.onerror = (event) => {
19
+ var _a;
20
+ reject(new Error(`Failed to load ${typeof event === 'string'
21
+ ? event
22
+ : (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.src}`));
23
+ };
24
+ if (existingElement !== null) {
25
+ existingElement.remove();
26
+ }
27
+ head.appendChild(script);
28
+ });
29
+ (_a = promises[id]) === null || _a === void 0 ? void 0 : _a.then(() => {
30
+ promises[id] = null;
31
+ }).catch(() => {
32
+ promises[id] = null;
33
+ });
34
+ return promises[id];
35
+ };
36
+ })();
37
+ export { loadScript };
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/script/index.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE;IACvB,MAAM,QAAQ,GAA2C,EAAE,CAAC;IAE5D,OAAO,CAAC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C,EAAE,CAAC,GAAG,IAAI,CAAC;QACtB,CAAC,EACA,KAAK,CAAC,GAAG,EAAE;YACV,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,CAAC;QAEL,OAAO,QAAQ,CAAC,EAAE,CAAkB,CAAC;IACvC,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAEL,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export function parseURLParams(inpURL: any): {
2
+ [k: string]: string;
3
+ };
@@ -0,0 +1,6 @@
1
+ export const parseURLParams = inpURL => {
2
+ const url = new URL(inpURL);
3
+ const params = new URLSearchParams(url.search);
4
+ return Object.fromEntries(params);
5
+ };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/url/index.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE;IACrC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE/C,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/web-utils",
3
- "version": "1.0.18",
3
+ "version": "1.0.19-beta.0",
4
4
  "description": "Shared web utils package",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",