@splpi/estore-shared-components 0.0.6 → 7.0.2

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.mjs CHANGED
@@ -6,7 +6,6 @@ import {
6
6
  Select,
7
7
  createListCollection
8
8
  } from "@chakra-ui/react";
9
- import { useState as useState2, useEffect } from "react";
10
9
 
11
10
  // src/lib/theme/layout-tokens.ts
12
11
  var RESPONSIVE_LAYOUT_TOKENS = {
@@ -227,6 +226,40 @@ var STANDARD_ICON_BUTTON_STYLES = {
227
226
  }
228
227
  };
229
228
 
229
+ // src/hooks/ocrStorage.ts
230
+ var OCR_STORAGE_KEY = "ocrResult";
231
+ var readStored = () => {
232
+ try {
233
+ const raw = localStorage.getItem(OCR_STORAGE_KEY);
234
+ return raw ? JSON.parse(raw) : null;
235
+ } catch {
236
+ return null;
237
+ }
238
+ };
239
+ var readOcrResult = (section) => {
240
+ if (typeof window === "undefined") return null;
241
+ const stored = readStored();
242
+ if (!stored || stored.applied?.[section]) return null;
243
+ return stored;
244
+ };
245
+ var markOcrApplied = (section) => {
246
+ if (typeof window === "undefined") return false;
247
+ const stored = readStored();
248
+ if (!stored || stored.applied?.[section]) return false;
249
+ try {
250
+ localStorage.setItem(
251
+ OCR_STORAGE_KEY,
252
+ JSON.stringify({ ...stored, applied: { ...stored.applied, [section]: true } })
253
+ );
254
+ } catch {
255
+ return false;
256
+ }
257
+ return true;
258
+ };
259
+
260
+ // src/NewSaleForm/LifePlanApplication1.tsx
261
+ import { useEffect, useState as useState2 } from "react";
262
+
230
263
  // src/NewSaleForm/ui/FloatingLabelInput.tsx
231
264
  import {
232
265
  Box,
@@ -327,11 +360,20 @@ var civilStatusCollection = createListCollection({
327
360
  { label: "Annulled", value: "annulled" }
328
361
  ]
329
362
  });
363
+ var applyOcr = (data, ocr) => ocr ? {
364
+ ...data,
365
+ firstName: ocr.firstName || data.firstName || "",
366
+ middleName: ocr.middleName || data.middleName || "",
367
+ lastName: ocr.lastName || data.lastName || "",
368
+ birthDate: ocr.birthDate || data.birthDate || "",
369
+ idType: ocr.idType || data.idType || "",
370
+ idNumber: ocr.idNumber || data.idNumber || ""
371
+ } : data;
330
372
  var LifePlanApplication1 = ({
331
373
  initialData,
332
374
  onUpdate
333
375
  }) => {
334
- const [formData, setFormData] = useState2({
376
+ const [formData, setFormData] = useState2(() => applyOcr({
335
377
  firstName: initialData?.firstName ?? "Juan",
336
378
  middleName: initialData?.middleName ?? "Santos",
337
379
  lastName: initialData?.lastName ?? "Dela Cruz",
@@ -348,44 +390,14 @@ var LifePlanApplication1 = ({
348
390
  emailAddress: initialData?.emailAddress ?? "juan.delacruz@example.com",
349
391
  mailingAddress: initialData?.mailingAddress ?? "123 Mabini Street, Barangay San Antonio, Makati City",
350
392
  landLineNumber: initialData?.landLineNumber ?? "02-8123-4567"
351
- });
393
+ }, readOcrResult("personal")));
352
394
  const updateFormData = (nextData) => {
353
395
  setFormData(nextData);
354
396
  onUpdate?.(nextData);
355
397
  };
356
398
  useEffect(() => {
357
- const OCRValue = typeof window === "undefined" ? null : localStorage.getItem("ocrResult");
358
- if (OCRValue != null) {
359
- try {
360
- const ocrData = JSON.parse(OCRValue);
361
- const [month, day, year] = ocrData.birthDate.split("/").map((part) => part.trim());
362
- const formattedBirthDate = `${year}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`;
363
- let mappedIdType = "";
364
- if (ocrData?.idType) {
365
- const normalizedIdType = ocrData.idType.toLowerCase().replace(/\s+/g, "_").replace(/'/g, "");
366
- if (normalizedIdType.includes("passport")) {
367
- mappedIdType = "passport";
368
- } else if (normalizedIdType.includes("driver")) {
369
- mappedIdType = "driver_license";
370
- } else if (normalizedIdType.includes("national") || normalizedIdType.includes("id")) {
371
- mappedIdType = "national_id";
372
- }
373
- }
374
- const updatedData = {
375
- ...formData,
376
- firstName: ocrData?.firstName || "",
377
- lastName: ocrData?.lastName || "",
378
- middleName: ocrData?.middleName || "",
379
- birthDate: formattedBirthDate || "",
380
- idType: mappedIdType || ""
381
- };
382
- updateFormData(updatedData);
383
- } catch (e) {
384
- console.error("Failed to parse OCR value:", e);
385
- localStorage.removeItem("ocrResult");
386
- }
387
- }
388
- }, []);
399
+ if (markOcrApplied("personal")) onUpdate?.(formData);
400
+ }, [formData, onUpdate]);
389
401
  return /* @__PURE__ */ jsxs2(
390
402
  Grid,
391
403
  {
@@ -618,7 +630,37 @@ import {
618
630
  Portal,
619
631
  Field as Field3
620
632
  } from "@chakra-ui/react";
621
- import { useState as useState3 } from "react";
633
+ import { useEffect as useEffect2, useState as useState3 } from "react";
634
+
635
+ // src/lib/theme/brand-colors.ts
636
+ var BRAND_COLORS = {
637
+ primaryGreen: "#109448",
638
+ darkGreen: "#006838",
639
+ softGreen: "#92DDBF",
640
+ pastelPeaGreen: "#ACD6A6",
641
+ seafoamGreen: "#92DDBF",
642
+ lightCyan: "#D3EDEE",
643
+ successBg: "#F0FDF4",
644
+ warningBg: "#FFF7ED",
645
+ warningText: "#F1592B",
646
+ warningBorder: "#F4845F",
647
+ errorBg: "#FEF2F2",
648
+ destructiveRed: "#BF1F2F",
649
+ errorRed: "#EF4444",
650
+ neutralText: "#22223B",
651
+ neutralBorder: "#E5E7EB",
652
+ mutedBg: "#F3F4F6",
653
+ subtleBg: "#F9FAFB",
654
+ white: "#FFFFFF",
655
+ black: "#000000",
656
+ grey: "#808080",
657
+ ashWhite: "#ECECEC",
658
+ gold: "#CBA135",
659
+ brightGold: "#FFD026",
660
+ paleGold: "#FFF48E"
661
+ };
662
+
663
+ // src/NewSaleForm/LifePlanApplication2.tsx
622
664
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
623
665
  var provinceOptions = [
624
666
  "Abra",
@@ -812,22 +854,55 @@ var cityOptions = [
812
854
  "Bongao",
813
855
  "Ipil"
814
856
  ].map((city) => ({ label: city, value: city }));
815
- var districtOptions = cityOptions;
816
- var barangayOptions = cityOptions;
817
857
  var provinceCollection = createListCollection2({ items: provinceOptions });
818
858
  var cityCollection = createListCollection2({ items: cityOptions });
819
- var districtCollection = createListCollection2({ items: districtOptions });
820
- var barangayCollection = createListCollection2({ items: barangayOptions });
859
+ var normalizePlace = (value) => value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/^city of\s+/, "").replace(/\s+city$/, "").replace(/[^a-z0-9]/g, "");
860
+ var matchOption = (candidates, options) => {
861
+ for (const candidate of candidates ?? []) {
862
+ const key = normalizePlace(candidate);
863
+ const match = options.find(
864
+ (option) => normalizePlace(option.value) === key
865
+ );
866
+ if (match) return match.value;
867
+ }
868
+ return "";
869
+ };
821
870
  var LifePlanApplication2 = ({
822
- onAddressUpdate
871
+ onAddressUpdate,
872
+ parseAddress
823
873
  }) => {
824
- const OCRValue = typeof window === "undefined" ? null : localStorage.getItem("ocrResult");
825
- const [lot, setLot] = useState3("123");
826
- const [street, setStreet] = useState3("Mabini Street");
827
- const [city, setCity] = useState3("Makati");
828
- const [province, setProvince] = useState3("Metro Manila");
829
- const [district, setDistrict] = useState3("Taguig");
830
- const [barangay, setBarangay] = useState3("San Juan");
874
+ const [lot, setLot] = useState3("");
875
+ const [street, setStreet] = useState3("");
876
+ const [city, setCity] = useState3("");
877
+ const [province, setProvince] = useState3("");
878
+ const [district, setDistrict] = useState3("");
879
+ const [barangay, setBarangay] = useState3("");
880
+ useEffect2(() => {
881
+ if (!parseAddress) return;
882
+ const ocr = readOcrResult("address");
883
+ if (!ocr?.addressLine) return;
884
+ markOcrApplied("address");
885
+ parseAddress(ocr.addressLine).then((result) => {
886
+ setLot(result.lot ?? "");
887
+ setStreet(result.street ?? "");
888
+ setProvince(matchOption(result.provinceCandidates, provinceOptions));
889
+ setCity(matchOption(result.cityCandidates, cityOptions));
890
+ setDistrict(result.district ?? "");
891
+ setBarangay(result.barangay ?? "");
892
+ }).catch((error) => {
893
+ console.error("Error parsing address:", error);
894
+ });
895
+ }, [parseAddress]);
896
+ useEffect2(() => {
897
+ onAddressUpdate?.({
898
+ lot,
899
+ street,
900
+ barangay,
901
+ district,
902
+ city,
903
+ province
904
+ });
905
+ }, [lot, street, barangay, city, province, district]);
831
906
  return /* @__PURE__ */ jsx3(
832
907
  Box2,
833
908
  {
@@ -873,44 +948,22 @@ var LifePlanApplication2 = ({
873
948
  ]
874
949
  }
875
950
  ) }),
876
- /* @__PURE__ */ jsx3(Field3.Root, { children: /* @__PURE__ */ jsxs3(
877
- Select2.Root,
951
+ /* @__PURE__ */ jsx3(Field3.Root, { children: /* @__PURE__ */ jsx3(
952
+ FloatingLabelInput,
878
953
  {
879
- value: [district],
880
- onValueChange: (e) => setDistrict(e.value[0] ?? ""),
881
- collection: districtCollection,
882
- width: "100%",
883
- children: [
884
- /* @__PURE__ */ jsx3(Select2.HiddenSelect, {}),
885
- /* @__PURE__ */ jsxs3(Select2.Control, { children: [
886
- /* @__PURE__ */ jsx3(Select2.Trigger, { children: /* @__PURE__ */ jsx3(Select2.ValueText, { placeholder: "Select District" }) }),
887
- /* @__PURE__ */ jsx3(Select2.IndicatorGroup, { children: /* @__PURE__ */ jsx3(Select2.Indicator, {}) })
888
- ] }),
889
- /* @__PURE__ */ jsx3(Portal, { children: /* @__PURE__ */ jsx3(Select2.Positioner, { children: /* @__PURE__ */ jsx3(Select2.Content, { children: districtOptions.map((item) => /* @__PURE__ */ jsxs3(Select2.Item, { item, children: [
890
- item.label,
891
- /* @__PURE__ */ jsx3(Select2.ItemIndicator, {})
892
- ] }, item.value)) }) }) })
893
- ]
954
+ id: "district",
955
+ label: "District",
956
+ value: district,
957
+ onChange: (e) => setDistrict(e.target.value)
894
958
  }
895
959
  ) }),
896
- /* @__PURE__ */ jsx3(Field3.Root, { children: /* @__PURE__ */ jsxs3(
897
- Select2.Root,
960
+ /* @__PURE__ */ jsx3(Field3.Root, { children: /* @__PURE__ */ jsx3(
961
+ FloatingLabelInput,
898
962
  {
899
- value: [barangay],
900
- onValueChange: (e) => setBarangay(e.value[0] ?? ""),
901
- collection: barangayCollection,
902
- width: "100%",
903
- children: [
904
- /* @__PURE__ */ jsx3(Select2.HiddenSelect, {}),
905
- /* @__PURE__ */ jsxs3(Select2.Control, { children: [
906
- /* @__PURE__ */ jsx3(Select2.Trigger, { children: /* @__PURE__ */ jsx3(Select2.ValueText, { placeholder: "Select Barangay" }) }),
907
- /* @__PURE__ */ jsx3(Select2.IndicatorGroup, { children: /* @__PURE__ */ jsx3(Select2.Indicator, {}) })
908
- ] }),
909
- /* @__PURE__ */ jsx3(Portal, { children: /* @__PURE__ */ jsx3(Select2.Positioner, { children: /* @__PURE__ */ jsx3(Select2.Content, { children: barangayOptions.map((item) => /* @__PURE__ */ jsxs3(Select2.Item, { item, children: [
910
- item.label,
911
- /* @__PURE__ */ jsx3(Select2.ItemIndicator, {})
912
- ] }, item.value)) }) }) })
913
- ]
963
+ id: "barangay",
964
+ label: "Barangay",
965
+ value: barangay,
966
+ onChange: (e) => setBarangay(e.target.value)
914
967
  }
915
968
  ) }),
916
969
  /* @__PURE__ */ jsx3(Field3.Root, { children: /* @__PURE__ */ jsx3(
@@ -1068,7 +1121,7 @@ import {
1068
1121
  useBreakpointValue,
1069
1122
  Button
1070
1123
  } from "@chakra-ui/react";
1071
- import { useState as useState4 } from "react";
1124
+ import { useEffect as useEffect3, useState as useState4 } from "react";
1072
1125
  import { FaRegTrashAlt } from "react-icons/fa";
1073
1126
  import { LuPencil } from "react-icons/lu";
1074
1127
  import {
@@ -1099,7 +1152,66 @@ var RowItem = ({
1099
1152
  ),
1100
1153
  /* @__PURE__ */ jsx5(Text3, { fontWeight: "medium", textAlign: "right", whiteSpace: "nowrap", children: value ?? "-" })
1101
1154
  ] });
1102
- var row_item_default = RowItem;
1155
+
1156
+ // src/lib/applicationData.ts
1157
+ var LIFE_PLAN_APPLICATION_KEY = "LifePlanApplication";
1158
+ var createEmptyApplicationData = () => ({
1159
+ personalInfo: {
1160
+ firstName: "",
1161
+ middleName: "",
1162
+ lastName: "",
1163
+ suffix: "",
1164
+ birthDate: "",
1165
+ idType: "",
1166
+ idNumber: "",
1167
+ height: 0,
1168
+ weight: 0,
1169
+ gender: "",
1170
+ civilStatus: "",
1171
+ nationality: "",
1172
+ mobileNumber: "",
1173
+ emailAddress: "",
1174
+ mailingAddress: "",
1175
+ landLineNumber: ""
1176
+ },
1177
+ address: {
1178
+ lot: "",
1179
+ street: "",
1180
+ barangay: "",
1181
+ district: "",
1182
+ city: "",
1183
+ province: ""
1184
+ },
1185
+ employment: {
1186
+ occupation: "",
1187
+ employerName: "",
1188
+ employmentStatus: "",
1189
+ officeAddress: "",
1190
+ TIN: "",
1191
+ SSS: "",
1192
+ sourceOfIncome: ""
1193
+ },
1194
+ beneficiaries: [],
1195
+ healthDeclaration: {
1196
+ healthDeclaration1: false,
1197
+ healthDeclaration2: false,
1198
+ healthDeclaration3: false,
1199
+ healthDeclaration4: false
1200
+ }
1201
+ });
1202
+ var loadApplicationDataFromLocalStorage = (storageKey = LIFE_PLAN_APPLICATION_KEY) => {
1203
+ if (typeof window === "undefined") return null;
1204
+ try {
1205
+ const stored = window.localStorage.getItem(storageKey);
1206
+ return stored ? JSON.parse(stored) : null;
1207
+ } catch {
1208
+ return null;
1209
+ }
1210
+ };
1211
+ var saveApplicationDataToLocalStorage = (data, storageKey = LIFE_PLAN_APPLICATION_KEY) => {
1212
+ if (typeof window === "undefined") return;
1213
+ window.localStorage.setItem(storageKey, JSON.stringify(data));
1214
+ };
1103
1215
 
1104
1216
  // src/NewSaleForm/beneficiary.tsx
1105
1217
  import { Fragment, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
@@ -1120,7 +1232,7 @@ var relationshipTypes = createListCollection3({
1120
1232
  });
1121
1233
  var ReviewRows = ({
1122
1234
  rows
1123
- }) => /* @__PURE__ */ jsx6(VStack3, { align: "stretch", gap: 1, children: rows.map((row) => /* @__PURE__ */ jsx6(row_item_default, { label: row.label, value: row.value }, row.label)) });
1235
+ }) => /* @__PURE__ */ jsx6(VStack3, { align: "stretch", gap: 1, children: rows.map((row) => /* @__PURE__ */ jsx6(RowItem, { label: row.label, value: row.value }, row.label)) });
1124
1236
  var Beneficiary = ({ onUpdate }) => {
1125
1237
  const isMobile = useBreakpointValue({ base: true, md: false });
1126
1238
  const [principalBeneficiaries, setPrincipalBeneficiaries] = useState4([]);
@@ -1146,6 +1258,65 @@ var Beneficiary = ({ onUpdate }) => {
1146
1258
  relationship: "",
1147
1259
  beneficiaryClass: "principal"
1148
1260
  });
1261
+ const syncBeneficiaries = (principal, contingent) => {
1262
+ const allBeneficiaries = [...principal, ...contingent];
1263
+ onUpdate?.(
1264
+ principal.length > 0 ? principal[0] : void 0,
1265
+ contingent.length > 0 ? contingent[0] : void 0,
1266
+ allBeneficiaries
1267
+ );
1268
+ const currentData = loadApplicationDataFromLocalStorage() ?? createEmptyApplicationData();
1269
+ const {
1270
+ principalBeneficiary: _oldPrincipal,
1271
+ contingentBeneficiary: _oldContingent,
1272
+ ...restData
1273
+ } = currentData;
1274
+ saveApplicationDataToLocalStorage({
1275
+ ...restData,
1276
+ beneficiaries: allBeneficiaries,
1277
+ ...principal[0] ? { principalBeneficiary: principal[0] } : {},
1278
+ ...contingent[0] ? { contingentBeneficiary: contingent[0] } : {}
1279
+ });
1280
+ };
1281
+ useEffect3(() => {
1282
+ const timeoutId = window.setTimeout(() => {
1283
+ const currentData = loadApplicationDataFromLocalStorage();
1284
+ if (!currentData) return;
1285
+ const storedBeneficiaries = currentData.beneficiaries ?? [];
1286
+ let principalFromStorage = storedBeneficiaries.filter(
1287
+ (beneficiary) => beneficiary.beneficiaryClass === "principal"
1288
+ );
1289
+ let contingentFromStorage = storedBeneficiaries.filter(
1290
+ (beneficiary) => beneficiary.beneficiaryClass === "contingent"
1291
+ );
1292
+ if (storedBeneficiaries.length === 0) {
1293
+ if (currentData.principalBeneficiary) {
1294
+ principalFromStorage = [
1295
+ {
1296
+ ...currentData.principalBeneficiary,
1297
+ beneficiaryClass: currentData.principalBeneficiary.beneficiaryClass || "principal"
1298
+ }
1299
+ ];
1300
+ }
1301
+ if (currentData.contingentBeneficiary) {
1302
+ contingentFromStorage = [
1303
+ {
1304
+ ...currentData.contingentBeneficiary,
1305
+ beneficiaryClass: currentData.contingentBeneficiary.beneficiaryClass || "contingent"
1306
+ }
1307
+ ];
1308
+ }
1309
+ }
1310
+ setPrincipalBeneficiaries(principalFromStorage);
1311
+ setContingentBeneficiaries(contingentFromStorage);
1312
+ onUpdate?.(
1313
+ principalFromStorage.length > 0 ? principalFromStorage[0] : void 0,
1314
+ contingentFromStorage.length > 0 ? contingentFromStorage[0] : void 0,
1315
+ [...principalFromStorage, ...contingentFromStorage]
1316
+ );
1317
+ }, 0);
1318
+ return () => window.clearTimeout(timeoutId);
1319
+ }, [onUpdate]);
1149
1320
  const handleSaveAddBeneficiary = () => {
1150
1321
  if (!addFormBeneficiary.firstName || !addFormBeneficiary.lastName || !addFormBeneficiary.birthDate || !addFormBeneficiary.relationship || !addFormBeneficiary.address) {
1151
1322
  alert("Please fill in all required fields");
@@ -1171,6 +1342,7 @@ var Beneficiary = ({ onUpdate }) => {
1171
1342
  });
1172
1343
  setAddDialogOpen(false);
1173
1344
  console.log("Beneficiary added:", addFormBeneficiary);
1345
+ syncBeneficiaries(newPrincipal, newContingent);
1174
1346
  };
1175
1347
  const formatFullName = (beneficiary) => {
1176
1348
  return [
@@ -1194,9 +1366,6 @@ var Beneficiary = ({ onUpdate }) => {
1194
1366
  setFormBeneficiary({ ...beneficiary });
1195
1367
  setEditDialogOpen(true);
1196
1368
  };
1197
- function handleDeleteBeneficiary(arg0, idx) {
1198
- throw new Error("Function not implemented.");
1199
- }
1200
1369
  const handleSaveEdit = () => {
1201
1370
  if (!selectedBeneficiary) return;
1202
1371
  let updatedPrincipal = principalBeneficiaries;
@@ -1212,9 +1381,26 @@ var Beneficiary = ({ onUpdate }) => {
1212
1381
  );
1213
1382
  setContingentBeneficiaries(updatedContingent);
1214
1383
  }
1384
+ syncBeneficiaries(updatedPrincipal, updatedContingent);
1215
1385
  setEditDialogOpen(false);
1216
1386
  setSelectedBeneficiary(null);
1217
1387
  };
1388
+ const handleDeleteBeneficiary = (type, index) => {
1389
+ let updatedPrincipal = principalBeneficiaries;
1390
+ let updatedContingent = contingentBeneficiaries;
1391
+ if (type === "principal") {
1392
+ updatedPrincipal = principalBeneficiaries.filter(
1393
+ (_, beneficiaryIndex) => beneficiaryIndex !== index
1394
+ );
1395
+ setPrincipalBeneficiaries(updatedPrincipal);
1396
+ } else {
1397
+ updatedContingent = contingentBeneficiaries.filter(
1398
+ (_, beneficiaryIndex) => beneficiaryIndex !== index
1399
+ );
1400
+ setContingentBeneficiaries(updatedContingent);
1401
+ }
1402
+ syncBeneficiaries(updatedPrincipal, updatedContingent);
1403
+ };
1218
1404
  return /* @__PURE__ */ jsxs6(Fragment, { children: [
1219
1405
  /* @__PURE__ */ jsxs6(
1220
1406
  Flex2,
@@ -1234,14 +1420,14 @@ var Beneficiary = ({ onUpdate }) => {
1234
1420
  {
1235
1421
  placement: "center",
1236
1422
  motionPreset: "slide-in-bottom",
1237
- size: { mdDown: "full", md: "lg" },
1423
+ size: { mdDown: "full", md: "xl" },
1238
1424
  open: addDialogOpen,
1239
1425
  onOpenChange: (details) => setAddDialogOpen(details.open),
1240
1426
  children: [
1241
1427
  /* @__PURE__ */ jsx6(Dialog.Trigger, { asChild: true, children: /* @__PURE__ */ jsx6(Button, { w: { base: "full", md: "auto" }, children: "Add Beneficiary" }) }),
1242
1428
  /* @__PURE__ */ jsxs6(Portal2, { children: [
1243
1429
  /* @__PURE__ */ jsx6(Dialog.Backdrop, {}),
1244
- /* @__PURE__ */ jsx6(Dialog.Positioner, { children: /* @__PURE__ */ jsxs6(Dialog.Content, { mx: { base: 3, md: 0 }, children: [
1430
+ /* @__PURE__ */ jsx6(Dialog.Positioner, { children: /* @__PURE__ */ jsxs6(Dialog.Content, { children: [
1245
1431
  /* @__PURE__ */ jsx6(Dialog.Header, { children: /* @__PURE__ */ jsx6(Dialog.Title, { children: "Add Beneficiary" }) }),
1246
1432
  /* @__PURE__ */ jsx6(Dialog.Body, { children: /* @__PURE__ */ jsxs6(VStack3, { gap: 5, w: "full", align: "stretch", children: [
1247
1433
  /* @__PURE__ */ jsxs6(
@@ -1734,7 +1920,7 @@ var Beneficiary = ({ onUpdate }) => {
1734
1920
  var beneficiary_default = Beneficiary;
1735
1921
 
1736
1922
  // src/NewSaleForm/HealthDeclaration.tsx
1737
- import { useState as useState5 } from "react";
1923
+ import { useState as useState5, useEffect as useEffect4 } from "react";
1738
1924
  import {
1739
1925
  VStack as VStack4,
1740
1926
  Box as Box6,
@@ -1754,6 +1940,29 @@ var HealthDeclaration = () => {
1754
1940
  healthDeclaration3: false,
1755
1941
  healthDeclaration4: false
1756
1942
  });
1943
+ useEffect4(() => {
1944
+ let appData = loadApplicationDataFromLocalStorage();
1945
+ if (!appData) {
1946
+ appData = createEmptyApplicationData();
1947
+ saveApplicationDataToLocalStorage(appData);
1948
+ }
1949
+ if (appData && appData.healthDeclaration) {
1950
+ setHealthDeclarationValues(appData.healthDeclaration);
1951
+ }
1952
+ }, []);
1953
+ useEffect4(() => {
1954
+ return () => {
1955
+ const appData = loadApplicationDataFromLocalStorage();
1956
+ if (appData) {
1957
+ appData.healthDeclaration = healthDeclarationValues;
1958
+ saveApplicationDataToLocalStorage(appData);
1959
+ console.log(
1960
+ "Health Declaration saved to localStorage",
1961
+ healthDeclarationValues
1962
+ );
1963
+ }
1964
+ };
1965
+ }, [healthDeclarationValues]);
1757
1966
  const items = [
1758
1967
  {
1759
1968
  value: "first-item",
@@ -1895,71 +2104,10 @@ import { FaRegAddressCard, FaRegUser } from "react-icons/fa";
1895
2104
  import { IoIosInformationCircleOutline } from "react-icons/io";
1896
2105
  import { LuChevronsDown, LuChevronsUp } from "react-icons/lu";
1897
2106
  import { useCallback, useEffect as useEffect5, useState as useState7 } from "react";
1898
- import { TertiarySmButton } from "st-peter-ui";
1899
-
1900
- // src/lib/applicationData.ts
1901
- var LIFE_PLAN_APPLICATION_KEY = "LifePlanApplication";
1902
- var createEmptyApplicationData = () => ({
1903
- personalInfo: {
1904
- firstName: "",
1905
- middleName: "",
1906
- lastName: "",
1907
- suffix: "",
1908
- birthDate: "",
1909
- idType: "",
1910
- idNumber: "",
1911
- height: 0,
1912
- weight: 0,
1913
- gender: "",
1914
- civilStatus: "",
1915
- nationality: "",
1916
- mobileNumber: "",
1917
- emailAddress: "",
1918
- mailingAddress: "",
1919
- landLineNumber: ""
1920
- },
1921
- address: {
1922
- lot: "",
1923
- street: "",
1924
- barangay: "",
1925
- district: "",
1926
- city: "",
1927
- province: ""
1928
- },
1929
- employment: {
1930
- occupation: "",
1931
- employerName: "",
1932
- employmentStatus: "",
1933
- officeAddress: "",
1934
- TIN: "",
1935
- SSS: "",
1936
- sourceOfIncome: ""
1937
- },
1938
- beneficiaries: [],
1939
- healthDeclaration: {
1940
- healthDeclaration1: false,
1941
- healthDeclaration2: false,
1942
- healthDeclaration3: false,
1943
- healthDeclaration4: false
1944
- }
1945
- });
1946
- var loadApplicationDataFromLocalStorage = (storageKey = LIFE_PLAN_APPLICATION_KEY) => {
1947
- if (typeof window === "undefined") return null;
1948
- try {
1949
- const stored = window.localStorage.getItem(storageKey);
1950
- return stored ? JSON.parse(stored) : null;
1951
- } catch {
1952
- return null;
1953
- }
1954
- };
1955
- var saveApplicationDataToLocalStorage = (data, storageKey = LIFE_PLAN_APPLICATION_KEY) => {
1956
- if (typeof window === "undefined") return;
1957
- window.localStorage.setItem(storageKey, JSON.stringify(data));
1958
- };
1959
2107
 
1960
2108
  // src/NewSaleForm/ui/info-card.tsx
1961
- import "react";
1962
2109
  import { Box as Box7, HStack as HStack2, Text as Text4 } from "@chakra-ui/react";
2110
+ import "st-peter-ui";
1963
2111
  import { HiInformationCircle } from "react-icons/hi";
1964
2112
  import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1965
2113
  var InfoCard = ({
@@ -1969,22 +2117,29 @@ var InfoCard = ({
1969
2117
  return /* @__PURE__ */ jsxs8(
1970
2118
  HStack2,
1971
2119
  {
1972
- gap: 3,
2120
+ gap: STANDARD_SPACING.sm,
1973
2121
  align: "center",
1974
2122
  p: "8px",
1975
- borderRadius: "md",
2123
+ borderRadius: STANDARD_RADIUS.md,
1976
2124
  bg: "#ebf4fb",
1977
2125
  borderWidth: "1px",
1978
2126
  borderColor: "#1976d2",
1979
- color: "#0b3d2e",
2127
+ color: BRAND_COLORS.darkGreen,
1980
2128
  children: [
1981
- /* @__PURE__ */ jsx8(Box7, { as: icon, boxSize: "20px", color: "#1976d2", flexShrink: 0 }),
2129
+ /* @__PURE__ */ jsx8(
2130
+ Box7,
2131
+ {
2132
+ as: icon,
2133
+ boxSize: STANDARD_SIZES.iconButton.sm,
2134
+ color: "#1976d2",
2135
+ flexShrink: 0
2136
+ }
2137
+ ),
1982
2138
  /* @__PURE__ */ jsx8(Text4, { color: "#1976d2", fontSize: "xs", children })
1983
2139
  ]
1984
2140
  }
1985
2141
  );
1986
2142
  };
1987
- var info_card_default = InfoCard;
1988
2143
 
1989
2144
  // src/NewSaleForm/ui/input-card-accordion.tsx
1990
2145
  import { Box as Box8, Flex as Flex3, Text as Text5 } from "@chakra-ui/react";
@@ -2083,6 +2238,7 @@ function InputCardAccordion({
2083
2238
  }
2084
2239
 
2085
2240
  // src/NewSaleForm/LifePlanApplicationFormWrapper.tsx
2241
+ import { TertiarySmButton } from "st-peter-ui";
2086
2242
  import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
2087
2243
  var hasText = (value) => String(value ?? "").trim() !== "";
2088
2244
  var isPersonalComplete = (p) => !!p && [
@@ -2111,7 +2267,8 @@ var isEmploymentComplete = (e) => !!e && [
2111
2267
  var LifePlanApplicationFormWrapper = ({
2112
2268
  openSection,
2113
2269
  openSectionKey,
2114
- onValidChange
2270
+ onValidChange,
2271
+ parseAddress
2115
2272
  }) => {
2116
2273
  const [applicationData, setApplicationData] = useState7(
2117
2274
  createEmptyApplicationData
@@ -2186,7 +2343,13 @@ var LifePlanApplicationFormWrapper = ({
2186
2343
  description: "Where you currently live",
2187
2344
  value: "address",
2188
2345
  complete: isAddressComplete(applicationData.address),
2189
- page: /* @__PURE__ */ jsx10(LifePlanApplication2_default, { onAddressUpdate: handleAddressUpdate })
2346
+ page: /* @__PURE__ */ jsx10(
2347
+ LifePlanApplication2_default,
2348
+ {
2349
+ onAddressUpdate: handleAddressUpdate,
2350
+ ...parseAddress ? { parseAddress } : {}
2351
+ }
2352
+ )
2190
2353
  },
2191
2354
  {
2192
2355
  icon: IoIosInformationCircleOutline,
@@ -2219,8 +2382,8 @@ var LifePlanApplicationFormWrapper = ({
2219
2382
  justify: "space-between",
2220
2383
  gap: STANDARD_SPACING.sm,
2221
2384
  mb: STANDARD_SPACING.sm,
2222
- children: /* @__PURE__ */ jsxs10(Flex4, { direction: "column", gap: STANDARD_SPACING.xs, children: [
2223
- /* @__PURE__ */ jsx10(info_card_default, { children: "Sections below are expandable and collapsible. Use them to focus only on relevant details." }),
2385
+ children: /* @__PURE__ */ jsxs10(Flex4, { direction: "column", gap: STANDARD_SPACING.xs, w: "full", children: [
2386
+ /* @__PURE__ */ jsx10(InfoCard, { children: "Sections below are expandable and collapsible. Use them to focus only on relevant details." }),
2224
2387
  /* @__PURE__ */ jsxs10(Flex4, { gap: STANDARD_SPACING.xs, justify: "flex-end", children: [
2225
2388
  /* @__PURE__ */ jsxs10(TertiarySmButton, { onClick: expandAll, children: [
2226
2389
  /* @__PURE__ */ jsx10(LuChevronsDown, { size: 14 }),
@@ -2274,8 +2437,11 @@ import {
2274
2437
  Dialog as Dialog2,
2275
2438
  Flex as Flex6,
2276
2439
  HStack as HStack3,
2440
+ Heading as Heading2,
2277
2441
  Icon as Icon3,
2442
+ IconButton as IconButton2,
2278
2443
  Portal as Portal3,
2444
+ SimpleGrid as SimpleGrid3,
2279
2445
  Text as Text7,
2280
2446
  VStack as VStack6
2281
2447
  } from "@chakra-ui/react";
@@ -2283,37 +2449,50 @@ import { CancelButton, ConfirmButton, H3 } from "st-peter-ui";
2283
2449
  import { FaRegAddressCard as FaRegAddressCard2 } from "react-icons/fa6";
2284
2450
  import { FaRegUser as FaRegUser2 } from "react-icons/fa";
2285
2451
  import { IoIosInformationCircleOutline as IoIosInformationCircleOutline2 } from "react-icons/io";
2452
+ import { FiEdit2 } from "react-icons/fi";
2286
2453
  import { useEffect as useEffect6, useState as useState9 } from "react";
2287
2454
 
2288
2455
  // src/NewSaleForm/data/checkBoxList.tsx
2289
2456
  import { Box as Box10, Separator as Separator2 } from "@chakra-ui/react";
2290
- import { Body as Body3, Small } from "st-peter-ui";
2457
+ import { Body as Body4, Small } from "st-peter-ui";
2291
2458
  import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
2292
2459
  var checkboxList = [
2293
2460
  {
2294
2461
  title: "TERMS OF USE",
2295
2462
  checkBoxTitle: "I hereby confirm that the information that I provided is correct and that I accept the TERMS AND CONDITIONS AND DATA PRIVACY AGREEMENT.",
2296
2463
  description: /* @__PURE__ */ jsxs11(Box10, { children: [
2297
- /* @__PURE__ */ jsx11(Body3, { children: "Please read these Terms and Conditions of Use carefully before using this website. Using this website means you have read, understood, agreed to and accepted these Terms and Conditions of Use. If you do not accept these Terms and Conditions of Use, do not use this website." }),
2298
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "CHANGES TO THIS TERMS AND USE" }),
2299
- /* @__PURE__ */ jsx11(Body3, { children: "St. Peter Group reserves the right to change these Terms and Conditions of Use from time to time, in whole or in part, without prior notice. Your continued use of this Website after changes to the Terms and Conditions of Use have been published constitutes your binding agreement and acceptance of the updated Terms and Conditions of Use." }),
2300
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "TRADEMARKS" }),
2301
- /* @__PURE__ */ jsx11(Body3, { children: "The trademarks, logos, and service marks displayed on this Website are the properties of the St. Peter Group. You are not permitted to use these items without prior written consent." }),
2302
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "INTELLECTUAL PROPERTY RIGHTS" }),
2303
- /* @__PURE__ */ jsx11(Body3, { children: "The St. Peter Group owns the intellectual property rights in the content made available on this Website, or has obtained permission from the proper owners to make such content available." }),
2304
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "LINKS TO OTHER SITES" }),
2305
- /* @__PURE__ */ jsx11(Body3, { children: "This website contains links to other websites for convenience only. St. Peter Group is not responsible for the content or availability of linked websites." }),
2306
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "RULES OF CONDUCT" }),
2307
- /* @__PURE__ */ jsx11(Body3, { children: "Your use of this Website is subject to all applicable laws. Do not post threatening, abusive, defamatory, obscene, hateful, or illegal content. Do not upload harmful software or attempt to disrupt the Website." }),
2308
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "DISCLAIMER" }),
2309
- /* @__PURE__ */ jsx11(Body3, { children: "The Website is provided as is. St. Peter Group makes no warranties and is not liable for any damages, including loss of data, viruses, errors, or reliance on content." }),
2310
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "PRIVACY POLICY" }),
2311
- /* @__PURE__ */ jsx11(Body3, { children: "Please read our Privacy Policy." }),
2464
+ /* @__PURE__ */ jsx11(Body4, { children: "Please read these Terms and Conditions of Use carefully before using this website. Using this website means you have read, understood, agreed to and accepted these Terms and Conditions of Use. If you do not accept these Terms and Conditions of Use, do not use this website." }),
2465
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "CHANGES TO THIS TERMS AND USE" }),
2466
+ /* @__PURE__ */ jsx11(Body4, { children: "St. Peter Group reserves the right to change these Terms and Conditions of Use from time to time, in whole or in part, without prior notice. Your continued use of this Website after changes to the Terms and Conditions of Use have been published constitutes your binding agreement and acceptance of the updated Terms and Conditions of Use. If at any time the Terms and Conditions of Use are not acceptable to you, you should immediately cease use of this website." }),
2467
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "TRADEMARKS" }),
2468
+ /* @__PURE__ */ jsx11(Body4, { children: "The trademarks, logos, and service marks displayed on this Website are the properties of the St. Peter Group or the St. Peter Group. You are not permitted to use these items without the prior written consent of St. Peter Group or the St. Peter Group." }),
2469
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "INTELLECTUAL PROPERTY RIGHTS" }),
2470
+ /* @__PURE__ */ jsx11(Body4, { children: "The St. Peter Group owns the intellectual property rights in the content that is made available on this Website, or has obtained the permission of the proper owner/s to make such content available. The St. Peter Group strictly prohibits the redistribution or copying of this Website, in whole or in part, without written permission." }),
2471
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "LINKS TO OTHER SITES" }),
2472
+ /* @__PURE__ */ jsx11(Body4, { children: "This website contains links to other websites and are provided for convenience only. St. Peter Group has not reviewed the linked websites and is not responsible for the content or availability of any linked websites. Inclusion of any link does not imply endorsement." }),
2473
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "SUBMISSION OF UNOFFICIAL IDEAS" }),
2474
+ /* @__PURE__ */ jsx11(Body4, { children: "St. Peter Group does not accept unsolicited unofficial ideas. Do not send original creative artwork, samples, demos, or other works. Any submissions will not be treated as confidential or proprietary." }),
2475
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "RULES OF CONDUCT" }),
2476
+ /* @__PURE__ */ jsx11(Body4, { children: "Your use of this Website is subject to all applicable laws. Do not post threatening, abusive, defamatory, obscene, hateful, or illegal content. Do not upload harmful software or attempt to disrupt the Website." }),
2477
+ /* @__PURE__ */ jsx11(Body4, { mt: 2, children: "You may not post advertisements, political materials, chain letters, spam, or use robots or scraping tools. You may not harvest data without consent." }),
2478
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "GLOBAL AVAILABILITY" }),
2479
+ /* @__PURE__ */ jsx11(Body4, { children: "St. Peter Group manages this site from the Philippines. You are responsible for complying with local laws if used from other locations. Some products may not be available worldwide." }),
2480
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "ACCURACY, COMPLETENESS AND TIMELINESS OF INFORMATION" }),
2481
+ /* @__PURE__ */ jsx11(Body4, { children: "St. Peter Group is not responsible if information on this Website is inaccurate or incomplete for very specific needs. You are responsible for monitoring changes." }),
2482
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "DISCLAIMER" }),
2483
+ /* @__PURE__ */ jsx11(Body4, { children: "The Website is provided \u201Cas is\u201D. St. Peter Group makes no warranties and is not liable for any damages, including loss of data, viruses, errors, or reliance on content." }),
2484
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "LIMITATION OF LIABILITY" }),
2485
+ /* @__PURE__ */ jsx11(Body4, { children: "St. Peter Group is not liable for any direct, indirect, punitive, special, incidental, or consequential damages, including loss of business or data." }),
2486
+ /* @__PURE__ */ jsx11(Body4, { mt: 2, children: "Some jurisdictions may not allow the exclusion of certain damages." }),
2487
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "JURISDICTION" }),
2488
+ /* @__PURE__ */ jsx11(Body4, { children: "These Terms are governed by Philippine law. If any provision is held invalid, the remainder stays effective." }),
2489
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "PRIVACY POLICY" }),
2490
+ /* @__PURE__ */ jsx11(Body4, { children: "Please read our Privacy Policy." }),
2312
2491
  /* @__PURE__ */ jsx11(Separator2, { my: 8 }),
2313
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "HOW TO CONTACT US" }),
2314
- /* @__PURE__ */ jsx11(Body3, { children: "If you have any concern regarding these Terms of Use, contact us:" }),
2315
- /* @__PURE__ */ jsx11(Body3, { mt: 2, fontWeight: "semibold", children: "For website concerns: ronagl@stpeter.com.ph" }),
2316
- /* @__PURE__ */ jsx11(Body3, { mt: 2, fontWeight: "semibold", children: "For data privacy concerns: joycemb@stpeter.com.ph" }),
2492
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "HOW TO CONTACT US" }),
2493
+ /* @__PURE__ */ jsx11(Body4, { children: "If you have any concern regarding these Terms of Use, contact us:" }),
2494
+ /* @__PURE__ */ jsx11(Body4, { mt: 2, fontWeight: "semibold", children: "For website concerns: ronagl@stpeter.com.ph" }),
2495
+ /* @__PURE__ */ jsx11(Body4, { mt: 2, fontWeight: "semibold", children: "For data privacy concerns: joycemb@stpeter.com.ph" }),
2317
2496
  /* @__PURE__ */ jsx11(Small, { textAlign: "center", mt: 8, children: "This Terms of Use was amended on August 30, 2018" })
2318
2497
  ] })
2319
2498
  },
@@ -2321,41 +2500,47 @@ var checkboxList = [
2321
2500
  title: "TERMS OF LIFE PLAN CONTRACT",
2322
2501
  checkBoxTitle: "I hereby confirm that the information that I provided is correct and that I accept the TERMS OF LIFE PLAN CONTRACT.",
2323
2502
  description: /* @__PURE__ */ jsxs11(Box10, { children: [
2324
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "ARTICLE I. DEFINITION OF TERMS" }),
2325
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "ST. PETER" }),
2326
- /* @__PURE__ */ jsx11(Body3, { children: "ST. PETER LIFE PLAN, INC." }),
2327
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "PLANHOLDER" }),
2328
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the person who purchases and owns the plan for whom or for whose beneficiaries benefits are to be delivered, as stipulated and guaranteed by ST. PETER." }),
2329
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Contract" }),
2330
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the Life Plan Contract between ST. PETER and the PLANHOLDER providing the terms and conditions thereof." }),
2331
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Contract Price" }),
2332
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the stipulated price of the Life Plan which may be paid either in lump sum or in installments, net of handling fees and other charges, if any." }),
2333
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Gross Contract Price" }),
2334
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the stipulated price of the Life Plan which includes handling fees and other charges." }),
2335
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Plan Installment" }),
2336
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the monthly, quarterly, semi-annual or annual installment amounts paid by the PLANHOLDER." }),
2337
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Paying Period" }),
2338
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the period of time within which the PLANHOLDER has to pay for the Gross Contract Price of the plan in monthly, quarterly, semi-annual, annual installments or lump sum." }),
2339
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Due Date" }),
2340
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the date when the PLANHOLDER installment should be paid." }),
2341
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Beneficiary" }),
2342
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the person designated by the PLANHOLDER, in accordance with law, to receive the plan insurance proceeds and/or pre-need benefits in case of unrendered service." }),
2343
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Grace Period" }),
2344
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the sixty-day period given to the PLANHOLDER within which to pay accrued installments due, counted from the due date of the first unpaid installment in default." }),
2345
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Lapsed Plan" }),
2346
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to a delinquent plan which has remained unpaid beyond the grace period. A Lapsed Plan has no force and effect." }),
2347
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Reinstatement" }),
2348
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to the process of reactivating a lapsed plan." }),
2349
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Certificate of Full Payment" }),
2350
- /* @__PURE__ */ jsx11(Body3, { children: "Refers to ST. PETER duly signed certification stating that a plan has been fully paid." })
2503
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "ARTICLE I. DEFINITION OF TERMS" }),
2504
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "ST. PETER" }),
2505
+ /* @__PURE__ */ jsx11(Body4, { children: "ST. PETER LIFE PLAN, INC." }),
2506
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "PLANHOLDER" }),
2507
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the person who purchases and owns the plan for whom or for whose beneficiaries benefits are to be delivered, as stipulated and guaranteed by ST. PETER. The term includes the assignee, transferee, and any successor-in-interest of the PLANHOLDER." }),
2508
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Contract" }),
2509
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the Life Plan Contract between ST. PETER and the PLANHOLDER providing the terms and conditions thereof." }),
2510
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Contract Price" }),
2511
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the stipulated price of the Life Plan which may be paid either in lump sum or in installments, net of handling fees and other charges, if any." }),
2512
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Gross Contract Price" }),
2513
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the stipulated price of the Life Plan which includes handling fees and other charges." }),
2514
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Plan Installment" }),
2515
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the monthly, quarterly, semi-annual or annual installment amounts paid by the PLANHOLDER." }),
2516
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Paying Period" }),
2517
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the period of time within which the PLANHOLDER has to pay for the Gross Contract Price of the plan in monthly, quarterly, semi-annual, annual installments or lump sum." }),
2518
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Due Date" }),
2519
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the date when the PLANHOLDER\u2019s installment should be paid." }),
2520
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Beneficiary" }),
2521
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the person designated by the PLANHOLDER, in accordance with law, to receive the plan\u2019s insurance proceeds and/or pre-need benefits in case of unrendered service. The PLANHOLDER has the right to change the beneficiary/ies designated in the application subject to the submission of the standard form and approval." }),
2522
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Grace Period" }),
2523
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the sixty-day period given to the PLANHOLDER within which to pay accrued installments due, counted from the due date of the first unpaid installment in default, as stipulated in this Life Plan Contract." }),
2524
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Lapsed Plan" }),
2525
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to a delinquent plan which has remained unpaid beyond the grace period. A Lapsed Plan has no force and effect." }),
2526
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Reinstatement" }),
2527
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the process of reactivating a lapsed plan." }),
2528
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Certificate of Full Payment" }),
2529
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to ST. PETER\u2019s duly signed certification stating that a plan has been fully paid." }),
2530
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "In Force Plan or Active Plan" }),
2531
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to a pre-need plan for which ST. PETER has an outstanding obligation, either for (1) delivery of benefits or services or (2) payment of termination value." }),
2532
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Mortuary Tie-Up" }),
2533
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the memorial servicing tie-up or mortuary accredited with ST. PETER which renders the memorial services stipulated hereunder." }),
2534
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Effective Date" }),
2535
+ /* @__PURE__ */ jsx11(Body4, { children: "Refers to the date when the payment of at least one (1) modal installment has been accepted and the purchase has been approved by ST. PETER with the issuance of this Contract and as indicated herein." })
2351
2536
  ] })
2352
2537
  },
2353
2538
  {
2354
2539
  title: "OUR CUSTOMER SERVICE CHARTER",
2355
2540
  checkBoxTitle: "I have read and understood the CUSTOMER SERVICE CHARTER.",
2356
2541
  description: /* @__PURE__ */ jsxs11(Box10, { children: [
2357
- /* @__PURE__ */ jsx11(Body3, { children: "We at ST. PETER LIFE PLAN, INC. hold ourselves as DeathCare Experts who aspire to be the most trusted and reliable provider in your Pre-Need Life Plan needs. We also aim to deliver world-class DeathCare services to our planholders." }),
2358
- /* @__PURE__ */ jsx11(Body3, { fontWeight: "semibold", mt: 4, children: "Our customer service charter reflects our commitment to:" }),
2542
+ /* @__PURE__ */ jsx11(Body4, { children: "We at ST. PETER LIFE PLAN, INC. hold ourselves as DeathCare Experts who aspire to be the most trusted and reliable provider in your Pre-Need Life Plan needs. We also aim to deliver world-class DeathCare services to our planholders. At the core of our corporate values is customer satisfaction. We believe that every filipino family should have a St. Peter Life Plan. These are the pillars of our company\u2019s customer service commitment especially in our online facility and in social media." }),
2543
+ /* @__PURE__ */ jsx11(Body4, { fontWeight: "semibold", mt: 4, children: "Our customer service charter reflects our commitment to:" }),
2359
2544
  /* @__PURE__ */ jsxs11(Box10, { as: "ul", listStyleType: "circle", listStylePosition: "inside", children: [
2360
2545
  /* @__PURE__ */ jsx11("li", { children: "Safe and Secure Operations" }),
2361
2546
  /* @__PURE__ */ jsx11("li", { children: "Maintenance of Customer Privacy" }),
@@ -2363,7 +2548,7 @@ var checkboxList = [
2363
2548
  /* @__PURE__ */ jsx11("li", { children: "Transparent Product Information" }),
2364
2549
  /* @__PURE__ */ jsx11("li", { children: "Prompt Response to Inquiries and Complaints" })
2365
2550
  ] }),
2366
- /* @__PURE__ */ jsx11(Body3, { mt: 4, fontWeight: "semibold", children: "OUR CUSTOMER SERVICE STANDARDS AND COMMITMENTS" })
2551
+ /* @__PURE__ */ jsx11(Body4, { mt: 4, fontWeight: "semibold", children: "OUR CUSTOMER SERVICE STANDARDS AND COMMITMENTS" })
2367
2552
  ] })
2368
2553
  }
2369
2554
  ];
@@ -2516,7 +2701,57 @@ var ApplicationAccordion = ({
2516
2701
  };
2517
2702
  var ReviewRows2 = ({
2518
2703
  rows
2519
- }) => /* @__PURE__ */ jsx13(VStack6, { align: "stretch", gap: 1, children: rows.map((row) => /* @__PURE__ */ jsx13(row_item_default, { label: row.label, value: row.value }, row.label)) });
2704
+ }) => /* @__PURE__ */ jsx13(VStack6, { align: "stretch", gap: 1, children: rows.map((row) => /* @__PURE__ */ jsx13(RowItem, { label: row.label, value: row.value }, row.label)) });
2705
+ var FieldGrid = ({
2706
+ rows
2707
+ }) => /* @__PURE__ */ jsx13(SimpleGrid3, { columns: { base: 1, sm: 2 }, columnGap: 6, rowGap: 5, children: rows.map((row) => /* @__PURE__ */ jsxs13(Box12, { minW: 0, children: [
2708
+ /* @__PURE__ */ jsx13(Text7, { fontSize: "xs", color: "gray.500", mb: 1, children: row.label }),
2709
+ /* @__PURE__ */ jsx13(
2710
+ Text7,
2711
+ {
2712
+ fontSize: "sm",
2713
+ fontWeight: "600",
2714
+ color: "gray.900",
2715
+ wordBreak: "break-word",
2716
+ children: row.value ?? "-"
2717
+ }
2718
+ )
2719
+ ] }, row.label)) });
2720
+ var SectionCard = ({
2721
+ title,
2722
+ onEdit,
2723
+ children
2724
+ }) => /* @__PURE__ */ jsxs13(
2725
+ Box12,
2726
+ {
2727
+ css: { breakInside: "avoid" },
2728
+ mb: 6,
2729
+ bg: "white",
2730
+ borderWidth: "1px",
2731
+ borderColor: "gray.200",
2732
+ borderRadius: "xl",
2733
+ boxShadow: "sm",
2734
+ p: 6,
2735
+ children: [
2736
+ /* @__PURE__ */ jsxs13(Flex6, { justify: "space-between", align: "center", mb: 5, children: [
2737
+ /* @__PURE__ */ jsx13(Heading2, { as: "h3", fontSize: "lg", fontWeight: "bold", color: "gray.900", children: title }),
2738
+ onEdit ? /* @__PURE__ */ jsx13(
2739
+ IconButton2,
2740
+ {
2741
+ "aria-label": `Edit ${title}`,
2742
+ size: "sm",
2743
+ variant: "ghost",
2744
+ color: "gray.400",
2745
+ _hover: { color: "green.600", bg: "green.50" },
2746
+ onClick: onEdit,
2747
+ children: /* @__PURE__ */ jsx13(FiEdit2, {})
2748
+ }
2749
+ ) : null
2750
+ ] }),
2751
+ children
2752
+ ]
2753
+ }
2754
+ );
2520
2755
  var Confirmation = ({ onAllAcceptedChange, onEdit }) => {
2521
2756
  const [cartItems, setCartItems] = useState9(null);
2522
2757
  const [lifePlanApplication, setLifePlanApplication] = useState9(null);
@@ -2587,269 +2822,221 @@ var Confirmation = ({ onAllAcceptedChange, onEdit }) => {
2587
2822
  setOpenDialog(false);
2588
2823
  setPendingCheck(null);
2589
2824
  };
2590
- return /* @__PURE__ */ jsx13(Box12, { minH: "100vh", children: /* @__PURE__ */ jsx13(Box12, { px: { base: 0, md: 8 }, pb: { base: 4, md: 8 }, children: /* @__PURE__ */ jsxs13(VStack6, { align: "stretch", gap: 3, children: [
2591
- /* @__PURE__ */ jsx13(
2592
- InfoCardAccordion,
2593
- {
2594
- icon: /* @__PURE__ */ jsx13(Icon3, { as: IoIosInformationCircleOutline2, boxSize: "18px" }),
2595
- title: "Order Summary",
2596
- subtitle: modeLabel(selectedPlan?.mode),
2597
- defaultOpen: true,
2598
- children: /* @__PURE__ */ jsx13(
2599
- ReviewRows2,
2600
- {
2601
- rows: [
2602
- {
2603
- label: "Selected Plan",
2604
- value: selectedPlan?.planDesc
2605
- },
2606
- {
2607
- label: "Quantity",
2608
- value: selectedPlan?.quantity
2609
- },
2610
- {
2611
- label: "Total Amount Payable",
2612
- value: selectedPlan ? `\u20B1 ${selectedPlan.total}` : void 0
2613
- }
2614
- ]
2615
- }
2616
- )
2617
- }
2618
- ),
2825
+ const orderRows = [
2826
+ { label: "Selected Plan", value: selectedPlan?.planDesc },
2827
+ { label: "Quantity", value: selectedPlan?.quantity },
2828
+ {
2829
+ label: "Total Amount Payable",
2830
+ value: selectedPlan ? `\u20B1 ${selectedPlan.total}` : void 0
2831
+ }
2832
+ ];
2833
+ const personalRows = [
2834
+ { label: "Uploaded ID", value: lifePlanApplication?.personalInfo.idType },
2835
+ { label: "Last Name", value: lifePlanApplication?.personalInfo.lastName },
2836
+ { label: "First Name", value: lifePlanApplication?.personalInfo.firstName },
2837
+ {
2838
+ label: "Middle Name",
2839
+ value: lifePlanApplication?.personalInfo.middleName
2840
+ },
2841
+ { label: "Suffix", value: lifePlanApplication?.personalInfo.suffix },
2842
+ {
2843
+ label: "Date of Birth",
2844
+ value: lifePlanApplication?.personalInfo.birthDate
2845
+ },
2846
+ { label: "Gender", value: lifePlanApplication?.personalInfo.gender },
2847
+ {
2848
+ label: "Contact Number",
2849
+ value: lifePlanApplication?.personalInfo.mobileNumber
2850
+ },
2851
+ { label: "Email", value: lifePlanApplication?.personalInfo.emailAddress },
2852
+ {
2853
+ label: "Landline Number",
2854
+ value: lifePlanApplication?.personalInfo.landLineNumber
2855
+ },
2856
+ {
2857
+ label: "Mailing Address",
2858
+ value: lifePlanApplication?.personalInfo.mailingAddress
2859
+ },
2860
+ {
2861
+ label: "Civil Status",
2862
+ value: lifePlanApplication?.personalInfo.civilStatus
2863
+ }
2864
+ ];
2865
+ const addressRows = [
2866
+ { label: "Lot #", value: lifePlanApplication?.address.lot },
2867
+ { label: "Street", value: lifePlanApplication?.address.street },
2868
+ { label: "Barangay", value: lifePlanApplication?.address.barangay },
2869
+ { label: "City", value: lifePlanApplication?.address.city },
2870
+ { label: "Province", value: lifePlanApplication?.address.province }
2871
+ ];
2872
+ const employmentRows = [
2873
+ { label: "Occupation", value: lifePlanApplication?.employment.occupation },
2874
+ {
2875
+ label: "Employer Name",
2876
+ value: lifePlanApplication?.employment.employerName
2877
+ },
2878
+ {
2879
+ label: "Employment Status",
2880
+ value: lifePlanApplication?.employment.employmentStatus
2881
+ },
2882
+ {
2883
+ label: "Office Address",
2884
+ value: lifePlanApplication?.employment.officeAddress
2885
+ },
2886
+ { label: "TIN", value: lifePlanApplication?.employment.TIN },
2887
+ { label: "SSS/GSIS", value: lifePlanApplication?.employment.SSS },
2888
+ {
2889
+ label: "Source of Income",
2890
+ value: lifePlanApplication?.employment.sourceOfIncome
2891
+ }
2892
+ ];
2893
+ const beneficiaryItems = /* @__PURE__ */ jsx13(VStack6, { align: "stretch", gap: 4, children: beneficiaries.map((beneficiary, index) => /* @__PURE__ */ jsxs13(Box12, { children: [
2894
+ /* @__PURE__ */ jsx13(Text7, { fontWeight: "semibold", fontSize: "sm", mb: 1, children: beneficiary.name }),
2619
2895
  /* @__PURE__ */ jsx13(
2620
- ApplicationAccordion,
2896
+ ReviewRows2,
2621
2897
  {
2622
- onEdit: onEdit ?? (() => {
2623
- }),
2624
- items: [
2625
- {
2626
- icon: FaRegUser2,
2627
- label: "Personal Info",
2628
- subtitle: "Identification and full name",
2629
- value: "personal",
2630
- page: /* @__PURE__ */ jsx13(
2631
- ReviewRows2,
2632
- {
2633
- rows: [
2634
- {
2635
- label: "Uploaded ID",
2636
- value: lifePlanApplication?.personalInfo.idType
2637
- },
2638
- {
2639
- label: "Last Name",
2640
- value: lifePlanApplication?.personalInfo.lastName
2641
- },
2642
- {
2643
- label: "First Name",
2644
- value: lifePlanApplication?.personalInfo.firstName
2645
- },
2646
- {
2647
- label: "Middle Name",
2648
- value: lifePlanApplication?.personalInfo.middleName
2649
- },
2650
- {
2651
- label: "Suffix",
2652
- value: lifePlanApplication?.personalInfo.suffix
2653
- },
2654
- {
2655
- label: "Date of Birth",
2656
- value: lifePlanApplication?.personalInfo.birthDate
2657
- },
2658
- {
2659
- label: "Gender",
2660
- value: lifePlanApplication?.personalInfo.gender
2661
- },
2662
- {
2663
- label: "Contact Number",
2664
- value: lifePlanApplication?.personalInfo.mobileNumber
2665
- },
2666
- {
2667
- label: "Email",
2668
- value: lifePlanApplication?.personalInfo.emailAddress
2669
- },
2670
- {
2671
- label: "Landline Number",
2672
- value: lifePlanApplication?.personalInfo.landLineNumber
2673
- },
2674
- {
2675
- label: "Mailing Address",
2676
- value: lifePlanApplication?.personalInfo.mailingAddress
2677
- },
2678
- {
2679
- label: "Civil Status",
2680
- value: lifePlanApplication?.personalInfo.civilStatus
2681
- }
2682
- ]
2683
- }
2684
- )
2685
- },
2686
- {
2687
- icon: FaRegAddressCard2,
2688
- label: "Address",
2689
- subtitle: "Where you currently live",
2690
- value: "address",
2691
- page: /* @__PURE__ */ jsx13(
2692
- ReviewRows2,
2693
- {
2694
- rows: [
2695
- {
2696
- label: "Lot #",
2697
- value: lifePlanApplication?.address.lot
2698
- },
2699
- {
2700
- label: "Street",
2701
- value: lifePlanApplication?.address.street
2702
- },
2703
- {
2704
- label: "Barangay",
2705
- value: lifePlanApplication?.address.barangay
2706
- },
2707
- {
2708
- label: "City",
2709
- value: lifePlanApplication?.address.city
2710
- },
2711
- {
2712
- label: "Province",
2713
- value: lifePlanApplication?.address.province
2714
- }
2715
- ]
2716
- }
2717
- )
2718
- },
2719
- {
2720
- icon: IoIosInformationCircleOutline2,
2721
- label: "Employment",
2722
- subtitle: "Work and income details",
2723
- value: "employment",
2724
- page: /* @__PURE__ */ jsx13(
2725
- ReviewRows2,
2726
- {
2727
- rows: [
2728
- {
2729
- label: "Occupation",
2730
- value: lifePlanApplication?.employment.occupation
2731
- },
2732
- {
2733
- label: "Employer Name",
2734
- value: lifePlanApplication?.employment.employerName
2735
- },
2736
- {
2737
- label: "Employment Status",
2738
- value: lifePlanApplication?.employment.employmentStatus
2739
- },
2740
- {
2741
- label: "Office Address",
2742
- value: lifePlanApplication?.employment.officeAddress
2743
- },
2744
- {
2745
- label: "TIN",
2746
- value: lifePlanApplication?.employment.TIN
2747
- },
2748
- {
2749
- label: "SSS/GSIS",
2750
- value: lifePlanApplication?.employment.SSS
2751
- },
2752
- {
2753
- label: "Source of Income",
2754
- value: lifePlanApplication?.employment.sourceOfIncome
2755
- }
2756
- ]
2757
- }
2758
- )
2759
- }
2898
+ rows: [
2899
+ { label: "Relationship", value: beneficiary.relationship },
2900
+ { label: "Date of Birth", value: beneficiary.dob },
2901
+ { label: "Address", value: beneficiary.address }
2760
2902
  ]
2761
2903
  }
2762
- ),
2763
- /* @__PURE__ */ jsx13(
2764
- InfoCardAccordion,
2904
+ )
2905
+ ] }, `${beneficiary.name}-${index}`)) });
2906
+ const agreementItems = /* @__PURE__ */ jsx13(VStack6, { align: "stretch", gap: 3, children: checkboxList.map((item, index) => {
2907
+ const isAccepted = acceptedAgreements[index];
2908
+ return /* @__PURE__ */ jsx13(
2909
+ Box12,
2765
2910
  {
2766
- icon: /* @__PURE__ */ jsx13(Icon3, { as: FaRegUser2, boxSize: "18px" }),
2767
- title: "Beneficiaries",
2768
- subtitle: `${beneficiaries.length} listed`,
2769
- children: /* @__PURE__ */ jsx13(VStack6, { align: "stretch", gap: 4, children: beneficiaries.map((beneficiary, index) => /* @__PURE__ */ jsxs13(Box12, { children: [
2770
- /* @__PURE__ */ jsx13(Text7, { fontWeight: "semibold", fontSize: "sm", mb: 1, children: beneficiary.name }),
2911
+ role: "button",
2912
+ tabIndex: 0,
2913
+ p: 4,
2914
+ borderWidth: "1px",
2915
+ rounded: "xl",
2916
+ bg: isAccepted ? "green.50" : "gray.50",
2917
+ transition: "all 0.15s ease",
2918
+ _hover: { bg: isAccepted ? "green.100" : "gray.100" },
2919
+ onClick: () => {
2920
+ setPendingCheck(index);
2921
+ setOpenDialog(true);
2922
+ },
2923
+ onKeyDown: (e) => {
2924
+ if (e.key === "Enter" || e.key === " ") {
2925
+ e.preventDefault();
2926
+ setPendingCheck(index);
2927
+ setOpenDialog(true);
2928
+ }
2929
+ },
2930
+ children: /* @__PURE__ */ jsxs13(Flex6, { justify: "space-between", align: "start", gap: 4, children: [
2931
+ /* @__PURE__ */ jsxs13(Box12, { flex: "1", minW: 0, children: [
2932
+ /* @__PURE__ */ jsxs13(Text7, { fontWeight: "semibold", lineClamp: 2, children: [
2933
+ item.checkBoxTitle,
2934
+ "."
2935
+ ] }),
2936
+ /* @__PURE__ */ jsx13(Text7, { fontSize: "sm", color: "gray.600", mt: 1, lineClamp: 1, children: "Tap to review details." })
2937
+ ] }),
2771
2938
  /* @__PURE__ */ jsx13(
2772
- ReviewRows2,
2939
+ Badge,
2773
2940
  {
2774
- rows: [
2775
- {
2776
- label: "Relationship",
2777
- value: beneficiary.relationship
2778
- },
2779
- {
2780
- label: "Date of Birth",
2781
- value: beneficiary.dob
2782
- },
2783
- {
2784
- label: "Address",
2785
- value: beneficiary.address
2786
- }
2787
- ]
2941
+ variant: "subtle",
2942
+ colorPalette: isAccepted ? "green" : "gray",
2943
+ children: isAccepted ? "Accepted" : "Review"
2788
2944
  }
2789
2945
  )
2790
- ] }, `${beneficiary.name}-${index}`)) })
2791
- }
2792
- ),
2793
- /* @__PURE__ */ jsx13(
2794
- InfoCardAccordion,
2795
- {
2796
- icon: /* @__PURE__ */ jsx13(Icon3, { as: IoIosInformationCircleOutline2, boxSize: "18px" }),
2797
- title: "Agreements",
2798
- subtitle: `${acceptedCount}/${checkboxList.length} accepted`,
2799
- children: /* @__PURE__ */ jsx13(VStack6, { align: "stretch", gap: 3, children: checkboxList.map((item, index) => {
2800
- const isAccepted = acceptedAgreements[index];
2801
- return /* @__PURE__ */ jsx13(
2802
- Box12,
2946
+ ] })
2947
+ },
2948
+ index
2949
+ );
2950
+ }) });
2951
+ return /* @__PURE__ */ jsx13(Box12, { minH: "100vh", children: /* @__PURE__ */ jsxs13(Box12, { px: { base: 0, md: 8 }, pb: { base: 4, md: 8 }, children: [
2952
+ /* @__PURE__ */ jsx13(Box12, { display: { base: "block", lg: "none" }, children: /* @__PURE__ */ jsxs13(VStack6, { align: "stretch", gap: 3, children: [
2953
+ /* @__PURE__ */ jsx13(
2954
+ InfoCardAccordion,
2955
+ {
2956
+ icon: /* @__PURE__ */ jsx13(Icon3, { as: IoIosInformationCircleOutline2, boxSize: "18px" }),
2957
+ title: "Order Summary",
2958
+ subtitle: modeLabel(selectedPlan?.mode),
2959
+ defaultOpen: true,
2960
+ children: /* @__PURE__ */ jsx13(ReviewRows2, { rows: orderRows })
2961
+ }
2962
+ ),
2963
+ /* @__PURE__ */ jsx13(
2964
+ ApplicationAccordion,
2965
+ {
2966
+ onEdit: onEdit ?? (() => {
2967
+ }),
2968
+ items: [
2803
2969
  {
2804
- role: "button",
2805
- tabIndex: 0,
2806
- p: 4,
2807
- borderWidth: "1px",
2808
- rounded: "xl",
2809
- bg: isAccepted ? "green.50" : "gray.50",
2810
- transition: "all 0.15s ease",
2811
- _hover: { bg: isAccepted ? "green.100" : "gray.100" },
2812
- onClick: () => {
2813
- setPendingCheck(index);
2814
- setOpenDialog(true);
2815
- },
2816
- onKeyDown: (e) => {
2817
- if (e.key === "Enter" || e.key === " ") {
2818
- e.preventDefault();
2819
- setPendingCheck(index);
2820
- setOpenDialog(true);
2821
- }
2822
- },
2823
- children: /* @__PURE__ */ jsxs13(Flex6, { justify: "space-between", align: "start", gap: 4, children: [
2824
- /* @__PURE__ */ jsxs13(Box12, { flex: "1", minW: 0, children: [
2825
- /* @__PURE__ */ jsxs13(Text7, { fontWeight: "semibold", lineClamp: 2, children: [
2826
- item.checkBoxTitle,
2827
- "."
2828
- ] }),
2829
- /* @__PURE__ */ jsx13(
2830
- Text7,
2831
- {
2832
- fontSize: "sm",
2833
- color: "gray.600",
2834
- mt: 1,
2835
- lineClamp: 1,
2836
- children: "Tap to review details."
2837
- }
2838
- )
2839
- ] }),
2840
- /* @__PURE__ */ jsx13(
2841
- Badge,
2842
- {
2843
- variant: "subtle",
2844
- colorPalette: isAccepted ? "green" : "gray",
2845
- children: isAccepted ? "Accepted" : "Review"
2846
- }
2847
- )
2848
- ] })
2970
+ icon: FaRegUser2,
2971
+ label: "Personal Info",
2972
+ subtitle: "Identification and full name",
2973
+ value: "personal",
2974
+ page: /* @__PURE__ */ jsx13(ReviewRows2, { rows: personalRows })
2849
2975
  },
2850
- index
2851
- );
2852
- }) })
2976
+ {
2977
+ icon: FaRegAddressCard2,
2978
+ label: "Address",
2979
+ subtitle: "Where you currently live",
2980
+ value: "address",
2981
+ page: /* @__PURE__ */ jsx13(ReviewRows2, { rows: addressRows })
2982
+ },
2983
+ {
2984
+ icon: IoIosInformationCircleOutline2,
2985
+ label: "Employment",
2986
+ subtitle: "Work and income details",
2987
+ value: "employment",
2988
+ page: /* @__PURE__ */ jsx13(ReviewRows2, { rows: employmentRows })
2989
+ }
2990
+ ]
2991
+ }
2992
+ ),
2993
+ /* @__PURE__ */ jsx13(
2994
+ InfoCardAccordion,
2995
+ {
2996
+ icon: /* @__PURE__ */ jsx13(Icon3, { as: FaRegUser2, boxSize: "18px" }),
2997
+ title: "Beneficiaries",
2998
+ subtitle: `${beneficiaries.length} listed`,
2999
+ children: beneficiaryItems
3000
+ }
3001
+ ),
3002
+ /* @__PURE__ */ jsx13(
3003
+ InfoCardAccordion,
3004
+ {
3005
+ icon: /* @__PURE__ */ jsx13(Icon3, { as: IoIosInformationCircleOutline2, boxSize: "18px" }),
3006
+ title: "Agreements",
3007
+ subtitle: `${acceptedCount}/${checkboxList.length} accepted`,
3008
+ children: agreementItems
3009
+ }
3010
+ )
3011
+ ] }) }),
3012
+ /* @__PURE__ */ jsxs13(
3013
+ Box12,
3014
+ {
3015
+ display: { base: "none", lg: "block" },
3016
+ css: { columnCount: 2, columnGap: "24px" },
3017
+ children: [
3018
+ /* @__PURE__ */ jsx13(
3019
+ SectionCard,
3020
+ {
3021
+ title: "Personal Information",
3022
+ onEdit: () => onEdit?.("personal"),
3023
+ children: /* @__PURE__ */ jsx13(FieldGrid, { rows: personalRows })
3024
+ }
3025
+ ),
3026
+ /* @__PURE__ */ jsx13(SectionCard, { title: "Order Summary", children: /* @__PURE__ */ jsx13(FieldGrid, { rows: orderRows }) }),
3027
+ /* @__PURE__ */ jsx13(SectionCard, { title: "Address", onEdit: () => onEdit?.("address"), children: /* @__PURE__ */ jsx13(FieldGrid, { rows: addressRows }) }),
3028
+ /* @__PURE__ */ jsx13(SectionCard, { title: "Employment", onEdit: () => onEdit?.("employment"), children: /* @__PURE__ */ jsx13(FieldGrid, { rows: employmentRows }) }),
3029
+ /* @__PURE__ */ jsx13(SectionCard, { title: "Beneficiaries", children: beneficiaryItems }),
3030
+ /* @__PURE__ */ jsxs13(SectionCard, { title: "Agreements", children: [
3031
+ /* @__PURE__ */ jsxs13(Text7, { fontSize: "xs", color: "gray.500", mb: 4, children: [
3032
+ acceptedCount,
3033
+ "/",
3034
+ checkboxList.length,
3035
+ " accepted"
3036
+ ] }),
3037
+ agreementItems
3038
+ ] })
3039
+ ]
2853
3040
  }
2854
3041
  ),
2855
3042
  /* @__PURE__ */ jsx13(
@@ -2870,52 +3057,30 @@ var Confirmation = ({ onAllAcceptedChange, onEdit }) => {
2870
3057
  overflow: "hidden",
2871
3058
  children: [
2872
3059
  /* @__PURE__ */ jsx13(Dialog2.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx13(CloseButton2, { position: "absolute", top: 3, right: 3 }) }),
2873
- /* @__PURE__ */ jsxs13(
2874
- Dialog2.Header,
2875
- {
2876
- px: { base: 4, md: 6 },
2877
- pt: { base: 5, md: 6 },
2878
- children: [
2879
- /* @__PURE__ */ jsx13(H3, { children: pendingCheck !== null ? pendingAgreement?.title || "Agreement" : "Agreement" }),
2880
- /* @__PURE__ */ jsx13(Text7, { fontSize: "sm", color: "gray.600", mt: 2, children: "Please read carefully. Confirm to accept this agreement." })
2881
- ]
2882
- }
2883
- ),
2884
- /* @__PURE__ */ jsx13(Dialog2.Body, { px: { base: 4, md: 6 }, pb: { base: 5, md: 6 }, children: /* @__PURE__ */ jsx13(Box12, { p: 4, borderWidth: "0px", rounded: "lg", bg: "gray.50", children: /* @__PURE__ */ jsx13(
2885
- Text7,
2886
- {
2887
- whiteSpace: "pre-wrap",
2888
- fontSize: "sm",
2889
- color: "gray.800",
2890
- children: pendingCheck !== null ? pendingAgreement?.description || "Please review and confirm before proceeding." : "Please review and confirm before proceeding."
2891
- }
2892
- ) }) }),
2893
- /* @__PURE__ */ jsx13(
2894
- Dialog2.Footer,
2895
- {
2896
- px: { base: 4, md: 6 },
2897
- pb: { base: 5, md: 6 },
2898
- children: /* @__PURE__ */ jsxs13(HStack3, { justify: "flex-end", gap: 3, w: "full", children: [
2899
- /* @__PURE__ */ jsx13(
2900
- CancelButton,
2901
- {
2902
- onClick: () => {
2903
- setOpenDialog(false);
2904
- setPendingCheck(null);
2905
- }
2906
- }
2907
- ),
2908
- /* @__PURE__ */ jsx13(ConfirmButton, { onClick: confirmAgreement })
2909
- ] })
2910
- }
2911
- )
3060
+ /* @__PURE__ */ jsxs13(Dialog2.Header, { px: { base: 4, md: 6 }, pt: { base: 5, md: 6 }, children: [
3061
+ /* @__PURE__ */ jsx13(H3, { children: pendingCheck !== null ? pendingAgreement?.title || "Agreement" : "Agreement" }),
3062
+ /* @__PURE__ */ jsx13(Text7, { fontSize: "sm", color: "gray.600", mt: 2, children: "Please read carefully. Confirm to accept this agreement." })
3063
+ ] }),
3064
+ /* @__PURE__ */ jsx13(Dialog2.Body, { px: { base: 4, md: 6 }, pb: { base: 5, md: 6 }, children: /* @__PURE__ */ jsx13(Box12, { p: 4, borderWidth: "0px", rounded: "lg", bg: "gray.50", children: /* @__PURE__ */ jsx13(Text7, { whiteSpace: "pre-wrap", fontSize: "sm", color: "gray.800", children: pendingCheck !== null ? pendingAgreement?.description || "Please review and confirm before proceeding." : "Please review and confirm before proceeding." }) }) }),
3065
+ /* @__PURE__ */ jsx13(Dialog2.Footer, { px: { base: 4, md: 6 }, pb: { base: 5, md: 6 }, children: /* @__PURE__ */ jsxs13(HStack3, { justify: "flex-end", gap: 3, w: "full", children: [
3066
+ /* @__PURE__ */ jsx13(
3067
+ CancelButton,
3068
+ {
3069
+ onClick: () => {
3070
+ setOpenDialog(false);
3071
+ setPendingCheck(null);
3072
+ }
3073
+ }
3074
+ ),
3075
+ /* @__PURE__ */ jsx13(ConfirmButton, { onClick: confirmAgreement })
3076
+ ] }) })
2912
3077
  ]
2913
3078
  }
2914
3079
  ) })
2915
3080
  ] })
2916
3081
  }
2917
3082
  )
2918
- ] }) }) });
3083
+ ] }) });
2919
3084
  };
2920
3085
  var confirmation_default = Confirmation;
2921
3086
 
@@ -2939,6 +3104,9 @@ var createLifePlanSteps = (confirmationProps) => [
2939
3104
  if (confirmationProps?.onApplicationValidChange !== void 0) {
2940
3105
  applicationFormWrapperProps.onValidChange = confirmationProps.onApplicationValidChange;
2941
3106
  }
3107
+ if (confirmationProps?.parseAddress !== void 0) {
3108
+ applicationFormWrapperProps.parseAddress = confirmationProps.parseAddress;
3109
+ }
2942
3110
  return /* @__PURE__ */ jsx14(LifePlanApplicationFormWrapper_default, { ...applicationFormWrapperProps });
2943
3111
  })()
2944
3112
  },
@@ -3037,7 +3205,8 @@ var HorizontalStepper = ({
3037
3205
  overflow: "visible",
3038
3206
  pb: { base: "12px", md: "0px" },
3039
3207
  children: [
3040
- (title || description) && /* @__PURE__ */ jsxs14(Box13, { mb: 4, ref: formTopRef, children: [
3208
+ /* @__PURE__ */ jsx15(Box13, { ref: formTopRef, h: "0", w: "full", scrollMarginTop: { base: 4, md: 6 } }),
3209
+ (title || description) && /* @__PURE__ */ jsxs14(Box13, { mb: 4, children: [
3041
3210
  title && /* @__PURE__ */ jsx15(
3042
3211
  Box13,
3043
3212
  {
@@ -3321,10 +3490,20 @@ var horizontal_stepper_default = HorizontalStepper;
3321
3490
 
3322
3491
  // src/NewSaleForm/SharedLifePlanApplication.tsx
3323
3492
  import { jsx as jsx16 } from "react/jsx-runtime";
3493
+ var safeParse = (value) => {
3494
+ if (!value) return null;
3495
+ try {
3496
+ return JSON.parse(value);
3497
+ } catch {
3498
+ return null;
3499
+ }
3500
+ };
3324
3501
  var SharedLifePlanApplication = ({
3325
3502
  title = "Life Plan Application",
3326
3503
  description = "Please fill out the form below to apply for a life plan.",
3327
- onPaymentError
3504
+ onPaymentError,
3505
+ onCheckout,
3506
+ parseAddress
3328
3507
  }) => {
3329
3508
  const [currentStep, setCurrentStep] = useState11(0);
3330
3509
  const [loading, setLoading] = useState11(false);
@@ -3337,6 +3516,7 @@ var SharedLifePlanApplication = ({
3337
3516
  ...applicationSection ? { applicationSection } : {},
3338
3517
  applicationSectionKey,
3339
3518
  onApplicationValidChange: setApplicationValid,
3519
+ ...parseAddress ? { parseAddress } : {},
3340
3520
  onEdit: (section) => {
3341
3521
  setApplicationSection(section ?? "personal");
3342
3522
  setApplicationSectionKey((key) => key + 1);
@@ -3347,6 +3527,38 @@ var SharedLifePlanApplication = ({
3347
3527
  const handleCheckout = async () => {
3348
3528
  if (!allAgreementsAccepted) return;
3349
3529
  setLoading(true);
3530
+ try {
3531
+ if (!onCheckout) {
3532
+ throw new Error("onCheckout prop is not provided");
3533
+ }
3534
+ const checkoutRaw = sessionStorage.getItem("CheckoutCart");
3535
+ const cartRaw = sessionStorage.getItem("Cart");
3536
+ const parsed = safeParse(checkoutRaw) ?? safeParse(cartRaw);
3537
+ const items = Array.isArray(parsed) ? parsed : parsed ? [parsed] : [];
3538
+ if (items.length === 0) {
3539
+ throw new Error("No items to checkout");
3540
+ }
3541
+ const applicationData = loadApplicationDataFromLocalStorage() ?? createEmptyApplicationData();
3542
+ const checkoutPayload = items.map((item) => ({
3543
+ planDesc: item.planDesc,
3544
+ mode: item.mode,
3545
+ ipInstAmt: Number(item.price),
3546
+ planTerm: item.planTerm,
3547
+ quantity: item.quantity ?? 1
3548
+ }));
3549
+ const checkoutUrl = await onCheckout({
3550
+ items: checkoutPayload,
3551
+ application: applicationData
3552
+ });
3553
+ if (!checkoutUrl) throw new Error("Checkout URL not found");
3554
+ window.location.href = checkoutUrl;
3555
+ } catch (error) {
3556
+ console.error(error);
3557
+ onPaymentError?.(error);
3558
+ alert("Failed to proceed to payment");
3559
+ } finally {
3560
+ setLoading(false);
3561
+ }
3350
3562
  };
3351
3563
  return /* @__PURE__ */ jsx16(Box14, { w: "full", overflowX: "hidden", children: /* @__PURE__ */ jsx16(
3352
3564
  horizontal_stepper_default,
@@ -3364,8 +3576,8 @@ var SharedLifePlanApplication_default = SharedLifePlanApplication;
3364
3576
 
3365
3577
  // src/NewSaleForm/LifePlanApplicationStepWrapper.tsx
3366
3578
  import { jsx as jsx17 } from "react/jsx-runtime";
3367
- var LifePlanApplicationStepWrapper = () => {
3368
- return /* @__PURE__ */ jsx17(SharedLifePlanApplication_default, {});
3579
+ var LifePlanApplicationStepWrapper = (props) => {
3580
+ return /* @__PURE__ */ jsx17(SharedLifePlanApplication_default, { ...props });
3369
3581
  };
3370
3582
  var LifePlanApplicationStepWrapper_default = LifePlanApplicationStepWrapper;
3371
3583
 
@@ -3384,36 +3596,6 @@ import {
3384
3596
  } from "@chakra-ui/react";
3385
3597
  import { LuChevronRight as LuChevronRight2 } from "react-icons/lu";
3386
3598
  import Link from "next/link";
3387
-
3388
- // src/lib/theme/brand-colors.ts
3389
- var BRAND_COLORS = {
3390
- primaryGreen: "#109448",
3391
- darkGreen: "#006838",
3392
- softGreen: "#92DDBF",
3393
- pastelPeaGreen: "#ACD6A6",
3394
- seafoamGreen: "#92DDBF",
3395
- lightCyan: "#D3EDEE",
3396
- successBg: "#F0FDF4",
3397
- warningBg: "#FFF7ED",
3398
- warningText: "#F1592B",
3399
- warningBorder: "#F4845F",
3400
- errorBg: "#FEF2F2",
3401
- destructiveRed: "#BF1F2F",
3402
- errorRed: "#EF4444",
3403
- neutralText: "#22223B",
3404
- neutralBorder: "#E5E7EB",
3405
- mutedBg: "#F3F4F6",
3406
- subtleBg: "#F9FAFB",
3407
- white: "#FFFFFF",
3408
- black: "#000000",
3409
- grey: "#808080",
3410
- ashWhite: "#ECECEC",
3411
- gold: "#CBA135",
3412
- brightGold: "#FFD026",
3413
- paleGold: "#FFF48E"
3414
- };
3415
-
3416
- // src/Generic/BottomQuickActions.tsx
3417
3599
  import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
3418
3600
  var SHEET_BG = BRAND_COLORS.white;
3419
3601
  var DRAG_COLOR = BRAND_COLORS.neutralBorder;
@@ -3917,7 +4099,7 @@ import {
3917
4099
  Button as Button4,
3918
4100
  Flex as Flex10,
3919
4101
  HStack as HStack6,
3920
- IconButton as IconButton2,
4102
+ IconButton as IconButton3,
3921
4103
  Input as Input4,
3922
4104
  InputGroup,
3923
4105
  Separator as Separator3,
@@ -4836,7 +5018,7 @@ function ReusableProfile({
4836
5018
  const editAccountContent = /* @__PURE__ */ jsxs17(Fragment4, { children: [
4837
5019
  /* @__PURE__ */ jsx20(Box16, { px: 4, pt: 4, pb: 3, borderBottomWidth: "1px", borderColor: "gray.200", children: /* @__PURE__ */ jsxs17(Flex10, { align: "center", gap: 2, pr: 10, children: [
4838
5020
  /* @__PURE__ */ jsx20(
4839
- IconButton2,
5021
+ IconButton3,
4840
5022
  {
4841
5023
  size: "sm",
4842
5024
  variant: "ghost",
@@ -4909,7 +5091,7 @@ function ReusableProfile({
4909
5091
  const changePasswordContent = /* @__PURE__ */ jsxs17(Fragment4, { children: [
4910
5092
  /* @__PURE__ */ jsx20(Box16, { px: 4, pt: 4, pb: 3, borderBottomWidth: "1px", borderColor: "gray.200", children: /* @__PURE__ */ jsxs17(Flex10, { align: "center", gap: 2, pr: 10, children: [
4911
5093
  /* @__PURE__ */ jsx20(
4912
- IconButton2,
5094
+ IconButton3,
4913
5095
  {
4914
5096
  size: "sm",
4915
5097
  variant: "ghost",
@@ -4928,7 +5110,7 @@ function ReusableProfile({
4928
5110
  InputGroup,
4929
5111
  {
4930
5112
  endElement: /* @__PURE__ */ jsx20(
4931
- IconButton2,
5113
+ IconButton3,
4932
5114
  {
4933
5115
  size: "xs",
4934
5116
  variant: "ghost",
@@ -4957,7 +5139,7 @@ function ReusableProfile({
4957
5139
  InputGroup,
4958
5140
  {
4959
5141
  endElement: /* @__PURE__ */ jsx20(
4960
- IconButton2,
5142
+ IconButton3,
4961
5143
  {
4962
5144
  size: "xs",
4963
5145
  variant: "ghost",
@@ -5000,7 +5182,7 @@ function ReusableProfile({
5000
5182
  InputGroup,
5001
5183
  {
5002
5184
  endElement: /* @__PURE__ */ jsx20(
5003
- IconButton2,
5185
+ IconButton3,
5004
5186
  {
5005
5187
  size: "xs",
5006
5188
  variant: "ghost",
@@ -5055,7 +5237,7 @@ function ReusableProfile({
5055
5237
  zIndex: 1,
5056
5238
  children: /* @__PURE__ */ jsxs17(Flex10, { align: "center", gap: 2, pr: 10, children: [
5057
5239
  /* @__PURE__ */ jsx20(
5058
- IconButton2,
5240
+ IconButton3,
5059
5241
  {
5060
5242
  size: "sm",
5061
5243
  variant: "ghost",
@@ -5170,7 +5352,7 @@ function ReusableProfile({
5170
5352
  ] }),
5171
5353
  /* @__PURE__ */ jsxs17(HStack6, { gap: 0.5, children: [
5172
5354
  /* @__PURE__ */ jsx20(
5173
- IconButton2,
5355
+ IconButton3,
5174
5356
  {
5175
5357
  size: "xs",
5176
5358
  variant: "ghost",
@@ -5182,7 +5364,7 @@ function ReusableProfile({
5182
5364
  }
5183
5365
  ),
5184
5366
  /* @__PURE__ */ jsx20(
5185
- IconButton2,
5367
+ IconButton3,
5186
5368
  {
5187
5369
  size: "xs",
5188
5370
  variant: "ghost",
@@ -5194,7 +5376,7 @@ function ReusableProfile({
5194
5376
  }
5195
5377
  ),
5196
5378
  /* @__PURE__ */ jsx20(
5197
- IconButton2,
5379
+ IconButton3,
5198
5380
  {
5199
5381
  size: "xs",
5200
5382
  variant: isReplacing ? "solid" : "ghost",
@@ -5207,7 +5389,7 @@ function ReusableProfile({
5207
5389
  }
5208
5390
  ),
5209
5391
  /* @__PURE__ */ jsx20(
5210
- IconButton2,
5392
+ IconButton3,
5211
5393
  {
5212
5394
  size: "xs",
5213
5395
  variant: "ghost",
@@ -5306,7 +5488,7 @@ function ReusableProfile({
5306
5488
  )
5307
5489
  ] }),
5308
5490
  isReplacingMode ? /* @__PURE__ */ jsx20(
5309
- IconButton2,
5491
+ IconButton3,
5310
5492
  {
5311
5493
  size: "xs",
5312
5494
  variant: "outline",
@@ -5318,7 +5500,7 @@ function ReusableProfile({
5318
5500
  children: /* @__PURE__ */ jsx20(LuArrowLeftRight, { size: 13 })
5319
5501
  }
5320
5502
  ) : /* @__PURE__ */ jsx20(
5321
- IconButton2,
5503
+ IconButton3,
5322
5504
  {
5323
5505
  size: "xs",
5324
5506
  variant: "outline",
@@ -5424,10 +5606,13 @@ export {
5424
5606
  LifePlanApplicationFormWrapper_default as LifePlanApplicationFormWrapper,
5425
5607
  LifePlanApplicationStepWrapper_default as LifePlanApplicationStepWrapper,
5426
5608
  NotifyInstall,
5609
+ OCR_STORAGE_KEY,
5427
5610
  SharedLifePlanApplication_default as SharedLifePlanApplication,
5428
5611
  UserProfile_default as UserProfile,
5429
5612
  createEmptyApplicationData,
5430
5613
  loadApplicationDataFromLocalStorage,
5614
+ markOcrApplied,
5615
+ readOcrResult,
5431
5616
  saveApplicationDataToLocalStorage
5432
5617
  };
5433
5618
  //# sourceMappingURL=index.mjs.map