@mseva/upyog-ui-module-ads 1.0.86 → 1.0.87

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.
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
4
4
  import { useHistory, Link, useParams, useRouteMatch, Switch, useLocation, Route, Redirect } from 'react-router-dom';
5
5
  import { useForm, Controller } from 'react-hook-form';
6
6
  import { useQueryClient } from 'react-query';
7
- import { useSelector, useDispatch } from 'react-redux';
7
+ import { useDispatch, useSelector } from 'react-redux';
8
8
  import { combineReducers } from 'redux';
9
9
 
10
10
  const shouldHideBackButton = (config = []) => {
@@ -34,6 +34,188 @@ const pdfDownloadLink = (documents = {}, fileStoreId = "", format = "") => {
34
34
  });
35
35
  return fileURL;
36
36
  };
37
+ function normalizeDate(d) {
38
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate());
39
+ }
40
+ const validateSchedule = ({
41
+ startDate,
42
+ endDate,
43
+ startTime,
44
+ endTime,
45
+ scheduleType
46
+ }) => {
47
+ if (!startDate || !endDate || !startTime || !endTime) {
48
+ return "Start and end date/time are required.";
49
+ }
50
+ const start = normalizeDate(new Date(startDate));
51
+ const end = normalizeDate(new Date(endDate));
52
+ const selYear = start.getFullYear();
53
+ const selMonth = start.getMonth();
54
+ const daysInSelMonth = new Date(selYear, selMonth + 1, 0).getDate();
55
+ switch (scheduleType) {
56
+ case "Monthly":
57
+ {
58
+ const monthStart = normalizeDate(new Date(selYear, selMonth, 1));
59
+ const monthEnd = normalizeDate(new Date(selYear, selMonth, daysInSelMonth));
60
+ const today = normalizeDate(new Date());
61
+ if (monthEnd < today) {
62
+ return `This Monthly block (${monthStart.toDateString()} – ${monthEnd.toDateString()}) is already in the past. Please select a future month.`;
63
+ }
64
+ if (start.getTime() !== monthStart.getTime() || end.getTime() !== monthEnd.getTime()) {
65
+ return `For Monthly, you must select ${monthStart.toDateString()} to ${monthEnd.toDateString()}`;
66
+ }
67
+ break;
68
+ }
69
+ case "Weekly":
70
+ {
71
+ const day = start.getDate();
72
+ let blockStart, blockEnd;
73
+ if (day >= 1 && day <= 7) {
74
+ blockStart = 1;
75
+ blockEnd = 7;
76
+ } else if (day >= 8 && day <= 15) {
77
+ blockStart = 8;
78
+ blockEnd = 15;
79
+ } else if (day >= 16 && day <= 23) {
80
+ blockStart = 16;
81
+ blockEnd = 23;
82
+ } else {
83
+ blockStart = 24;
84
+ blockEnd = daysInSelMonth;
85
+ }
86
+ const blockStartDate = normalizeDate(new Date(selYear, selMonth, blockStart));
87
+ const blockEndDate = normalizeDate(new Date(selYear, selMonth, blockEnd));
88
+ const today = normalizeDate(new Date());
89
+ if (blockEndDate < today) {
90
+ return `This weekly block (${blockStart}-${blockEnd} ${start.toLocaleString("default", {
91
+ month: "long"
92
+ })}) is already in the past. Please select a future block.`;
93
+ }
94
+ if (start.getTime() !== blockStartDate.getTime() || end.getTime() !== blockEndDate.getTime()) {
95
+ return `For Weekly, you must select ${blockStart}-${blockEnd} of ${start.toLocaleString("default", {
96
+ month: "long"
97
+ })}`;
98
+ }
99
+ break;
100
+ }
101
+ case "FortNight":
102
+ {
103
+ const firstHalfStart = normalizeDate(new Date(selYear, selMonth, 1));
104
+ const firstHalfEnd = normalizeDate(new Date(selYear, selMonth, 15));
105
+ const secondHalfStart = normalizeDate(new Date(selYear, selMonth, 16));
106
+ const secondHalfEnd = normalizeDate(new Date(selYear, selMonth, daysInSelMonth));
107
+ const today = normalizeDate(new Date());
108
+ if (start.getTime() === firstHalfStart.getTime() && firstHalfEnd < today || start.getTime() === secondHalfStart.getTime() && secondHalfEnd < today) {
109
+ return `This FortNight block is already in the past. Please select a future block.`;
110
+ }
111
+ if (!(start.getTime() === firstHalfStart.getTime() && end.getTime() === firstHalfEnd.getTime() || start.getTime() === secondHalfStart.getTime() && end.getTime() === secondHalfEnd.getTime())) {
112
+ return `For FortNight, you must select 1–15 or 16–${daysInSelMonth} of ${start.toLocaleString("default", {
113
+ month: "long"
114
+ })}`;
115
+ }
116
+ break;
117
+ }
118
+ case "Yearly":
119
+ {
120
+ let fyStart, fyEnd;
121
+ if (selMonth < 3) {
122
+ fyStart = normalizeDate(new Date(selYear - 1, 3, 1));
123
+ fyEnd = normalizeDate(new Date(selYear, 2, 31));
124
+ } else {
125
+ fyStart = normalizeDate(new Date(selYear, 3, 1));
126
+ fyEnd = normalizeDate(new Date(selYear + 1, 2, 31));
127
+ }
128
+ if (start.getTime() !== fyStart.getTime() || end.getTime() !== fyEnd.getTime()) {
129
+ return `For Yearly, you must select ${fyStart.toDateString()} to ${fyEnd.toDateString()} (Financial Year)`;
130
+ }
131
+ break;
132
+ }
133
+ default:
134
+ return "Invalid schedule type.";
135
+ }
136
+ return null;
137
+ };
138
+ function getScheduleMessage(scheduleType, t) {
139
+ switch (scheduleType) {
140
+ case "Monthly":
141
+ return t("ADS_GUIDE_MONTHLY");
142
+ case "Weekly":
143
+ return t("ADS_GUIDE_WEEKLY");
144
+ case "FortNight":
145
+ return t("ADS_GUIDE_FORTNIGHT");
146
+ case "Yearly":
147
+ return t("ADS_GUIDE_YEARLY");
148
+ default:
149
+ return "";
150
+ }
151
+ }
152
+ function getMinDateForType(scheduleType) {
153
+ const today = new Date();
154
+ const year = today.getFullYear();
155
+ const month = today.getMonth();
156
+ if (scheduleType === "Monthly" || scheduleType === "Weekly" || scheduleType === "FortNight") {
157
+ return new Date(year, month, 1).toISOString().split("T")[0];
158
+ }
159
+ if (type === "Yearly") {
160
+ if (month < 3) {
161
+ return new Date(year - 1, 3, 1).toISOString().split("T")[0];
162
+ } else {
163
+ return new Date(year, 3, 1).toISOString().split("T")[0];
164
+ }
165
+ }
166
+ return today.toISOString().split("T")[0];
167
+ }
168
+ function transformAdsData(adsData) {
169
+ var _Object$values;
170
+ const grouped = {};
171
+ adsData === null || adsData === void 0 ? void 0 : adsData.forEach(item => {
172
+ var _grouped$adId;
173
+ const adId = item === null || item === void 0 ? void 0 : item.advertisementId;
174
+ if (!grouped[adId]) {
175
+ grouped[adId] = {
176
+ ad: {
177
+ id: Number(adId),
178
+ ...item
179
+ },
180
+ slots: []
181
+ };
182
+ }
183
+ (_grouped$adId = grouped[adId]) === null || _grouped$adId === void 0 ? void 0 : _grouped$adId.slots.push({
184
+ addType: item === null || item === void 0 ? void 0 : item.addType,
185
+ location: item === null || item === void 0 ? void 0 : item.location,
186
+ faceArea: item === null || item === void 0 ? void 0 : item.faceArea,
187
+ nightLight: item === null || item === void 0 ? void 0 : item.nightLight,
188
+ bookingId: item === null || item === void 0 ? void 0 : item.bookingId,
189
+ timerValue: 0,
190
+ bookingDate: item === null || item === void 0 ? void 0 : item.bookingDate,
191
+ bookingStartDate: item === null || item === void 0 ? void 0 : item.bookingDate,
192
+ bookingEndDate: item === null || item === void 0 ? void 0 : item.bookingDate,
193
+ advertisementId: item === null || item === void 0 ? void 0 : item.advertisementId,
194
+ slotStaus: item === null || item === void 0 ? void 0 : item.status,
195
+ bookingFromTime: item === null || item === void 0 ? void 0 : item.bookingFromTime,
196
+ bookingToTime: item === null || item === void 0 ? void 0 : item.bookingToTime
197
+ });
198
+ });
199
+ (_Object$values = Object.values(grouped)) === null || _Object$values === void 0 ? void 0 : _Object$values.forEach(group => {
200
+ const dates = group === null || group === void 0 ? void 0 : group.slots.map(s => new Date(s === null || s === void 0 ? void 0 : s.bookingDate));
201
+ const minDate = new Date(Math === null || Math === void 0 ? void 0 : Math.min(...dates));
202
+ const maxDate = new Date(Math === null || Math === void 0 ? void 0 : Math.max(...dates));
203
+ const format = d => d.toISOString().split("T")[0];
204
+ group.ad.bookingStartDate = format(minDate);
205
+ group.ad.bookingEndDate = format(maxDate);
206
+ group.ad.startDate = format(minDate);
207
+ group.ad.endDate = format(maxDate);
208
+ });
209
+ return Object.values(grouped);
210
+ }
211
+ const formatLabel = key => {
212
+ var _key$replace, _key$replace$replace, _spaced$split, _spaced$split$map;
213
+ const spaced = key === null || key === void 0 ? void 0 : (_key$replace = key.replace(/([a-z])([A-Z])/g, "$1 $2")) === null || _key$replace === void 0 ? void 0 : (_key$replace$replace = _key$replace.replace(/_/g, " ")) === null || _key$replace$replace === void 0 ? void 0 : _key$replace$replace.replace(/([a-z])([0-9])/gi, "$1 $2");
214
+ return spaced === null || spaced === void 0 ? void 0 : (_spaced$split = spaced.split(" ")) === null || _spaced$split === void 0 ? void 0 : (_spaced$split$map = _spaced$split.map(word => {
215
+ var _word$charAt;
216
+ return (word === null || word === void 0 ? void 0 : (_word$charAt = word.charAt(0)) === null || _word$charAt === void 0 ? void 0 : _word$charAt.toUpperCase()) + (word === null || word === void 0 ? void 0 : word.slice(1));
217
+ })) === null || _spaced$split$map === void 0 ? void 0 : _spaced$split$map.join(" ");
218
+ };
37
219
 
38
220
  const Heading = props => {
39
221
  return /*#__PURE__*/React.createElement("h1", {
@@ -261,13 +443,7 @@ const ADSSearchApplication = ({
261
443
  setValue("offset", getValues("offset") - getValues("limit"));
262
444
  handleSubmit(onSubmit)();
263
445
  }
264
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, null, t("ADS_SEARCH_BOOKINGS")), /*#__PURE__*/React.createElement(Card$1, {
265
- className: "card-search-heading"
266
- }, /*#__PURE__*/React.createElement("span", {
267
- style: {
268
- color: "#505A5F"
269
- }
270
- }, t("Provide at least one parameter to search for an application"))), /*#__PURE__*/React.createElement(SearchForm, {
446
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, null, t("ADS_SEARCH_BOOKINGS")), /*#__PURE__*/React.createElement(SearchForm, {
271
447
  onSubmit: onSubmit,
272
448
  handleSubmit: handleSubmit
273
449
  }, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("ADS_BOOKING_NO")), /*#__PURE__*/React.createElement(TextInput, {
@@ -308,7 +484,7 @@ const ADSSearchApplication = ({
308
484
  componentInFront: /*#__PURE__*/React.createElement("div", {
309
485
  className: "employee-card-input employee-card-input--front"
310
486
  }, "+91")
311
- }), /*#__PURE__*/React.createElement(CardLabelError$1, null, formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$mob = _formState$errors["mobileNumber"]) === null || _formState$errors$mob === void 0 ? void 0 : _formState$errors$mob.message)), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("FROM_DATE")), /*#__PURE__*/React.createElement(Controller, {
487
+ }), /*#__PURE__*/React.createElement(CardLabelError$1, null, formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$mob = _formState$errors["mobileNumber"]) === null || _formState$errors$mob === void 0 ? void 0 : _formState$errors$mob.message)), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("EVENTS_FROM_DATE_LABEL")), /*#__PURE__*/React.createElement(Controller, {
312
488
  render: props => /*#__PURE__*/React.createElement(DatePicker, {
313
489
  date: props.value,
314
490
  disabled: false,
@@ -317,7 +493,7 @@ const ADSSearchApplication = ({
317
493
  }),
318
494
  name: "fromDate",
319
495
  control: control
320
- })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("TO_DATE")), /*#__PURE__*/React.createElement(Controller, {
496
+ })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("EVENTS_TO_DATE_LABEL")), /*#__PURE__*/React.createElement(Controller, {
321
497
  render: props => /*#__PURE__*/React.createElement(DatePicker, {
322
498
  date: props.value,
323
499
  disabled: false,
@@ -13380,7 +13556,7 @@ const ADSResponseCitizen = props => {
13380
13556
  history.push(isCitizen ? `/digit-ui/citizen/ads-home` : `/digit-ui/employee/ads/inbox`);
13381
13557
  };
13382
13558
  const handlePayment = () => {
13383
- history.push(isCitizen ? `/digit-ui/citizen/payment/collect/adv-services/${ptrCode}/${tenantId}?tenantId=${tenantId}` : `/digit-ui/employee/payment/collect/adv-services/${ptrCode}/${tenantId}?tenantId=${tenantId}`);
13559
+ history.push(isCitizen ? `/digit-ui/citizen/payment/my-bills/adv-services/${applicationData === null || applicationData === void 0 ? void 0 : applicationData.bookingNo}` : `/digit-ui/employee/payment/collect/adv-services/${ptrCode}/${tenantId}?tenantId=${tenantId}`);
13384
13560
  };
13385
13561
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(Banner, {
13386
13562
  message: t(`ADS_BOOKED_HEADER`),
@@ -13407,7 +13583,7 @@ const ADSResponseCitizen = props => {
13407
13583
  label: t("CORE_COMMON_GO_TO_ADS"),
13408
13584
  onSubmit: onGoToNDC
13409
13585
  }), /*#__PURE__*/React.createElement(SubmitBar, {
13410
- label: t("COMMON_MAKE_PAYMENT"),
13586
+ label: t("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),
13411
13587
  onSubmit: handlePayment
13412
13588
  }))));
13413
13589
  };
@@ -18206,8 +18382,10 @@ const ADSAddressField = ({
18206
18382
  onBlur,
18207
18383
  t
18208
18384
  }) => {
18385
+ var _window$location, _window$location$href;
18209
18386
  const [isOpen, setIsOpen] = useState(false);
18210
18387
  const [placeName, setPlaceName] = useState("");
18388
+ const isCitizen = typeof window !== "undefined" && ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : (_window$location$href = _window$location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.includes("citizen"));
18211
18389
  useEffect(() => {
18212
18390
  if (!value) {
18213
18391
  setPlaceName("");
@@ -18234,15 +18412,18 @@ const ADSAddressField = ({
18234
18412
  };
18235
18413
  return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", {
18236
18414
  style: {
18237
- display: "flex",
18238
- gap: 8
18415
+ width: "100%",
18416
+ marginTop: "8px"
18239
18417
  }
18240
18418
  }, /*#__PURE__*/React.createElement(TextInput, {
18241
18419
  value: placeName,
18242
18420
  onChange: () => {},
18243
18421
  onBlur: onBlur,
18244
18422
  disabled: true,
18245
- placeholder: t("ADS_LOCATION")
18423
+ placeholder: t("ADS_LOCATION"),
18424
+ style: {
18425
+ maxWidth: !isCitizen && "330px"
18426
+ }
18246
18427
  })), isOpen && /*#__PURE__*/React.createElement(GIS, {
18247
18428
  t: t,
18248
18429
  formData: {
@@ -18300,7 +18481,7 @@ const InboxLinks = ({
18300
18481
  link: "/digit-ui/employee/ads/bookad",
18301
18482
  roles: []
18302
18483
  }, {
18303
- text: t("ADS_MY_APPLICATION"),
18484
+ text: t("ADS_MY_APPLICATIONS"),
18304
18485
  link: `/digit-ui/employee/ads/my-applications`,
18305
18486
  roles: []
18306
18487
  }];
@@ -19202,19 +19383,70 @@ const EmployeeApp = ({
19202
19383
  })))));
19203
19384
  };
19204
19385
 
19386
+ const ReservationTimer = ({
19387
+ t,
19388
+ createTime,
19389
+ onExpire
19390
+ }) => {
19391
+ const expiry = createTime ? new Date(createTime).getTime() + 30 * 60 * 1000 : null;
19392
+ const [remaining, setRemaining] = useState(null);
19393
+ useEffect(() => {
19394
+ if (!expiry) return;
19395
+ const update = () => {
19396
+ const diff = expiry - Date.now();
19397
+ setRemaining(diff);
19398
+ if (diff <= 0 && typeof onExpire === "function") {
19399
+ onExpire(true);
19400
+ }
19401
+ };
19402
+ update();
19403
+ const interval = setInterval(update, 1000);
19404
+ return () => clearInterval(interval);
19405
+ }, [expiry, onExpire]);
19406
+ if (!expiry) return null;
19407
+ if (remaining !== null && remaining <= 0) {
19408
+ return /*#__PURE__*/React.createElement("span", {
19409
+ style: {
19410
+ fontSize: "16px",
19411
+ color: "red",
19412
+ fontWeight: 800
19413
+ }
19414
+ }, t("ADS_SLOTS_EXPIRED"));
19415
+ }
19416
+ if (remaining === null) return null;
19417
+ const minutes = Math === null || Math === void 0 ? void 0 : Math.floor(remaining / 60000);
19418
+ const seconds = Math === null || Math === void 0 ? void 0 : Math.floor(remaining % 60000 / 1000).toString().padStart(2, "0");
19419
+ const isCritical = remaining <= 60 * 1000;
19420
+ return /*#__PURE__*/React.createElement("span", {
19421
+ style: {
19422
+ color: isCritical ? "red" : "#2947a3",
19423
+ fontWeight: 600,
19424
+ fontSize: "14px",
19425
+ marginLeft: "8px"
19426
+ }
19427
+ }, t("ADS_PAYMENT_TIMER"), /*#__PURE__*/React.createElement("span", {
19428
+ style: {
19429
+ fontSize: "16px",
19430
+ fontWeight: 900,
19431
+ color: "red",
19432
+ marginLeft: "4px"
19433
+ }
19434
+ }, minutes, ":", seconds));
19435
+ };
19436
+
19205
19437
  const AdsApplication = ({
19206
19438
  application,
19207
19439
  tenantId,
19208
19440
  buttonLabel
19209
19441
  }) => {
19210
- var _application$applican;
19442
+ var _application$auditDet, _application$auditDet2, _application$applican;
19211
19443
  const {
19212
19444
  t
19213
19445
  } = useTranslation();
19214
19446
  const history = useHistory();
19215
19447
  const [showToast, setShowToast] = useState(null);
19216
19448
  const handleMakePayment = () => {
19217
- history.push(`/digit-ui/citizen/payment/collect/adv-services/${application === null || application === void 0 ? void 0 : application.bookingNo}/${tenantId}?tenantId=${tenantId}`);
19449
+ history.push(`/digit-ui/citizen/payment/my-bills/adv-services/${application === null || application === void 0 ? void 0 : application.bookingNo}`);
19218
19450
  };
19219
19451
  useEffect(() => {
19220
19452
  if (showToast) {
@@ -19225,7 +19457,17 @@ const AdsApplication = ({
19225
19457
  }
19226
19458
  }, [showToast]);
19227
19459
  const appDate = new Date(application === null || application === void 0 ? void 0 : application.applicationDate).toLocaleDateString();
19228
- return /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(KeyNote, {
19460
+ const [expired, setExpired] = useState(false);
19461
+ return /*#__PURE__*/React.createElement(Card$1, null, application.bookingStatus === "PENDING_FOR_PAYMENT" && (application === null || application === void 0 ? void 0 : (_application$auditDet = application.auditDetails) === null || _application$auditDet === void 0 ? void 0 : _application$auditDet.createdTime) && /*#__PURE__*/React.createElement("div", {
19462
+ style: {
19463
+ display: "flex",
19464
+ justifyContent: "flex-end"
19465
+ }
19466
+ }, /*#__PURE__*/React.createElement(ReservationTimer, {
19467
+ t: t,
19468
+ createTime: application === null || application === void 0 ? void 0 : (_application$auditDet2 = application.auditDetails) === null || _application$auditDet2 === void 0 ? void 0 : _application$auditDet2.createdTime,
19469
+ onExpire: val => setExpired(val)
19470
+ })), /*#__PURE__*/React.createElement(KeyNote, {
19229
19471
  keyValue: t("ADS_BOOKING_NO"),
19230
19472
  note: application === null || application === void 0 ? void 0 : application.bookingNo
19231
19473
  }), /*#__PURE__*/React.createElement(KeyNote, {
@@ -19241,12 +19483,13 @@ const AdsApplication = ({
19241
19483
  to: `/digit-ui/citizen/ads/application/${application === null || application === void 0 ? void 0 : application.bookingNo}/${application === null || application === void 0 ? void 0 : application.tenantId}`
19242
19484
  }, /*#__PURE__*/React.createElement(SubmitBar, {
19243
19485
  label: buttonLabel
19244
- })), (application.bookingStatus === "BOOKING_CREATED" || application.bookingStatus === "/mybookingsPAYMENT_FAILED" || application.bookingStatus === "PENDING_FOR_PAYMENT") && /*#__PURE__*/React.createElement(SubmitBar, {
19486
+ })), (application.bookingStatus === "/mybookingsPAYMENT_FAILED" || application.bookingStatus === "PENDING_FOR_PAYMENT") && /*#__PURE__*/React.createElement(SubmitBar, {
19245
19487
  label: t("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),
19246
19488
  onSubmit: handleMakePayment,
19247
19489
  style: {
19248
19490
  margin: "20px"
19249
- }
19491
+ },
19492
+ disabled: expired
19250
19493
  })), showToast && /*#__PURE__*/React.createElement(Toast, {
19251
19494
  error: showToast.error,
19252
19495
  warning: showToast.warning,
@@ -19278,23 +19521,29 @@ const ADSMyApplications = () => {
19278
19521
  sortOrder: "ASC",
19279
19522
  sortBy: "createdTime",
19280
19523
  offset: off,
19281
- tenantId
19524
+ tenantId,
19525
+ mobileNumber: user === null || user === void 0 ? void 0 : user.mobileNumber
19282
19526
  } : {
19283
19527
  limit: "4",
19284
19528
  sortOrder: "ASC",
19285
19529
  sortBy: "createdTime",
19286
19530
  offset: "0",
19287
- tenantId
19531
+ tenantId,
19532
+ mobileNumber: user === null || user === void 0 ? void 0 : user.mobileNumber
19288
19533
  };
19289
19534
  useEffect(() => {
19290
19535
  setFilters(initialFilters);
19291
19536
  }, [filter]);
19292
19537
  const {
19293
19538
  isLoading,
19294
- data
19539
+ data,
19540
+ refetch
19295
19541
  } = Digit.Hooks.ads.useADSSearch({
19296
19542
  filters
19297
19543
  });
19544
+ useEffect(() => {
19545
+ refetch();
19546
+ }, []);
19298
19547
  if (isLoading) return /*#__PURE__*/React.createElement(Loader$1, null);
19299
19548
  const applications = (data === null || data === void 0 ? void 0 : data.bookingApplication) || [];
19300
19549
  return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Header, null, `${t("ADS_MY_BOOKINGS_HEADER")} ${applications ? `(${applications.length})` : ""}`), /*#__PURE__*/React.createElement("div", null, (applications === null || applications === void 0 ? void 0 : applications.length) > 0 && applications.map((application, index) => /*#__PURE__*/React.createElement("div", {
@@ -20065,8 +20314,104 @@ function get(object, path, defaultValue) {
20065
20314
  }
20066
20315
  var get_1 = get;
20067
20316
 
20317
+ const ADSCartDetails$1 = ({
20318
+ cartDetails,
20319
+ t
20320
+ }) => {
20321
+ const [expanded, setExpanded] = useState(() => cartDetails === null || cartDetails === void 0 ? void 0 : cartDetails.map(item => {
20322
+ var _item$ad;
20323
+ return item === null || item === void 0 ? void 0 : (_item$ad = item.ad) === null || _item$ad === void 0 ? void 0 : _item$ad.id;
20324
+ }));
20325
+ const toggleExpand = adId => {
20326
+ setExpanded(prev => prev !== null && prev !== void 0 && prev.includes(adId) ? prev === null || prev === void 0 ? void 0 : prev.filter(id => id !== adId) : [...prev, adId]);
20327
+ };
20328
+ const makeColumns = () => [{
20329
+ Header: t("ADS_DATE"),
20330
+ accessor: "bookingDate"
20331
+ }, {
20332
+ Header: t("ADS_LOCATION"),
20333
+ accessor: "location",
20334
+ Cell: ({
20335
+ value
20336
+ }) => t(value || "N/A")
20337
+ }, {
20338
+ Header: t("ADS_FACE_AREA"),
20339
+ accessor: "faceArea",
20340
+ Cell: ({
20341
+ value
20342
+ }) => t((value === null || value === void 0 ? void 0 : value.replaceAll("_", " ")) || "N/A")
20343
+ }, {
20344
+ Header: t("ADS_TYPE"),
20345
+ accessor: "addType"
20346
+ }, {
20347
+ Header: t("ADS_NIGHT_LIGHT"),
20348
+ accessor: row => row.nightLight ? t("ADS_YES") : t("ADS_NO")
20349
+ }];
20350
+ return /*#__PURE__*/React.createElement("div", {
20351
+ style: {
20352
+ marginTop: "1rem"
20353
+ }
20354
+ }, (cartDetails === null || cartDetails === void 0 ? void 0 : cartDetails.length) === 0 ? /*#__PURE__*/React.createElement("p", {
20355
+ style: {
20356
+ padding: "12px",
20357
+ color: "#666"
20358
+ }
20359
+ }, t("ADS_NO_ADVERTISMENT_DETAILS")) : cartDetails === null || cartDetails === void 0 ? void 0 : cartDetails.map((item, idx) => {
20360
+ var _item$ad2, _item$ad4, _item$ad5, _item$ad6, _item$ad7, _item$slots;
20361
+ const isOpen = expanded === null || expanded === void 0 ? void 0 : expanded.includes(item === null || item === void 0 ? void 0 : (_item$ad2 = item.ad) === null || _item$ad2 === void 0 ? void 0 : _item$ad2.id);
20362
+ return /*#__PURE__*/React.createElement("div", {
20363
+ key: idx,
20364
+ style: {
20365
+ marginBottom: "16px",
20366
+ border: "1px solid #ddd",
20367
+ borderRadius: "8px",
20368
+ overflow: "hidden"
20369
+ }
20370
+ }, /*#__PURE__*/React.createElement("div", {
20371
+ onClick: () => {
20372
+ var _item$ad3;
20373
+ return toggleExpand(item === null || item === void 0 ? void 0 : (_item$ad3 = item.ad) === null || _item$ad3 === void 0 ? void 0 : _item$ad3.id);
20374
+ },
20375
+ style: {
20376
+ background: "#f9f9f9",
20377
+ padding: "10px 14px",
20378
+ fontWeight: 600,
20379
+ fontSize: "14px",
20380
+ borderBottom: "1px solid #ddd",
20381
+ cursor: "pointer",
20382
+ display: "flex",
20383
+ justifyContent: "space-between",
20384
+ alignItems: "center"
20385
+ }
20386
+ }, /*#__PURE__*/React.createElement("span", null, t((item === null || item === void 0 ? void 0 : (_item$ad4 = item.ad) === null || _item$ad4 === void 0 ? void 0 : _item$ad4.name) ?? (item === null || item === void 0 ? void 0 : (_item$ad5 = item.ad) === null || _item$ad5 === void 0 ? void 0 : _item$ad5.location)), item !== null && item !== void 0 && (_item$ad6 = item.ad) !== null && _item$ad6 !== void 0 && _item$ad6.amount ? ` — ₹${((item === null || item === void 0 ? void 0 : (_item$ad7 = item.ad) === null || _item$ad7 === void 0 ? void 0 : _item$ad7.amount) * 1.18 * (item === null || item === void 0 ? void 0 : (_item$slots = item.slots) === null || _item$slots === void 0 ? void 0 : _item$slots.length)).toFixed(2)}` : ""), /*#__PURE__*/React.createElement("span", {
20387
+ style: {
20388
+ fontSize: "18px"
20389
+ }
20390
+ }, isOpen ? "▾" : "▸")), isOpen && /*#__PURE__*/React.createElement("div", {
20391
+ style: {
20392
+ overflowX: "auto"
20393
+ }
20394
+ }, /*#__PURE__*/React.createElement(Table, {
20395
+ t: t,
20396
+ data: item.slots,
20397
+ columns: makeColumns(),
20398
+ disableSort: true,
20399
+ isPaginationRequired: false,
20400
+ getCellProps: cell => ({
20401
+ style: {
20402
+ padding: "12px 14px",
20403
+ fontSize: "14px",
20404
+ borderBottom: "1px solid #f0f0f0",
20405
+ textAlign: "left",
20406
+ whiteSpace: "nowrap"
20407
+ }
20408
+ })
20409
+ })));
20410
+ }));
20411
+ };
20412
+
20068
20413
  const ADSApplicationDetails = () => {
20069
- var _workflowDetails$data, _workflowDetails$data2, _ads_details$addition, _ads_details$cartDeta, _ads_details$applican, _ads_details$applican2, _ads_details$applican3, _ads_details$address, _ads_details$address2, _docs;
20414
+ var _workflowDetails$data, _workflowDetails$data2, _ads_details$addition, _ads_details$applican, _ads_details$applican2, _ads_details$applican3, _ads_details$address, _ads_details$address2, _docs;
20070
20415
  const [wfActionsState, setWfActionsState] = useState([]);
20071
20416
  const {
20072
20417
  t
@@ -20076,9 +20421,7 @@ const ADSApplicationDetails = () => {
20076
20421
  acknowledgementIds,
20077
20422
  tenantId
20078
20423
  } = useParams();
20079
- const [acknowldgementData, setAcknowldgementData] = useState([]);
20080
20424
  const [showOptions, setShowOptions] = useState(false);
20081
- const [popup, setpopup] = useState(false);
20082
20425
  const [showToast, setShowToast] = useState(null);
20083
20426
  const [displayMenu, setDisplayMenu] = useState(false);
20084
20427
  const [selectedAction, setSelectedAction] = useState(null);
@@ -20090,7 +20433,6 @@ const ADSApplicationDetails = () => {
20090
20433
  } = Digit.Hooks.useStore.getInitData();
20091
20434
  const {
20092
20435
  isLoading,
20093
- isError,
20094
20436
  error,
20095
20437
  data: adsData,
20096
20438
  refetch
@@ -20100,12 +20442,14 @@ const ADSApplicationDetails = () => {
20100
20442
  bookingNo: acknowledgementIds
20101
20443
  }
20102
20444
  });
20445
+ useEffect(() => {
20446
+ refetch();
20447
+ }, [acknowledgementIds, refetch]);
20103
20448
  const mutation = Digit.Hooks.ads.useADSCreateAPI(tenantId, false);
20104
20449
  const BookingApplication = get_1(adsData, "bookingApplication", []);
20105
20450
  const adsId = get_1(adsData, "bookingApplication[0].bookingNo", []);
20106
20451
  let ads_details = BookingApplication && BookingApplication.length > 0 && BookingApplication[0] || {};
20107
20452
  const application = ads_details;
20108
- sessionStorage.setItem("ads", JSON.stringify(application));
20109
20453
  const businessServicMINE = "advandhoarding";
20110
20454
  const workflowDetails = Digit.Hooks.useWorkflowDetails({
20111
20455
  tenantId,
@@ -20152,29 +20496,7 @@ const ADSApplicationDetails = () => {
20152
20496
  documentDate = `${date.getDate()} ${month} ${date.getFullYear()}`;
20153
20497
  }
20154
20498
  let dowloadOptions = [];
20155
- const columns = [{
20156
- Header: `${t("ADS_TYPE")}`,
20157
- accessor: "addType"
20158
- }, {
20159
- Header: `${t("ADS_FACE_AREA")}`,
20160
- accessor: "faceArea"
20161
- }, {
20162
- Header: `${t("ADS_NIGHT_LIGHT")}`,
20163
- accessor: "nightLight"
20164
- }, {
20165
- Header: `${t("CHB_BOOKING_DATE")}`,
20166
- accessor: "bookingDate"
20167
- }, {
20168
- Header: `${t("PT_COMMON_TABLE_COL_STATUS_LABEL")}`,
20169
- accessor: "bookingStatus"
20170
- }];
20171
- const adslistRows = (ads_details === null || ads_details === void 0 ? void 0 : (_ads_details$cartDeta = ads_details.cartDetails) === null || _ads_details$cartDeta === void 0 ? void 0 : _ads_details$cartDeta.map(slot => ({
20172
- addType: `${t(slot.addType)}`,
20173
- faceArea: `${t(slot.faceArea)}`,
20174
- nightLight: `${t(slot.nightLight ? "Yes" : "No")}`,
20175
- bookingDate: `${t(slot.bookingDate)}`,
20176
- bookingStatus: `${t(slot.status)}`
20177
- }))) || [];
20499
+ const cartData = transformAdsData(ads_details === null || ads_details === void 0 ? void 0 : ads_details.cartDetails);
20178
20500
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
20179
20501
  className: "cardHeaderWithOptions",
20180
20502
  style: {
@@ -20190,11 +20512,7 @@ const ADSApplicationDetails = () => {
20190
20512
  onHeadClick: () => setShowOptions(!showOptions),
20191
20513
  displayOptions: showOptions,
20192
20514
  options: dowloadOptions
20193
- })), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
20194
- className: "border-none",
20195
- label: t("ADS_BOOKING_NO"),
20196
- text: ads_details === null || ads_details === void 0 ? void 0 : ads_details.bookingNo
20197
- })), /*#__PURE__*/React.createElement(CardSubHeader, {
20515
+ })), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(StatusTable, null), /*#__PURE__*/React.createElement(CardSubHeader, {
20198
20516
  style: {
20199
20517
  fontSize: "24px"
20200
20518
  }
@@ -20218,24 +20536,25 @@ const ADSApplicationDetails = () => {
20218
20536
  className: "border-none",
20219
20537
  label: t("ADS_ADDRESS_PINCODE"),
20220
20538
  text: (ads_details === null || ads_details === void 0 ? void 0 : (_ads_details$address2 = ads_details.address) === null || _ads_details$address2 === void 0 ? void 0 : _ads_details$address2.pincode) || t("CS_NA")
20539
+ }), /*#__PURE__*/React.createElement(Row, {
20540
+ className: "border-none",
20541
+ label: t("ADS_BOOKING_NO"),
20542
+ text: ads_details === null || ads_details === void 0 ? void 0 : ads_details.bookingNo
20543
+ }), /*#__PURE__*/React.createElement(Row, {
20544
+ className: "border-none",
20545
+ label: t("BOOKING_STATUS"),
20546
+ text: ads_details === null || ads_details === void 0 ? void 0 : ads_details.bookingStatus
20547
+ }), (ads_details === null || ads_details === void 0 ? void 0 : ads_details.receiptNo) && /*#__PURE__*/React.createElement(Row, {
20548
+ className: "border-none",
20549
+ label: t("CITIZEN_SUCCESS_ADVT_HOARDINGS_PAYMENT_RECEIPT_NO"),
20550
+ text: ads_details === null || ads_details === void 0 ? void 0 : ads_details.receiptNo
20221
20551
  })), /*#__PURE__*/React.createElement(CardSubHeader, {
20222
20552
  style: {
20223
20553
  fontSize: "24px"
20224
20554
  }
20225
- }, t("ADS_CART_DETAILS")), /*#__PURE__*/React.createElement(ApplicationTable, {
20226
- t: t,
20227
- data: adslistRows,
20228
- columns: columns,
20229
- getCellProps: cellInfo => ({
20230
- style: {
20231
- minWidth: "150px",
20232
- padding: "10px",
20233
- fontSize: "16px",
20234
- paddingLeft: "20px"
20235
- }
20236
- }),
20237
- isPaginationRequired: false,
20238
- totalRecords: adslistRows.length
20555
+ }, t("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(ADSCartDetails$1, {
20556
+ cartDetails: cartData ?? [],
20557
+ t: t
20239
20558
  }), /*#__PURE__*/React.createElement(CardSubHeader, {
20240
20559
  style: {
20241
20560
  fontSize: "24px"
@@ -20248,11 +20567,11 @@ const ADSApplicationDetails = () => {
20248
20567
  }
20249
20568
  }, docs.map((doc, index) => /*#__PURE__*/React.createElement("div", {
20250
20569
  key: index
20251
- }, t(doc === null || doc === void 0 ? void 0 : doc.documentType), /*#__PURE__*/React.createElement(ADSDocument, {
20570
+ }, /*#__PURE__*/React.createElement(ADSDocument, {
20252
20571
  value: docs,
20253
20572
  Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
20254
20573
  index: index
20255
- })))) : /*#__PURE__*/React.createElement("div", {
20574
+ }), t(doc === null || doc === void 0 ? void 0 : doc.documentType)))) : /*#__PURE__*/React.createElement("div", {
20256
20575
  style: {
20257
20576
  padding: "0 1.5rem"
20258
20577
  }
@@ -20389,7 +20708,7 @@ if (_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag || _Ma
20389
20708
  }
20390
20709
 
20391
20710
  const ApplicationDetails = () => {
20392
- var _applicationDetails$b, _Digit$Hooks$ads, _Digit$Hooks$ads$useA, _displayData$applican, _displayData$applican2, _workflowDetails$data, _workflowDetails$data2, _reciept_data$Payment, _displayData$AdsDetai, _application$document, _displayData$applican4, _workflowDetails$data4, _workflowDetails$data5;
20711
+ var _applicationDetails$b, _Digit$Hooks$ads, _Digit$Hooks$ads$useA, _displayData$applican, _displayData$applican2, _workflowDetails$data, _workflowDetails$data2, _reciept_data$Payment, _displayData$applican4, _displayData$applican5, _displayData$applican6, _displayData$applican7, _displayData$applican8, _application$document, _displayData$applican9, _displayData$applican0, _workflowDetails$data4, _workflowDetails$data5;
20393
20712
  const {
20394
20713
  id
20395
20714
  } = useParams();
@@ -20434,7 +20753,6 @@ const ApplicationDetails = () => {
20434
20753
  return null;
20435
20754
  }).filter(Boolean);
20436
20755
  if (!(filesArray !== null && filesArray !== void 0 && filesArray.length)) {
20437
- setPdfFiles({});
20438
20756
  setFilesLoading(false);
20439
20757
  return;
20440
20758
  }
@@ -20521,39 +20839,29 @@ const ApplicationDetails = () => {
20521
20839
  buttonLabel: ((a === null || a === void 0 ? void 0 : a.action) || "").replace(/_/g, " ").toUpperCase()
20522
20840
  }))) || [];
20523
20841
  useEffect(() => {
20524
- const adsObject = bookingObj;
20525
- if (adsObject) {
20526
- var _adsObject$applicantD, _adsObject$applicantD2, _adsObject$applicantD3, _adsObject$address, _adsObject$address2, _adsObject$cartDetail;
20842
+ if (bookingObj) {
20843
+ var _bookingObj$applicant, _bookingObj$applicant2, _bookingObj$applicant3, _bookingObj$address, _bookingObj$address2;
20527
20844
  const applicantData = {
20528
- applicationNo: adsObject === null || adsObject === void 0 ? void 0 : adsObject.bookingNo,
20529
- name: adsObject === null || adsObject === void 0 ? void 0 : (_adsObject$applicantD = adsObject.applicantDetail) === null || _adsObject$applicantD === void 0 ? void 0 : _adsObject$applicantD.applicantName,
20530
- email: adsObject === null || adsObject === void 0 ? void 0 : (_adsObject$applicantD2 = adsObject.applicantDetail) === null || _adsObject$applicantD2 === void 0 ? void 0 : _adsObject$applicantD2.applicantEmailId,
20531
- mobile: adsObject === null || adsObject === void 0 ? void 0 : (_adsObject$applicantD3 = adsObject.applicantDetail) === null || _adsObject$applicantD3 === void 0 ? void 0 : _adsObject$applicantD3.applicantMobileNo,
20532
- address: adsObject === null || adsObject === void 0 ? void 0 : (_adsObject$address = adsObject.address) === null || _adsObject$address === void 0 ? void 0 : _adsObject$address.addressLine1,
20533
- pincode: adsObject === null || adsObject === void 0 ? void 0 : (_adsObject$address2 = adsObject.address) === null || _adsObject$address2 === void 0 ? void 0 : _adsObject$address2.pincode,
20534
- bookingStatus: adsObject === null || adsObject === void 0 ? void 0 : adsObject.bookingStatus,
20535
- paymentDate: adsObject !== null && adsObject !== void 0 && adsObject.paymentDate ? new Date(adsObject.paymentDate).toLocaleDateString() : "",
20536
- receiptNo: adsObject === null || adsObject === void 0 ? void 0 : adsObject.receiptNo
20845
+ applicationNo: bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.bookingNo,
20846
+ name: bookingObj === null || bookingObj === void 0 ? void 0 : (_bookingObj$applicant = bookingObj.applicantDetail) === null || _bookingObj$applicant === void 0 ? void 0 : _bookingObj$applicant.applicantName,
20847
+ email: bookingObj === null || bookingObj === void 0 ? void 0 : (_bookingObj$applicant2 = bookingObj.applicantDetail) === null || _bookingObj$applicant2 === void 0 ? void 0 : _bookingObj$applicant2.applicantEmailId,
20848
+ mobile: bookingObj === null || bookingObj === void 0 ? void 0 : (_bookingObj$applicant3 = bookingObj.applicantDetail) === null || _bookingObj$applicant3 === void 0 ? void 0 : _bookingObj$applicant3.applicantMobileNo,
20849
+ address: bookingObj === null || bookingObj === void 0 ? void 0 : (_bookingObj$address = bookingObj.address) === null || _bookingObj$address === void 0 ? void 0 : _bookingObj$address.addressLine1,
20850
+ pincode: bookingObj === null || bookingObj === void 0 ? void 0 : (_bookingObj$address2 = bookingObj.address) === null || _bookingObj$address2 === void 0 ? void 0 : _bookingObj$address2.pincode,
20851
+ bookingStatus: bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.bookingStatus,
20852
+ paymentDate: bookingObj !== null && bookingObj !== void 0 && bookingObj.paymentDate ? new Date(bookingObj.paymentDate).toLocaleDateString() : "",
20853
+ receiptNo: bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.receiptNo,
20854
+ auditDetails: bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.auditDetails
20537
20855
  };
20538
- const Documents = removeDuplicatesByUUID((adsObject === null || adsObject === void 0 ? void 0 : adsObject.documents) || []);
20539
- const AdsDetails = (adsObject === null || adsObject === void 0 ? void 0 : (_adsObject$cartDetail = adsObject.cartDetails) === null || _adsObject$cartDetail === void 0 ? void 0 : _adsObject$cartDetail.map(item => ({
20540
- adType: item === null || item === void 0 ? void 0 : item.addType,
20541
- location: item === null || item === void 0 ? void 0 : item.location,
20542
- faceArea: item === null || item === void 0 ? void 0 : item.faceArea,
20543
- bookingDate: item === null || item === void 0 ? void 0 : item.bookingDate,
20544
- bookingTime: `${item === null || item === void 0 ? void 0 : item.bookingFromTime} - ${item === null || item === void 0 ? void 0 : item.bookingToTime}`,
20545
- nightLight: item !== null && item !== void 0 && item.nightLight ? t("YES") : t("NO"),
20546
- status: item === null || item === void 0 ? void 0 : item.status
20547
- }))) || [];
20856
+ const Documents = removeDuplicatesByUUID((bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.documents) || []);
20548
20857
  setDisplayData({
20549
20858
  applicantData,
20550
- Documents,
20551
- AdsDetails
20859
+ Documents
20552
20860
  });
20553
20861
  } else {
20554
20862
  setDisplayData({});
20555
20863
  }
20556
- }, [bookingObj, t]);
20864
+ }, [bookingObj]);
20557
20865
  useEffect(() => {
20558
20866
  setIsDetailsLoading(isLoading || !bookingObj);
20559
20867
  if (bookingObj) {
@@ -20768,6 +21076,8 @@ const ApplicationDetails = () => {
20768
21076
  }
20769
21077
  });
20770
21078
  }
21079
+ const cartData = transformAdsData(bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.cartDetails);
21080
+ const [expired, setExpired] = useState(false);
20771
21081
  if (isLoading || isDetailsLoading) {
20772
21082
  return /*#__PURE__*/React.createElement(Loader$1, null);
20773
21083
  }
@@ -20805,43 +21115,29 @@ const ApplicationDetails = () => {
20805
21115
  options: downloadOptions,
20806
21116
  downloadBtnClassName: "employee-download-btn-className",
20807
21117
  optionsClassName: "employee-options-btn-className"
20808
- }))))), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ADS_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(StatusTable, null, (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && Object.entries(displayData.applicantData).filter(([_, value]) => {
21118
+ }))))), /*#__PURE__*/React.createElement(Card$1, null, (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican4 = displayData.applicantData) === null || _displayData$applican4 === void 0 ? void 0 : (_displayData$applican5 = _displayData$applican4.auditDetails) === null || _displayData$applican5 === void 0 ? void 0 : _displayData$applican5.createdTime) && (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican6 = displayData.applicantData) === null || _displayData$applican6 === void 0 ? void 0 : _displayData$applican6.bookingStatus) === "PENDING_FOR_PAYMENT" && /*#__PURE__*/React.createElement("div", {
21119
+ style: {
21120
+ display: "flex",
21121
+ justifyContent: "flex-end"
21122
+ }
21123
+ }, /*#__PURE__*/React.createElement(ReservationTimer, {
21124
+ t: t,
21125
+ createTime: displayData === null || displayData === void 0 ? void 0 : (_displayData$applican7 = displayData.applicantData) === null || _displayData$applican7 === void 0 ? void 0 : (_displayData$applican8 = _displayData$applican7.auditDetails) === null || _displayData$applican8 === void 0 ? void 0 : _displayData$applican8.createdTime,
21126
+ onExpire: val => setExpired(val)
21127
+ })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("ADS_APPLICANT_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData).filter(([_, value]) => {
20809
21128
  if (value === null || value === undefined) return false;
20810
21129
  if (typeof value === "string" && value.trim() === "") return false;
20811
21130
  if (Array.isArray(value) && value.length === 0) return false;
20812
21131
  if (typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0) return false;
20813
21132
  return true;
20814
- }).map(([key, value]) => /*#__PURE__*/React.createElement(Row, {
21133
+ }).filter(([key]) => !["auditDetails", "paymentDate"].includes(key)).map(([key, value]) => /*#__PURE__*/React.createElement(Row, {
20815
21134
  key: key,
20816
- label: t(key === null || key === void 0 ? void 0 : key.toUpperCase()),
21135
+ label: t(formatLabel(key)),
20817
21136
  text: Array.isArray(value) ? value.map(item => typeof item === "object" ? t((item === null || item === void 0 ? void 0 : item.code) || "N/A") : t(item || "N/A")).join(", ") : typeof value === "object" ? t((value === null || value === void 0 ? void 0 : value.code) || "N/A") : t(value || "N/A")
20818
- })))), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$AdsDetai = displayData.AdsDetails) === null || _displayData$AdsDetai === void 0 ? void 0 : _displayData$AdsDetai.map((detail, index) => /*#__PURE__*/React.createElement("div", {
20819
- key: index,
20820
- style: {
20821
- marginBottom: "30px",
20822
- background: "#FAFAFA",
20823
- padding: "16px",
20824
- borderRadius: "4px"
20825
- }
20826
- }, /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
20827
- label: t("ADS_AD_TYPE"),
20828
- text: t(detail.adType) || detail.adType
20829
- }), /*#__PURE__*/React.createElement(Row, {
20830
- label: t("ADS_LOCATION"),
20831
- text: detail.location || "N/A"
20832
- }), /*#__PURE__*/React.createElement(Row, {
20833
- label: t("ADS_FACE_AREA"),
20834
- text: detail.faceArea || "N/A"
20835
- }), /*#__PURE__*/React.createElement(Row, {
20836
- label: t("CHB_BOOKING_DATE"),
20837
- text: detail.bookingDate || "N/A"
20838
- }), /*#__PURE__*/React.createElement(Row, {
20839
- label: t("ADS_NIGHT_LIGHT"),
20840
- text: detail.nightLight ? "Yes" : "No"
20841
- }), /*#__PURE__*/React.createElement(Row, {
20842
- label: t("ADS_STATUS"),
20843
- text: t(detail.status) || detail.status
20844
- }))))), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ADS_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement(Fragment$1, null, (application === null || application === void 0 ? void 0 : (_application$document = application.documents) === null || _application$document === void 0 ? void 0 : _application$document.length) > 0 ? /*#__PURE__*/React.createElement("div", {
21137
+ })))), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(ADSCartDetails$1, {
21138
+ cartDetails: cartData ?? [],
21139
+ t: t
21140
+ })), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ADS_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement(Fragment$1, null, (application === null || application === void 0 ? void 0 : (_application$document = application.documents) === null || _application$document === void 0 ? void 0 : _application$document.length) > 0 ? /*#__PURE__*/React.createElement("div", {
20845
21141
  style: {
20846
21142
  display: "flex",
20847
21143
  flexWrap: "wrap",
@@ -20849,17 +21145,17 @@ const ApplicationDetails = () => {
20849
21145
  }
20850
21146
  }, application === null || application === void 0 ? void 0 : application.documents.map((doc, idx) => /*#__PURE__*/React.createElement("div", {
20851
21147
  key: idx
20852
- }, t(doc === null || doc === void 0 ? void 0 : doc.documentType), /*#__PURE__*/React.createElement(ADSDocument, {
21148
+ }, /*#__PURE__*/React.createElement(ADSDocument, {
20853
21149
  value: application === null || application === void 0 ? void 0 : application.documents,
20854
21150
  Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
20855
21151
  index: idx
20856
- })))) : /*#__PURE__*/React.createElement("div", {
21152
+ }), t(doc === null || doc === void 0 ? void 0 : doc.documentType)))) : /*#__PURE__*/React.createElement("div", {
20857
21153
  style: {
20858
21154
  padding: "0 1.5rem"
20859
21155
  }
20860
21156
  }, t("TL_NO_DOCUMENTS_MSG"))), /*#__PURE__*/React.createElement(ADSWFApplicationTimeline, {
20861
21157
  application: application,
20862
- id: (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican4 = displayData.applicantData) === null || _displayData$applican4 === void 0 ? void 0 : _displayData$applican4.applicationNo) || id,
21158
+ id: (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican9 = displayData.applicantData) === null || _displayData$applican9 === void 0 ? void 0 : _displayData$applican9.applicationNo) || id,
20863
21159
  userType: "employee"
20864
21160
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
20865
21161
  error: showToast.key === "error",
@@ -20882,7 +21178,8 @@ const ApplicationDetails = () => {
20882
21178
  }), /*#__PURE__*/React.createElement(SubmitBar, {
20883
21179
  ref: menuRef,
20884
21180
  label: t("WF_TAKE_ACTION"),
20885
- onSubmit: () => setDisplayMenu(!displayMenu)
21181
+ onSubmit: () => setDisplayMenu(!displayMenu),
21182
+ disabled: expired || (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican0 = displayData.applicantData) === null || _displayData$applican0 === void 0 ? void 0 : _displayData$applican0.bookingStatus) === "BOOKING_CREATED"
20886
21183
  })), showModal ? /*#__PURE__*/React.createElement(ADSModal, {
20887
21184
  t: t,
20888
21185
  action: selectedAction,
@@ -21255,48 +21552,6 @@ const RESET_ADS_NEW_APPLICATION_FORM = () => ({
21255
21552
  type: RESET_ADS_NEW_APPLICATION_FORMType
21256
21553
  });
21257
21554
 
21258
- const ReservationTimer = ({
21259
- t
21260
- }) => {
21261
- const expiry = useSelector(state => state.ads.ADSNewApplicationFormReducer.formData.reservationExpiry);
21262
- const [remaining, setRemaining] = useState(expiry ? expiry - Date.now() : 0);
21263
- useEffect(() => {
21264
- if (!expiry) return;
21265
- const interval = setInterval(() => {
21266
- setRemaining(expiry - Date.now());
21267
- }, 1000);
21268
- return () => clearInterval(interval);
21269
- }, [expiry]);
21270
- if (!expiry) return null;
21271
- if (remaining <= 0) {
21272
- return /*#__PURE__*/React.createElement("span", {
21273
- style: {
21274
- fontSize: "16px",
21275
- color: "red",
21276
- fontWeight: 800
21277
- }
21278
- }, t("ADS_SLOTS_EXPIRED"));
21279
- }
21280
- const minutes = Math.floor(remaining / 60000);
21281
- const seconds = Math.floor(remaining % 60000 / 1000).toString().padStart(2, "0");
21282
- const isCritical = remaining <= 60 * 1000;
21283
- return /*#__PURE__*/React.createElement("span", {
21284
- style: {
21285
- color: isCritical ? "red" : "#2947a3",
21286
- fontWeight: 600,
21287
- fontSize: "14px",
21288
- marginLeft: "8px"
21289
- }
21290
- }, t("ADS_PAYMENT_TIMER"), /*#__PURE__*/React.createElement("span", {
21291
- style: {
21292
- fontSize: "16px",
21293
- fontWeight: 900,
21294
- color: "red",
21295
- marginLeft: "4px"
21296
- }
21297
- }, minutes, ":", seconds));
21298
- };
21299
-
21300
21555
  const isEmployee = window.location.href.includes("employee");
21301
21556
  const createEmployeeConfig = [{
21302
21557
  head: "PET DETAILS",
@@ -21413,6 +21668,7 @@ const NewADSStepperForm = ({
21413
21668
  const dispatch = useDispatch();
21414
21669
  const [showToast, setShowToast] = useState(null);
21415
21670
  const formState = useSelector(state => state.ads.ADSNewApplicationFormReducer);
21671
+ const formData = formState.formData;
21416
21672
  const step = formState.step;
21417
21673
  const tenantId = Digit.ULBService.getCurrentTenantId();
21418
21674
  const setStep = updatedStepNumber => {
@@ -21422,6 +21678,7 @@ const NewADSStepperForm = ({
21422
21678
  dispatch(RESET_ADS_NEW_APPLICATION_FORM());
21423
21679
  }, []);
21424
21680
  const handleSubmit = dataGet => {};
21681
+ const createTime = formData === null || formData === void 0 ? void 0 : formData.reservationExpiry;
21425
21682
  return /*#__PURE__*/React.createElement("div", {
21426
21683
  className: "pageCard"
21427
21684
  }, /*#__PURE__*/React.createElement(CardHeader$1, {
@@ -21431,8 +21688,9 @@ const NewADSStepperForm = ({
21431
21688
  color: "#1C1D1F"
21432
21689
  },
21433
21690
  divider: true
21434
- }, t("ADS_REGISTRATION_APPLICATION"), /*#__PURE__*/React.createElement(ReservationTimer, {
21435
- t: t
21691
+ }, t("ADS_REGISTRATION_APPLICATION"), createTime && /*#__PURE__*/React.createElement(ReservationTimer, {
21692
+ t: t,
21693
+ createTime: createTime
21436
21694
  })), /*#__PURE__*/React.createElement(Stepper, {
21437
21695
  stepsList: updatedConfig,
21438
21696
  onSubmit: handleSubmit,
@@ -21491,10 +21749,9 @@ const ADSCitizenDetailsNew = ({
21491
21749
  }
21492
21750
  });
21493
21751
  if (typeof window !== "undefined") window.__ADS_FORM_DRAFT = window.__ADS_FORM_DRAFT || {};
21494
- console.log('currentStepData', currentStepData);
21495
21752
  useEffect(() => {
21496
21753
  if (currentStepData !== null && currentStepData !== void 0 && currentStepData.CreatedResponse) {
21497
- const created = currentStepData.CreatedResponse;
21754
+ const created = currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.CreatedResponse;
21498
21755
  if (created !== null && created !== void 0 && created.address) {
21499
21756
  setValue("address", created.address.addressLine1 || "");
21500
21757
  setValue("pincode", created.address.pincode || "");
@@ -21523,9 +21780,6 @@ const ADSCitizenDetailsNew = ({
21523
21780
  }, []);
21524
21781
  const onSubmit = async data => {
21525
21782
  var _currentStepData$ads, _currentStepData$Crea;
21526
- try {
21527
- if (window.__ADS_FORM_DRAFT) delete window.__ADS_FORM_DRAFT[formStorageKey];
21528
- } catch (e) {}
21529
21783
  const applicationDate = Date.now();
21530
21784
  const cartDetails = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$ads = currentStepData.ads) === null || _currentStepData$ads === void 0 ? void 0 : _currentStepData$ads.flatMap(item => item.slots.map(slot => ({
21531
21785
  ...slot,
@@ -21538,8 +21792,8 @@ const ADSCitizenDetailsNew = ({
21538
21792
  bookingStatus: "BOOKING_CREATED",
21539
21793
  businessService: "ADV",
21540
21794
  address: {
21541
- pincode: data.pincode || "",
21542
- addressLine1: data.address || ""
21795
+ pincode: (data === null || data === void 0 ? void 0 : data.pincode) || "",
21796
+ addressLine1: (data === null || data === void 0 ? void 0 : data.address) || ""
21543
21797
  },
21544
21798
  applicantDetail: {
21545
21799
  applicantName: `${data.firstName || ""} ${data.lastName || ""}`.trim(),
@@ -21611,7 +21865,11 @@ const ADSCitizenDetailsNew = ({
21611
21865
  };
21612
21866
  return /*#__PURE__*/React.createElement("form", {
21613
21867
  onSubmit: handleSubmit(onSubmit)
21614
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("NDC_FIRST_NAME"), /*#__PURE__*/React.createElement("span", {
21868
+ }, /*#__PURE__*/React.createElement("div", {
21869
+ style: {
21870
+ maxWidth: !isCitizen && "500px"
21871
+ }
21872
+ }, /*#__PURE__*/React.createElement(CardLabel, null, t("NDC_FIRST_NAME"), /*#__PURE__*/React.createElement("span", {
21615
21873
  style: mandatoryStyle
21616
21874
  }, "*"), " "), /*#__PURE__*/React.createElement(Controller, {
21617
21875
  control: control,
@@ -21683,7 +21941,7 @@ const ADSCitizenDetailsNew = ({
21683
21941
  rules: {
21684
21942
  required: t("PTR_EMAIL_REQUIRED"),
21685
21943
  pattern: {
21686
- value: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
21944
+ value: /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/,
21687
21945
  message: "Enter a valid email"
21688
21946
  }
21689
21947
  },
@@ -21727,7 +21985,7 @@ const ADSCitizenDetailsNew = ({
21727
21985
  })
21728
21986
  }), errors.mobileNumber && /*#__PURE__*/React.createElement(CardLabelError$1, {
21729
21987
  style: errorStyle
21730
- }, errors.mobileNumber.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
21988
+ }, errors.mobileNumber.message), /*#__PURE__*/React.createElement(CardLabel, {
21731
21989
  className: "card-label-smaller"
21732
21990
  }, `${t("PT_COMMON_COL_ADDRESS")}`, /*#__PURE__*/React.createElement("span", {
21733
21991
  style: mandatoryStyle
@@ -21764,9 +22022,9 @@ const ADSCitizenDetailsNew = ({
21764
22022
  },
21765
22023
  t: t
21766
22024
  })
21767
- }))), (errors === null || errors === void 0 ? void 0 : errors.address) && /*#__PURE__*/React.createElement(CardLabelError$1, {
22025
+ })), (errors === null || errors === void 0 ? void 0 : errors.address) && /*#__PURE__*/React.createElement(CardLabelError$1, {
21768
22026
  style: errorStyle
21769
- }, errors === null || errors === void 0 ? void 0 : (_errors$address = errors.address) === null || _errors$address === void 0 ? void 0 : _errors$address.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
22027
+ }, errors === null || errors === void 0 ? void 0 : (_errors$address = errors.address) === null || _errors$address === void 0 ? void 0 : _errors$address.message), /*#__PURE__*/React.createElement(CardLabel, {
21770
22028
  className: "card-label-smaller"
21771
22029
  }, `${t("CORE_COMMON_PINCODE")}`, /*#__PURE__*/React.createElement("span", {
21772
22030
  style: mandatoryStyle
@@ -21804,7 +22062,7 @@ const ADSCitizenDetailsNew = ({
21804
22062
  t: t,
21805
22063
  maxLength: 6
21806
22064
  })
21807
- }))), errors.pincode && /*#__PURE__*/React.createElement(CardLabelError$1, {
22065
+ })), errors.pincode && /*#__PURE__*/React.createElement(CardLabelError$1, {
21808
22066
  style: errorStyle
21809
22067
  }, errors === null || errors === void 0 ? void 0 : (_errors$pincode = errors.pincode) === null || _errors$pincode === void 0 ? void 0 : _errors$pincode.message)), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
21810
22068
  style: {
@@ -21833,12 +22091,14 @@ const NewADSStepFormOne = ({
21833
22091
  onGoNext,
21834
22092
  onBackClick
21835
22093
  }) => {
22094
+ var _window$location, _window$location$href;
21836
22095
  const dispatch = useDispatch();
21837
22096
  const {
21838
22097
  t
21839
22098
  } = useTranslation();
21840
22099
  const [showToast, setShowToast] = useState(false);
21841
22100
  const [error, setError] = useState("");
22101
+ const isCitizen = typeof window !== "undefined" && ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : (_window$location$href = _window$location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.includes("citizen"));
21842
22102
  const currentStepData = useSelector(function (state) {
21843
22103
  return state.ads.ADSNewApplicationFormReducer.formData;
21844
22104
  });
@@ -21853,7 +22113,9 @@ const NewADSStepFormOne = ({
21853
22113
  setShowToast(false);
21854
22114
  setError("");
21855
22115
  };
21856
- return /*#__PURE__*/React.createElement(React.Fragment, null, " ", /*#__PURE__*/React.createElement(ADSCitizenDetailsNew, {
22116
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
22117
+ className: !isCitizen && "employeeCard"
22118
+ }, /*#__PURE__*/React.createElement(ADSCitizenDetailsNew, {
21857
22119
  onGoBack: onGoBack,
21858
22120
  goNext: goNext,
21859
22121
  currentStepData: currentStepData,
@@ -21863,7 +22125,7 @@ const NewADSStepFormOne = ({
21863
22125
  error: true,
21864
22126
  label: error,
21865
22127
  onClose: closeToast
21866
- }), " ");
22128
+ }), " "));
21867
22129
  };
21868
22130
 
21869
22131
  const AvailabilityModal = ({
@@ -21877,18 +22139,20 @@ const AvailabilityModal = ({
21877
22139
  }) => {
21878
22140
  var _cartSlots$find;
21879
22141
  const [selectedSlots, setSelectedSlots] = useState([]);
22142
+ const [selectAll, setSelectAll] = useState(false);
21880
22143
  const slotPayload = useMemo(() => ({
21881
22144
  advertisementSlotSearchCriteria: [{
21882
22145
  advertisementId: ad === null || ad === void 0 ? void 0 : ad.id,
21883
22146
  bookingId: "",
21884
- addType: ad.adType,
22147
+ addType: ad === null || ad === void 0 ? void 0 : ad.adType,
21885
22148
  bookingStartDate: dateRange === null || dateRange === void 0 ? void 0 : dateRange.startDate,
21886
22149
  bookingEndDate: dateRange === null || dateRange === void 0 ? void 0 : dateRange.endDate,
21887
22150
  faceArea: `${ad === null || ad === void 0 ? void 0 : ad.adType}_${ad === null || ad === void 0 ? void 0 : ad.width}_X_${ad === null || ad === void 0 ? void 0 : ad.height}`,
21888
22151
  tenantId,
21889
- location: ad.locationCode,
22152
+ location: ad === null || ad === void 0 ? void 0 : ad.locationCode,
21890
22153
  nightLight: (ad === null || ad === void 0 ? void 0 : ad.light) === "With Light" ? "true" : "false",
21891
- isTimerRequired: false
22154
+ isTimerRequired: false,
22155
+ amount: ad === null || ad === void 0 ? void 0 : ad.amount
21892
22156
  }]
21893
22157
  }), [ad, tenantId, dateRange]);
21894
22158
  const {
@@ -21900,49 +22164,64 @@ const AvailabilityModal = ({
21900
22164
  data: slotPayload
21901
22165
  });
21902
22166
  const slots = (slotResults === null || slotResults === void 0 ? void 0 : slotResults.advertisementSlotAvailabiltityDetails) || [];
21903
- const existingForAd = ((_cartSlots$find = cartSlots.find(item => item.ad.id === ad.id)) === null || _cartSlots$find === void 0 ? void 0 : _cartSlots$find.slots) || [];
21904
- const handleCheckboxChange = (slot, checked) => {
22167
+ const existingForAd = (cartSlots === null || cartSlots === void 0 ? void 0 : (_cartSlots$find = cartSlots.find(item => {
22168
+ var _item$ad;
22169
+ return (item === null || item === void 0 ? void 0 : (_item$ad = item.ad) === null || _item$ad === void 0 ? void 0 : _item$ad.id) === (ad === null || ad === void 0 ? void 0 : ad.id);
22170
+ })) === null || _cartSlots$find === void 0 ? void 0 : _cartSlots$find.slots) || [];
22171
+ const allBooked = (slots === null || slots === void 0 ? void 0 : slots.length) > 0 && (slots === null || slots === void 0 ? void 0 : slots.every(s => (s === null || s === void 0 ? void 0 : s.slotStaus) !== "AVAILABLE"));
22172
+ const allAvailableSlots = slots === null || slots === void 0 ? void 0 : slots.filter(s => (s === null || s === void 0 ? void 0 : s.slotStaus) === "AVAILABLE");
22173
+ const allInCart = (allAvailableSlots === null || allAvailableSlots === void 0 ? void 0 : allAvailableSlots.length) > 0 && (allAvailableSlots === null || allAvailableSlots === void 0 ? void 0 : allAvailableSlots.every(slot => existingForAd === null || existingForAd === void 0 ? void 0 : existingForAd.some(s => (s === null || s === void 0 ? void 0 : s.bookingDate) === (slot === null || slot === void 0 ? void 0 : slot.bookingDate))));
22174
+ const handleSelectAll = checked => {
22175
+ setSelectAll(checked);
21905
22176
  if (checked) {
21906
- setSelectedSlots(prev => [...prev.filter(s => s.bookingDate !== slot.bookingDate), slot]);
22177
+ const allAvailable = slots === null || slots === void 0 ? void 0 : slots.filter(s => (s === null || s === void 0 ? void 0 : s.slotStaus) === "AVAILABLE");
22178
+ setSelectedSlots(allAvailable);
21907
22179
  } else {
21908
- setSelectedSlots(prev => [...prev.filter(s => s.bookingDate !== slot.bookingDate), {
21909
- ...slot,
21910
- _remove: true
21911
- }]);
22180
+ setSelectedSlots([]);
21912
22181
  }
21913
22182
  };
21914
22183
  const handleAddToCart = () => {
21915
- if (selectedSlots.length > 0) {
22184
+ if ((selectedSlots === null || selectedSlots === void 0 ? void 0 : selectedSlots.length) > 0) {
21916
22185
  onSelectSlot(selectedSlots, {
21917
22186
  ...ad,
21918
22187
  faceArea: `${ad === null || ad === void 0 ? void 0 : ad.adType}_${ad === null || ad === void 0 ? void 0 : ad.width}_X_${ad === null || ad === void 0 ? void 0 : ad.height}`,
21919
22188
  location: ad === null || ad === void 0 ? void 0 : ad.name,
21920
22189
  addType: ad === null || ad === void 0 ? void 0 : ad.adType,
22190
+ amount: ad === null || ad === void 0 ? void 0 : ad.amount,
21921
22191
  bookingDate: dateRange === null || dateRange === void 0 ? void 0 : dateRange.startDate,
21922
22192
  nightLight: (ad === null || ad === void 0 ? void 0 : ad.light) === "With Light" ? true : false,
21923
22193
  bookingStartDate: dateRange === null || dateRange === void 0 ? void 0 : dateRange.startDate,
21924
22194
  bookingEndDate: dateRange === null || dateRange === void 0 ? void 0 : dateRange.endDate
21925
22195
  });
21926
22196
  setSelectedSlots([]);
22197
+ setSelectAll(false);
21927
22198
  onClose();
21928
22199
  }
21929
22200
  };
21930
22201
  const columns = [{
21931
- Header: t("ADS_SELECT"),
22202
+ Header: () => /*#__PURE__*/React.createElement("input", {
22203
+ type: "checkbox",
22204
+ checked: allInCart || selectAll,
22205
+ onChange: e => handleSelectAll(e.target.checked),
22206
+ style: {
22207
+ cursor: "pointer",
22208
+ width: "18px",
22209
+ height: "18px",
22210
+ accentColor: "#0b74de"
22211
+ }
22212
+ }),
21932
22213
  accessor: "select",
21933
22214
  Cell: ({
21934
22215
  row
21935
22216
  }) => {
21936
- const slot = row.original;
21937
- const isInCart = existingForAd.some(s => s.bookingDate === slot.bookingDate);
21938
- const isChecked = isInCart && !selectedSlots.some(s => s.bookingDate === slot.bookingDate && s._remove) || selectedSlots.some(s => s.bookingDate === slot.bookingDate && !s._remove);
22217
+ const slot = row === null || row === void 0 ? void 0 : row.original;
22218
+ const isChecked = allInCart || selectAll && (slot === null || slot === void 0 ? void 0 : slot.slotStaus) === "AVAILABLE";
21939
22219
  return /*#__PURE__*/React.createElement("input", {
21940
22220
  type: "checkbox",
21941
22221
  checked: isChecked,
21942
- disabled: slot.slotStaus !== "AVAILABLE",
21943
- onChange: e => handleCheckboxChange(slot, e.target.checked),
22222
+ disabled: true,
21944
22223
  style: {
21945
- cursor: slot.slotStaus === "AVAILABLE" ? "pointer" : "not-allowed",
22224
+ cursor: "not-allowed",
21946
22225
  width: "18px",
21947
22226
  height: "18px",
21948
22227
  accentColor: "#0b74de"
@@ -21954,10 +22233,16 @@ const AvailabilityModal = ({
21954
22233
  accessor: "bookingDate"
21955
22234
  }, {
21956
22235
  Header: t("ADS_LOCATION"),
21957
- accessor: "location"
22236
+ accessor: "location",
22237
+ Cell: ({
22238
+ value
22239
+ }) => t(value || "N/A")
21958
22240
  }, {
21959
22241
  Header: t("ADS_FACE_AREA"),
21960
- accessor: "faceArea"
22242
+ accessor: "faceArea",
22243
+ Cell: ({
22244
+ value
22245
+ }) => t((value === null || value === void 0 ? void 0 : value.replaceAll("_", " ")) || "N/A")
21961
22246
  }, {
21962
22247
  Header: t("ADS_TYPE"),
21963
22248
  accessor: "addType"
@@ -21970,7 +22255,8 @@ const AvailabilityModal = ({
21970
22255
  Cell: ({
21971
22256
  row
21972
22257
  }) => {
21973
- const status = row.original.slotStaus;
22258
+ var _row$original;
22259
+ const status = row === null || row === void 0 ? void 0 : (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.slotStaus;
21974
22260
  const isAvailable = status === "AVAILABLE";
21975
22261
  return /*#__PURE__*/React.createElement("span", {
21976
22262
  style: {
@@ -21987,7 +22273,6 @@ const AvailabilityModal = ({
21987
22273
  }, status);
21988
22274
  }
21989
22275
  }];
21990
- const allBooked = slots.length > 0 && slots.every(s => s.slotStaus !== "AVAILABLE");
21991
22276
  return /*#__PURE__*/React.createElement("div", {
21992
22277
  style: {
21993
22278
  position: "fixed",
@@ -22057,7 +22342,7 @@ const AvailabilityModal = ({
22057
22342
  color: "#555",
22058
22343
  textAlign: "center"
22059
22344
  }
22060
- }, t("ADS_LOADING_SLOTS")) : slots.length === 0 ? /*#__PURE__*/React.createElement("div", {
22345
+ }, t("ADS_LOADING_SLOTS")) : (slots === null || slots === void 0 ? void 0 : slots.length) === 0 ? /*#__PURE__*/React.createElement("div", {
22061
22346
  style: {
22062
22347
  fontSize: "24px",
22063
22348
  color: "#555",
@@ -22096,18 +22381,18 @@ const AvailabilityModal = ({
22096
22381
  }
22097
22382
  }, t ? t("Cancel") : "Cancel"), /*#__PURE__*/React.createElement("button", {
22098
22383
  onClick: handleAddToCart,
22099
- disabled: selectedSlots.length === 0,
22384
+ disabled: (selectedSlots === null || selectedSlots === void 0 ? void 0 : selectedSlots.length) === 0,
22100
22385
  style: {
22101
22386
  padding: "10px 18px",
22102
22387
  borderRadius: "6px",
22103
22388
  border: "none",
22104
- background: selectedSlots.length > 0 ? "#2947a3" : "#ccc",
22389
+ background: (selectedSlots === null || selectedSlots === void 0 ? void 0 : selectedSlots.length) > 0 ? "#2947a3" : "#ccc",
22105
22390
  color: "#fff",
22106
22391
  fontWeight: 600,
22107
- cursor: selectedSlots.length > 0 ? "pointer" : "not-allowed",
22392
+ cursor: (selectedSlots === null || selectedSlots === void 0 ? void 0 : selectedSlots.length) > 0 ? "pointer" : "not-allowed",
22108
22393
  transition: "background 0.2s"
22109
22394
  }
22110
- }, "\uD83D\uDED2 ", (existingForAd === null || existingForAd === void 0 ? void 0 : existingForAd.length) > 0 ? t("Update Cart") : t("Add To Cart")))));
22395
+ }, "\uD83D\uDED2 ", (existingForAd === null || existingForAd === void 0 ? void 0 : existingForAd.length) > 0 ? t("ADS_UPDATE_CART") : t("ADS_ADD_TO_CART")))));
22111
22396
  };
22112
22397
 
22113
22398
  const CartModal = ({
@@ -22116,32 +22401,42 @@ const CartModal = ({
22116
22401
  onRemoveSlot,
22117
22402
  t
22118
22403
  }) => {
22119
- const [expanded, setExpanded] = useState(() => cartSlots.map(item => item.ad.id));
22404
+ const [expanded, setExpanded] = useState(() => cartSlots === null || cartSlots === void 0 ? void 0 : cartSlots.map(item => {
22405
+ var _item$ad;
22406
+ return item === null || item === void 0 ? void 0 : (_item$ad = item.ad) === null || _item$ad === void 0 ? void 0 : _item$ad.id;
22407
+ }));
22120
22408
  const toggleExpand = adId => {
22121
- setExpanded(prev => prev.includes(adId) ? prev.filter(id => id !== adId) : [...prev, adId]);
22409
+ setExpanded(prev => prev !== null && prev !== void 0 && prev.includes(adId) ? prev === null || prev === void 0 ? void 0 : prev.filter(id => id !== adId) : [...prev, adId]);
22122
22410
  };
22123
22411
  const makeColumns = ad => [{
22124
22412
  Header: t("ADS_DATE"),
22125
22413
  accessor: "bookingDate"
22126
22414
  }, {
22127
22415
  Header: t("ADS_LOCATION"),
22128
- accessor: "location"
22416
+ accessor: "location",
22417
+ Cell: ({
22418
+ value
22419
+ }) => t(value || "N/A")
22129
22420
  }, {
22130
22421
  Header: t("ADS_FACE_AREA"),
22131
- accessor: "faceArea"
22422
+ accessor: "faceArea",
22423
+ Cell: ({
22424
+ value
22425
+ }) => t((value === null || value === void 0 ? void 0 : value.replaceAll("_", " ")) || "N/A")
22132
22426
  }, {
22133
22427
  Header: t("ADS_TYPE"),
22134
22428
  accessor: "addType"
22135
22429
  }, {
22136
22430
  Header: t("ADS_NIGHT_LIGHT"),
22137
- accessor: row => row.nightLight ? t("ADS_YES") : t("ADS_NO")
22431
+ accessor: row => row !== null && row !== void 0 && row.nightLight ? t("ADS_YES") : t("ADS_NO")
22138
22432
  }, {
22139
22433
  Header: t("ADS_STATUS"),
22140
22434
  accessor: "slotStaus",
22141
22435
  Cell: ({
22142
22436
  row
22143
22437
  }) => {
22144
- const status = row.original.slotStaus;
22438
+ var _row$original;
22439
+ const status = row === null || row === void 0 ? void 0 : (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.slotStaus;
22145
22440
  const isAvailable = status === "AVAILABLE";
22146
22441
  return /*#__PURE__*/React.createElement("span", {
22147
22442
  style: {
@@ -22157,26 +22452,6 @@ const CartModal = ({
22157
22452
  }
22158
22453
  }, status);
22159
22454
  }
22160
- }, {
22161
- Header: t("ADS_REMOVE"),
22162
- accessor: "remove",
22163
- Cell: ({
22164
- row
22165
- }) => {
22166
- const slot = row.original;
22167
- return /*#__PURE__*/React.createElement("button", {
22168
- onClick: () => onRemoveSlot(ad, slot),
22169
- style: {
22170
- padding: "4px 10px",
22171
- borderRadius: "6px",
22172
- border: "none",
22173
- background: "#dc3545",
22174
- color: "#fff",
22175
- cursor: "pointer",
22176
- fontSize: "12px"
22177
- }
22178
- }, t("ADS_DELETE"));
22179
- }
22180
22455
  }];
22181
22456
  return /*#__PURE__*/React.createElement("div", {
22182
22457
  style: {
@@ -22233,14 +22508,14 @@ const CartModal = ({
22233
22508
  flex: 1,
22234
22509
  overflowY: "auto"
22235
22510
  }
22236
- }, cartSlots.length === 0 ? /*#__PURE__*/React.createElement("p", {
22511
+ }, (cartSlots === null || cartSlots === void 0 ? void 0 : cartSlots.length) === 0 ? /*#__PURE__*/React.createElement("p", {
22237
22512
  style: {
22238
22513
  padding: "12px",
22239
22514
  color: "#666"
22240
22515
  }
22241
- }, t("ADS_NO_ITEMS_IN_CART")) : cartSlots.map((item, idx) => {
22242
- var _item$slots;
22243
- const isOpen = expanded.includes(item.ad.id);
22516
+ }, t("ADS_NO_ITEMS_IN_CART")) : cartSlots === null || cartSlots === void 0 ? void 0 : cartSlots.map((item, idx) => {
22517
+ var _item$ad3, _item$ad4, _item$ad5, _item$slots;
22518
+ const isOpen = expanded === null || expanded === void 0 ? void 0 : expanded.includes(item.ad.id);
22244
22519
  return /*#__PURE__*/React.createElement("div", {
22245
22520
  key: idx,
22246
22521
  style: {
@@ -22250,30 +22525,50 @@ const CartModal = ({
22250
22525
  overflow: "hidden"
22251
22526
  }
22252
22527
  }, /*#__PURE__*/React.createElement("div", {
22253
- onClick: () => toggleExpand(item.ad.id),
22254
22528
  style: {
22255
22529
  background: "#f9f9f9",
22256
22530
  padding: "10px 14px",
22257
22531
  fontWeight: 600,
22258
22532
  fontSize: "14px",
22259
22533
  borderBottom: "1px solid #ddd",
22260
- cursor: "pointer",
22261
22534
  display: "flex",
22262
22535
  justifyContent: "space-between",
22263
22536
  alignItems: "center"
22264
22537
  }
22265
- }, /*#__PURE__*/React.createElement("span", null, item.ad.name, " \u2014 \u20B9", item.ad.amount * (item === null || item === void 0 ? void 0 : (_item$slots = item.slots) === null || _item$slots === void 0 ? void 0 : _item$slots.length)), /*#__PURE__*/React.createElement("span", {
22538
+ }, /*#__PURE__*/React.createElement("div", {
22539
+ onClick: () => {
22540
+ var _item$ad2;
22541
+ return toggleExpand(item === null || item === void 0 ? void 0 : (_item$ad2 = item.ad) === null || _item$ad2 === void 0 ? void 0 : _item$ad2.id);
22542
+ },
22266
22543
  style: {
22267
- fontSize: "18px"
22544
+ cursor: "pointer",
22545
+ flex: 1
22268
22546
  }
22269
- }, isOpen ? "▾" : "▸")), isOpen && /*#__PURE__*/React.createElement("div", {
22547
+ }, item === null || item === void 0 ? void 0 : (_item$ad3 = item.ad) === null || _item$ad3 === void 0 ? void 0 : _item$ad3.name, item !== null && item !== void 0 && (_item$ad4 = item.ad) !== null && _item$ad4 !== void 0 && _item$ad4.amount ? ` — ₹${((item === null || item === void 0 ? void 0 : (_item$ad5 = item.ad) === null || _item$ad5 === void 0 ? void 0 : _item$ad5.amount) * 1.18 * (item === null || item === void 0 ? void 0 : (_item$slots = item.slots) === null || _item$slots === void 0 ? void 0 : _item$slots.length)).toFixed(2)}` : "", /*#__PURE__*/React.createElement("span", {
22548
+ style: {
22549
+ fontSize: "18px",
22550
+ marginLeft: "8px"
22551
+ }
22552
+ }, isOpen ? "▾" : "▸")), /*#__PURE__*/React.createElement("button", {
22553
+ onClick: () => onRemoveSlot(item === null || item === void 0 ? void 0 : item.ad),
22554
+ style: {
22555
+ padding: "6px 12px",
22556
+ borderRadius: "6px",
22557
+ border: "none",
22558
+ background: "#dc3545",
22559
+ color: "#fff",
22560
+ cursor: "pointer",
22561
+ fontSize: "12px",
22562
+ marginLeft: "10px"
22563
+ }
22564
+ }, t("ADS_REMOVE"))), isOpen && /*#__PURE__*/React.createElement("div", {
22270
22565
  style: {
22271
22566
  overflowX: "auto"
22272
22567
  }
22273
22568
  }, /*#__PURE__*/React.createElement(Table, {
22274
22569
  t: t,
22275
22570
  data: item.slots,
22276
- columns: makeColumns(item.ad),
22571
+ columns: makeColumns(),
22277
22572
  disableSort: true,
22278
22573
  isPaginationRequired: false,
22279
22574
  getCellProps: cell => ({
@@ -22297,11 +22592,15 @@ const AdCard = ({
22297
22592
  t,
22298
22593
  onViewAvailability: _onViewAvailability = () => {},
22299
22594
  cartSlots: _cartSlots = [],
22300
- openCart
22595
+ openCart,
22596
+ scheduleType
22301
22597
  }) => {
22302
- const todayISO = new Date().toISOString().split("T")[0];
22303
22598
  const startDateVal = watch(`ads.${idx}.startDate`) || "";
22304
- const isAdded = _cartSlots.some(item => item.ad.id === ad.id && item.slots.length > 0);
22599
+ const minDate = getMinDateForType(scheduleType);
22600
+ const isAdded = _cartSlots === null || _cartSlots === void 0 ? void 0 : _cartSlots.some(item => {
22601
+ var _item$ad, _item$slots;
22602
+ return (item === null || item === void 0 ? void 0 : (_item$ad = item.ad) === null || _item$ad === void 0 ? void 0 : _item$ad.id) === (ad === null || ad === void 0 ? void 0 : ad.id) && (item === null || item === void 0 ? void 0 : (_item$slots = item.slots) === null || _item$slots === void 0 ? void 0 : _item$slots.length) > 0;
22603
+ });
22305
22604
  return /*#__PURE__*/React.createElement("div", {
22306
22605
  style: {
22307
22606
  width: 280,
@@ -22322,8 +22621,8 @@ const AdCard = ({
22322
22621
  background: "#f5f5f5"
22323
22622
  }
22324
22623
  }, ad.imageSrc || ad.photoURL ? /*#__PURE__*/React.createElement("img", {
22325
- src: ad.imageSrc || ad.photoURL,
22326
- alt: ad.name || `Ad ${ad.id}`,
22624
+ src: (ad === null || ad === void 0 ? void 0 : ad.imageSrc) || (ad === null || ad === void 0 ? void 0 : ad.photoURL),
22625
+ alt: (ad === null || ad === void 0 ? void 0 : ad.name) || `Ad ${ad === null || ad === void 0 ? void 0 : ad.id}`,
22327
22626
  loading: "lazy",
22328
22627
  style: {
22329
22628
  width: "100%",
@@ -22357,22 +22656,22 @@ const AdCard = ({
22357
22656
  style: {
22358
22657
  color: "#222"
22359
22658
  }
22360
- }, "\u20B9", ad.amount)), /*#__PURE__*/React.createElement("div", {
22659
+ }, "\u20B9", ad === null || ad === void 0 ? void 0 : ad.amount)), /*#__PURE__*/React.createElement("div", {
22361
22660
  style: {
22362
22661
  display: "flex",
22363
22662
  justifyContent: "space-between"
22364
22663
  }
22365
- }, /*#__PURE__*/React.createElement("span", null, ad.locationCode), /*#__PURE__*/React.createElement("span", null, "Pole ", ad.poleNo)), /*#__PURE__*/React.createElement("div", {
22664
+ }, /*#__PURE__*/React.createElement("span", null, ad === null || ad === void 0 ? void 0 : ad.locationCode), /*#__PURE__*/React.createElement("span", null, "Pole ", ad.poleNo)), /*#__PURE__*/React.createElement("div", {
22366
22665
  style: {
22367
22666
  display: "flex",
22368
22667
  justifyContent: "space-between"
22369
22668
  }
22370
- }, /*#__PURE__*/React.createElement("span", null, ad.adType), /*#__PURE__*/React.createElement("span", {
22669
+ }, /*#__PURE__*/React.createElement("span", null, ad === null || ad === void 0 ? void 0 : ad.adType), /*#__PURE__*/React.createElement("span", {
22371
22670
  style: {
22372
- color: "red",
22373
- fontWeight: 500
22671
+ color: "green",
22672
+ fontWeight: 600
22374
22673
  }
22375
- }, ad.light))), /*#__PURE__*/React.createElement("div", {
22674
+ }, ad === null || ad === void 0 ? void 0 : ad.light))), /*#__PURE__*/React.createElement("div", {
22376
22675
  style: {
22377
22676
  fontSize: 12,
22378
22677
  color: "#666",
@@ -22388,7 +22687,7 @@ const AdCard = ({
22388
22687
  name: `ads.${idx}.startDate`,
22389
22688
  render: props => /*#__PURE__*/React.createElement("input", {
22390
22689
  type: "date",
22391
- min: todayISO,
22690
+ min: minDate,
22392
22691
  value: props.value || "",
22393
22692
  onChange: e => props.onChange(e.target.value),
22394
22693
  style: {
@@ -22430,7 +22729,7 @@ const AdCard = ({
22430
22729
  name: `ads.${idx}.endDate`,
22431
22730
  render: props => /*#__PURE__*/React.createElement("input", {
22432
22731
  type: "date",
22433
- min: startDateVal || todayISO,
22732
+ min: startDateVal || minDate,
22434
22733
  value: props.value || "",
22435
22734
  onChange: e => props.onChange(e.target.value),
22436
22735
  style: {
@@ -22509,8 +22808,7 @@ const ADSCitizenSecond = ({
22509
22808
  currentStepData,
22510
22809
  t
22511
22810
  }) => {
22512
- var _window$location, _window$location$href;
22513
- const stateId = Digit.ULBService.getStateId();
22811
+ var _window$location, _window$location$href, _adsForLocation$slice;
22514
22812
  const isCitizen = typeof window !== "undefined" && ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : (_window$location$href = _window$location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.includes("citizen"));
22515
22813
  const tenantId = isCitizen ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
22516
22814
  const [adsForLocation, setAdsForLocation] = useState([]);
@@ -22525,10 +22823,13 @@ const ADSCitizenSecond = ({
22525
22823
  });
22526
22824
  const {
22527
22825
  data: mdmsAds = []
22528
- } = Digit.Hooks.ads.useADSAllMDMS(stateId);
22826
+ } = Digit.Hooks.ads.useADSAllMDMS(tenantId);
22529
22827
  const {
22530
22828
  data: location = []
22531
- } = Digit.Hooks.ads.useADSLocationMDMS(stateId);
22829
+ } = Digit.Hooks.ads.useADSLocationMDMS(tenantId);
22830
+ const {
22831
+ data: scheduleType = []
22832
+ } = Digit.Hooks.ads.useADSScheduleTypeMDMS(tenantId);
22532
22833
  const [cartSlots, setCartSlots] = useState([]);
22533
22834
  const dispatch = useDispatch();
22534
22835
  const {
@@ -22577,27 +22878,6 @@ const ADSCitizenSecond = ({
22577
22878
  });
22578
22879
  }
22579
22880
  };
22580
- const validateSchedule = ({
22581
- startDate,
22582
- startTime,
22583
- endDate,
22584
- endTime
22585
- }) => {
22586
- if (!startDate || !startTime || !endDate || !endTime) {
22587
- return "Start and end date/time are required.";
22588
- }
22589
- const now = new Date();
22590
- const s = new Date(`${startDate}T${startTime}`);
22591
- const e = new Date(`${endDate}T${endTime}`);
22592
- if (s < now) {
22593
- return "Start date/time cannot be in the past.";
22594
- }
22595
- if (e <= s) {
22596
- return "End date/time must be later than start date/time.";
22597
- }
22598
- return null;
22599
- };
22600
- const showMore = () => setVisibleCount(v => v + 6);
22601
22881
  const areCartSlotsEqual = (a = [], b = []) => {
22602
22882
  if (a.length !== b.length) return false;
22603
22883
  const sortByAd = arr => [...arr].sort((x, y) => String(x.ad.id).localeCompare(String(y.ad.id)));
@@ -22614,7 +22894,7 @@ const ADSCitizenSecond = ({
22614
22894
  };
22615
22895
  const onSubmit = async data => {
22616
22896
  var _currentStepData$ads;
22617
- if (cartSlots.length === 0) {
22897
+ if ((cartSlots === null || cartSlots === void 0 ? void 0 : cartSlots.length) === 0) {
22618
22898
  setShowToast({
22619
22899
  label: t("ADS_ONE_AD_ATLEAST"),
22620
22900
  error: true
@@ -22622,7 +22902,7 @@ const ADSCitizenSecond = ({
22622
22902
  return;
22623
22903
  }
22624
22904
  if ((currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$ads = currentStepData.ads) === null || _currentStepData$ads === void 0 ? void 0 : _currentStepData$ads.length) > 0) {
22625
- const unchanged = areCartSlotsEqual(cartSlots, currentStepData.ads);
22905
+ const unchanged = areCartSlotsEqual(cartSlots, currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.ads);
22626
22906
  if (unchanged) {
22627
22907
  goNext(cartSlots);
22628
22908
  return;
@@ -22638,8 +22918,8 @@ const ADSCitizenSecond = ({
22638
22918
  try {
22639
22919
  const response = await Digit.ADSServices.slot_search(payload, tenantId);
22640
22920
  if (response) {
22641
- const expiry = Date.now() + 30 * 60 * 1000;
22642
- dispatch(UPDATE_ADSNewApplication_FORM("reservationExpiry", expiry));
22921
+ const createTime = Date.now();
22922
+ dispatch(UPDATE_ADSNewApplication_FORM("reservationExpiry", createTime));
22643
22923
  goNext(cartSlots);
22644
22924
  } else {
22645
22925
  setShowToast({
@@ -22682,7 +22962,8 @@ const ADSCitizenSecond = ({
22682
22962
  startDate,
22683
22963
  endDate,
22684
22964
  startTime,
22685
- endTime
22965
+ endTime,
22966
+ scheduleType
22686
22967
  });
22687
22968
  if (err) {
22688
22969
  setShowToast({
@@ -22706,79 +22987,53 @@ const ADSCitizenSecond = ({
22706
22987
  });
22707
22988
  setShowModal(true);
22708
22989
  };
22990
+ const handleRemoveFromCart = ad => {
22991
+ setCartSlots(prev => prev.filter(item => item.ad.id !== ad.id));
22992
+ setShowToast({
22993
+ label: `Removed all slots for ${ad.name}`,
22994
+ error: true
22995
+ });
22996
+ };
22709
22997
  const handleAddToCart = (slots, ad) => {
22710
22998
  setCartSlots(prev => {
22999
+ const enrichedSlots = slots.map(s => ({
23000
+ ...s,
23001
+ bookingStartDate: s === null || s === void 0 ? void 0 : s.bookingDate,
23002
+ bookingEndDate: dateRange === null || dateRange === void 0 ? void 0 : dateRange.endDate,
23003
+ bookingFromTime: dateRange === null || dateRange === void 0 ? void 0 : dateRange.startTime,
23004
+ bookingToTime: dateRange === null || dateRange === void 0 ? void 0 : dateRange.endTime
23005
+ }));
22711
23006
  const existing = prev.find(item => item.ad.id === ad.id);
22712
23007
  let updated;
22713
23008
  if (existing) {
22714
- let updatedSlots = existing.slots;
22715
- slots.forEach(slot => {
22716
- if (slot._remove) {
22717
- updatedSlots = updatedSlots.filter(s => s.bookingDate !== slot.bookingDate);
22718
- setShowToast({
22719
- label: `Removed slot ${slot.bookingDate} from ${ad.name}`,
22720
- error: true
22721
- });
22722
- } else if (!updatedSlots.some(s => s.bookingDate === slot.bookingDate)) {
22723
- const enrichedSlot = {
22724
- ...slot,
22725
- bookingStartDate: slot === null || slot === void 0 ? void 0 : slot.bookingDate,
22726
- bookingEndDate: dateRange === null || dateRange === void 0 ? void 0 : dateRange.endDate,
22727
- bookingFromTime: dateRange === null || dateRange === void 0 ? void 0 : dateRange.startTime,
22728
- bookingToTime: dateRange === null || dateRange === void 0 ? void 0 : dateRange.endTime
22729
- };
22730
- updatedSlots = [...updatedSlots, enrichedSlot];
22731
- setShowToast({
22732
- label: `Added slot ${slot.bookingDate} to ${ad.name}`,
22733
- error: false
22734
- });
22735
- }
22736
- });
22737
23009
  updated = prev.map(item => item.ad.id === ad.id ? {
22738
23010
  ...item,
22739
- slots: updatedSlots
23011
+ slots: enrichedSlots
22740
23012
  } : item);
23013
+ setShowToast({
23014
+ label: `Updated ${enrichedSlots.length} slot(s) for ${ad.name}`,
23015
+ error: false
23016
+ });
22741
23017
  } else {
22742
- const addSlots = slots.filter(s => !s._remove).map(s => ({
22743
- ...s,
22744
- bookingStartDate: s === null || s === void 0 ? void 0 : s.bookingDate,
22745
- bookingEndDate: dateRange === null || dateRange === void 0 ? void 0 : dateRange.endDate,
22746
- bookingFromTime: dateRange === null || dateRange === void 0 ? void 0 : dateRange.startTime,
22747
- bookingToTime: dateRange === null || dateRange === void 0 ? void 0 : dateRange.endTime
22748
- }));
22749
- if (addSlots.length > 0) {
22750
- setShowToast({
22751
- label: `Added ${addSlots.length} slot(s) to ${ad.name}`,
22752
- error: false
22753
- });
22754
- updated = [...prev, {
22755
- ad,
22756
- slots: addSlots
22757
- }];
22758
- } else {
22759
- updated = prev;
22760
- }
23018
+ updated = [...prev, {
23019
+ ad,
23020
+ slots: enrichedSlots
23021
+ }];
23022
+ setShowToast({
23023
+ label: `Added ${enrichedSlots.length} slot(s) to ${ad.name}`,
23024
+ error: false
23025
+ });
22761
23026
  }
22762
23027
  return updated;
22763
23028
  });
22764
23029
  };
22765
- const handleRemoveFromCart = (ad, slotToRemove) => {
22766
- setCartSlots(prev => prev.map(item => item.ad.id === ad.id ? {
22767
- ...item,
22768
- slots: item.slots.filter(s => s.bookingDate !== slotToRemove.bookingDate)
22769
- } : item).filter(item => item.slots.length > 0));
22770
- setShowToast({
22771
- label: `Removed slot ${slotToRemove.bookingDate} from ${ad.name}`,
22772
- error: true
22773
- });
22774
- };
22775
23030
  useEffect(() => {
22776
23031
  var _currentStepData$ads2;
22777
23032
  if ((currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$ads2 = currentStepData.ads) === null || _currentStepData$ads2 === void 0 ? void 0 : _currentStepData$ads2.length) > 0) {
22778
23033
  var _currentStepData$ads$, _currentStepData$ads$2, _matchedOption$geo_ta, _matchedOption$geo_ta2;
22779
23034
  setCartSlots(currentStepData.ads);
22780
23035
  const locationCode = (_currentStepData$ads$ = currentStepData.ads[0]) === null || _currentStepData$ads$ === void 0 ? void 0 : (_currentStepData$ads$2 = _currentStepData$ads$.ad) === null || _currentStepData$ads$2 === void 0 ? void 0 : _currentStepData$ads$2.locationCode;
22781
- const matchedOption = locationOptions.find(opt => opt.code === locationCode);
23036
+ const matchedOption = locationOptions === null || locationOptions === void 0 ? void 0 : locationOptions.find(opt => opt.code === locationCode);
22782
23037
  if (matchedOption) {
22783
23038
  setValue("siteId", matchedOption);
22784
23039
  filterAds(matchedOption);
@@ -22802,6 +23057,7 @@ const ADSCitizenSecond = ({
22802
23057
  const mandatoryStyle = {
22803
23058
  color: "red"
22804
23059
  };
23060
+ const guidance = getScheduleMessage(scheduleType, t);
22805
23061
  return /*#__PURE__*/React.createElement(React.Fragment, null, (cartSlots === null || cartSlots === void 0 ? void 0 : cartSlots.length) > 0 && /*#__PURE__*/React.createElement("div", {
22806
23062
  style: {
22807
23063
  display: "flex",
@@ -22824,12 +23080,19 @@ const ADSCitizenSecond = ({
22824
23080
  }
22825
23081
  }, "\uD83D\uDED2"), t("ADS_VIEW_CART"), " (", cartSlots === null || cartSlots === void 0 ? void 0 : cartSlots.length, ")")), /*#__PURE__*/React.createElement("form", {
22826
23082
  onSubmit: handleSubmit(onSubmit)
22827
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ADS_SITE_NAME_LABEL"), " ", /*#__PURE__*/React.createElement("span", {
23083
+ }, /*#__PURE__*/React.createElement(CardLabel, null, t("ADS_SITE_NAME_LABEL"), " ", /*#__PURE__*/React.createElement("span", {
22828
23084
  style: mandatoryStyle
22829
- }, "*")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("style", null, `
22830
- .select-wrap{
22831
- width:100% !important;
22832
- }
23085
+ }, "*")), /*#__PURE__*/React.createElement("div", {
23086
+ style: {
23087
+ width: "100%"
23088
+ }
23089
+ }, isCitizen && /*#__PURE__*/React.createElement("style", null, `
23090
+ .form-field {
23091
+ width: 100% !important;
23092
+ }
23093
+ .select-wrap {
23094
+ width: 100% !important;
23095
+ }
22833
23096
  .select {
22834
23097
  border: 1px solid #b4b4b4 !important;
22835
23098
  border-radius: 8px !important;
@@ -22839,7 +23102,6 @@ const ADSCitizenSecond = ({
22839
23102
  border: 1px solid #2947a3 !important;
22840
23103
  border-radius: 8px !important;
22841
23104
  }
22842
-
22843
23105
  `), /*#__PURE__*/React.createElement(Controller, {
22844
23106
  control: control,
22845
23107
  name: "siteId",
@@ -22856,43 +23118,63 @@ const ADSCitizenSecond = ({
22856
23118
  filterAds(e);
22857
23119
  }
22858
23120
  })
22859
- }))), errors.siteId && /*#__PURE__*/React.createElement(CardLabelError$1, {
23121
+ })), errors.siteId && /*#__PURE__*/React.createElement(CardLabelError$1, {
22860
23122
  style: errorStyle
22861
- }, errors.siteId.message), (adsForLocation === null || adsForLocation === void 0 ? void 0 : adsForLocation.length) > 0 && /*#__PURE__*/React.createElement("div", {
23123
+ }, errors.siteId.message), guidance && (adsForLocation === null || adsForLocation === void 0 ? void 0 : adsForLocation.length) > 0 && /*#__PURE__*/React.createElement("div", {
23124
+ style: {
23125
+ background: "#fff3cd",
23126
+ border: "1px solid #ffeeba",
23127
+ color: "#856404",
23128
+ padding: "6px 10px",
23129
+ borderRadius: "6px",
23130
+ fontSize: "14px",
23131
+ marginBottom: "8px",
23132
+ width: "100%",
23133
+ maxWidth: "545px"
23134
+ }
23135
+ }, "\u26A0\uFE0F ", guidance), (adsForLocation === null || adsForLocation === void 0 ? void 0 : adsForLocation.length) > 0 && /*#__PURE__*/React.createElement("div", {
22862
23136
  style: {
22863
23137
  display: "flex",
22864
23138
  flexWrap: "wrap",
22865
- gap: 12,
22866
- margin: "12px"
22867
- }
22868
- }, adsForLocation.slice(0, visibleCount).map((ad, idx) => {
22869
- return /*#__PURE__*/React.createElement(AdCard, {
22870
- key: ad.id ?? idx,
22871
- ad: ad,
22872
- idx: idx,
22873
- control: control,
22874
- watch: watch,
22875
- cartSlots: cartSlots,
22876
- onViewAvailability: handleViewAvailability,
22877
- openCart: () => setShowCart(true),
22878
- t: t
22879
- });
22880
- })), visibleCount < adsForLocation.length && /*#__PURE__*/React.createElement("div", {
23139
+ gap: 12
23140
+ }
23141
+ }, adsForLocation === null || adsForLocation === void 0 ? void 0 : (_adsForLocation$slice = adsForLocation.slice(0, visibleCount)) === null || _adsForLocation$slice === void 0 ? void 0 : _adsForLocation$slice.map((ad, idx) => /*#__PURE__*/React.createElement(AdCard, {
23142
+ key: ad.id || idx,
23143
+ ad: ad,
23144
+ idx: idx,
23145
+ control: control,
23146
+ watch: watch,
23147
+ cartSlots: cartSlots,
23148
+ onViewAvailability: handleViewAvailability,
23149
+ openCart: () => setShowCart(true),
23150
+ t: t,
23151
+ scheduleType: scheduleType
23152
+ }))), (adsForLocation === null || adsForLocation === void 0 ? void 0 : adsForLocation.length) > 6 && /*#__PURE__*/React.createElement("div", {
22881
23153
  style: {
22882
- marginTop: 12,
22883
- textAlign: "center"
23154
+ textAlign: "center",
23155
+ marginTop: "1rem"
22884
23156
  }
22885
- }, /*#__PURE__*/React.createElement("button", {
23157
+ }, visibleCount < adsForLocation.length ? /*#__PURE__*/React.createElement("button", {
22886
23158
  type: "button",
22887
- onClick: showMore,
22888
23159
  style: {
22889
23160
  padding: "8px 12px",
22890
23161
  borderRadius: 6,
22891
23162
  border: "1px solid #ccc",
22892
23163
  background: "#fff",
22893
23164
  cursor: "pointer"
22894
- }
22895
- }, t("ADS_SHOW_MORE"))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("CS_COMPLAINT_DETAILS_GEO_LOCATION")), /*#__PURE__*/React.createElement(Controller, {
23165
+ },
23166
+ onClick: () => setVisibleCount(v => v + 6)
23167
+ }, t("ADS_SHOW_MORE")) : /*#__PURE__*/React.createElement("button", {
23168
+ type: "button",
23169
+ style: {
23170
+ padding: "8px 12px",
23171
+ borderRadius: 6,
23172
+ border: "1px solid #ccc",
23173
+ background: "#fff",
23174
+ cursor: "pointer"
23175
+ },
23176
+ onClick: () => setVisibleCount(6)
23177
+ }, t("SHOW_LESS"))), /*#__PURE__*/React.createElement(CardLabel, null, t("CS_COMPLAINT_DETAILS_GEO_LOCATION")), /*#__PURE__*/React.createElement(Controller, {
22896
23178
  control: control,
22897
23179
  name: "geoLocation",
22898
23180
  render: props => /*#__PURE__*/React.createElement(ADSAddressField, {
@@ -22900,7 +23182,7 @@ const ADSCitizenSecond = ({
22900
23182
  onChange: props.onChange,
22901
23183
  t: t
22902
23184
  })
22903
- })), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
23185
+ }), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
22904
23186
  label: "Next",
22905
23187
  submit: "submit"
22906
23188
  })), showModal && /*#__PURE__*/React.createElement(AvailabilityModal, {
@@ -22929,6 +23211,7 @@ const NewADSStepFormTwo = ({
22929
23211
  onBackClick,
22930
23212
  onGoNext
22931
23213
  }) => {
23214
+ var _window$location, _window$location$href;
22932
23215
  const {
22933
23216
  t
22934
23217
  } = useTranslation();
@@ -22949,7 +23232,10 @@ const NewADSStepFormTwo = ({
22949
23232
  setShowToast(false);
22950
23233
  setError("");
22951
23234
  };
22952
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ADSCitizenSecond, {
23235
+ const isCitizen = typeof window !== "undefined" && ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : (_window$location$href = _window$location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.includes("citizen"));
23236
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
23237
+ className: !isCitizen && "employeeCard"
23238
+ }, /*#__PURE__*/React.createElement(ADSCitizenSecond, {
22953
23239
  onGoBack: onGoBack,
22954
23240
  goNext: goNext,
22955
23241
  currentStepData: currentStepData,
@@ -22959,7 +23245,7 @@ const NewADSStepFormTwo = ({
22959
23245
  error: true,
22960
23246
  label: error,
22961
23247
  onClose: closeToast
22962
- }));
23248
+ })));
22963
23249
  };
22964
23250
 
22965
23251
  const NewADSStepFormThree = ({
@@ -23246,7 +23532,6 @@ function NewADSStepFormFive(props) {
23246
23532
  id: globalBookingNo,
23247
23533
  moduleCode: businessServicMINE
23248
23534
  });
23249
- console.log("workflowDetails", workflowDetails);
23250
23535
  useEffect(() => {
23251
23536
  var _logged$info, _logged$info$roles;
23252
23537
  const wd = workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.data;
@@ -24658,7 +24943,7 @@ const ADSSelectProofIdentity = ({
24658
24943
  allowedExtensions: [".pdf", ".jpeg", ".jpg", ".png"]
24659
24944
  };
24660
24945
  const validateFile = (file, docCode) => {
24661
- var _file$name, _file$name$toLowerCas;
24946
+ var _file$name, _file$name$toLowerCas, _allowedExtensions;
24662
24947
  if (!file) return null;
24663
24948
  const maxBytes = FILE_POLICY.maxBytes;
24664
24949
  let allowedExtensions = [...FILE_POLICY.allowedExtensions];
@@ -24666,28 +24951,29 @@ const ADSSelectProofIdentity = ({
24666
24951
  allowedExtensions = [".jpeg", ".jpg", ".png"];
24667
24952
  }
24668
24953
  const nameLower = (file === null || file === void 0 ? void 0 : (_file$name = file.name) === null || _file$name === void 0 ? void 0 : (_file$name$toLowerCas = _file$name.toLowerCase) === null || _file$name$toLowerCas === void 0 ? void 0 : _file$name$toLowerCas.call(_file$name)) || "";
24669
- const okType = allowedExtensions.some(ext => nameLower.endsWith(ext));
24954
+ const okType = (_allowedExtensions = allowedExtensions) === null || _allowedExtensions === void 0 ? void 0 : _allowedExtensions.some(ext => nameLower === null || nameLower === void 0 ? void 0 : nameLower.endsWith(ext));
24670
24955
  if (!okType) return "CS_FILE_INVALID_TYPE";
24671
- if (file.size > maxBytes) return "CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED";
24956
+ if ((file === null || file === void 0 ? void 0 : file.size) > maxBytes) return "CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED";
24672
24957
  return null;
24673
24958
  };
24674
24959
  const makeDocumentsValidator = mdms => {
24675
- const requiredDocs = (mdms || []).filter(d => d === null || d === void 0 ? void 0 : d.required);
24960
+ var _ref;
24961
+ const requiredDocs = (_ref = mdms || []) === null || _ref === void 0 ? void 0 : _ref.filter(d => d === null || d === void 0 ? void 0 : d.required);
24676
24962
  return (documents = []) => {
24677
24963
  const errors = {};
24678
24964
  const missingDocs = [];
24679
24965
  const docsArray = Array.isArray(documents) ? documents : [];
24680
- if (!requiredDocs.length) return errors;
24966
+ if (!(requiredDocs !== null && requiredDocs !== void 0 && requiredDocs.length)) return errors;
24681
24967
  for (const doc of requiredDocs) {
24682
- const satisfied = docsArray.some(d => {
24968
+ const satisfied = docsArray === null || docsArray === void 0 ? void 0 : docsArray.some(d => {
24683
24969
  var _d$documentType;
24684
- return ((_d$documentType = d.documentType) === null || _d$documentType === void 0 ? void 0 : _d$documentType.includes(doc.code)) && (d.filestoreId || d.fileStoreId);
24970
+ return ((_d$documentType = d.documentType) === null || _d$documentType === void 0 ? void 0 : _d$documentType.includes(doc === null || doc === void 0 ? void 0 : doc.code)) && ((d === null || d === void 0 ? void 0 : d.filestoreId) || d.fileStoreId);
24685
24971
  });
24686
24972
  if (!satisfied) {
24687
24973
  missingDocs.push(t(doc === null || doc === void 0 ? void 0 : doc.code.replaceAll(".", "_")));
24688
24974
  }
24689
24975
  }
24690
- if (missingDocs.length > 0) {
24976
+ if ((missingDocs === null || missingDocs === void 0 ? void 0 : missingDocs.length) > 0) {
24691
24977
  errors.missingRequired = "PTR_MISSING_REQUIRED_DOCUMENTS";
24692
24978
  errors.missingDocs = missingDocs;
24693
24979
  }
@@ -24723,10 +25009,11 @@ const ADSSelectProofIdentity = ({
24723
25009
  }
24724
25010
  }, [documents, config.key]);
24725
25011
  const handleSubmit = () => {
24726
- if (Object.keys(formErrors).length > 0) {
24727
- setToastError(t(formErrors.missingRequired || "PTR_VALIDATION_ERROR"));
25012
+ var _Object$keys;
25013
+ if (((_Object$keys = Object.keys(formErrors)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) {
25014
+ setToastError(t((formErrors === null || formErrors === void 0 ? void 0 : formErrors.missingRequired) || "PTR_VALIDATION_ERROR"));
24728
25015
  onSelect(config.key, {
24729
- missingDocs: formErrors.missingDocs || []
25016
+ missingDocs: (formErrors === null || formErrors === void 0 ? void 0 : formErrors.missingDocs) || []
24730
25017
  });
24731
25018
  return;
24732
25019
  }
@@ -24743,8 +25030,8 @@ const ADSSelectProofIdentity = ({
24743
25030
  onSelect: handleSubmit,
24744
25031
  onSkip: onSkip,
24745
25032
  isDisabled: Object.keys(formErrors).length > 0
24746
- }, Array.isArray(mdmsDocsData) && mdmsDocsData.map((mdmsDoc, index) => {
24747
- const existing = documents.find(d => d.documentType === mdmsDoc.code);
25033
+ }, Array.isArray(mdmsDocsData) && (mdmsDocsData === null || mdmsDocsData === void 0 ? void 0 : mdmsDocsData.map((mdmsDoc, index) => {
25034
+ const existing = documents === null || documents === void 0 ? void 0 : documents.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === (mdmsDoc === null || mdmsDoc === void 0 ? void 0 : mdmsDoc.code));
24748
25035
  return /*#__PURE__*/React.createElement(ADSSelectDocument$1, {
24749
25036
  key: index,
24750
25037
  document: {
@@ -24760,7 +25047,7 @@ const ADSSelectProofIdentity = ({
24760
25047
  setFormErrors: setFormErrors,
24761
25048
  formErrors: formErrors
24762
25049
  });
24763
- }), toastError && /*#__PURE__*/React.createElement(Toast, {
25050
+ })), toastError && /*#__PURE__*/React.createElement(Toast, {
24764
25051
  isDleteBtn: true,
24765
25052
  label: toastError,
24766
25053
  onClose: () => setToastError(null),
@@ -24821,7 +25108,7 @@ function ADSSelectDocument$1({
24821
25108
  }
24822
25109
  }, [file]);
24823
25110
  const updateParentDocs = fileId => {
24824
- const updatedDocs = [...documents.filter(d => d.documentType !== (doc === null || doc === void 0 ? void 0 : doc.code)), ...(fileId ? [{
25111
+ const updatedDocs = [...(documents === null || documents === void 0 ? void 0 : documents.filter(d => (d === null || d === void 0 ? void 0 : d.documentType) !== (doc === null || doc === void 0 ? void 0 : doc.code))), ...(fileId ? [{
24825
25112
  documentType: doc === null || doc === void 0 ? void 0 : doc.code,
24826
25113
  fileStoreId: fileId,
24827
25114
  documentUid: fileId
@@ -24838,17 +25125,17 @@ function ADSSelectDocument$1({
24838
25125
  marginTop: "4px",
24839
25126
  marginBottom: "10px"
24840
25127
  };
24841
- console.log("doc", doc);
24842
25128
  return /*#__PURE__*/React.createElement("div", {
24843
25129
  style: {
24844
25130
  marginBottom: "24px"
24845
25131
  }
24846
25132
  }, loading && /*#__PURE__*/React.createElement(Loader$1, null), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
24847
25133
  className: "card-label-smaller"
24848
- }, t(doc === null || doc === void 0 ? void 0 : doc.code.replaceAll(".", "_")) + (doc !== null && doc !== void 0 && doc.required ? " *" : ""))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
24849
- className: "card-label-smaller"
24850
- }), /*#__PURE__*/React.createElement("div", {
24851
- className: "field"
25134
+ }, t(doc === null || doc === void 0 ? void 0 : doc.code.replaceAll(".", "_")) + (doc !== null && doc !== void 0 && doc.required ? " *" : ""))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", {
25135
+ className: "field",
25136
+ style: {
25137
+ width: "100%"
25138
+ }
24852
25139
  }, /*#__PURE__*/React.createElement(UploadFile, {
24853
25140
  onUpload: selectfile,
24854
25141
  onDelete: () => {
@@ -24871,94 +25158,10 @@ function ADSSelectDocument$1({
24871
25158
  }, fieldError))));
24872
25159
  }
24873
25160
 
24874
- const ADSCartDetails$1 = ({
24875
- cartDetails,
24876
- t
24877
- }) => {
24878
- const [expanded, setExpanded] = useState(() => cartDetails.map(item => item.ad.id));
24879
- const toggleExpand = adId => {
24880
- setExpanded(prev => prev.includes(adId) ? prev.filter(id => id !== adId) : [...prev, adId]);
24881
- };
24882
- const makeColumns = () => [{
24883
- Header: t("ADS_DATE"),
24884
- accessor: "bookingDate"
24885
- }, {
24886
- Header: t("ADS_LOCATION"),
24887
- accessor: "location"
24888
- }, {
24889
- Header: t("ADS_FACE_AREA"),
24890
- accessor: "faceArea"
24891
- }, {
24892
- Header: t("ADS_TYPE"),
24893
- accessor: "addType"
24894
- }, {
24895
- Header: t("ADS_NIGHT_LIGHT"),
24896
- accessor: row => row.nightLight ? t("ADS_YES") : t("ADS_NO")
24897
- }];
24898
- return /*#__PURE__*/React.createElement("div", {
24899
- style: {
24900
- marginTop: "1rem"
24901
- }
24902
- }, cartDetails.length === 0 ? /*#__PURE__*/React.createElement("p", {
24903
- style: {
24904
- padding: "12px",
24905
- color: "#666"
24906
- }
24907
- }, t("ADS_NO_ADVERTISMENT_DETAILS")) : cartDetails.map((item, idx) => {
24908
- var _item$slots;
24909
- const isOpen = expanded.includes(item.ad.id);
24910
- return /*#__PURE__*/React.createElement("div", {
24911
- key: idx,
24912
- style: {
24913
- marginBottom: "16px",
24914
- border: "1px solid #ddd",
24915
- borderRadius: "8px",
24916
- overflow: "hidden"
24917
- }
24918
- }, /*#__PURE__*/React.createElement("div", {
24919
- onClick: () => toggleExpand(item.ad.id),
24920
- style: {
24921
- background: "#f9f9f9",
24922
- padding: "10px 14px",
24923
- fontWeight: 600,
24924
- fontSize: "14px",
24925
- borderBottom: "1px solid #ddd",
24926
- cursor: "pointer",
24927
- display: "flex",
24928
- justifyContent: "space-between",
24929
- alignItems: "center"
24930
- }
24931
- }, /*#__PURE__*/React.createElement("span", null, item.ad.name, " \u2014 \u20B9", item.ad.amount * (item === null || item === void 0 ? void 0 : (_item$slots = item.slots) === null || _item$slots === void 0 ? void 0 : _item$slots.length)), /*#__PURE__*/React.createElement("span", {
24932
- style: {
24933
- fontSize: "18px"
24934
- }
24935
- }, isOpen ? "▾" : "▸")), isOpen && /*#__PURE__*/React.createElement("div", {
24936
- style: {
24937
- overflowX: "auto"
24938
- }
24939
- }, /*#__PURE__*/React.createElement(Table, {
24940
- t: t,
24941
- data: item.slots,
24942
- columns: makeColumns(),
24943
- disableSort: true,
24944
- isPaginationRequired: false,
24945
- getCellProps: cell => ({
24946
- style: {
24947
- padding: "12px 14px",
24948
- fontSize: "14px",
24949
- borderBottom: "1px solid #f0f0f0",
24950
- textAlign: "left",
24951
- whiteSpace: "nowrap"
24952
- }
24953
- })
24954
- })));
24955
- }));
24956
- };
24957
-
24958
25161
  function ADSSummary({
24959
25162
  t
24960
25163
  }) {
24961
- var _formData$CreatedResp, _formData$ownerDetail, _formData$CreatedResp2, _formData$documents, _formData$documents$d, _formData$documents2;
25164
+ var _formData$CreatedResp, _formData$ownerDetail, _formData$CreatedResp2, _formData$documents, _formData$documents$d, _formData$documents2, _formData$documents2$, _formData$documents3;
24962
25165
  const dispatch = useDispatch();
24963
25166
  const TT = key => t ? t(key) : key;
24964
25167
  const rawFormData = useSelector(state => {
@@ -24968,7 +25171,7 @@ function ADSSummary({
24968
25171
  const formData = React.useMemo(() => rawFormData || {}, [rawFormData]);
24969
25172
  const applicant = (formData === null || formData === void 0 ? void 0 : (_formData$CreatedResp = formData.CreatedResponse) === null || _formData$CreatedResp === void 0 ? void 0 : _formData$CreatedResp.applicantDetail) || {};
24970
25173
  const address = (formData === null || formData === void 0 ? void 0 : (_formData$ownerDetail = formData.ownerDetails) === null || _formData$ownerDetail === void 0 ? void 0 : _formData$ownerDetail.address) || (formData === null || formData === void 0 ? void 0 : (_formData$CreatedResp2 = formData.CreatedResponse) === null || _formData$CreatedResp2 === void 0 ? void 0 : _formData$CreatedResp2.address) || {};
24971
- const docs = Array.isArray(formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : (_formData$documents$d = _formData$documents.documents) === null || _formData$documents$d === void 0 ? void 0 : _formData$documents$d.documents) ? formData.documents.documents.documents : Array.isArray((_formData$documents2 = formData.documents) === null || _formData$documents2 === void 0 ? void 0 : _formData$documents2.documents) ? formData.documents.documents : Array.isArray(formData.documents) ? formData.documents : [];
25174
+ const docs = Array.isArray(formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : (_formData$documents$d = _formData$documents.documents) === null || _formData$documents$d === void 0 ? void 0 : _formData$documents$d.documents) ? formData === null || formData === void 0 ? void 0 : (_formData$documents2 = formData.documents) === null || _formData$documents2 === void 0 ? void 0 : (_formData$documents2$ = _formData$documents2.documents) === null || _formData$documents2$ === void 0 ? void 0 : _formData$documents2$.documents : Array.isArray((_formData$documents3 = formData.documents) === null || _formData$documents3 === void 0 ? void 0 : _formData$documents3.documents) ? formData.documents.documents : Array.isArray(formData.documents) ? formData.documents : [];
24972
25175
  const sectionStyle = {
24973
25176
  backgroundColor: "#ffffff",
24974
25177
  padding: "1rem 0",
@@ -25057,7 +25260,7 @@ function ADSSummary({
25057
25260
  }, TT("ADS_APPLICANT_DETAILS")), /*#__PURE__*/React.createElement("span", {
25058
25261
  style: editLabelStyle,
25059
25262
  onClick: () => dispatch(SET_ADSNewApplication_STEP(2))
25060
- }, TT("TL_SUMMARY_EDIT"))), renderRow(TT("ES_NEW_APPLICATION_APPLICANT_NAME"), applicant === null || applicant === void 0 ? void 0 : applicant.applicantName), renderRow(TT("MOBILE"), applicant === null || applicant === void 0 ? void 0 : applicant.applicantMobileNo), renderRow(TT("ADS_EMAIL_ID"), applicant === null || applicant === void 0 ? void 0 : applicant.applicantEmailId), renderRow(TT("CORE_COMMON_PINCODE"), address === null || address === void 0 ? void 0 : address.pincode), renderRow(TT("ES_CREATECOMPLAINT_ADDRESS"), address === null || address === void 0 ? void 0 : address.addressLine1))), /*#__PURE__*/React.createElement(Card$1, {
25263
+ }, TT("TL_SUMMARY_EDIT"))), renderRow(TT("NOC_APPLICANT_NAME_LABEL"), applicant === null || applicant === void 0 ? void 0 : applicant.applicantName), renderRow(TT("CORE_Mobile_Number"), applicant === null || applicant === void 0 ? void 0 : applicant.applicantMobileNo), renderRow(TT("CORE_EMAIL_ID"), applicant === null || applicant === void 0 ? void 0 : applicant.applicantEmailId), renderRow(TT("CORE_COMMON_PINCODE"), address === null || address === void 0 ? void 0 : address.pincode), renderRow(TT("ES_CREATECOMPLAINT_ADDRESS"), address === null || address === void 0 ? void 0 : address.addressLine1))), /*#__PURE__*/React.createElement(Card$1, {
25061
25264
  className: "summary-section"
25062
25265
  }, /*#__PURE__*/React.createElement("div", {
25063
25266
  style: sectionStyle
@@ -25087,11 +25290,11 @@ function ADSSummary({
25087
25290
  }, docs.map((doc, idx) => /*#__PURE__*/React.createElement("div", {
25088
25291
  key: idx,
25089
25292
  style: documentCardStyle
25090
- }, TT(doc === null || doc === void 0 ? void 0 : doc.documentType), /*#__PURE__*/React.createElement(ADSDocument, {
25293
+ }, /*#__PURE__*/React.createElement(ADSDocument, {
25091
25294
  value: docs,
25092
25295
  Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
25093
25296
  index: idx
25094
- })))) : /*#__PURE__*/React.createElement("div", {
25297
+ }), TT(doc === null || doc === void 0 ? void 0 : doc.documentType)))) : /*#__PURE__*/React.createElement("div", {
25095
25298
  style: {
25096
25299
  padding: "0 1.5rem"
25097
25300
  }