@yangsaiyam/helper 1.12.1 → 1.12.3

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.
Files changed (98) hide show
  1. package/dist/index.cjs +786 -0
  2. package/dist/index.d.cts +655 -0
  3. package/dist/index.d.ts +655 -17
  4. package/dist/index.js +703 -17
  5. package/package.json +13 -6
  6. package/dist/addressess/index.d.ts +0 -137
  7. package/dist/addressess/index.js +0 -24
  8. package/dist/addressess/index.test.d.ts +0 -1
  9. package/dist/addressess/index.test.js +0 -16
  10. package/dist/assessment-question/index.d.ts +0 -19
  11. package/dist/assessment-question/index.js +0 -22
  12. package/dist/assessment-question/index.test.d.ts +0 -1
  13. package/dist/assessment-question/index.test.js +0 -27
  14. package/dist/career/index.d.ts +0 -132
  15. package/dist/career/index.js +0 -40
  16. package/dist/contact-form/index.d.ts +0 -13
  17. package/dist/contact-form/index.js +0 -13
  18. package/dist/email-history/index.d.ts +0 -17
  19. package/dist/email-history/index.js +0 -6
  20. package/dist/email-template/index.d.ts +0 -13
  21. package/dist/email-template/index.js +0 -5
  22. package/dist/files/index.d.ts +0 -18
  23. package/dist/files/index.js +0 -8
  24. package/dist/job-applications/index.d.ts +0 -33
  25. package/dist/job-applications/index.js +0 -10
  26. package/dist/locale/index.d.ts +0 -9
  27. package/dist/locale/index.js +0 -4
  28. package/dist/roles/index.d.ts +0 -61
  29. package/dist/roles/index.js +0 -170
  30. package/dist/roles/index.test.d.ts +0 -1
  31. package/dist/roles/index.test.js +0 -80
  32. package/dist/routes/index.d.ts +0 -80
  33. package/dist/routes/index.js +0 -106
  34. package/dist/routes/index.test.d.ts +0 -1
  35. package/dist/routes/index.test.js +0 -92
  36. package/dist/shared/helpers.d.ts +0 -5
  37. package/dist/shared/helpers.js +0 -15
  38. package/dist/shared/types.d.ts +0 -5
  39. package/dist/shared/types.js +0 -1
  40. package/dist/src/addressess/index.d.ts +0 -137
  41. package/dist/src/addressess/index.js +0 -24
  42. package/dist/src/addressess/index.test.d.ts +0 -1
  43. package/dist/src/addressess/index.test.js +0 -16
  44. package/dist/src/assessment-question/index.d.ts +0 -19
  45. package/dist/src/assessment-question/index.js +0 -22
  46. package/dist/src/assessment-question/index.test.d.ts +0 -1
  47. package/dist/src/assessment-question/index.test.js +0 -27
  48. package/dist/src/career/index.d.ts +0 -132
  49. package/dist/src/career/index.js +0 -40
  50. package/dist/src/contact-form/index.d.ts +0 -13
  51. package/dist/src/contact-form/index.js +0 -13
  52. package/dist/src/email-template/index.d.ts +0 -13
  53. package/dist/src/email-template/index.js +0 -5
  54. package/dist/src/files/index.d.ts +0 -18
  55. package/dist/src/files/index.js +0 -8
  56. package/dist/src/index.d.ts +0 -16
  57. package/dist/src/index.js +0 -16
  58. package/dist/src/job-applications/index.d.ts +0 -33
  59. package/dist/src/job-applications/index.js +0 -10
  60. package/dist/src/locale/index.d.ts +0 -9
  61. package/dist/src/locale/index.js +0 -4
  62. package/dist/src/roles/index.d.ts +0 -61
  63. package/dist/src/roles/index.js +0 -170
  64. package/dist/src/roles/index.test.d.ts +0 -1
  65. package/dist/src/roles/index.test.js +0 -80
  66. package/dist/src/routes/index.d.ts +0 -80
  67. package/dist/src/routes/index.js +0 -106
  68. package/dist/src/routes/index.test.d.ts +0 -1
  69. package/dist/src/routes/index.test.js +0 -92
  70. package/dist/src/shared/helpers.d.ts +0 -5
  71. package/dist/src/shared/helpers.js +0 -15
  72. package/dist/src/shared/types.d.ts +0 -5
  73. package/dist/src/shared/types.js +0 -1
  74. package/dist/src/time/index.d.ts +0 -73
  75. package/dist/src/time/index.js +0 -161
  76. package/dist/src/time/index.test.d.ts +0 -1
  77. package/dist/src/time/index.test.js +0 -35
  78. package/dist/src/track/index.d.ts +0 -17
  79. package/dist/src/track/index.js +0 -14
  80. package/dist/src/track/index.test.d.ts +0 -1
  81. package/dist/src/track/index.test.js +0 -7
  82. package/dist/src/url-prefix/index.d.ts +0 -8
  83. package/dist/src/url-prefix/index.js +0 -9
  84. package/dist/src/website/index.d.ts +0 -16
  85. package/dist/src/website/index.js +0 -17
  86. package/dist/time/index.d.ts +0 -73
  87. package/dist/time/index.js +0 -161
  88. package/dist/time/index.test.d.ts +0 -1
  89. package/dist/time/index.test.js +0 -35
  90. package/dist/track/index.d.ts +0 -17
  91. package/dist/track/index.js +0 -14
  92. package/dist/track/index.test.d.ts +0 -1
  93. package/dist/track/index.test.js +0 -7
  94. package/dist/url-prefix/index.d.ts +0 -8
  95. package/dist/url-prefix/index.js +0 -9
  96. package/dist/website/index.d.ts +0 -16
  97. package/dist/website/index.js +0 -17
  98. package/src/index.js +0 -16
package/dist/index.cjs ADDED
@@ -0,0 +1,786 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ ASSESSMENT_QUESTION_TYPE: () => ASSESSMENT_QUESTION_TYPE,
34
+ CAREER_CATEGORY: () => CAREER_CATEGORY,
35
+ CAREER_JOB_TYPE: () => CAREER_JOB_TYPE,
36
+ CAREER_LOCATION: () => CAREER_LOCATION,
37
+ CAREER_MODE: () => CAREER_MODE,
38
+ CONTACT_FORM_ENQUIRY_TYPE: () => CONTACT_FORM_ENQUIRY_TYPE,
39
+ COUNTRY_CODE: () => COUNTRY_CODE,
40
+ EMAIL_HISTORY_STATUS: () => EMAIL_HISTORY_STATUS,
41
+ EMAIL_TEMPLATE_ROLES: () => EMAIL_TEMPLATE_ROLES,
42
+ FILE_ORIGIN: () => FILE_ORIGIN,
43
+ FILE_STATUS: () => FILE_STATUS,
44
+ JOB_APPLICATION_STATUS: () => JOB_APPLICATION_STATUS,
45
+ LOCALE: () => LOCALE,
46
+ MALAYSIA_STATE: () => MALAYSIA_STATE,
47
+ ORIGIN: () => ORIGIN,
48
+ PERMISSION_I18N_KEY: () => PERMISSION_I18N_KEY,
49
+ Permission: () => Permission,
50
+ QuestionType: () => QuestionType,
51
+ ROLE: () => ROLE,
52
+ ROLE_MAP: () => ROLE_MAP,
53
+ ROLE_PERMISSIONS: () => ROLE_PERMISSIONS,
54
+ ROUTE: () => ROUTE,
55
+ ROUTES: () => ROUTES,
56
+ STATES: () => STATES,
57
+ TIMEZONE: () => TIMEZONE,
58
+ TIMEZONE_CURRENT_UTC_OFFSET: () => TIMEZONE_CURRENT_UTC_OFFSET,
59
+ TIMEZONE_TO_UTC: () => TIMEZONE_TO_UTC,
60
+ URL_PREFIXES: () => URL_PREFIXES,
61
+ WEBSITES: () => WEBSITES,
62
+ Website: () => Website2,
63
+ buildLocalizedRoute: () => buildLocalizedRoute,
64
+ buildRoutePathName: () => buildRoutePathName,
65
+ convertTimestampToTimezone: () => convertTimestampToTimezone,
66
+ getI18nKeyByKey: () => getI18nKeyByKey,
67
+ getLabelByKey: () => getLabelByKey,
68
+ getOptionByKey: () => getOptionByKey,
69
+ hasPermission: () => hasPermission,
70
+ normalizeRole: () => normalizeRole,
71
+ normalizeTimezone: () => normalizeTimezone,
72
+ permissionLabelKey: () => permissionLabelKey,
73
+ roleLabelKey: () => roleLabelKey,
74
+ roleToId: () => roleToId,
75
+ routeLabelKey: () => routeLabelKey,
76
+ routePathKey: () => routePathKey,
77
+ timezoneLabelKey: () => timezoneLabelKey,
78
+ timezoneToUtc: () => timezoneToUtc,
79
+ toRecord: () => toRecord
80
+ });
81
+ module.exports = __toCommonJS(index_exports);
82
+
83
+ // src/assessment-question/index.js
84
+ var QuestionType = {
85
+ Subjective: 1,
86
+ Objective: 2,
87
+ MultipleChoice: 3
88
+ };
89
+ var ASSESSMENT_QUESTION_TYPE = [
90
+ {
91
+ key: QuestionType.Subjective,
92
+ value: "Subjective",
93
+ i18nKey: "assessmentQuestion.questionType.1"
94
+ },
95
+ {
96
+ key: QuestionType.Objective,
97
+ value: "Objective",
98
+ i18nKey: "assessmentQuestion.questionType.2"
99
+ },
100
+ {
101
+ key: QuestionType.MultipleChoice,
102
+ value: "MultipleChoice",
103
+ i18nKey: "assessmentQuestion.questionType.3"
104
+ }
105
+ ];
106
+
107
+ // src/career/index.js
108
+ var CAREER_JOB_TYPE = [
109
+ { key: 1, value: "Full-time", i18nKey: "career.jobType.1" },
110
+ { key: 2, value: "Part-time", i18nKey: "career.jobType.2" },
111
+ { key: 3, value: "Contract", i18nKey: "career.jobType.3" },
112
+ { key: 4, value: "Internship", i18nKey: "career.jobType.4" }
113
+ ];
114
+ var CAREER_CATEGORY = [
115
+ { key: 1, value: "Technology", i18nKey: "career.category.1" },
116
+ { key: 2, value: "Design", i18nKey: "career.category.2" },
117
+ { key: 3, value: "Business", i18nKey: "career.category.3" },
118
+ { key: 4, value: "Marketing", i18nKey: "career.category.4" },
119
+ { key: 5, value: "Operations", i18nKey: "career.category.5" },
120
+ { key: 6, value: "Finance", i18nKey: "career.category.6" },
121
+ { key: 7, value: "Human Resources", i18nKey: "career.category.7" },
122
+ { key: 8, value: "Legal", i18nKey: "career.category.8" },
123
+ { key: 9, value: "Customer Support", i18nKey: "career.category.9" },
124
+ { key: 10, value: "Management", i18nKey: "career.category.10" }
125
+ ];
126
+ var CAREER_MODE = [
127
+ { key: 1, value: "On-site", i18nKey: "career.mode.1" },
128
+ { key: 2, value: "Remote", i18nKey: "career.mode.2" },
129
+ { key: 3, value: "Hybrid", i18nKey: "career.mode.3" }
130
+ ];
131
+ var CAREER_LOCATION = [
132
+ { key: 1, value: "KualaLumpur", i18nKey: "career.location.1" },
133
+ { key: 2, value: "Selangor", i18nKey: "career.location.2" },
134
+ { key: 3, value: "Johor", i18nKey: "career.location.3" },
135
+ { key: 4, value: "Penang", i18nKey: "career.location.4" },
136
+ { key: 5, value: "Sabah", i18nKey: "career.location.5" },
137
+ { key: 6, value: "Sarawak", i18nKey: "career.location.6" },
138
+ { key: 7, value: "NegeriSembilan", i18nKey: "career.location.7" },
139
+ { key: 8, value: "Kedah", i18nKey: "career.location.8" },
140
+ { key: 9, value: "Kelantan", i18nKey: "career.location.9" },
141
+ { key: 10, value: "Perak", i18nKey: "career.location.10" },
142
+ { key: 11, value: "Terengganu", i18nKey: "career.location.11" },
143
+ { key: 12, value: "Perlis", i18nKey: "career.location.12" },
144
+ { key: 13, value: "Melaka", i18nKey: "career.location.13" },
145
+ { key: 14, value: "Putrajaya", i18nKey: "career.location.14" },
146
+ { key: 15, value: "Labuan", i18nKey: "career.location.15" }
147
+ ];
148
+
149
+ // src/contact-form/index.js
150
+ var CONTACT_FORM_ENQUIRY_TYPE = [
151
+ {
152
+ key: 1,
153
+ value: "Software Development",
154
+ i18nKey: "contactForm.enquiryType.1"
155
+ },
156
+ {
157
+ key: 2,
158
+ value: "Advertising Platform",
159
+ i18nKey: "contactForm.enquiryType.2"
160
+ },
161
+ { key: 3, value: "MCN Business", i18nKey: "contactForm.enquiryType.3" }
162
+ ];
163
+
164
+ // src/files/index.js
165
+ var FILE_STATUS = [
166
+ { key: 1, value: "pending", i18nKey: "files.status.1" },
167
+ { key: 2, value: "submitted", i18nKey: "files.status.2" }
168
+ ];
169
+ var FILE_ORIGIN = [
170
+ { key: 1, value: "job applications", i18nKey: "files.origin.1" },
171
+ { key: 2, value: "submitted", i18nKey: "files.origin.2" }
172
+ ];
173
+
174
+ // src/locale/index.js
175
+ var LOCALE = [
176
+ { key: 1, value: "en", i18nKey: "locale.en" },
177
+ { key: 2, value: "zh", i18nKey: "locale.zh" }
178
+ ];
179
+
180
+ // src/roles/index.js
181
+ var ROLE_MAP = {
182
+ 0: "super-admin",
183
+ 1: "admin",
184
+ 2: "staff",
185
+ 3: "hr",
186
+ 32766: "visitor",
187
+ 32767: "none"
188
+ };
189
+ var ROLE = [
190
+ { key: 0, value: "super-admin", i18nKey: "users.roleSuperAdmin" },
191
+ { key: 1, value: "admin", i18nKey: "users.roleAdmin" },
192
+ { key: 2, value: "staff", i18nKey: "users.roleStaff" },
193
+ { key: 3, value: "hr", i18nKey: "users.roleHr" },
194
+ { key: 32766, value: "visitor", i18nKey: "users.roleVisitor" },
195
+ { key: 32767, value: "none", i18nKey: "users.roleNone" }
196
+ ];
197
+ function normalizeRole(role) {
198
+ if (typeof role === "number") {
199
+ return ROLE_MAP[role];
200
+ }
201
+ switch (role) {
202
+ case "super-admin":
203
+ return "super-admin";
204
+ case "admin":
205
+ return "admin";
206
+ case "staff":
207
+ return "staff";
208
+ case "hr":
209
+ return "hr";
210
+ case "visitor":
211
+ return "visitor";
212
+ case "none":
213
+ return "none";
214
+ default:
215
+ return void 0;
216
+ }
217
+ }
218
+ function roleLabelKey(role) {
219
+ switch (normalizeRole(role)) {
220
+ case "super-admin":
221
+ return "users.roleSuperAdmin";
222
+ case "admin":
223
+ return "users.roleAdmin";
224
+ case "hr":
225
+ return "users.roleHr";
226
+ case "staff":
227
+ return "users.roleStaff";
228
+ case "visitor":
229
+ return "users.roleVisitor";
230
+ case "none":
231
+ return "users.roleNone";
232
+ default:
233
+ return "users.roleStaff";
234
+ }
235
+ }
236
+ function roleToId(role) {
237
+ const normalizedRole = normalizeRole(role);
238
+ return ROLE.find((option) => option.value === normalizedRole)?.key;
239
+ }
240
+ var Permission = {
241
+ ALLOWED_EMAILS_READ: "allowed-emails:read",
242
+ ALLOWED_EMAILS_WRITE: "allowed-emails:write",
243
+ USERS_READ: "users:read",
244
+ USERS_WRITE: "users:write",
245
+ USERS_DELETE: "users:delete",
246
+ CAREERS_READ: "careers:read",
247
+ CAREERS_WRITE: "careers:write",
248
+ CAREERS_DELETE: "careers:delete",
249
+ CONTACT_FORM_READ: "contact-form:read",
250
+ CONTACT_FORM_DELETE: "contact-form:delete",
251
+ JOB_APPLICATIONS_READ: "job-applications:read",
252
+ OTP_ATTEMPTS_READ: "otp-attempts:read",
253
+ OTP_ATTEMPTS_WRITE: "otp-attempts:write",
254
+ TWO_FACTOR_AUTH_READ: "two-factor-auth:read",
255
+ TWO_FACTOR_AUTH_WRITE: "two-factor-auth:write",
256
+ VIEWS_READ: "views:read",
257
+ LOGS_READ: "logs:read",
258
+ UTM_RECORDS_READ: "utm-records:read",
259
+ UTM_RECORDS_WRITE: "utm-records:write",
260
+ ORIGIN_READ: "origin:read",
261
+ ORIGIN_WRITE: "origin:write",
262
+ ORIGIN_DELETE: "origin:delete"
263
+ };
264
+ var PERMISSION_I18N_KEY = {
265
+ [Permission.ALLOWED_EMAILS_READ]: "permissions.allowedEmailsRead",
266
+ [Permission.ALLOWED_EMAILS_WRITE]: "permissions.allowedEmailsWrite",
267
+ [Permission.USERS_READ]: "permissions.usersRead",
268
+ [Permission.USERS_WRITE]: "permissions.usersWrite",
269
+ [Permission.USERS_DELETE]: "permissions.usersDelete",
270
+ [Permission.CAREERS_READ]: "permissions.careersRead",
271
+ [Permission.CAREERS_WRITE]: "permissions.careersWrite",
272
+ [Permission.CAREERS_DELETE]: "permissions.careersDelete",
273
+ [Permission.CONTACT_FORM_READ]: "permissions.contactFormRead",
274
+ [Permission.CONTACT_FORM_DELETE]: "permissions.contactFormDelete",
275
+ [Permission.JOB_APPLICATIONS_READ]: "permissions.jobApplicationsRead",
276
+ [Permission.OTP_ATTEMPTS_READ]: "permissions.otpAttemptsRead",
277
+ [Permission.OTP_ATTEMPTS_WRITE]: "permissions.otpAttemptsWrite",
278
+ [Permission.TWO_FACTOR_AUTH_READ]: "permissions.twoFactorAuthRead",
279
+ [Permission.TWO_FACTOR_AUTH_WRITE]: "permissions.twoFactorAuthWrite",
280
+ [Permission.VIEWS_READ]: "permissions.viewsRead",
281
+ [Permission.LOGS_READ]: "permissions.logsRead",
282
+ [Permission.UTM_RECORDS_READ]: "permissions.utmRecordsRead",
283
+ [Permission.UTM_RECORDS_WRITE]: "permissions.utmRecordsWrite",
284
+ [Permission.ORIGIN_READ]: "permissions.originRead",
285
+ [Permission.ORIGIN_WRITE]: "permissions.originWrite",
286
+ [Permission.ORIGIN_DELETE]: "permissions.originDelete"
287
+ };
288
+ var ROLE_PERMISSIONS = {
289
+ "super-admin": [
290
+ Permission.ALLOWED_EMAILS_READ,
291
+ Permission.ALLOWED_EMAILS_WRITE,
292
+ Permission.USERS_READ,
293
+ Permission.USERS_WRITE,
294
+ Permission.USERS_DELETE,
295
+ Permission.CAREERS_READ,
296
+ Permission.CAREERS_WRITE,
297
+ Permission.CAREERS_DELETE,
298
+ Permission.CONTACT_FORM_READ,
299
+ Permission.CONTACT_FORM_DELETE,
300
+ Permission.JOB_APPLICATIONS_READ,
301
+ Permission.OTP_ATTEMPTS_READ,
302
+ Permission.OTP_ATTEMPTS_WRITE,
303
+ Permission.TWO_FACTOR_AUTH_READ,
304
+ Permission.TWO_FACTOR_AUTH_WRITE,
305
+ Permission.VIEWS_READ,
306
+ Permission.LOGS_READ,
307
+ Permission.UTM_RECORDS_READ,
308
+ Permission.UTM_RECORDS_WRITE,
309
+ Permission.ORIGIN_READ,
310
+ Permission.ORIGIN_WRITE,
311
+ Permission.ORIGIN_DELETE
312
+ ],
313
+ admin: [
314
+ Permission.ALLOWED_EMAILS_READ,
315
+ Permission.ALLOWED_EMAILS_WRITE,
316
+ Permission.USERS_READ,
317
+ Permission.CAREERS_READ,
318
+ Permission.CAREERS_WRITE,
319
+ Permission.CAREERS_DELETE,
320
+ Permission.CONTACT_FORM_READ,
321
+ Permission.CONTACT_FORM_DELETE,
322
+ Permission.JOB_APPLICATIONS_READ,
323
+ Permission.VIEWS_READ,
324
+ Permission.LOGS_READ,
325
+ Permission.UTM_RECORDS_READ,
326
+ Permission.UTM_RECORDS_WRITE,
327
+ Permission.ORIGIN_READ,
328
+ Permission.ORIGIN_WRITE,
329
+ Permission.ORIGIN_DELETE
330
+ ],
331
+ hr: [
332
+ Permission.CAREERS_READ,
333
+ Permission.CAREERS_WRITE,
334
+ Permission.CAREERS_DELETE,
335
+ Permission.JOB_APPLICATIONS_READ
336
+ ],
337
+ staff: [Permission.CONTACT_FORM_READ],
338
+ visitor: [],
339
+ none: []
340
+ };
341
+ function hasPermission(role, permission) {
342
+ const normalizedRole = normalizeRole(role);
343
+ if (!normalizedRole) {
344
+ return false;
345
+ }
346
+ return ROLE_PERMISSIONS[normalizedRole].includes(permission);
347
+ }
348
+ function permissionLabelKey(permission) {
349
+ return PERMISSION_I18N_KEY[permission];
350
+ }
351
+
352
+ // src/routes/index.js
353
+ var ROUTES = [
354
+ {
355
+ key: "home",
356
+ path: "/[locale]",
357
+ path_name: "/",
358
+ path_key: "/",
359
+ i18nKey: "routes.home"
360
+ },
361
+ {
362
+ key: "about",
363
+ path: "/[locale]/about",
364
+ path_name: "/about",
365
+ path_key: "/about",
366
+ i18nKey: "routes.about"
367
+ },
368
+ {
369
+ key: "career",
370
+ path: "/[locale]/career",
371
+ path_name: "/career",
372
+ path_key: "/career",
373
+ i18nKey: "routes.career"
374
+ },
375
+ {
376
+ key: "careerDetail",
377
+ path: "/[locale]/career/[id]",
378
+ path_name: "/career/[id]",
379
+ path_key: "/career/[id]",
380
+ i18nKey: "routes.careerDetail"
381
+ },
382
+ {
383
+ key: "careerApply",
384
+ path: "/[locale]/career/[id]/apply",
385
+ path_name: "/career/[id]/apply",
386
+ path_key: "/career/[id]/apply",
387
+ i18nKey: "routes.careerApply"
388
+ },
389
+ {
390
+ key: "careerAssessment",
391
+ path: "/[locale]/career/[id]/apply/assessment",
392
+ path_name: "/career/[id]/apply/assessment",
393
+ path_key: "/career/[id]/apply/assessment",
394
+ i18nKey: "routes.careerAssessment"
395
+ },
396
+ {
397
+ key: "contact",
398
+ path: "/[locale]/contact",
399
+ path_name: "/contact",
400
+ path_key: "/contact",
401
+ i18nKey: "routes.contact"
402
+ },
403
+ {
404
+ key: "services",
405
+ path: "/[locale]/services",
406
+ path_name: "/services",
407
+ path_key: "/services",
408
+ i18nKey: "routes.services"
409
+ },
410
+ {
411
+ key: "servicesAdvertisingPlatform",
412
+ path: "/[locale]/services/advertising-platform",
413
+ path_name: "/services/advertising-platform",
414
+ path_key: "/services/advertising-platform",
415
+ i18nKey: "routes.servicesAdvertisingPlatform"
416
+ },
417
+ {
418
+ key: "servicesMcnBusiness",
419
+ path: "/[locale]/services/mcn-business",
420
+ path_name: "/services/mcn-business",
421
+ path_key: "/services/mcn-business",
422
+ i18nKey: "routes.servicesMcnBusiness"
423
+ },
424
+ {
425
+ key: "servicesSoftwareDevelopment",
426
+ path: "/[locale]/services/software-development",
427
+ path_name: "/services/software-development",
428
+ path_key: "/services/software-development",
429
+ i18nKey: "routes.servicesSoftwareDevelopment"
430
+ }
431
+ ];
432
+ var ROUTE = Object.fromEntries(ROUTES.map((route) => [route.key, route.path]));
433
+ function routeLabelKey(route) {
434
+ return ROUTES.find((item) => item.key === route)?.i18nKey ?? "routes.home";
435
+ }
436
+ function routePathKey(route) {
437
+ return ROUTES.find((item) => item.key === route)?.path_key ?? "/";
438
+ }
439
+ function buildRoutePathName(route, params = {}) {
440
+ let pathName = ROUTES.find((item) => item.key === route)?.path_name ?? "/";
441
+ if (pathName.includes("[id]")) {
442
+ if (params.id === void 0 || params.id === null) {
443
+ throw new Error(`Route "${route}" requires an id parameter.`);
444
+ }
445
+ pathName = pathName.replace("[id]", encodeURIComponent(String(params.id)));
446
+ }
447
+ return pathName;
448
+ }
449
+ function buildLocalizedRoute(route, locale, params = {}) {
450
+ let path = ROUTE[route].replace("[locale]", encodeURIComponent(locale));
451
+ if (path.includes("[id]")) {
452
+ if (params.id === void 0 || params.id === null) {
453
+ throw new Error(`Route "${route}" requires an id parameter.`);
454
+ }
455
+ path = path.replace("[id]", encodeURIComponent(String(params.id)));
456
+ }
457
+ return path;
458
+ }
459
+
460
+ // src/shared/helpers.js
461
+ function getOptionByKey(options, key) {
462
+ if (key === null || key === void 0) {
463
+ return void 0;
464
+ }
465
+ return options.find((option) => option.key === key);
466
+ }
467
+ function getLabelByKey(options, key, fallback = "Unknown") {
468
+ return getOptionByKey(options, key)?.value ?? fallback;
469
+ }
470
+ function getI18nKeyByKey(options, key, fallback = "unknown") {
471
+ return getOptionByKey(options, key)?.i18nKey ?? fallback;
472
+ }
473
+ function toRecord(options) {
474
+ return Object.fromEntries(options.map((option) => [option.key, option.value]));
475
+ }
476
+
477
+ // src/time/index.js
478
+ var import_dayjs = __toESM(require("dayjs"), 1);
479
+ var import_timezone = __toESM(require("dayjs/plugin/timezone.js"), 1);
480
+ var import_utc = __toESM(require("dayjs/plugin/utc.js"), 1);
481
+ import_dayjs.default.extend(import_utc.default);
482
+ import_dayjs.default.extend(import_timezone.default);
483
+ var TIMEZONE = [
484
+ { key: 1, value: "UTC", i18nKey: "time.timezone.utc" },
485
+ {
486
+ key: 2,
487
+ value: "Asia/Kuala_Lumpur",
488
+ i18nKey: "time.timezone.asiaKualaLumpur"
489
+ },
490
+ {
491
+ key: 3,
492
+ value: "Asia/Singapore",
493
+ i18nKey: "time.timezone.asiaSingapore"
494
+ },
495
+ {
496
+ key: 4,
497
+ value: "Asia/Bangkok",
498
+ i18nKey: "time.timezone.asiaBangkok"
499
+ },
500
+ {
501
+ key: 5,
502
+ value: "Asia/Jakarta",
503
+ i18nKey: "time.timezone.asiaJakarta"
504
+ },
505
+ {
506
+ key: 6,
507
+ value: "Asia/Manila",
508
+ i18nKey: "time.timezone.asiaManila"
509
+ },
510
+ {
511
+ key: 7,
512
+ value: "Asia/Hong_Kong",
513
+ i18nKey: "time.timezone.asiaHongKong"
514
+ },
515
+ {
516
+ key: 8,
517
+ value: "Asia/Shanghai",
518
+ i18nKey: "time.timezone.asiaShanghai"
519
+ },
520
+ {
521
+ key: 9,
522
+ value: "Asia/Tokyo",
523
+ i18nKey: "time.timezone.asiaTokyo"
524
+ },
525
+ {
526
+ key: 10,
527
+ value: "Australia/Sydney",
528
+ i18nKey: "time.timezone.australiaSydney"
529
+ },
530
+ {
531
+ key: 11,
532
+ value: "Europe/London",
533
+ i18nKey: "time.timezone.europeLondon"
534
+ },
535
+ {
536
+ key: 12,
537
+ value: "Europe/Berlin",
538
+ i18nKey: "time.timezone.europeBerlin"
539
+ },
540
+ {
541
+ key: 13,
542
+ value: "America/New_York",
543
+ i18nKey: "time.timezone.americaNewYork"
544
+ },
545
+ {
546
+ key: 14,
547
+ value: "America/Chicago",
548
+ i18nKey: "time.timezone.americaChicago"
549
+ },
550
+ {
551
+ key: 15,
552
+ value: "America/Denver",
553
+ i18nKey: "time.timezone.americaDenver"
554
+ },
555
+ {
556
+ key: 16,
557
+ value: "America/Los_Angeles",
558
+ i18nKey: "time.timezone.americaLosAngeles"
559
+ }
560
+ ];
561
+ var TIMEZONE_ALIAS_TO_CANONICAL = {
562
+ utc: "UTC",
563
+ "etc/utc": "UTC",
564
+ "asia/kuala_lumpur": "Asia/Kuala_Lumpur",
565
+ "asia/kuala lumpur": "Asia/Kuala_Lumpur",
566
+ "kuala_lumpur": "Asia/Kuala_Lumpur",
567
+ "kuala lumpur": "Asia/Kuala_Lumpur",
568
+ "asia/singapore": "Asia/Singapore",
569
+ singapore: "Asia/Singapore",
570
+ "asia/bangkok": "Asia/Bangkok",
571
+ bangkok: "Asia/Bangkok",
572
+ "asia/jakarta": "Asia/Jakarta",
573
+ jakarta: "Asia/Jakarta",
574
+ "asia/manila": "Asia/Manila",
575
+ manila: "Asia/Manila",
576
+ "asia/hong_kong": "Asia/Hong_Kong",
577
+ "asia/hong kong": "Asia/Hong_Kong",
578
+ "hong_kong": "Asia/Hong_Kong",
579
+ "hong kong": "Asia/Hong_Kong",
580
+ "asia/shanghai": "Asia/Shanghai",
581
+ shanghai: "Asia/Shanghai",
582
+ "asia/tokyo": "Asia/Tokyo",
583
+ tokyo: "Asia/Tokyo",
584
+ "australia/sydney": "Australia/Sydney",
585
+ sydney: "Australia/Sydney",
586
+ "europe/london": "Europe/London",
587
+ london: "Europe/London",
588
+ "europe/berlin": "Europe/Berlin",
589
+ berlin: "Europe/Berlin",
590
+ "america/new_york": "America/New_York",
591
+ "america/new york": "America/New_York",
592
+ "new_york": "America/New_York",
593
+ "new york": "America/New_York",
594
+ "america/chicago": "America/Chicago",
595
+ chicago: "America/Chicago",
596
+ "america/denver": "America/Denver",
597
+ denver: "America/Denver",
598
+ "america/los_angeles": "America/Los_Angeles",
599
+ "america/los angeles": "America/Los_Angeles",
600
+ "los_angeles": "America/Los_Angeles",
601
+ "los angeles": "America/Los_Angeles"
602
+ };
603
+ var TIMEZONE_I18N_KEY = Object.fromEntries(TIMEZONE.map(({ value, i18nKey }) => [value, i18nKey]));
604
+ function toTimezoneAlias(timezone2) {
605
+ return timezone2.trim().toLowerCase().replace(/-/g, "_");
606
+ }
607
+ function normalizeTimezone(timezone2) {
608
+ if (!timezone2) {
609
+ return void 0;
610
+ }
611
+ return TIMEZONE_ALIAS_TO_CANONICAL[toTimezoneAlias(timezone2)];
612
+ }
613
+ function timezoneToUtc(timezone2, timestamp = Date.now()) {
614
+ const normalizedTimezone = normalizeTimezone(timezone2);
615
+ if (!normalizedTimezone) {
616
+ return void 0;
617
+ }
618
+ return `UTC${(0, import_dayjs.default)(timestamp).tz(normalizedTimezone).format("Z")}`;
619
+ }
620
+ var TIMEZONE_CURRENT_UTC_OFFSET = Object.fromEntries(TIMEZONE.map(({ value }) => [value, timezoneToUtc(value)]));
621
+ var TIMEZONE_TO_UTC = TIMEZONE_CURRENT_UTC_OFFSET;
622
+ function timezoneLabelKey(timezone2) {
623
+ const normalizedTimezone = normalizeTimezone(timezone2);
624
+ if (!normalizedTimezone) {
625
+ return "time.timezone.utc";
626
+ }
627
+ return TIMEZONE_I18N_KEY[normalizedTimezone];
628
+ }
629
+ function convertTimestampToTimezone(timestamp, sourceTimezone, targetTimezone) {
630
+ const normalizedSourceTimezone = normalizeTimezone(sourceTimezone);
631
+ const normalizedTargetTimezone = normalizeTimezone(targetTimezone);
632
+ if (!normalizedSourceTimezone || !normalizedTargetTimezone) {
633
+ return void 0;
634
+ }
635
+ const sourceDateTime = (0, import_dayjs.default)(timestamp).tz(normalizedSourceTimezone);
636
+ const preservedWallClock = sourceDateTime.format("YYYY-MM-DDTHH:mm:ss.SSS");
637
+ return import_dayjs.default.tz(preservedWallClock, normalizedTargetTimezone).valueOf();
638
+ }
639
+
640
+ // src/track/index.js
641
+ var ORIGIN = [
642
+ {
643
+ key: 0,
644
+ value: "Website",
645
+ i18nKey: "track.origin.0"
646
+ },
647
+ {
648
+ key: 1,
649
+ value: "Linkedin",
650
+ i18nKey: "track.origin.1"
651
+ },
652
+ { key: 2, value: "Jobstreet", i18nKey: "track.origin.2" },
653
+ { key: 3, value: "Maukerja", i18nKey: "track.origin.3" }
654
+ ];
655
+
656
+ // src/url-prefix/index.js
657
+ var URL_PREFIXES = {
658
+ [1 /* KORRE */]: {
659
+ contact: "https://www.korre.site/contact",
660
+ careerDetail: "https://www.korre.site/career/[id]",
661
+ careerApply: "https://www.korre.site/career/[id]/apply"
662
+ },
663
+ [2 /* KORRE_LABS */]: {}
664
+ };
665
+
666
+ // src/website/index.js
667
+ var Website2;
668
+ (function(Website3) {
669
+ Website3[Website3["KORRE"] = 1] = "KORRE";
670
+ Website3[Website3["KORRE_LABS"] = 2] = "KORRE_LABS";
671
+ })(Website2 || (Website2 = {}));
672
+ var WEBSITES = {
673
+ [Website2.KORRE]: {
674
+ id: Website2.KORRE,
675
+ name: "Korre Evolution",
676
+ url: "https://public.korre.site/images/korre-evo.png"
677
+ },
678
+ [Website2.KORRE_LABS]: {
679
+ id: Website2.KORRE_LABS,
680
+ name: "Korre Labs",
681
+ url: "https://public.korre.site/images/korre-labs.png"
682
+ }
683
+ };
684
+
685
+ // src/addressess/index.js
686
+ var COUNTRY_CODE = [
687
+ { key: 1, value: "MY", i18nKey: "country.code.1" }
688
+ ];
689
+ var STATES = {
690
+ MY: [
691
+ { key: 1, value: "Johor", i18nKey: "malaysia.state.1" },
692
+ { key: 2, value: "Kedah", i18nKey: "malaysia.state.2" },
693
+ { key: 3, value: "Kelantan", i18nKey: "malaysia.state.3" },
694
+ { key: 4, value: "Melaka", i18nKey: "malaysia.state.4" },
695
+ { key: 5, value: "Negeri Sembilan", i18nKey: "malaysia.state.5" },
696
+ { key: 6, value: "Pahang", i18nKey: "malaysia.state.6" },
697
+ { key: 7, value: "Penang", i18nKey: "malaysia.state.7" },
698
+ { key: 8, value: "Perak", i18nKey: "malaysia.state.8" },
699
+ { key: 9, value: "Perlis", i18nKey: "malaysia.state.9" },
700
+ { key: 10, value: "Sabah", i18nKey: "malaysia.state.10" },
701
+ { key: 11, value: "Sarawak", i18nKey: "malaysia.state.11" },
702
+ { key: 12, value: "Selangor", i18nKey: "malaysia.state.12" },
703
+ { key: 13, value: "Terengganu", i18nKey: "malaysia.state.13" },
704
+ { key: 14, value: "Kuala Lumpur", i18nKey: "malaysia.state.14" },
705
+ { key: 15, value: "Labuan", i18nKey: "malaysia.state.15" },
706
+ { key: 16, value: "Putrajaya", i18nKey: "malaysia.state.16" }
707
+ ]
708
+ };
709
+ var MALAYSIA_STATE = STATES.MY;
710
+
711
+ // src/job-applications/index.js
712
+ var JOB_APPLICATION_STATUS = [
713
+ { key: 0, value: "Pending Review", i18nKey: "jobApplication.status.0" },
714
+ { key: 1, value: "Shortlisted", i18nKey: "jobApplication.status.1" },
715
+ { key: 2, value: "Interview", i18nKey: "jobApplication.status.2" },
716
+ { key: 3, value: "Offered", i18nKey: "jobApplication.status.3" },
717
+ { key: 4, value: "Hired", i18nKey: "jobApplication.status.4" },
718
+ { key: 5, value: "Rejected", i18nKey: "jobApplication.status.5" },
719
+ { key: 6, value: "Withdrawn", i18nKey: "jobApplication.status.6" },
720
+ { key: 7, value: "Ghosted", i18nKey: "jobApplication.status.7" }
721
+ ];
722
+
723
+ // src/email-template/index.js
724
+ var EMAIL_TEMPLATE_ROLES = [
725
+ { key: 0, value: "Creator", i18nKey: "emailTemplate.role.0" },
726
+ { key: 1, value: "Editor", i18nKey: "emailTemplate.role.1" },
727
+ { key: 2, value: "Viewer", i18nKey: "emailTemplate.role.2" }
728
+ ];
729
+
730
+ // src/email-history/index.ts
731
+ var EMAIL_HISTORY_STATUS = [
732
+ { key: 0, value: "Scheduled", i18nKey: "emailHistory.status.0" },
733
+ { key: 1, value: "Delivering", i18nKey: "emailHistory.status.1" },
734
+ { key: 2, value: "Delivered", i18nKey: "emailHistory.status.2" },
735
+ { key: 3, value: "Failed", i18nKey: "emailHistory.status.3" }
736
+ ];
737
+ // Annotate the CommonJS export names for ESM import in node:
738
+ 0 && (module.exports = {
739
+ ASSESSMENT_QUESTION_TYPE,
740
+ CAREER_CATEGORY,
741
+ CAREER_JOB_TYPE,
742
+ CAREER_LOCATION,
743
+ CAREER_MODE,
744
+ CONTACT_FORM_ENQUIRY_TYPE,
745
+ COUNTRY_CODE,
746
+ EMAIL_HISTORY_STATUS,
747
+ EMAIL_TEMPLATE_ROLES,
748
+ FILE_ORIGIN,
749
+ FILE_STATUS,
750
+ JOB_APPLICATION_STATUS,
751
+ LOCALE,
752
+ MALAYSIA_STATE,
753
+ ORIGIN,
754
+ PERMISSION_I18N_KEY,
755
+ Permission,
756
+ QuestionType,
757
+ ROLE,
758
+ ROLE_MAP,
759
+ ROLE_PERMISSIONS,
760
+ ROUTE,
761
+ ROUTES,
762
+ STATES,
763
+ TIMEZONE,
764
+ TIMEZONE_CURRENT_UTC_OFFSET,
765
+ TIMEZONE_TO_UTC,
766
+ URL_PREFIXES,
767
+ WEBSITES,
768
+ Website,
769
+ buildLocalizedRoute,
770
+ buildRoutePathName,
771
+ convertTimestampToTimezone,
772
+ getI18nKeyByKey,
773
+ getLabelByKey,
774
+ getOptionByKey,
775
+ hasPermission,
776
+ normalizeRole,
777
+ normalizeTimezone,
778
+ permissionLabelKey,
779
+ roleLabelKey,
780
+ roleToId,
781
+ routeLabelKey,
782
+ routePathKey,
783
+ timezoneLabelKey,
784
+ timezoneToUtc,
785
+ toRecord
786
+ });