@asdp/ferryui 0.1.1 → 0.1.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.
package/dist/index.js CHANGED
@@ -3,12 +3,18 @@
3
3
  var reactComponents = require('@fluentui/react-components');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React2 = require('react');
6
+ var react = require('@iconify/react');
7
+ var reactHookForm = require('react-hook-form');
8
+ var PhoneInput = require('react-phone-input-2');
9
+ var Select = require('react-select');
10
+ var reactCalendarCompat = require('@fluentui/react-calendar-compat');
6
11
 
7
12
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
13
 
9
14
  var React2__default = /*#__PURE__*/_interopDefault(React2);
15
+ var PhoneInput__default = /*#__PURE__*/_interopDefault(PhoneInput);
16
+ var Select__default = /*#__PURE__*/_interopDefault(Select);
10
17
 
11
- // src/components/ModalIllustration/ModalIllustration.tsx
12
18
  var useStyles = reactComponents.makeStyles({
13
19
  dialogSurface: {
14
20
  maxWidth: "600px",
@@ -1075,6 +1081,1968 @@ var CardServiceMenu = ({
1075
1081
  ] })
1076
1082
  ] }, item.id)) }) });
1077
1083
  };
1084
+ var fontWeight = {
1085
+ "Medium": 500};
1086
+ var sharedColors = {
1087
+ "Shared_Cranberry_Primary": "#c50f1f"};
1088
+ var lightModeColors = {
1089
+ "Brand_Stroke_1_Rest": "#00B3BD"};
1090
+ var tokensV2_default = {
1091
+ lightModeColors};
1092
+ var DatePickerInput = React2.forwardRef(
1093
+ ({
1094
+ field,
1095
+ placeholder,
1096
+ disabled,
1097
+ appearance,
1098
+ size,
1099
+ contentBefore,
1100
+ onClick,
1101
+ style,
1102
+ max,
1103
+ ...restProps
1104
+ }, ref) => {
1105
+ const [isOpen, setIsOpen] = React2.useState(false);
1106
+ const dateValue = field.value ? new Date(field.value) : void 0;
1107
+ const onSelectDate = (date) => {
1108
+ if (date) {
1109
+ const offset = date.getTimezoneOffset();
1110
+ const adjustedDate = new Date(date.getTime() - offset * 60 * 1e3);
1111
+ field.onChange(adjustedDate.toISOString().split("T")[0]);
1112
+ setIsOpen(false);
1113
+ }
1114
+ };
1115
+ const formatDate = (dateString) => {
1116
+ if (!dateString) return "";
1117
+ const date = new Date(dateString);
1118
+ return date.toLocaleDateString("id-ID", {
1119
+ day: "numeric",
1120
+ month: "long",
1121
+ year: "numeric"
1122
+ });
1123
+ };
1124
+ const handleInputClick = (e) => {
1125
+ e?.preventDefault();
1126
+ if (!disabled) {
1127
+ setIsOpen(!isOpen);
1128
+ }
1129
+ onClick?.(e);
1130
+ };
1131
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Popover, { open: isOpen, onOpenChange: (_, data) => setIsOpen(data.open), trapFocus: true, children: [
1132
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.PopoverTrigger, { disableButtonEnhancement: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1133
+ reactComponents.Input,
1134
+ {
1135
+ ...restProps,
1136
+ value: formatDate(field.value),
1137
+ readOnly: true,
1138
+ placeholder: placeholder || "Pilih tanggal",
1139
+ disabled,
1140
+ appearance,
1141
+ size,
1142
+ contentBefore,
1143
+ onClick: handleInputClick,
1144
+ style: {
1145
+ cursor: disabled ? "not-allowed" : "pointer",
1146
+ ...style
1147
+ },
1148
+ contentAfter: /* @__PURE__ */ jsxRuntime.jsx(
1149
+ "div",
1150
+ {
1151
+ onClick: (e) => {
1152
+ e.stopPropagation();
1153
+ if (!disabled) {
1154
+ setIsOpen(!isOpen);
1155
+ }
1156
+ },
1157
+ style: {
1158
+ cursor: disabled ? "not-allowed" : "pointer",
1159
+ display: "flex",
1160
+ alignItems: "center"
1161
+ },
1162
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:calendar-24-regular" })
1163
+ }
1164
+ )
1165
+ }
1166
+ ) }),
1167
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.PopoverSurface, { tabIndex: -1, style: { maxWidth: "530px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1168
+ reactCalendarCompat.Calendar,
1169
+ {
1170
+ value: dateValue,
1171
+ onSelectDate,
1172
+ showGoToToday: true,
1173
+ highlightSelectedMonth: true,
1174
+ showMonthPickerAsOverlay: false,
1175
+ maxDate: max ? new Date(max) : void 0
1176
+ }
1177
+ ) })
1178
+ ] });
1179
+ }
1180
+ );
1181
+ DatePickerInput.displayName = "DatePickerInput";
1182
+ var DatePickerInput_default = DatePickerInput;
1183
+ var useStyles7 = reactComponents.makeStyles({
1184
+ field: {
1185
+ display: "flex",
1186
+ flexDirection: "column",
1187
+ gap: reactComponents.tokens.spacingVerticalXS,
1188
+ marginBottom: reactComponents.tokens.spacingVerticalM
1189
+ },
1190
+ errorText: {
1191
+ color: reactComponents.tokens.colorPaletteRedBackground1,
1192
+ fontSize: reactComponents.tokens.fontSizeBase200
1193
+ },
1194
+ helperText: {
1195
+ color: reactComponents.tokens.colorNeutralForeground2,
1196
+ fontSize: reactComponents.tokens.fontSizeBase200
1197
+ },
1198
+ disabledFilledLighter: {
1199
+ backgroundColor: reactComponents.tokens.colorNeutralBackground4,
1200
+ border: "none",
1201
+ "& input": {
1202
+ backgroundColor: reactComponents.tokens.colorNeutralBackground4,
1203
+ border: "none"
1204
+ }
1205
+ },
1206
+ fileInput: {
1207
+ padding: reactComponents.tokens.spacingVerticalS,
1208
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
1209
+ borderRadius: reactComponents.tokens.borderRadiusMedium,
1210
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1,
1211
+ fontSize: reactComponents.tokens.fontSizeBase300,
1212
+ "&:focus": {
1213
+ outline: `2px solid ${reactComponents.tokens.colorBrandStroke1}`
1214
+ }
1215
+ },
1216
+ reactSelect: {
1217
+ // Custom styles akan dihandle via styles prop react-select
1218
+ },
1219
+ reactSelectError: {
1220
+ // Custom styles akan dihandle via styles prop react-select
1221
+ },
1222
+ phoneContainer: {
1223
+ display: "flex",
1224
+ gap: reactComponents.tokens.spacingHorizontalS,
1225
+ alignItems: "flex-start",
1226
+ width: "100%"
1227
+ },
1228
+ phoneCountrySelect: {
1229
+ minWidth: "120px",
1230
+ maxWidth: "120px",
1231
+ flexShrink: 0
1232
+ },
1233
+ switchWrapper: {
1234
+ "& .fui-Switch": {
1235
+ minHeight: "20px"
1236
+ },
1237
+ "& .fui-Switch__indicator": {
1238
+ height: "20px",
1239
+ width: "40px",
1240
+ borderRadius: "10px"
1241
+ },
1242
+ "& .fui-Switch__thumb": {
1243
+ height: "14px",
1244
+ width: "14px",
1245
+ borderRadius: "50%"
1246
+ }
1247
+ },
1248
+ otpInput: {
1249
+ "& input": {
1250
+ textAlign: "center"
1251
+ }
1252
+ },
1253
+ inputWithAutocomplete: {
1254
+ "& input:-webkit-autofill": {
1255
+ "-webkit-box-shadow": "0 0 0 30px white inset !important",
1256
+ "-webkit-text-fill-color": `${reactComponents.tokens.colorNeutralForeground1} !important`
1257
+ },
1258
+ "& input:-webkit-autofill:hover": {
1259
+ "-webkit-box-shadow": "0 0 0 30px white inset !important"
1260
+ },
1261
+ "& input:-webkit-autofill:focus": {
1262
+ "-webkit-box-shadow": "0 0 0 30px white inset !important"
1263
+ },
1264
+ "& input:-webkit-autofill:active": {
1265
+ "-webkit-box-shadow": "0 0 0 30px white inset !important"
1266
+ }
1267
+ },
1268
+ phoneInputWrapper: {
1269
+ width: "100%",
1270
+ "& .react-tel-input": {
1271
+ width: "100%"
1272
+ },
1273
+ "& .react-tel-input .form-control": {
1274
+ width: "100%",
1275
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
1276
+ borderRadius: reactComponents.tokens.borderRadiusMedium,
1277
+ padding: reactComponents.tokens.spacingVerticalS,
1278
+ paddingLeft: "48px",
1279
+ fontSize: reactComponents.tokens.fontSizeBase300,
1280
+ fontFamily: reactComponents.tokens.fontFamilyBase,
1281
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1,
1282
+ color: reactComponents.tokens.colorNeutralForeground1,
1283
+ outline: "none",
1284
+ height: "auto",
1285
+ minHeight: "40px"
1286
+ },
1287
+ "& .react-tel-input .form-control::placeholder": {
1288
+ fontSize: reactComponents.tokens.fontSizeBase400
1289
+ },
1290
+ "& .react-tel-input .form-control:hover": {
1291
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1Hover}`
1292
+ },
1293
+ "& .react-tel-input .form-control:focus": {
1294
+ borderBottom: `2px solid ${reactComponents.tokens.colorBrandStroke1}`
1295
+ // boxShadow: `0 0 0 1px ${tokens.colorBrandStroke1}`,
1296
+ },
1297
+ "& .react-tel-input .form-control:disabled": {
1298
+ backgroundColor: reactComponents.tokens.colorNeutralBackground4,
1299
+ color: reactComponents.tokens.colorNeutralForegroundDisabled,
1300
+ cursor: "not-allowed"
1301
+ },
1302
+ "& .react-tel-input .flag-dropdown": {
1303
+ border: "none",
1304
+ backgroundColor: "transparent",
1305
+ borderRadius: reactComponents.tokens.borderRadiusMedium
1306
+ },
1307
+ "& .react-tel-input .selected-flag": {
1308
+ padding: "0 0 0 8px",
1309
+ width: "40px",
1310
+ backgroundColor: "transparent"
1311
+ },
1312
+ "& .react-tel-input .selected-flag:hover": {
1313
+ backgroundColor: "transparent"
1314
+ },
1315
+ "& .react-tel-input .flag-dropdown.open .selected-flag": {
1316
+ backgroundColor: "transparent"
1317
+ }
1318
+ },
1319
+ phoneInputError: {
1320
+ "& .react-tel-input .form-control": {
1321
+ border: `2px solid ${reactComponents.tokens.colorPaletteRedBorder2}`
1322
+ },
1323
+ "& .react-tel-input .form-control:focus": {
1324
+ border: `2px solid ${reactComponents.tokens.colorPaletteRedBorder2}`,
1325
+ boxShadow: `0 0 0 1px ${reactComponents.tokens.colorPaletteRedBorder2}`
1326
+ }
1327
+ },
1328
+ classRadioGroup: {
1329
+ display: "flex",
1330
+ flexDirection: "row",
1331
+ gap: "12px"
1332
+ },
1333
+ classRadio: {
1334
+ "& .fui-Radio__indicator": {
1335
+ display: "none"
1336
+ },
1337
+ "& .fui-Radio__label": {
1338
+ padding: "10px 24px",
1339
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
1340
+ borderRadius: reactComponents.tokens.borderRadiusCircular,
1341
+ cursor: "pointer",
1342
+ transition: "all 0.2s ease",
1343
+ fontSize: reactComponents.tokens.fontSizeBase300,
1344
+ color: reactComponents.tokens.colorNeutralForeground2
1345
+ },
1346
+ "&:hover .fui-Radio__label": {
1347
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1Hover,
1348
+ border: `1px solid ${tokensV2_default.lightModeColors.Brand_Stroke_1_Rest}`
1349
+ },
1350
+ "& .fui-Radio__input:checked ~ .fui-Radio__label": {
1351
+ borderRadius: reactComponents.tokens.borderRadiusXLarge,
1352
+ border: `1px solid ${tokensV2_default.lightModeColors.Brand_Stroke_1_Rest}`,
1353
+ color: tokensV2_default.lightModeColors.Brand_Stroke_1_Rest,
1354
+ backgroundColor: "transparent"
1355
+ },
1356
+ // Fallback for aria-checked if needed
1357
+ '&[aria-checked="true"] .fui-Radio__label': {
1358
+ borderRadius: reactComponents.tokens.borderRadiusXLarge,
1359
+ border: `1px solid ${tokensV2_default.lightModeColors.Brand_Stroke_1_Rest}`,
1360
+ color: tokensV2_default.lightModeColors.Brand_Stroke_1_Rest,
1361
+ backgroundColor: "transparent"
1362
+ }
1363
+ }
1364
+ });
1365
+ var DEFAULT_COUNTRY_CODES = [
1366
+ { code: "AF", name: "Afghanistan", dialCode: "+93", passportRegex: "^[A-Z][0-9]{7}$" },
1367
+ { code: "AL", name: "Albania", dialCode: "+355", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1368
+ { code: "DZ", name: "Algeria", dialCode: "+213", passportRegex: "^[0-9]{9}$" },
1369
+ { code: "AS", name: "American Samoa", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
1370
+ { code: "AD", name: "Andorra", dialCode: "+376", passportRegex: "^[A-Z0-9]{6,10}$" },
1371
+ { code: "AO", name: "Angola", dialCode: "+244", passportRegex: "^[A-Z0-9]{6,10}$" },
1372
+ { code: "AI", name: "Anguilla", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1373
+ { code: "AQ", name: "Antarctica", dialCode: "+672", passportRegex: "^[A-Z0-9]{6,10}$" },
1374
+ { code: "AG", name: "Antigua and Barbuda", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1375
+ { code: "AR", name: "Argentina", dialCode: "+54", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1376
+ { code: "AM", name: "Armenia", dialCode: "+374", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1377
+ { code: "AW", name: "Aruba", dialCode: "+297", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1378
+ { code: "AU", name: "Australia", dialCode: "+61", passportRegex: "^[A-Z][0-9]{7}$" },
1379
+ { code: "AT", name: "Austria", dialCode: "+43", passportRegex: "^[A-Z0-9]{8}$" },
1380
+ { code: "AZ", name: "Azerbaijan", dialCode: "+994", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1381
+ { code: "BS", name: "Bahamas", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1382
+ { code: "BH", name: "Bahrain", dialCode: "+973", passportRegex: "^[A-Z][0-9]{7}$" },
1383
+ { code: "BD", name: "Bangladesh", dialCode: "+880", passportRegex: "^[A-Z][0-9]{7}$" },
1384
+ { code: "BB", name: "Barbados", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1385
+ { code: "BY", name: "Belarus", dialCode: "+375", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1386
+ { code: "BE", name: "Belgium", dialCode: "+32", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1387
+ { code: "BZ", name: "Belize", dialCode: "+501", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1388
+ { code: "BJ", name: "Benin", dialCode: "+229", passportRegex: "^[A-Z0-9]{6,10}$" },
1389
+ { code: "BM", name: "Bermuda", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1390
+ { code: "BT", name: "Bhutan", dialCode: "+975", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1391
+ { code: "BO", name: "Bolivia", dialCode: "+591", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1392
+ {
1393
+ code: "BA",
1394
+ name: "Bosnia and Herzegovina",
1395
+ dialCode: "+387",
1396
+ passportRegex: "^[A-Z]{2}[0-9]{6}$"
1397
+ },
1398
+ { code: "BW", name: "Botswana", dialCode: "+267", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1399
+ { code: "BR", name: "Brazil", dialCode: "+55", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1400
+ { code: "BN", name: "Brunei", dialCode: "+673", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1401
+ { code: "BG", name: "Bulgaria", dialCode: "+359", passportRegex: "^[0-9]{9}$" },
1402
+ { code: "BF", name: "Burkina Faso", dialCode: "+226", passportRegex: "^[A-Z0-9]{6,10}$" },
1403
+ { code: "BI", name: "Burundi", dialCode: "+257", passportRegex: "^[A-Z0-9]{6,10}$" },
1404
+ { code: "KH", name: "Cambodia", dialCode: "+855", passportRegex: "^[A-Z][0-9]{7}$" },
1405
+ { code: "CM", name: "Cameroon", dialCode: "+237", passportRegex: "^[A-Z0-9]{6,10}$" },
1406
+ { code: "CA", name: "Canada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1407
+ { code: "CV", name: "Cape Verde", dialCode: "+238", passportRegex: "^[A-Z0-9]{6,10}$" },
1408
+ { code: "KY", name: "Cayman Islands", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1409
+ {
1410
+ code: "CF",
1411
+ name: "Central African Republic",
1412
+ dialCode: "+236",
1413
+ passportRegex: "^[A-Z0-9]{6,10}$"
1414
+ },
1415
+ { code: "TD", name: "Chad", dialCode: "+235", passportRegex: "^[A-Z0-9]{6,10}$" },
1416
+ { code: "CL", name: "Chile", dialCode: "+56", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1417
+ { code: "CN", name: "China", dialCode: "+86", passportRegex: "^[0-9]{9}$" },
1418
+ { code: "CO", name: "Colombia", dialCode: "+57", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1419
+ { code: "KM", name: "Comoros", dialCode: "+269", passportRegex: "^[A-Z0-9]{6,10}$" },
1420
+ { code: "CG", name: "Congo", dialCode: "+242", passportRegex: "^[A-Z0-9]{6,10}$" },
1421
+ { code: "CR", name: "Costa Rica", dialCode: "+506", passportRegex: "^[A-Z0-9]{6,10}$" },
1422
+ { code: "HR", name: "Croatia", dialCode: "+385", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1423
+ { code: "CU", name: "Cuba", dialCode: "+53", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1424
+ { code: "CY", name: "Cyprus", dialCode: "+357", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1425
+ { code: "CZ", name: "Czech Republic", dialCode: "+420", passportRegex: "^[0-9]{8}$" },
1426
+ { code: "DK", name: "Denmark", dialCode: "+45", passportRegex: "^[A-Z0-9]{9}$" },
1427
+ { code: "DJ", name: "Djibouti", dialCode: "+253", passportRegex: "^[A-Z0-9]{6,10}$" },
1428
+ { code: "DM", name: "Dominica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1429
+ { code: "DO", name: "Dominican Republic", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1430
+ { code: "EC", name: "Ecuador", dialCode: "+593", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1431
+ { code: "EG", name: "Egypt", dialCode: "+20", passportRegex: "^[A-Z][0-9]{7}$" },
1432
+ { code: "SV", name: "El Salvador", dialCode: "+503", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1433
+ { code: "GQ", name: "Equatorial Guinea", dialCode: "+240", passportRegex: "^[A-Z0-9]{6,10}$" },
1434
+ { code: "ER", name: "Eritrea", dialCode: "+291", passportRegex: "^[A-Z0-9]{6,10}$" },
1435
+ { code: "EE", name: "Estonia", dialCode: "+372", passportRegex: "^[A-Z0-9]{8}$" },
1436
+ { code: "SZ", name: "Eswatini", dialCode: "+268", passportRegex: "^[A-Z0-9]{6,10}$" },
1437
+ { code: "ET", name: "Ethiopia", dialCode: "+251", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1438
+ { code: "FJ", name: "Fiji", dialCode: "+679", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1439
+ { code: "FI", name: "Finland", dialCode: "+358", passportRegex: "^[A-Z0-9]{9}$" },
1440
+ { code: "FR", name: "France", dialCode: "+33", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1441
+ { code: "GA", name: "Gabon", dialCode: "+241", passportRegex: "^[A-Z0-9]{6,10}$" },
1442
+ { code: "GM", name: "Gambia", dialCode: "+220", passportRegex: "^[A-Z0-9]{6,10}$" },
1443
+ { code: "GE", name: "Georgia", dialCode: "+995", passportRegex: "^[A-Z0-9]{8}$" },
1444
+ { code: "DE", name: "Germany", dialCode: "+49", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1445
+ { code: "GH", name: "Ghana", dialCode: "+233", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1446
+ { code: "GR", name: "Greece", dialCode: "+30", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1447
+ { code: "GD", name: "Grenada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1448
+ { code: "GT", name: "Guatemala", dialCode: "+502", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1449
+ { code: "GN", name: "Guinea", dialCode: "+224", passportRegex: "^[A-Z0-9]{6,10}$" },
1450
+ { code: "GW", name: "Guinea-Bissau", dialCode: "+245", passportRegex: "^[A-Z0-9]{6,10}$" },
1451
+ { code: "GY", name: "Guyana", dialCode: "+592", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1452
+ { code: "HT", name: "Haiti", dialCode: "+509", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1453
+ { code: "HN", name: "Honduras", dialCode: "+504", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1454
+ { code: "HK", name: "Hong Kong", dialCode: "+852", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1455
+ { code: "HU", name: "Hungary", dialCode: "+36", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1456
+ { code: "IS", name: "Iceland", dialCode: "+354", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1457
+ { code: "IN", name: "India", dialCode: "+91", passportRegex: "^[A-Z][0-9]{7}$" },
1458
+ { code: "ID", name: "Indonesia", dialCode: "+62", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1459
+ { code: "IR", name: "Iran", dialCode: "+98", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1460
+ { code: "IQ", name: "Iraq", dialCode: "+964", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1461
+ { code: "IE", name: "Ireland", dialCode: "+353", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
1462
+ { code: "IL", name: "Israel", dialCode: "+972", passportRegex: "^[0-9]{8,9}$" },
1463
+ { code: "IT", name: "Italy", dialCode: "+39", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1464
+ { code: "JM", name: "Jamaica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1465
+ { code: "JP", name: "Japan", dialCode: "+81", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1466
+ { code: "JO", name: "Jordan", dialCode: "+962", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1467
+ { code: "KZ", name: "Kazakhstan", dialCode: "+7", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1468
+ { code: "KE", name: "Kenya", dialCode: "+254", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1469
+ { code: "KI", name: "Kiribati", dialCode: "+686", passportRegex: "^[A-Z0-9]{6,10}$" },
1470
+ { code: "KP", name: "North Korea", dialCode: "+850", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1471
+ { code: "KR", name: "South Korea", dialCode: "+82", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
1472
+ { code: "KW", name: "Kuwait", dialCode: "+965", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1473
+ { code: "KG", name: "Kyrgyzstan", dialCode: "+996", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1474
+ { code: "LA", name: "Laos", dialCode: "+856", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1475
+ { code: "LV", name: "Latvia", dialCode: "+371", passportRegex: "^[A-Z0-9]{8}$" },
1476
+ { code: "LB", name: "Lebanon", dialCode: "+961", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1477
+ { code: "LS", name: "Lesotho", dialCode: "+266", passportRegex: "^[A-Z0-9]{6,10}$" },
1478
+ { code: "LR", name: "Liberia", dialCode: "+231", passportRegex: "^[A-Z0-9]{6,10}$" },
1479
+ { code: "LY", name: "Libya", dialCode: "+218", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1480
+ { code: "LI", name: "Liechtenstein", dialCode: "+423", passportRegex: "^[A-Z0-9]{6,10}$" },
1481
+ { code: "LT", name: "Lithuania", dialCode: "+370", passportRegex: "^[A-Z0-9]{8}$" },
1482
+ { code: "LU", name: "Luxembourg", dialCode: "+352", passportRegex: "^[A-Z0-9]{8}$" },
1483
+ { code: "MO", name: "Macau", dialCode: "+853", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1484
+ { code: "MG", name: "Madagascar", dialCode: "+261", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1485
+ { code: "MW", name: "Malawi", dialCode: "+265", passportRegex: "^[A-Z0-9]{6,10}$" },
1486
+ { code: "MY", name: "Malaysia", dialCode: "+60", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
1487
+ { code: "MV", name: "Maldives", dialCode: "+960", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1488
+ { code: "ML", name: "Mali", dialCode: "+223", passportRegex: "^[A-Z0-9]{6,10}$" },
1489
+ { code: "MT", name: "Malta", dialCode: "+356", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1490
+ { code: "MH", name: "Marshall Islands", dialCode: "+692", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1491
+ { code: "MQ", name: "Martinique", dialCode: "+596", passportRegex: "^[A-Z0-9]{6,10}$" },
1492
+ { code: "MR", name: "Mauritania", dialCode: "+222", passportRegex: "^[A-Z0-9]{6,10}$" },
1493
+ { code: "MU", name: "Mauritius", dialCode: "+230", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1494
+ { code: "MX", name: "Mexico", dialCode: "+52", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
1495
+ { code: "FM", name: "Micronesia", dialCode: "+691", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1496
+ { code: "MD", name: "Moldova", dialCode: "+373", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1497
+ { code: "MC", name: "Monaco", dialCode: "+377", passportRegex: "^[A-Z0-9]{6,10}$" },
1498
+ { code: "MN", name: "Mongolia", dialCode: "+976", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1499
+ { code: "ME", name: "Montenegro", dialCode: "+382", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1500
+ { code: "MS", name: "Montserrat", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1501
+ { code: "MA", name: "Morocco", dialCode: "+212", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1502
+ { code: "MZ", name: "Mozambique", dialCode: "+258", passportRegex: "^[A-Z0-9]{6,10}$" },
1503
+ { code: "MM", name: "Myanmar", dialCode: "+95", passportRegex: "^[A-Z]{1}[0-9]{6,7}$" },
1504
+ { code: "NA", name: "Namibia", dialCode: "+264", passportRegex: "^[A-Z0-9]{6,10}$" },
1505
+ { code: "NR", name: "Nauru", dialCode: "+674", passportRegex: "^[A-Z0-9]{6,10}$" },
1506
+ { code: "NP", name: "Nepal", dialCode: "+977", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1507
+ { code: "NL", name: "Netherlands", dialCode: "+31", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1508
+ { code: "NC", name: "New Caledonia", dialCode: "+687", passportRegex: "^[A-Z0-9]{6,10}$" },
1509
+ { code: "NZ", name: "New Zealand", dialCode: "+64", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1510
+ { code: "NI", name: "Nicaragua", dialCode: "+505", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1511
+ { code: "NE", name: "Niger", dialCode: "+227", passportRegex: "^[A-Z0-9]{6,10}$" },
1512
+ { code: "NG", name: "Nigeria", dialCode: "+234", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1513
+ { code: "NO", name: "Norway", dialCode: "+47", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1514
+ { code: "OM", name: "Oman", dialCode: "+968", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1515
+ { code: "PK", name: "Pakistan", dialCode: "+92", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1516
+ { code: "PW", name: "Palau", dialCode: "+680", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1517
+ { code: "PS", name: "Palestine", dialCode: "+970", passportRegex: "^[A-Z0-9]{6,10}$" },
1518
+ { code: "PA", name: "Panama", dialCode: "+507", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1519
+ { code: "PG", name: "Papua New Guinea", dialCode: "+675", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1520
+ { code: "PY", name: "Paraguay", dialCode: "+595", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1521
+ { code: "PE", name: "Peru", dialCode: "+51", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1522
+ { code: "PH", name: "Philippines", dialCode: "+63", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1523
+ { code: "PL", name: "Poland", dialCode: "+48", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
1524
+ { code: "PT", name: "Portugal", dialCode: "+351", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1525
+ { code: "RO", name: "Romania", dialCode: "+40", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1526
+ { code: "RU", name: "Russia", dialCode: "+7", passportRegex: "^[0-9]{9}$" },
1527
+ { code: "RW", name: "Rwanda", dialCode: "+250", passportRegex: "^[A-Z0-9]{6,10}$" },
1528
+ {
1529
+ code: "KN",
1530
+ name: "Saint Kitts and Nevis",
1531
+ dialCode: "+1",
1532
+ passportRegex: "^[A-Z]{2}[0-9]{7}$"
1533
+ },
1534
+ { code: "LC", name: "Saint Lucia", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1535
+ {
1536
+ code: "VC",
1537
+ name: "Saint Vincent and the Grenadines",
1538
+ dialCode: "+1",
1539
+ passportRegex: "^[A-Z]{2}[0-9]{7}$"
1540
+ },
1541
+ { code: "WS", name: "Samoa", dialCode: "+685", passportRegex: "^[A-Z0-9]{6,10}$" },
1542
+ { code: "SM", name: "San Marino", dialCode: "+378", passportRegex: "^[A-Z0-9]{6,10}$" },
1543
+ {
1544
+ code: "ST",
1545
+ name: "Sao Tome and Principe",
1546
+ dialCode: "+239",
1547
+ passportRegex: "^[A-Z0-9]{6,10}$"
1548
+ },
1549
+ { code: "SA", name: "Saudi Arabia", dialCode: "+966", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1550
+ { code: "SN", name: "Senegal", dialCode: "+221", passportRegex: "^[A-Z0-9]{6,10}$" },
1551
+ { code: "RS", name: "Serbia", dialCode: "+381", passportRegex: "^[A-Z0-9]{9}$" },
1552
+ { code: "SC", name: "Seychelles", dialCode: "+248", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1553
+ { code: "SL", name: "Sierra Leone", dialCode: "+232", passportRegex: "^[A-Z0-9]{6,10}$" },
1554
+ { code: "SG", name: "Singapore", dialCode: "+65", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1555
+ { code: "SK", name: "Slovakia", dialCode: "+421", passportRegex: "^[0-9]{9}$" },
1556
+ { code: "SI", name: "Slovenia", dialCode: "+386", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1557
+ { code: "SB", name: "Solomon Islands", dialCode: "+677", passportRegex: "^[A-Z0-9]{6,10}$" },
1558
+ { code: "SO", name: "Somalia", dialCode: "+252", passportRegex: "^[A-Z0-9]{6,10}$" },
1559
+ { code: "ZA", name: "South Africa", dialCode: "+27", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1560
+ { code: "ES", name: "Spain", dialCode: "+34", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1561
+ { code: "LK", name: "Sri Lanka", dialCode: "+94", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1562
+ { code: "SD", name: "Sudan", dialCode: "+249", passportRegex: "^[A-Z0-9]{6,10}$" },
1563
+ { code: "SR", name: "Suriname", dialCode: "+597", passportRegex: "^[A-Z0-9]{6,10}$" },
1564
+ { code: "SE", name: "Sweden", dialCode: "+46", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1565
+ { code: "CH", name: "Switzerland", dialCode: "+41", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1566
+ { code: "SY", name: "Syria", dialCode: "+963", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1567
+ { code: "TW", name: "Taiwan", dialCode: "+886", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
1568
+ { code: "TJ", name: "Tajikistan", dialCode: "+992", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1569
+ { code: "TZ", name: "Tanzania", dialCode: "+255", passportRegex: "^[A-Z0-9]{6,10}$" },
1570
+ { code: "TH", name: "Thailand", dialCode: "+66", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1571
+ { code: "TL", name: "Timor-Leste", dialCode: "+670", passportRegex: "^[A-Z0-9]{6,10}$" },
1572
+ { code: "TG", name: "Togo", dialCode: "+228", passportRegex: "^[A-Z0-9]{6,10}$" },
1573
+ { code: "TO", name: "Tonga", dialCode: "+676", passportRegex: "^[A-Z0-9]{6,10}$" },
1574
+ { code: "TT", name: "Trinidad and Tobago", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1575
+ { code: "TN", name: "Tunisia", dialCode: "+216", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1576
+ { code: "TR", name: "Turkey", dialCode: "+90", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1577
+ { code: "TM", name: "Turkmenistan", dialCode: "+993", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1578
+ {
1579
+ code: "TC",
1580
+ name: "Turks and Caicos Islands",
1581
+ dialCode: "+1",
1582
+ passportRegex: "^[A-Z0-9]{6,10}$"
1583
+ },
1584
+ { code: "TV", name: "Tuvalu", dialCode: "+688", passportRegex: "^[A-Z0-9]{6,10}$" },
1585
+ { code: "UG", name: "Uganda", dialCode: "+256", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1586
+ { code: "UA", name: "Ukraine", dialCode: "+380", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1587
+ {
1588
+ code: "AE",
1589
+ name: "United Arab Emirates",
1590
+ dialCode: "+971",
1591
+ passportRegex: "^[A-Z]{1}[0-9]{7}$"
1592
+ },
1593
+ { code: "GB", name: "United Kingdom", dialCode: "+44", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1594
+ { code: "US", name: "United States", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
1595
+ { code: "UY", name: "Uruguay", dialCode: "+598", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1596
+ { code: "UZ", name: "Uzbekistan", dialCode: "+998", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1597
+ { code: "VU", name: "Vanuatu", dialCode: "+678", passportRegex: "^[A-Z0-9]{6,10}$" },
1598
+ { code: "VA", name: "Vatican City", dialCode: "+379", passportRegex: "^[A-Z0-9]{6,10}$" },
1599
+ { code: "VE", name: "Venezuela", dialCode: "+58", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1600
+ { code: "VN", name: "Vietnam", dialCode: "+84", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1601
+ { code: "YE", name: "Yemen", dialCode: "+967", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1602
+ { code: "ZM", name: "Zambia", dialCode: "+260", passportRegex: "^[A-Z0-9]{6,10}$" },
1603
+ { code: "ZW", name: "Zimbabwe", dialCode: "+263", passportRegex: "^[A-Z0-9]{6,10}$" }
1604
+ ];
1605
+ var detectIdentityType = (value) => {
1606
+ if (!value) return "id";
1607
+ const stringValue = String(value);
1608
+ if (stringValue.includes("@")) return "email";
1609
+ if (stringValue.startsWith("+")) return "phone";
1610
+ return "id";
1611
+ };
1612
+ var detectEmailOrPhoneStrict = (value) => {
1613
+ if (!value) return "none";
1614
+ if (value.includes("@")) return "email";
1615
+ if (value.startsWith("+")) return "phone";
1616
+ if (/^0\d/.test(value)) return "phone";
1617
+ if (/^62\d/.test(value)) return "phone";
1618
+ return "none";
1619
+ };
1620
+ function InputDynamic({
1621
+ name,
1622
+ control,
1623
+ label,
1624
+ type,
1625
+ placeholder,
1626
+ required = false,
1627
+ disabled = false,
1628
+ options = [],
1629
+ multiple = false,
1630
+ accept,
1631
+ rows = 3,
1632
+ min,
1633
+ max,
1634
+ step,
1635
+ isMultiSelect = false,
1636
+ selectScrollbarColor,
1637
+ contentBefore,
1638
+ appearance = "outline",
1639
+ validationRules,
1640
+ helperText,
1641
+ className,
1642
+ layout,
1643
+ size,
1644
+ onClick,
1645
+ style,
1646
+ countryCodes = DEFAULT_COUNTRY_CODES,
1647
+ defaultCountry = "ID",
1648
+ maxLength,
1649
+ autoAdvance = false,
1650
+ otpIndex,
1651
+ hasError = false,
1652
+ autoComplete,
1653
+ onInput,
1654
+ contentAfter,
1655
+ onChange
1656
+ }) {
1657
+ const styles = useStyles7();
1658
+ const [showPassword, setShowPassword] = React2.useState(false);
1659
+ const [isPhoneMode, setIsPhoneMode] = React2.useState(false);
1660
+ const [emailOrPhoneType, setEmailOrPhoneType] = React2.useState("none");
1661
+ const [identityType, setIdentityType] = React2.useState("id");
1662
+ const [lastPhoneValue, setLastPhoneValue] = React2.useState("");
1663
+ const [lastEmailOrPhoneValue, setLastEmailOrPhoneValue] = React2.useState("");
1664
+ const inputRef = React2.useRef(null);
1665
+ const phoneInputRef = React2.useRef(null);
1666
+ const emailOrPhoneInputRef = React2.useRef(null);
1667
+ const shouldFocusRef = React2.useRef(false);
1668
+ const isBackspaceNavigationRef = React2.useRef(false);
1669
+ const getSelectStyles = (hasError2) => ({
1670
+ menuPortal: (base) => ({
1671
+ ...base,
1672
+ zIndex: 9999999,
1673
+ borderRadius: reactComponents.tokens.borderRadiusMedium
1674
+ }),
1675
+ control: (provided, state) => ({
1676
+ ...provided,
1677
+ borderColor: hasError2 ? reactComponents.tokens.colorPaletteRedBorder2 : state.isFocused ? reactComponents.tokens.colorBrandStroke1 : reactComponents.tokens.colorNeutralStroke1,
1678
+ borderRadius: reactComponents.tokens.borderRadiusMedium,
1679
+ minHeight: "40px",
1680
+ fontSize: reactComponents.tokens.fontSizeBase400,
1681
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1,
1682
+ boxShadow: state.isFocused ? `0 0 0 2px ${hasError2 ? reactComponents.tokens.colorPaletteRedBorder2 : reactComponents.tokens.colorBrandStroke1}` : "none",
1683
+ "&:hover": {
1684
+ borderColor: hasError2 ? reactComponents.tokens.colorPaletteRedBorder2 : reactComponents.tokens.colorNeutralStroke1Hover
1685
+ }
1686
+ }),
1687
+ menu: (provided) => ({
1688
+ ...provided,
1689
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
1690
+ borderRadius: reactComponents.tokens.borderRadiusMedium,
1691
+ zIndex: 9999
1692
+ }),
1693
+ menuList: (provided) => ({
1694
+ ...provided,
1695
+ padding: 0,
1696
+ // Opsional: bersihkan padding agar scrollbar mepet ke pinggir
1697
+ maxHeight: "300px",
1698
+ // Pastikan ada limit height agar scrollbar muncul
1699
+ /* Targetkan Webkit Scrollbar di menuList */
1700
+ "&::-webkit-scrollbar": {
1701
+ width: "8px",
1702
+ display: "block"
1703
+ // Pastikan tampil
1704
+ },
1705
+ "&::-webkit-scrollbar-track": {
1706
+ backgroundColor: reactComponents.tokens.colorNeutralBackground2,
1707
+ borderRadius: "4px"
1708
+ },
1709
+ "&::-webkit-scrollbar-thumb": {
1710
+ backgroundColor: selectScrollbarColor || reactComponents.tokens.colorNeutralStroke2,
1711
+ borderRadius: "4px"
1712
+ },
1713
+ "&::-webkit-scrollbar-thumb:hover": {
1714
+ backgroundColor: selectScrollbarColor || reactComponents.tokens.colorBrandBackground
1715
+ },
1716
+ "&::-webkit-scrollbar-thumb:active": {
1717
+ backgroundColor: selectScrollbarColor || reactComponents.tokens.colorBrandBackgroundPressed
1718
+ }
1719
+ }),
1720
+ option: (provided, state) => ({
1721
+ ...provided,
1722
+ fontSize: reactComponents.tokens.fontSizeBase300,
1723
+ color: state.isSelected ? reactComponents.tokens.colorNeutralForegroundOnBrand : reactComponents.tokens.colorNeutralForeground1,
1724
+ backgroundColor: state.isSelected ? reactComponents.tokens.colorBrandBackground : state.isFocused ? reactComponents.tokens.colorNeutralBackground1Hover : "transparent"
1725
+ }),
1726
+ placeholder: (provided) => ({
1727
+ ...provided,
1728
+ color: reactComponents.tokens.colorNeutralForeground3,
1729
+ fontSize: reactComponents.tokens.fontSizeBase400
1730
+ }),
1731
+ singleValue: (provided) => ({
1732
+ ...provided,
1733
+ color: reactComponents.tokens.colorNeutralForeground1,
1734
+ fontSize: reactComponents.tokens.fontSizeBase400
1735
+ })
1736
+ });
1737
+ React2.useEffect(() => {
1738
+ if (shouldFocusRef.current) {
1739
+ setTimeout(() => {
1740
+ if (identityType === "phone" && phoneInputRef.current) {
1741
+ const phoneInput = phoneInputRef.current.querySelector("input.form-control");
1742
+ if (phoneInput) {
1743
+ phoneInput.focus();
1744
+ const len = phoneInput.value.length;
1745
+ phoneInput.setSelectionRange(len, len);
1746
+ }
1747
+ } else if (inputRef.current) {
1748
+ inputRef.current.focus();
1749
+ const inputType = inputRef.current.type;
1750
+ if (inputType === "text" || inputType === "tel" || inputType === "url" || inputType === "search") {
1751
+ const len = inputRef.current.value.length;
1752
+ inputRef.current.setSelectionRange(len, len);
1753
+ }
1754
+ }
1755
+ shouldFocusRef.current = false;
1756
+ }, 50);
1757
+ }
1758
+ }, [identityType]);
1759
+ React2.useEffect(() => {
1760
+ if (shouldFocusRef.current && type === "emailOrPhone") {
1761
+ setTimeout(() => {
1762
+ if (emailOrPhoneType === "phone" && emailOrPhoneInputRef.current) {
1763
+ const phoneInput = emailOrPhoneInputRef.current.querySelector("input.form-control");
1764
+ if (phoneInput) {
1765
+ phoneInput.focus();
1766
+ const len = phoneInput.value.length;
1767
+ phoneInput.setSelectionRange(len, len);
1768
+ }
1769
+ } else if (inputRef.current) {
1770
+ inputRef.current.focus();
1771
+ const inputType = inputRef.current.type;
1772
+ if (inputType === "text" || inputType === "tel" || inputType === "url" || inputType === "search") {
1773
+ const len = inputRef.current.value.length;
1774
+ inputRef.current.setSelectionRange(len, len);
1775
+ }
1776
+ }
1777
+ shouldFocusRef.current = false;
1778
+ }, 50);
1779
+ }
1780
+ }, [emailOrPhoneType, type]);
1781
+ const updateIdentityType = (value) => {
1782
+ const stringValue = typeof value === "string" ? value : value?.phoneNumber || "";
1783
+ const detectedType = detectIdentityType(stringValue);
1784
+ if (detectedType !== identityType) {
1785
+ setIdentityType(detectedType);
1786
+ }
1787
+ };
1788
+ const updateEmailOrPhoneType = (value) => {
1789
+ const stringValue = typeof value === "string" ? value : "";
1790
+ const detectedType = detectEmailOrPhoneStrict(stringValue);
1791
+ if (detectedType !== emailOrPhoneType) {
1792
+ setEmailOrPhoneType(detectedType);
1793
+ }
1794
+ };
1795
+ const renderInput = (field, error) => {
1796
+ const shouldTransparentBorder = disabled && appearance !== "outline" && appearance !== "underline";
1797
+ const inputStyle = shouldTransparentBorder ? { ...style, border: "transparent" } : style;
1798
+ const handleInputChange = (e) => {
1799
+ field.onChange(e);
1800
+ if (onChange) {
1801
+ onChange(e.target?.value ?? e);
1802
+ }
1803
+ };
1804
+ const commonProps = {
1805
+ ...field,
1806
+ onChange: handleInputChange,
1807
+ value: field.value ?? "",
1808
+ placeholder,
1809
+ disabled,
1810
+ appearance: error ? "invalid" : appearance,
1811
+ size,
1812
+ contentBefore,
1813
+ onClick,
1814
+ style: inputStyle,
1815
+ maxLength,
1816
+ autoComplete: autoComplete || "off",
1817
+ contentAfter,
1818
+ max
1819
+ };
1820
+ const otpMatch = /^otp(\d+)$/.exec(String(name));
1821
+ const otpIndex2 = otpMatch ? parseInt(otpMatch[1], 10) : null;
1822
+ if (type === "emailOrPhone") {
1823
+ updateEmailOrPhoneType(field.value);
1824
+ const stringValue = typeof field.value === "string" ? field.value : "";
1825
+ let inputType = "text";
1826
+ let inputPlaceholder = placeholder || "Email atau Nomor HP";
1827
+ if (emailOrPhoneType === "email") {
1828
+ inputType = "email";
1829
+ inputPlaceholder = placeholder || "Email";
1830
+ } else if (emailOrPhoneType === "phone") {
1831
+ inputType = "tel";
1832
+ inputPlaceholder = placeholder || "Nomor HP";
1833
+ }
1834
+ const normalizePhoneNumber = (val) => {
1835
+ if (!val) return val;
1836
+ if (val.startsWith("08")) {
1837
+ return "+62" + val.substring(1);
1838
+ }
1839
+ if (val.startsWith("62") && !val.startsWith("+")) {
1840
+ return "+" + val;
1841
+ }
1842
+ return val;
1843
+ };
1844
+ const cleanPhoneValue = (val) => {
1845
+ if (!val) return val;
1846
+ const match = val.match(/^(\d{1,4})(0\d+)$/);
1847
+ if (match) {
1848
+ return match[1] + match[2].substring(1);
1849
+ }
1850
+ return val;
1851
+ };
1852
+ emailOrPhoneType === "phone" ? cleanPhoneValue(stringValue) : stringValue;
1853
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.phoneContainer, children: emailOrPhoneType === "phone" ? /* @__PURE__ */ jsxRuntime.jsx(
1854
+ "div",
1855
+ {
1856
+ ref: emailOrPhoneInputRef,
1857
+ className: `${styles.phoneInputWrapper} ${error ? styles.phoneInputError : ""}`,
1858
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1859
+ PhoneInput__default.default,
1860
+ {
1861
+ country: defaultCountry.toLowerCase(),
1862
+ value: stringValue.startsWith("+") ? stringValue.substring(1) : stringValue,
1863
+ onChange: (value, data) => {
1864
+ if (!value) {
1865
+ shouldFocusRef.current = true;
1866
+ field.onChange("");
1867
+ updateEmailOrPhoneType("");
1868
+ setLastEmailOrPhoneValue("");
1869
+ return;
1870
+ }
1871
+ const countryDialCode = data?.dialCode || "";
1872
+ if (value === countryDialCode) {
1873
+ const dialCodeChanged = lastEmailOrPhoneValue && lastEmailOrPhoneValue !== countryDialCode && !lastEmailOrPhoneValue.startsWith(countryDialCode);
1874
+ const isInitial = !lastEmailOrPhoneValue;
1875
+ const wasFullNumber = lastEmailOrPhoneValue && lastEmailOrPhoneValue.length > 3;
1876
+ if (isInitial || dialCodeChanged || wasFullNumber) {
1877
+ const phoneValue2 = "+" + value;
1878
+ field.onChange(phoneValue2);
1879
+ updateEmailOrPhoneType(phoneValue2);
1880
+ setLastEmailOrPhoneValue(value);
1881
+ return;
1882
+ } else {
1883
+ shouldFocusRef.current = true;
1884
+ field.onChange("");
1885
+ updateEmailOrPhoneType("");
1886
+ setLastEmailOrPhoneValue("");
1887
+ return;
1888
+ }
1889
+ }
1890
+ const phoneValue = "+" + value;
1891
+ field.onChange(phoneValue);
1892
+ updateEmailOrPhoneType(phoneValue);
1893
+ setLastEmailOrPhoneValue(value);
1894
+ },
1895
+ placeholder: inputPlaceholder,
1896
+ disabled,
1897
+ enableSearch: true
1898
+ }
1899
+ )
1900
+ }
1901
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1902
+ reactComponents.Input,
1903
+ {
1904
+ ref: inputRef,
1905
+ value: stringValue,
1906
+ maxLength,
1907
+ autoComplete: autoComplete || "off",
1908
+ onChange: (e) => {
1909
+ const newValue = e.target.value;
1910
+ const willSwitchType = emailOrPhoneType !== detectEmailOrPhoneStrict(newValue);
1911
+ if (willSwitchType) shouldFocusRef.current = true;
1912
+ let normalizedValue = newValue;
1913
+ const detectedType = detectEmailOrPhoneStrict(newValue);
1914
+ if (detectedType === "phone") {
1915
+ normalizedValue = normalizePhoneNumber(newValue);
1916
+ }
1917
+ field.onChange(normalizedValue);
1918
+ updateEmailOrPhoneType(normalizedValue);
1919
+ },
1920
+ placeholder: inputPlaceholder,
1921
+ disabled,
1922
+ appearance,
1923
+ size,
1924
+ type: inputType,
1925
+ style: { width: "100%" }
1926
+ }
1927
+ ) });
1928
+ }
1929
+ if (type === "identity") {
1930
+ updateIdentityType(field.value);
1931
+ const stringValue = typeof field.value === "string" ? field.value : "";
1932
+ let inputType = "text";
1933
+ let inputPlaceholder = placeholder || "Email, KTP, SIM, Passport, atau Nomor Telepon";
1934
+ if (identityType === "email") {
1935
+ inputType = "email";
1936
+ inputPlaceholder = placeholder || "Email";
1937
+ } else if (identityType === "phone") {
1938
+ inputType = "tel";
1939
+ inputPlaceholder = placeholder || "Nomor telepon";
1940
+ } else if (identityType === "id") {
1941
+ inputType = "text";
1942
+ inputPlaceholder = placeholder || "KTP, SIM, atau Passport";
1943
+ }
1944
+ const cleanPhoneValue = (val) => {
1945
+ if (!val) return val;
1946
+ const stringVal = String(val);
1947
+ const match = stringVal.match(/^(\d{1,4})(0\d+)$/);
1948
+ if (match) {
1949
+ return match[1] + match[2].substring(1);
1950
+ }
1951
+ return stringVal;
1952
+ };
1953
+ identityType === "phone" ? cleanPhoneValue(stringValue) : stringValue;
1954
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.phoneContainer, children: identityType === "phone" ? /* @__PURE__ */ jsxRuntime.jsx(
1955
+ "div",
1956
+ {
1957
+ ref: phoneInputRef,
1958
+ className: `${styles.phoneInputWrapper} ${error ? styles.phoneInputError : ""}`,
1959
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1960
+ PhoneInput__default.default,
1961
+ {
1962
+ country: defaultCountry.toLowerCase(),
1963
+ value: stringValue.startsWith("+") ? stringValue.substring(1) : stringValue,
1964
+ onChange: (value, data) => {
1965
+ if (!value) {
1966
+ shouldFocusRef.current = true;
1967
+ field.onChange("");
1968
+ updateIdentityType("");
1969
+ setLastPhoneValue("");
1970
+ return;
1971
+ }
1972
+ const countryDialCode = data?.dialCode || "";
1973
+ if (value === countryDialCode) {
1974
+ const dialCodeChanged = lastPhoneValue && lastPhoneValue !== countryDialCode && !lastPhoneValue.startsWith(countryDialCode);
1975
+ const isInitial = !lastPhoneValue;
1976
+ const wasFullNumber = lastPhoneValue && lastPhoneValue.length > 3;
1977
+ if (isInitial || dialCodeChanged || wasFullNumber) {
1978
+ const phoneValue2 = "+" + value;
1979
+ field.onChange(phoneValue2);
1980
+ updateIdentityType(phoneValue2);
1981
+ setLastPhoneValue(value);
1982
+ return;
1983
+ } else {
1984
+ shouldFocusRef.current = true;
1985
+ field.onChange("");
1986
+ updateIdentityType("");
1987
+ setLastPhoneValue("");
1988
+ return;
1989
+ }
1990
+ }
1991
+ const phoneValue = "+" + value;
1992
+ field.onChange(phoneValue);
1993
+ updateIdentityType(phoneValue);
1994
+ setLastPhoneValue(value);
1995
+ },
1996
+ placeholder: inputPlaceholder,
1997
+ disabled,
1998
+ enableSearch: true,
1999
+ disableSearchIcon: true
2000
+ }
2001
+ )
2002
+ }
2003
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2004
+ reactComponents.Input,
2005
+ {
2006
+ ref: inputRef,
2007
+ value: stringValue,
2008
+ maxLength,
2009
+ autoComplete: autoComplete || "off",
2010
+ onChange: (e) => {
2011
+ const newValue = e.target.value;
2012
+ const willSwitchType = identityType !== detectIdentityType(newValue);
2013
+ if (willSwitchType) shouldFocusRef.current = true;
2014
+ field.onChange(newValue);
2015
+ updateIdentityType(newValue);
2016
+ },
2017
+ placeholder: inputPlaceholder,
2018
+ disabled,
2019
+ appearance,
2020
+ size,
2021
+ type: inputType,
2022
+ style: { width: "100%" }
2023
+ }
2024
+ ) });
2025
+ }
2026
+ switch (type) {
2027
+ case "textarea":
2028
+ return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Textarea, { ...commonProps, rows, resize: "vertical" });
2029
+ case "select":
2030
+ return /* @__PURE__ */ jsxRuntime.jsx(
2031
+ Select__default.default,
2032
+ {
2033
+ ...field,
2034
+ name: `${String(name)}_${Math.random().toString(36).substring(7)}`,
2035
+ isDisabled: disabled,
2036
+ placeholder,
2037
+ options,
2038
+ styles: getSelectStyles(!!error),
2039
+ className: styles.reactSelect,
2040
+ classNamePrefix: "react-select",
2041
+ isMulti: isMultiSelect,
2042
+ inputProps: {
2043
+ autoComplete: "new-password",
2044
+ autoCorrect: "off",
2045
+ autoCapitalize: "off",
2046
+ spellCheck: "false"
2047
+ },
2048
+ value: isMultiSelect ? options.filter((option) => field.value?.includes(option.value)) : options.find((option) => option.value === field.value) || null,
2049
+ onChange: (selectedOption) => {
2050
+ if (isMultiSelect) {
2051
+ const values = selectedOption ? selectedOption.map((opt) => opt.value) : [];
2052
+ field.onChange(values);
2053
+ } else {
2054
+ field.onChange(selectedOption ? selectedOption.value : "");
2055
+ }
2056
+ },
2057
+ getOptionLabel: (option) => option.label,
2058
+ getOptionValue: (option) => option.value,
2059
+ isOptionDisabled: (option) => option.disabled || false
2060
+ }
2061
+ );
2062
+ case "phone": {
2063
+ const cleanPhoneValue = (val) => {
2064
+ if (!val) return val;
2065
+ const stringVal = String(val);
2066
+ const match = stringVal.match(/^(\d{1,4})(0\d+)$/);
2067
+ if (match) {
2068
+ return match[1] + match[2].substring(1);
2069
+ }
2070
+ return stringVal;
2071
+ };
2072
+ const cleanedFieldValue = cleanPhoneValue(field.value || "");
2073
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles.phoneInputWrapper} ${error ? styles.phoneInputError : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
2074
+ PhoneInput__default.default,
2075
+ {
2076
+ country: defaultCountry.toLowerCase(),
2077
+ value: cleanedFieldValue,
2078
+ onChange: (value, data) => {
2079
+ const cleanedValue = cleanPhoneValue(value || "");
2080
+ field.onChange(cleanedValue);
2081
+ },
2082
+ placeholder: placeholder || "Nomor telepon",
2083
+ disabled,
2084
+ enableSearch: true,
2085
+ disableSearchIcon: true
2086
+ }
2087
+ ) });
2088
+ }
2089
+ case "passport": {
2090
+ const passportValue = field.value || {
2091
+ countryCode: defaultCountry,
2092
+ phoneNumber: ""
2093
+ };
2094
+ const countryOptions = countryCodes.map((country) => ({
2095
+ value: country.code,
2096
+ label: country.name,
2097
+ code: country.code,
2098
+ passportRegex: country.passportRegex
2099
+ }));
2100
+ const formatOptionLabel = (option) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2101
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "18px" }, children: String.fromCodePoint(
2102
+ ...option.code.split("").map((char) => 127397 + char.charCodeAt(0))
2103
+ ) }),
2104
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
2105
+ ] });
2106
+ const selectedCountry = countryOptions.find((opt) => opt.value === passportValue.countryCode);
2107
+ const isCountrySelected = !!selectedCountry;
2108
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.phoneContainer, children: [
2109
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.phoneCountrySelect, children: /* @__PURE__ */ jsxRuntime.jsx(
2110
+ Select__default.default,
2111
+ {
2112
+ value: selectedCountry || null,
2113
+ onChange: (selectedOption) => {
2114
+ field.onChange({
2115
+ ...passportValue,
2116
+ countryCode: selectedOption ? selectedOption.value : defaultCountry
2117
+ });
2118
+ },
2119
+ options: countryOptions,
2120
+ isDisabled: disabled,
2121
+ placeholder: "\xF0\u0178\x8F\xB3\xEF\xB8\x8F",
2122
+ styles: getSelectStyles(!!error),
2123
+ isSearchable: true,
2124
+ formatOptionLabel
2125
+ }
2126
+ ) }),
2127
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
2128
+ reactComponents.Input,
2129
+ {
2130
+ value: passportValue.phoneNumber,
2131
+ maxLength,
2132
+ autoComplete: autoComplete || "off",
2133
+ onChange: (e) => {
2134
+ field.onChange({
2135
+ ...passportValue,
2136
+ phoneNumber: e.target.value
2137
+ });
2138
+ },
2139
+ placeholder: placeholder || "Nomor paspor",
2140
+ disabled: disabled || !isCountrySelected,
2141
+ appearance,
2142
+ size,
2143
+ type: "text",
2144
+ style: { width: "100%" }
2145
+ }
2146
+ ) })
2147
+ ] });
2148
+ }
2149
+ case "file":
2150
+ return /* @__PURE__ */ jsxRuntime.jsx(
2151
+ "input",
2152
+ {
2153
+ ...field,
2154
+ type: "file",
2155
+ multiple,
2156
+ accept,
2157
+ disabled,
2158
+ className: styles.fileInput,
2159
+ value: void 0,
2160
+ onChange: (e) => {
2161
+ const files = e.target.files;
2162
+ field.onChange(multiple ? files : files?.[0]);
2163
+ }
2164
+ }
2165
+ );
2166
+ case "switch":
2167
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.switchWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(
2168
+ reactComponents.Switch,
2169
+ {
2170
+ ...field,
2171
+ checked: field.value || false,
2172
+ disabled,
2173
+ onChange: (_, data) => field.onChange(data.checked)
2174
+ }
2175
+ ) });
2176
+ case "date":
2177
+ return /* @__PURE__ */ jsxRuntime.jsx(DatePickerInput_default, { ...commonProps, field });
2178
+ case "radio":
2179
+ return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.RadioGroup, { ...field, disabled, layout: layout ?? "vertical", children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
2180
+ reactComponents.Radio,
2181
+ {
2182
+ value: option.value,
2183
+ label: option.label,
2184
+ disabled: option.disabled
2185
+ },
2186
+ option.value
2187
+ )) });
2188
+ case "radiobutton":
2189
+ return /* @__PURE__ */ jsxRuntime.jsx(
2190
+ reactComponents.RadioGroup,
2191
+ {
2192
+ ...field,
2193
+ disabled,
2194
+ layout: layout ?? "horizontal",
2195
+ className: styles.classRadioGroup,
2196
+ children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
2197
+ reactComponents.Radio,
2198
+ {
2199
+ value: option.value,
2200
+ label: option.label,
2201
+ disabled: option.disabled,
2202
+ className: styles.classRadio
2203
+ },
2204
+ option.value
2205
+ ))
2206
+ }
2207
+ );
2208
+ case "checkbox":
2209
+ return /* @__PURE__ */ jsxRuntime.jsx(
2210
+ reactComponents.Checkbox,
2211
+ {
2212
+ ...field,
2213
+ checked: field.value || false,
2214
+ disabled,
2215
+ onChange: (_, data) => field.onChange(data.checked),
2216
+ label
2217
+ }
2218
+ );
2219
+ case "number":
2220
+ return /* @__PURE__ */ jsxRuntime.jsx(
2221
+ reactComponents.Input,
2222
+ {
2223
+ ...commonProps,
2224
+ type: "number",
2225
+ min,
2226
+ max,
2227
+ step,
2228
+ className: styles.inputWithAutocomplete
2229
+ }
2230
+ );
2231
+ case "time":
2232
+ case "datetime-local":
2233
+ return /* @__PURE__ */ jsxRuntime.jsx(
2234
+ reactComponents.Input,
2235
+ {
2236
+ ...commonProps,
2237
+ type,
2238
+ min,
2239
+ max,
2240
+ className: styles.inputWithAutocomplete
2241
+ }
2242
+ );
2243
+ case "password":
2244
+ return /* @__PURE__ */ jsxRuntime.jsx(
2245
+ reactComponents.Input,
2246
+ {
2247
+ ...commonProps,
2248
+ type: showPassword ? "text" : "password",
2249
+ className: styles.inputWithAutocomplete,
2250
+ contentAfter: /* @__PURE__ */ jsxRuntime.jsx(
2251
+ reactComponents.Button,
2252
+ {
2253
+ appearance: "transparent",
2254
+ icon: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:eye-off-24-filled" }) : /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:eye-24-filled" }),
2255
+ "aria-label": showPassword ? "Hide password" : "Show password",
2256
+ onClick: () => setShowPassword(!showPassword),
2257
+ tabIndex: -1,
2258
+ type: "button"
2259
+ }
2260
+ )
2261
+ }
2262
+ );
2263
+ case "otp": {
2264
+ const setRefs = (el) => {
2265
+ try {
2266
+ if (field.ref) {
2267
+ if (typeof field.ref === "function") field.ref(el);
2268
+ else field.ref.current = el;
2269
+ }
2270
+ } catch {
2271
+ }
2272
+ inputRef.current = el;
2273
+ };
2274
+ const handleChange = (e) => {
2275
+ const val = e?.target?.value ?? "";
2276
+ const numericValue = val.replace(/\D/g, "");
2277
+ if (inputRef.current) {
2278
+ inputRef.current.value = numericValue;
2279
+ }
2280
+ const numericEvent = {
2281
+ ...e,
2282
+ target: {
2283
+ ...e.target,
2284
+ value: numericValue
2285
+ }
2286
+ };
2287
+ field.onChange(numericEvent);
2288
+ if (autoAdvance && otpIndex2 && maxLength && numericValue.length >= maxLength) {
2289
+ const next = document.querySelector(
2290
+ `[data-otp-index="${otpIndex2 + 1}"]`
2291
+ );
2292
+ if (next) next.focus();
2293
+ }
2294
+ };
2295
+ const handleKeyPress = (e) => {
2296
+ const char = e.key;
2297
+ if (!/^\d$/.test(char) && char !== "Backspace" && char !== "Delete" && char !== "Tab" && char !== "ArrowLeft" && char !== "ArrowRight") {
2298
+ e.preventDefault();
2299
+ }
2300
+ };
2301
+ const handleKeyDown = (e) => {
2302
+ if (e.key === "Backspace") {
2303
+ const curVal = field.value || "";
2304
+ if (!curVal && otpIndex2 !== null && otpIndex2 !== void 0) {
2305
+ const prevIndex = otpIndex2 - 1;
2306
+ if (prevIndex >= 1) {
2307
+ isBackspaceNavigationRef.current = true;
2308
+ const prev = document.querySelector(
2309
+ `[data-otp-index="${prevIndex}"]`
2310
+ );
2311
+ if (prev) {
2312
+ prev.focus();
2313
+ }
2314
+ }
2315
+ }
2316
+ }
2317
+ };
2318
+ const handleClick = (e) => {
2319
+ if (otpIndex2) {
2320
+ let lastFilledIndex = 0;
2321
+ for (let i = 1; i <= 6; i++) {
2322
+ const input = document.querySelector(`[data-otp-index="${i}"]`);
2323
+ if (input && input.value) {
2324
+ lastFilledIndex = i;
2325
+ } else {
2326
+ break;
2327
+ }
2328
+ }
2329
+ const targetIndex = lastFilledIndex === 6 ? 6 : lastFilledIndex + 1;
2330
+ if (otpIndex2 < targetIndex) {
2331
+ e.preventDefault();
2332
+ const targetInput = document.querySelector(
2333
+ `[data-otp-index="${targetIndex}"]`
2334
+ );
2335
+ if (targetInput) {
2336
+ targetInput.focus();
2337
+ const length = targetInput.value?.length || 0;
2338
+ setTimeout(() => {
2339
+ targetInput.setSelectionRange(length, length);
2340
+ }, 0);
2341
+ }
2342
+ return;
2343
+ }
2344
+ }
2345
+ if (inputRef.current) {
2346
+ const length = inputRef.current.value?.length || 0;
2347
+ setTimeout(() => {
2348
+ inputRef.current?.setSelectionRange(length, length);
2349
+ }, 0);
2350
+ }
2351
+ };
2352
+ const handleMouseDown = (e) => {
2353
+ isBackspaceNavigationRef.current = false;
2354
+ if (field.value) {
2355
+ e.preventDefault();
2356
+ if (inputRef.current) {
2357
+ inputRef.current.focus();
2358
+ const length = inputRef.current.value.length;
2359
+ inputRef.current.setSelectionRange(length, length);
2360
+ }
2361
+ }
2362
+ };
2363
+ const handleSelect = (e) => {
2364
+ if (inputRef.current && field.value) {
2365
+ const length = inputRef.current.value.length;
2366
+ inputRef.current.setSelectionRange(length, length);
2367
+ }
2368
+ };
2369
+ const handleFocus = (e) => {
2370
+ };
2371
+ const inputAttrs = {};
2372
+ if (otpIndex2) inputAttrs["data-otp-index"] = otpIndex2;
2373
+ const otpStyles = {
2374
+ height: "57px",
2375
+ borderRadius: reactComponents.tokens.borderRadiusXLarge,
2376
+ textAlign: "center",
2377
+ ...reactComponents.typographyStyles.title2,
2378
+ fontWeight: fontWeight.Medium,
2379
+ lineHeight: reactComponents.tokens.lineHeightHero800,
2380
+ borderColor: hasError ? sharedColors.Shared_Cranberry_Primary : void 0,
2381
+ ...style
2382
+ // Allow override from props
2383
+ };
2384
+ return /* @__PURE__ */ jsxRuntime.jsx(
2385
+ reactComponents.Input,
2386
+ {
2387
+ ...commonProps,
2388
+ type: "tel",
2389
+ onChange: handleChange,
2390
+ onKeyDown: handleKeyDown,
2391
+ onKeyPress: handleKeyPress,
2392
+ onClick: handleClick,
2393
+ onMouseDown: handleMouseDown,
2394
+ onSelect: handleSelect,
2395
+ onFocus: handleFocus,
2396
+ ref: setRefs,
2397
+ style: otpStyles,
2398
+ className: styles.otpInput,
2399
+ ...inputAttrs
2400
+ }
2401
+ );
2402
+ }
2403
+ default:
2404
+ return /* @__PURE__ */ jsxRuntime.jsx(
2405
+ reactComponents.Input,
2406
+ {
2407
+ ...commonProps,
2408
+ type,
2409
+ onInput,
2410
+ className: styles.inputWithAutocomplete
2411
+ }
2412
+ );
2413
+ }
2414
+ };
2415
+ const getValidationRules = () => {
2416
+ const rules = {};
2417
+ if (required) {
2418
+ rules.required = validationRules?.required || "Field ini wajib diisi";
2419
+ }
2420
+ if (validationRules?.minLength) {
2421
+ rules.minLength = validationRules.minLength;
2422
+ }
2423
+ if (validationRules?.maxLength) {
2424
+ rules.maxLength = validationRules.maxLength;
2425
+ }
2426
+ if (validationRules?.pattern) {
2427
+ rules.pattern = validationRules.pattern;
2428
+ }
2429
+ if (validationRules?.min) {
2430
+ rules.min = validationRules.min;
2431
+ }
2432
+ if (validationRules?.max) {
2433
+ rules.max = validationRules.max;
2434
+ }
2435
+ if (validationRules?.validate) {
2436
+ rules.validate = validationRules.validate;
2437
+ }
2438
+ if (type === "email") {
2439
+ rules.pattern = {
2440
+ value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
2441
+ message: "Email tidak valid"
2442
+ };
2443
+ }
2444
+ if (type === "emailOrPhone") {
2445
+ rules.validate = (value) => {
2446
+ if (required && !value) {
2447
+ return "Email atau nomor HP wajib diisi";
2448
+ }
2449
+ const stringValue = typeof value === "string" ? value : "";
2450
+ if (!stringValue) return true;
2451
+ const detectedType = detectEmailOrPhoneStrict(stringValue);
2452
+ if (detectedType === "email") {
2453
+ if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(stringValue)) {
2454
+ return "Format email tidak valid";
2455
+ }
2456
+ } else if (detectedType === "phone") {
2457
+ if (!stringValue.startsWith("+")) {
2458
+ return "Nomor HP harus dalam format internasional (contoh: +628123456789)";
2459
+ }
2460
+ const phoneDigits = stringValue.substring(1);
2461
+ if (!/^\d+$/.test(phoneDigits)) {
2462
+ return "Nomor HP hanya boleh berisi angka setelah +";
2463
+ }
2464
+ if (phoneDigits.length < 10) {
2465
+ return "Nomor HP minimal 10 digit";
2466
+ }
2467
+ } else {
2468
+ return "Masukkan email atau nomor HP yang valid";
2469
+ }
2470
+ return true;
2471
+ };
2472
+ }
2473
+ if (type === "identity") {
2474
+ rules.validate = (value) => {
2475
+ if (required && !value) {
2476
+ return "Field ini wajib diisi";
2477
+ }
2478
+ const stringValue = typeof value === "string" ? value : value?.phoneNumber || "";
2479
+ if (!stringValue) return true;
2480
+ const detectedType = detectIdentityType(stringValue);
2481
+ if (detectedType === "email") {
2482
+ if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(stringValue)) {
2483
+ return "Format email tidak valid";
2484
+ }
2485
+ } else if (detectedType === "phone") {
2486
+ if (!stringValue.startsWith("+")) {
2487
+ return "Nomor telepon harus diawali dengan +";
2488
+ }
2489
+ const phoneDigits = stringValue.substring(1);
2490
+ if (!/^\d+$/.test(phoneDigits)) {
2491
+ return "Nomor telepon hanya boleh berisi angka setelah +";
2492
+ }
2493
+ }
2494
+ return true;
2495
+ };
2496
+ }
2497
+ if (type === "phone") {
2498
+ rules.validate = (value) => {
2499
+ if (required && !value) {
2500
+ return "Nomor telepon wajib diisi";
2501
+ }
2502
+ return true;
2503
+ };
2504
+ }
2505
+ if (type === "passport") {
2506
+ rules.validate = (value) => {
2507
+ if (required && !value?.phoneNumber) {
2508
+ return "Nomor paspor wajib diisi";
2509
+ }
2510
+ if (value?.phoneNumber) {
2511
+ const selectedCountry = countryCodes.find((c) => c.code === value.countryCode);
2512
+ if (selectedCountry?.passportRegex) {
2513
+ const passportRegex = new RegExp(selectedCountry.passportRegex);
2514
+ if (!passportRegex.test(value.phoneNumber)) {
2515
+ return `Format paspor ${selectedCountry.name} tidak valid`;
2516
+ }
2517
+ }
2518
+ }
2519
+ return true;
2520
+ };
2521
+ }
2522
+ return rules;
2523
+ };
2524
+ return /* @__PURE__ */ jsxRuntime.jsx(
2525
+ reactHookForm.Controller,
2526
+ {
2527
+ name,
2528
+ control,
2529
+ rules: getValidationRules(),
2530
+ render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsxRuntime.jsxs(
2531
+ reactComponents.Field,
2532
+ {
2533
+ className: `${styles.field} ${className || ""}`,
2534
+ validationMessage: error?.message,
2535
+ validationState: error ? "error" : "none",
2536
+ children: [
2537
+ label && type !== "checkbox" && /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Label, { required, children: label }),
2538
+ renderInput(field, error?.message),
2539
+ helperText && !error && /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Text, { size: 200, style: { textAlign: "left" }, className: styles.helperText, children: helperText })
2540
+ ]
2541
+ }
2542
+ )
2543
+ }
2544
+ );
2545
+ }
2546
+ var InputDynamic_default = InputDynamic;
2547
+
2548
+ // src/components/InputDynamic/constants.ts
2549
+ var DEFAULT_COUNTRY_CODES2 = [
2550
+ { code: "AF", name: "Afghanistan", dialCode: "+93", passportRegex: "^[A-Z][0-9]{7}$" },
2551
+ { code: "AL", name: "Albania", dialCode: "+355", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2552
+ { code: "DZ", name: "Algeria", dialCode: "+213", passportRegex: "^[0-9]{9}$" },
2553
+ { code: "AS", name: "American Samoa", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
2554
+ { code: "AD", name: "Andorra", dialCode: "+376", passportRegex: "^[A-Z0-9]{6,10}$" },
2555
+ { code: "AO", name: "Angola", dialCode: "+244", passportRegex: "^[A-Z0-9]{6,10}$" },
2556
+ { code: "AI", name: "Anguilla", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2557
+ { code: "AQ", name: "Antarctica", dialCode: "+672", passportRegex: "^[A-Z0-9]{6,10}$" },
2558
+ { code: "AG", name: "Antigua and Barbuda", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2559
+ { code: "AR", name: "Argentina", dialCode: "+54", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2560
+ { code: "AM", name: "Armenia", dialCode: "+374", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2561
+ { code: "AW", name: "Aruba", dialCode: "+297", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2562
+ { code: "AU", name: "Australia", dialCode: "+61", passportRegex: "^[A-Z][0-9]{7}$" },
2563
+ { code: "AT", name: "Austria", dialCode: "+43", passportRegex: "^[A-Z0-9]{8}$" },
2564
+ { code: "AZ", name: "Azerbaijan", dialCode: "+994", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2565
+ { code: "BS", name: "Bahamas", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2566
+ { code: "BH", name: "Bahrain", dialCode: "+973", passportRegex: "^[A-Z][0-9]{7}$" },
2567
+ { code: "BD", name: "Bangladesh", dialCode: "+880", passportRegex: "^[A-Z][0-9]{7}$" },
2568
+ { code: "BB", name: "Barbados", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2569
+ { code: "BY", name: "Belarus", dialCode: "+375", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2570
+ { code: "BE", name: "Belgium", dialCode: "+32", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2571
+ { code: "BZ", name: "Belize", dialCode: "+501", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2572
+ { code: "BJ", name: "Benin", dialCode: "+229", passportRegex: "^[A-Z0-9]{6,10}$" },
2573
+ { code: "BM", name: "Bermuda", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2574
+ { code: "BT", name: "Bhutan", dialCode: "+975", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2575
+ { code: "BO", name: "Bolivia", dialCode: "+591", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2576
+ {
2577
+ code: "BA",
2578
+ name: "Bosnia and Herzegovina",
2579
+ dialCode: "+387",
2580
+ passportRegex: "^[A-Z]{2}[0-9]{6}$"
2581
+ },
2582
+ { code: "BW", name: "Botswana", dialCode: "+267", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2583
+ { code: "BR", name: "Brazil", dialCode: "+55", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2584
+ { code: "BN", name: "Brunei", dialCode: "+673", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2585
+ { code: "BG", name: "Bulgaria", dialCode: "+359", passportRegex: "^[0-9]{9}$" },
2586
+ { code: "BF", name: "Burkina Faso", dialCode: "+226", passportRegex: "^[A-Z0-9]{6,10}$" },
2587
+ { code: "BI", name: "Burundi", dialCode: "+257", passportRegex: "^[A-Z0-9]{6,10}$" },
2588
+ { code: "KH", name: "Cambodia", dialCode: "+855", passportRegex: "^[A-Z][0-9]{7}$" },
2589
+ { code: "CM", name: "Cameroon", dialCode: "+237", passportRegex: "^[A-Z0-9]{6,10}$" },
2590
+ { code: "CA", name: "Canada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2591
+ { code: "CV", name: "Cape Verde", dialCode: "+238", passportRegex: "^[A-Z0-9]{6,10}$" },
2592
+ { code: "KY", name: "Cayman Islands", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2593
+ {
2594
+ code: "CF",
2595
+ name: "Central African Republic",
2596
+ dialCode: "+236",
2597
+ passportRegex: "^[A-Z0-9]{6,10}$"
2598
+ },
2599
+ { code: "TD", name: "Chad", dialCode: "+235", passportRegex: "^[A-Z0-9]{6,10}$" },
2600
+ { code: "CL", name: "Chile", dialCode: "+56", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2601
+ { code: "CN", name: "China", dialCode: "+86", passportRegex: "^[0-9]{9}$" },
2602
+ { code: "CO", name: "Colombia", dialCode: "+57", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2603
+ { code: "KM", name: "Comoros", dialCode: "+269", passportRegex: "^[A-Z0-9]{6,10}$" },
2604
+ { code: "CG", name: "Congo", dialCode: "+242", passportRegex: "^[A-Z0-9]{6,10}$" },
2605
+ { code: "CR", name: "Costa Rica", dialCode: "+506", passportRegex: "^[A-Z0-9]{6,10}$" },
2606
+ { code: "HR", name: "Croatia", dialCode: "+385", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2607
+ { code: "CU", name: "Cuba", dialCode: "+53", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2608
+ { code: "CY", name: "Cyprus", dialCode: "+357", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2609
+ { code: "CZ", name: "Czech Republic", dialCode: "+420", passportRegex: "^[0-9]{8}$" },
2610
+ { code: "DK", name: "Denmark", dialCode: "+45", passportRegex: "^[A-Z0-9]{9}$" },
2611
+ { code: "DJ", name: "Djibouti", dialCode: "+253", passportRegex: "^[A-Z0-9]{6,10}$" },
2612
+ { code: "DM", name: "Dominica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2613
+ { code: "DO", name: "Dominican Republic", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2614
+ { code: "EC", name: "Ecuador", dialCode: "+593", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2615
+ { code: "EG", name: "Egypt", dialCode: "+20", passportRegex: "^[A-Z][0-9]{7}$" },
2616
+ { code: "SV", name: "El Salvador", dialCode: "+503", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2617
+ { code: "GQ", name: "Equatorial Guinea", dialCode: "+240", passportRegex: "^[A-Z0-9]{6,10}$" },
2618
+ { code: "ER", name: "Eritrea", dialCode: "+291", passportRegex: "^[A-Z0-9]{6,10}$" },
2619
+ { code: "EE", name: "Estonia", dialCode: "+372", passportRegex: "^[A-Z0-9]{8}$" },
2620
+ { code: "SZ", name: "Eswatini", dialCode: "+268", passportRegex: "^[A-Z0-9]{6,10}$" },
2621
+ { code: "ET", name: "Ethiopia", dialCode: "+251", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2622
+ { code: "FJ", name: "Fiji", dialCode: "+679", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2623
+ { code: "FI", name: "Finland", dialCode: "+358", passportRegex: "^[A-Z0-9]{9}$" },
2624
+ { code: "FR", name: "France", dialCode: "+33", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2625
+ { code: "GA", name: "Gabon", dialCode: "+241", passportRegex: "^[A-Z0-9]{6,10}$" },
2626
+ { code: "GM", name: "Gambia", dialCode: "+220", passportRegex: "^[A-Z0-9]{6,10}$" },
2627
+ { code: "GE", name: "Georgia", dialCode: "+995", passportRegex: "^[A-Z0-9]{8}$" },
2628
+ { code: "DE", name: "Germany", dialCode: "+49", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2629
+ { code: "GH", name: "Ghana", dialCode: "+233", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2630
+ { code: "GR", name: "Greece", dialCode: "+30", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2631
+ { code: "GD", name: "Grenada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2632
+ { code: "GT", name: "Guatemala", dialCode: "+502", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2633
+ { code: "GN", name: "Guinea", dialCode: "+224", passportRegex: "^[A-Z0-9]{6,10}$" },
2634
+ { code: "GW", name: "Guinea-Bissau", dialCode: "+245", passportRegex: "^[A-Z0-9]{6,10}$" },
2635
+ { code: "GY", name: "Guyana", dialCode: "+592", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2636
+ { code: "HT", name: "Haiti", dialCode: "+509", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2637
+ { code: "HN", name: "Honduras", dialCode: "+504", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2638
+ { code: "HK", name: "Hong Kong", dialCode: "+852", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2639
+ { code: "HU", name: "Hungary", dialCode: "+36", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2640
+ { code: "IS", name: "Iceland", dialCode: "+354", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2641
+ { code: "IN", name: "India", dialCode: "+91", passportRegex: "^[A-Z][0-9]{7}$" },
2642
+ { code: "ID", name: "Indonesia", dialCode: "+62", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2643
+ { code: "IR", name: "Iran", dialCode: "+98", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2644
+ { code: "IQ", name: "Iraq", dialCode: "+964", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2645
+ { code: "IE", name: "Ireland", dialCode: "+353", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
2646
+ { code: "IL", name: "Israel", dialCode: "+972", passportRegex: "^[0-9]{8,9}$" },
2647
+ { code: "IT", name: "Italy", dialCode: "+39", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2648
+ { code: "JM", name: "Jamaica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2649
+ { code: "JP", name: "Japan", dialCode: "+81", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2650
+ { code: "JO", name: "Jordan", dialCode: "+962", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2651
+ { code: "KZ", name: "Kazakhstan", dialCode: "+7", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2652
+ { code: "KE", name: "Kenya", dialCode: "+254", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2653
+ { code: "KI", name: "Kiribati", dialCode: "+686", passportRegex: "^[A-Z0-9]{6,10}$" },
2654
+ { code: "KP", name: "North Korea", dialCode: "+850", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2655
+ { code: "KR", name: "South Korea", dialCode: "+82", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
2656
+ { code: "KW", name: "Kuwait", dialCode: "+965", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2657
+ { code: "KG", name: "Kyrgyzstan", dialCode: "+996", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2658
+ { code: "LA", name: "Laos", dialCode: "+856", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2659
+ { code: "LV", name: "Latvia", dialCode: "+371", passportRegex: "^[A-Z0-9]{8}$" },
2660
+ { code: "LB", name: "Lebanon", dialCode: "+961", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2661
+ { code: "LS", name: "Lesotho", dialCode: "+266", passportRegex: "^[A-Z0-9]{6,10}$" },
2662
+ { code: "LR", name: "Liberia", dialCode: "+231", passportRegex: "^[A-Z0-9]{6,10}$" },
2663
+ { code: "LY", name: "Libya", dialCode: "+218", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2664
+ { code: "LI", name: "Liechtenstein", dialCode: "+423", passportRegex: "^[A-Z0-9]{6,10}$" },
2665
+ { code: "LT", name: "Lithuania", dialCode: "+370", passportRegex: "^[A-Z0-9]{8}$" },
2666
+ { code: "LU", name: "Luxembourg", dialCode: "+352", passportRegex: "^[A-Z0-9]{8}$" },
2667
+ { code: "MO", name: "Macau", dialCode: "+853", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2668
+ { code: "MG", name: "Madagascar", dialCode: "+261", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2669
+ { code: "MW", name: "Malawi", dialCode: "+265", passportRegex: "^[A-Z0-9]{6,10}$" },
2670
+ { code: "MY", name: "Malaysia", dialCode: "+60", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
2671
+ { code: "MV", name: "Maldives", dialCode: "+960", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2672
+ { code: "ML", name: "Mali", dialCode: "+223", passportRegex: "^[A-Z0-9]{6,10}$" },
2673
+ { code: "MT", name: "Malta", dialCode: "+356", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2674
+ { code: "MH", name: "Marshall Islands", dialCode: "+692", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2675
+ { code: "MQ", name: "Martinique", dialCode: "+596", passportRegex: "^[A-Z0-9]{6,10}$" },
2676
+ { code: "MR", name: "Mauritania", dialCode: "+222", passportRegex: "^[A-Z0-9]{6,10}$" },
2677
+ { code: "MU", name: "Mauritius", dialCode: "+230", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2678
+ { code: "MX", name: "Mexico", dialCode: "+52", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
2679
+ { code: "FM", name: "Micronesia", dialCode: "+691", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2680
+ { code: "MD", name: "Moldova", dialCode: "+373", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2681
+ { code: "MC", name: "Monaco", dialCode: "+377", passportRegex: "^[A-Z0-9]{6,10}$" },
2682
+ { code: "MN", name: "Mongolia", dialCode: "+976", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2683
+ { code: "ME", name: "Montenegro", dialCode: "+382", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2684
+ { code: "MS", name: "Montserrat", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2685
+ { code: "MA", name: "Morocco", dialCode: "+212", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2686
+ { code: "MZ", name: "Mozambique", dialCode: "+258", passportRegex: "^[A-Z0-9]{6,10}$" },
2687
+ { code: "MM", name: "Myanmar", dialCode: "+95", passportRegex: "^[A-Z]{1}[0-9]{6,7}$" },
2688
+ { code: "NA", name: "Namibia", dialCode: "+264", passportRegex: "^[A-Z0-9]{6,10}$" },
2689
+ { code: "NR", name: "Nauru", dialCode: "+674", passportRegex: "^[A-Z0-9]{6,10}$" },
2690
+ { code: "NP", name: "Nepal", dialCode: "+977", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2691
+ { code: "NL", name: "Netherlands", dialCode: "+31", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2692
+ { code: "NC", name: "New Caledonia", dialCode: "+687", passportRegex: "^[A-Z0-9]{6,10}$" },
2693
+ { code: "NZ", name: "New Zealand", dialCode: "+64", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2694
+ { code: "NI", name: "Nicaragua", dialCode: "+505", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2695
+ { code: "NE", name: "Niger", dialCode: "+227", passportRegex: "^[A-Z0-9]{6,10}$" },
2696
+ { code: "NG", name: "Nigeria", dialCode: "+234", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2697
+ { code: "NO", name: "Norway", dialCode: "+47", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2698
+ { code: "OM", name: "Oman", dialCode: "+968", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2699
+ { code: "PK", name: "Pakistan", dialCode: "+92", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2700
+ { code: "PW", name: "Palau", dialCode: "+680", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2701
+ { code: "PS", name: "Palestine", dialCode: "+970", passportRegex: "^[A-Z0-9]{6,10}$" },
2702
+ { code: "PA", name: "Panama", dialCode: "+507", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2703
+ { code: "PG", name: "Papua New Guinea", dialCode: "+675", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2704
+ { code: "PY", name: "Paraguay", dialCode: "+595", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2705
+ { code: "PE", name: "Peru", dialCode: "+51", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2706
+ { code: "PH", name: "Philippines", dialCode: "+63", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2707
+ { code: "PL", name: "Poland", dialCode: "+48", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
2708
+ { code: "PT", name: "Portugal", dialCode: "+351", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2709
+ { code: "RO", name: "Romania", dialCode: "+40", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2710
+ { code: "RU", name: "Russia", dialCode: "+7", passportRegex: "^[0-9]{9}$" },
2711
+ { code: "RW", name: "Rwanda", dialCode: "+250", passportRegex: "^[A-Z0-9]{6,10}$" },
2712
+ {
2713
+ code: "KN",
2714
+ name: "Saint Kitts and Nevis",
2715
+ dialCode: "+1",
2716
+ passportRegex: "^[A-Z]{2}[0-9]{7}$"
2717
+ },
2718
+ { code: "LC", name: "Saint Lucia", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2719
+ {
2720
+ code: "VC",
2721
+ name: "Saint Vincent and the Grenadines",
2722
+ dialCode: "+1",
2723
+ passportRegex: "^[A-Z]{2}[0-9]{7}$"
2724
+ },
2725
+ { code: "WS", name: "Samoa", dialCode: "+685", passportRegex: "^[A-Z0-9]{6,10}$" },
2726
+ { code: "SM", name: "San Marino", dialCode: "+378", passportRegex: "^[A-Z0-9]{6,10}$" },
2727
+ {
2728
+ code: "ST",
2729
+ name: "Sao Tome and Principe",
2730
+ dialCode: "+239",
2731
+ passportRegex: "^[A-Z0-9]{6,10}$"
2732
+ },
2733
+ { code: "SA", name: "Saudi Arabia", dialCode: "+966", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2734
+ { code: "SN", name: "Senegal", dialCode: "+221", passportRegex: "^[A-Z0-9]{6,10}$" },
2735
+ { code: "RS", name: "Serbia", dialCode: "+381", passportRegex: "^[A-Z0-9]{9}$" },
2736
+ { code: "SC", name: "Seychelles", dialCode: "+248", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2737
+ { code: "SL", name: "Sierra Leone", dialCode: "+232", passportRegex: "^[A-Z0-9]{6,10}$" },
2738
+ { code: "SG", name: "Singapore", dialCode: "+65", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2739
+ { code: "SK", name: "Slovakia", dialCode: "+421", passportRegex: "^[0-9]{9}$" },
2740
+ { code: "SI", name: "Slovenia", dialCode: "+386", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2741
+ { code: "SB", name: "Solomon Islands", dialCode: "+677", passportRegex: "^[A-Z0-9]{6,10}$" },
2742
+ { code: "SO", name: "Somalia", dialCode: "+252", passportRegex: "^[A-Z0-9]{6,10}$" },
2743
+ { code: "ZA", name: "South Africa", dialCode: "+27", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2744
+ { code: "ES", name: "Spain", dialCode: "+34", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2745
+ { code: "LK", name: "Sri Lanka", dialCode: "+94", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2746
+ { code: "SD", name: "Sudan", dialCode: "+249", passportRegex: "^[A-Z0-9]{6,10}$" },
2747
+ { code: "SR", name: "Suriname", dialCode: "+597", passportRegex: "^[A-Z0-9]{6,10}$" },
2748
+ { code: "SE", name: "Sweden", dialCode: "+46", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2749
+ { code: "CH", name: "Switzerland", dialCode: "+41", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2750
+ { code: "SY", name: "Syria", dialCode: "+963", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2751
+ { code: "TW", name: "Taiwan", dialCode: "+886", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
2752
+ { code: "TJ", name: "Tajikistan", dialCode: "+992", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2753
+ { code: "TZ", name: "Tanzania", dialCode: "+255", passportRegex: "^[A-Z0-9]{6,10}$" },
2754
+ { code: "TH", name: "Thailand", dialCode: "+66", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2755
+ { code: "TL", name: "Timor-Leste", dialCode: "+670", passportRegex: "^[A-Z0-9]{6,10}$" },
2756
+ { code: "TG", name: "Togo", dialCode: "+228", passportRegex: "^[A-Z0-9]{6,10}$" },
2757
+ { code: "TO", name: "Tonga", dialCode: "+676", passportRegex: "^[A-Z0-9]{6,10}$" },
2758
+ { code: "TT", name: "Trinidad and Tobago", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2759
+ { code: "TN", name: "Tunisia", dialCode: "+216", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2760
+ { code: "TR", name: "Turkey", dialCode: "+90", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2761
+ { code: "TM", name: "Turkmenistan", dialCode: "+993", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2762
+ {
2763
+ code: "TC",
2764
+ name: "Turks and Caicos Islands",
2765
+ dialCode: "+1",
2766
+ passportRegex: "^[A-Z0-9]{6,10}$"
2767
+ },
2768
+ { code: "TV", name: "Tuvalu", dialCode: "+688", passportRegex: "^[A-Z0-9]{6,10}$" },
2769
+ { code: "UG", name: "Uganda", dialCode: "+256", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2770
+ { code: "UA", name: "Ukraine", dialCode: "+380", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2771
+ {
2772
+ code: "AE",
2773
+ name: "United Arab Emirates",
2774
+ dialCode: "+971",
2775
+ passportRegex: "^[A-Z]{1}[0-9]{7}$"
2776
+ },
2777
+ { code: "GB", name: "United Kingdom", dialCode: "+44", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2778
+ { code: "US", name: "United States", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
2779
+ { code: "UY", name: "Uruguay", dialCode: "+598", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2780
+ { code: "UZ", name: "Uzbekistan", dialCode: "+998", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2781
+ { code: "VU", name: "Vanuatu", dialCode: "+678", passportRegex: "^[A-Z0-9]{6,10}$" },
2782
+ { code: "VA", name: "Vatican City", dialCode: "+379", passportRegex: "^[A-Z0-9]{6,10}$" },
2783
+ { code: "VE", name: "Venezuela", dialCode: "+58", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2784
+ { code: "VN", name: "Vietnam", dialCode: "+84", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2785
+ { code: "YE", name: "Yemen", dialCode: "+967", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2786
+ { code: "ZM", name: "Zambia", dialCode: "+260", passportRegex: "^[A-Z0-9]{6,10}$" },
2787
+ { code: "ZW", name: "Zimbabwe", dialCode: "+263", passportRegex: "^[A-Z0-9]{6,10}$" }
2788
+ ];
2789
+ var useStyles8 = reactComponents.makeStyles({
2790
+ dialogTitle: {
2791
+ display: "flex",
2792
+ justifyContent: "space-between",
2793
+ alignItems: "center",
2794
+ paddingRight: "8px"
2795
+ },
2796
+ dialogSurface: {
2797
+ maxWidth: "600px",
2798
+ width: "100%"
2799
+ },
2800
+ closeButton: {
2801
+ minWidth: "32px",
2802
+ minHeight: "32px"
2803
+ },
2804
+ content: {
2805
+ display: "flex",
2806
+ flexDirection: "column",
2807
+ gap: "0px",
2808
+ paddingTop: "10px",
2809
+ paddingLeft: "10px",
2810
+ paddingRight: "10px"
2811
+ },
2812
+ searchInput: {
2813
+ width: "100%",
2814
+ marginBottom: "16px"
2815
+ },
2816
+ resultList: {
2817
+ display: "flex",
2818
+ flexDirection: "column",
2819
+ gap: "0px",
2820
+ maxHeight: "400px",
2821
+ overflowY: "auto",
2822
+ paddingRight: "1rem"
2823
+ },
2824
+ resultItem: {
2825
+ padding: "16px 20px",
2826
+ borderBottom: `1px solid ${reactComponents.tokens.colorNeutralStroke2}`,
2827
+ cursor: "pointer",
2828
+ transition: "all 0.2s ease",
2829
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1,
2830
+ position: "relative",
2831
+ ":hover": {
2832
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1Hover,
2833
+ borderBottom: `1px solid ${reactComponents.tokens.colorBrandBackground}`
2834
+ }
2835
+ },
2836
+ resultItemSelected: {
2837
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1,
2838
+ borderLeft: `4px solid ${reactComponents.tokens.colorBrandBackground}`,
2839
+ paddingLeft: "16px"
2840
+ },
2841
+ harborName: {
2842
+ fontSize: reactComponents.tokens.fontSizeBase300,
2843
+ fontWeight: reactComponents.tokens.fontWeightRegular,
2844
+ color: reactComponents.tokens.colorNeutralForeground1,
2845
+ marginBottom: "2px"
2846
+ },
2847
+ harborLocation: {
2848
+ fontSize: reactComponents.tokens.fontSizeBase200,
2849
+ color: reactComponents.tokens.colorNeutralForeground3
2850
+ },
2851
+ buttonContainer: {
2852
+ display: "flex",
2853
+ gap: "1rem",
2854
+ marginBottom: "1rem",
2855
+ flexWrap: "wrap"
2856
+ },
2857
+ circularButton: {
2858
+ borderRadius: reactComponents.tokens.borderRadiusCircular
2859
+ },
2860
+ headerRow: {
2861
+ display: "flex",
2862
+ justifyContent: "space-between",
2863
+ marginTop: "1rem",
2864
+ marginBottom: "1rem"
2865
+ },
2866
+ dangerText: {
2867
+ color: reactComponents.tokens.colorStatusDangerForeground1
2868
+ },
2869
+ historyItem: {
2870
+ display: "flex",
2871
+ justifyContent: "space-between",
2872
+ marginTop: "1rem",
2873
+ marginBottom: "1rem"
2874
+ },
2875
+ iconMargin: {
2876
+ marginRight: "0.5rem"
2877
+ },
2878
+ cursorPointer: {
2879
+ cursor: "pointer"
2880
+ },
2881
+ sectionTitle: {
2882
+ marginTop: "1rem",
2883
+ marginBottom: "1rem"
2884
+ },
2885
+ harborList: {
2886
+ display: "flex",
2887
+ flexDirection: "column",
2888
+ gap: "1rem",
2889
+ marginBottom: "1rem"
2890
+ },
2891
+ harborItem: {
2892
+ display: "flex",
2893
+ justifyContent: "space-between"
2894
+ },
2895
+ emptyState: {
2896
+ textAlign: "center",
2897
+ padding: "32px",
2898
+ color: reactComponents.tokens.colorNeutralForeground3
2899
+ }
2900
+ });
2901
+ var ModalSearchHarbor = ({
2902
+ open,
2903
+ onClose,
2904
+ title = "Pilih Pelabuhan",
2905
+ modalType = "origin",
2906
+ harbors,
2907
+ favoriteHarbors,
2908
+ lastSearchedHarbors,
2909
+ isLoading = false,
2910
+ searchQuery,
2911
+ onSearchChange,
2912
+ onSelectHarbor,
2913
+ onToggleFavorite,
2914
+ onAddLastSearched,
2915
+ onRemoveLastSearched,
2916
+ onClearLastSearched
2917
+ }) => {
2918
+ const styles = useStyles8();
2919
+ const handleSelect = (harbor) => {
2920
+ onAddLastSearched(harbor);
2921
+ onSelectHarbor(harbor);
2922
+ onSearchChange("");
2923
+ };
2924
+ const handleClose = () => {
2925
+ onClose();
2926
+ onSearchChange("");
2927
+ };
2928
+ return /* @__PURE__ */ jsxRuntime.jsx(
2929
+ reactComponents.Dialog,
2930
+ {
2931
+ open,
2932
+ onOpenChange: (_, data) => {
2933
+ if (!data.open) {
2934
+ onClose();
2935
+ }
2936
+ },
2937
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.DialogSurface, { className: styles.dialogSurface, children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.DialogBody, { children: [
2938
+ /* @__PURE__ */ jsxRuntime.jsx(
2939
+ reactComponents.DialogTitle,
2940
+ {
2941
+ action: /* @__PURE__ */ jsxRuntime.jsx(
2942
+ reactComponents.Button,
2943
+ {
2944
+ appearance: "subtle",
2945
+ "aria-label": "close",
2946
+ icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:dismiss-24-regular" }),
2947
+ onClick: handleClose,
2948
+ className: styles.closeButton
2949
+ }
2950
+ ),
2951
+ children: title
2952
+ }
2953
+ ),
2954
+ /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.DialogContent, { className: styles.content, children: [
2955
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
2956
+ reactComponents.Input,
2957
+ {
2958
+ className: styles.searchInput,
2959
+ value: searchQuery,
2960
+ onChange: (e) => onSearchChange(e.target.value),
2961
+ placeholder: "Cari Pelabuhan...",
2962
+ contentBefore: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:search-24-regular", color: reactComponents.tokens.colorNeutralForeground3 }),
2963
+ size: "large"
2964
+ }
2965
+ ) }),
2966
+ favoriteHarbors.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.buttonContainer, children: favoriteHarbors.map((harbor) => /* @__PURE__ */ jsxRuntime.jsx(
2967
+ reactComponents.Button,
2968
+ {
2969
+ onClick: () => handleSelect(harbor),
2970
+ size: "medium",
2971
+ appearance: "outline",
2972
+ iconPosition: "before",
2973
+ className: styles.circularButton,
2974
+ icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:ribbon-20-filled" }),
2975
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { children: harbor.name })
2976
+ },
2977
+ harbor.id
2978
+ )) }),
2979
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, {}),
2980
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.resultList, children: [
2981
+ lastSearchedHarbors.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2982
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.headerRow, children: [
2983
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Strong, { children: "Terakhir dicari" }),
2984
+ /* @__PURE__ */ jsxRuntime.jsx(
2985
+ reactComponents.Caption1,
2986
+ {
2987
+ className: `${styles.dangerText} ${styles.cursorPointer}`,
2988
+ onClick: onClearLastSearched,
2989
+ children: "Hapus Semua"
2990
+ }
2991
+ )
2992
+ ] }),
2993
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: lastSearchedHarbors.map((harbor) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.historyItem, children: [
2994
+ /* @__PURE__ */ jsxRuntime.jsxs(
2995
+ "div",
2996
+ {
2997
+ style: { cursor: "pointer" },
2998
+ onClick: () => handleSelect(harbor),
2999
+ children: [
3000
+ /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:vehicle-ship-24-regular", className: styles.iconMargin }),
3001
+ harbor.name
3002
+ ]
3003
+ }
3004
+ ),
3005
+ /* @__PURE__ */ jsxRuntime.jsx(
3006
+ react.Icon,
3007
+ {
3008
+ onClick: () => onRemoveLastSearched(harbor.id),
3009
+ icon: "fluent:dismiss-24-regular",
3010
+ color: reactComponents.tokens.colorStatusDangerForeground1,
3011
+ className: styles.cursorPointer
3012
+ }
3013
+ )
3014
+ ] }, harbor.id)) }),
3015
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, {})
3016
+ ] }),
3017
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Strong, { className: styles.sectionTitle, children: "Semua Pelabuhan" }),
3018
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.harborList, children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.emptyState, children: "Memuat data..." }) : harbors.length > 0 ? harbors.map((harbor, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.harborItem, children: [
3019
+ /* @__PURE__ */ jsxRuntime.jsxs(
3020
+ "div",
3021
+ {
3022
+ className: styles.cursorPointer,
3023
+ onClick: () => handleSelect(harbor),
3024
+ children: [
3025
+ /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:vehicle-ship-24-regular", className: styles.iconMargin }),
3026
+ harbor.name
3027
+ ]
3028
+ }
3029
+ ),
3030
+ /* @__PURE__ */ jsxRuntime.jsx(
3031
+ react.Icon,
3032
+ {
3033
+ icon: favoriteHarbors.find((fav) => fav.id === harbor.id) ? "fluent:star-24-filled" : "fluent:star-24-regular",
3034
+ color: reactComponents.tokens.colorBrandBackground,
3035
+ className: styles.cursorPointer,
3036
+ onClick: () => onToggleFavorite(harbor)
3037
+ }
3038
+ )
3039
+ ] }, index)) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.emptyState, children: "Pelabuhan tidak ditemukan" }) })
3040
+ ] })
3041
+ ] })
3042
+ ] }) })
3043
+ }
3044
+ );
3045
+ };
1078
3046
 
1079
3047
  exports.BackgroundTicketCard = BackgroundTicketCard_default;
1080
3048
  exports.BackgroundTicketCardVertical = BackgroundTicketCardVertical_default;
@@ -1083,8 +3051,11 @@ exports.CardPromo = CardPromo;
1083
3051
  exports.CardServiceMenu = CardServiceMenu;
1084
3052
  exports.CardTicket = CardTicket;
1085
3053
  exports.CarouselWithCustomNav = CarouselWithCustomNav;
3054
+ exports.DEFAULT_COUNTRY_CODES = DEFAULT_COUNTRY_CODES2;
3055
+ exports.InputDynamic = InputDynamic_default;
1086
3056
  exports.MODAL_PRESETS = MODAL_PRESETS;
1087
3057
  exports.ModalIllustration = ModalIllustration;
3058
+ exports.ModalSearchHarbor = ModalSearchHarbor;
1088
3059
  exports.getModalPreset = getModalPreset;
1089
3060
  //# sourceMappingURL=index.js.map
1090
3061
  //# sourceMappingURL=index.js.map