kupos-ui-components-lib 9.1.1 → 9.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README copy.md +223 -67
  2. package/dist/assets/images/anims/service_list/directo.json +1 -1
  3. package/dist/components/ServiceItem/PeruServiceItemDesktop.js +1 -1
  4. package/dist/components/ServiceItem/RatingHover.js +32 -33
  5. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  6. package/dist/components/ServiceItem/ServiceItemDesktop.js +147 -267
  7. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  8. package/dist/components/ServiceItem/ServiceItemMobile.js +87 -278
  9. package/dist/components/ServiceItem/mobileTypes.d.ts +5 -0
  10. package/dist/components/ServiceItem/types.d.ts +7 -0
  11. package/dist/styles.css +131 -32
  12. package/dist/ui/AmenitiesBlock.js +23 -30
  13. package/dist/ui/BottomAmenities/BottomAmenities.js +0 -1
  14. package/dist/ui/DurationBlock.js +4 -4
  15. package/dist/ui/FlexibleBlock.js +5 -6
  16. package/dist/ui/PetBlock.js +1 -3
  17. package/dist/ui/RatingBlock.d.ts +9 -1
  18. package/dist/ui/RatingBlock.js +7 -3
  19. package/dist/utils/CommonService.d.ts +1 -1
  20. package/dist/utils/CommonService.js +2 -0
  21. package/package.json +2 -1
  22. package/src/assets/images/anims/service_list/bomb.json +1 -0
  23. package/src/assets/images/anims/service_list/directo.json +1 -1
  24. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +1 -0
  25. package/src/components/ServiceItem/RatingHover.tsx +44 -45
  26. package/src/components/ServiceItem/ServiceItemDesktop.tsx +313 -537
  27. package/src/components/ServiceItem/ServiceItemMobile.tsx +213 -530
  28. package/src/components/ServiceItem/mobileTypes.ts +5 -0
  29. package/src/components/ServiceItem/types.ts +7 -0
  30. package/src/ui/AmenitiesBlock.tsx +50 -29
  31. package/src/ui/BottomAmenities/BottomAmenities.tsx +110 -0
  32. package/src/ui/DateTimeSection/DateTimeSection.tsx +207 -0
  33. package/src/ui/DirectoBlock.tsx +31 -0
  34. package/src/ui/DurationBlock.tsx +4 -4
  35. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +103 -0
  36. package/src/ui/FlexibleBlock.tsx +6 -5
  37. package/src/ui/KuposButton/KuposButton.tsx +48 -0
  38. package/src/ui/PetBlock.tsx +2 -2
  39. package/src/ui/RatingBlock.tsx +18 -6
  40. package/src/ui/SeatSection/SeatSection.tsx +207 -0
  41. package/src/ui/TopAmenities/TopAmenities.tsx +127 -0
  42. package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +169 -0
  43. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +192 -0
  44. package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +56 -0
  45. package/src/ui/mobileweb/SeatSectionMobile.tsx +256 -0
  46. package/src/ui/mobileweb/TopAmenitieMobile.tsx +126 -0
  47. package/src/utils/CommonService.ts +2 -0
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
2
  import LottiePlayer from "../../assets/LottiePlayer";
3
- import DateService from "../../utils/DateService";
4
3
  import commonService from "../../utils/CommonService";
4
+ import BottomAmenitiesMobile from "../../ui/mobileweb/BottomAmenitiesMobile";
5
+ import DateTimeSectionMobile from "../../ui/mobileweb/DateTimeSectionMobile";
6
+ import ExpandedDropdownMobile from "../../ui/mobileweb/ExpandedDropdownMobile";
5
7
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
6
8
  const exceptions = [
7
9
  "gy",
@@ -14,10 +16,37 @@ const exceptions = [
14
16
  "blanco",
15
17
  "asiento_mascota",
16
18
  ];
17
- function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, }) {
19
+ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, }) {
18
20
  var _a, _b, _c;
21
+ const isItemExpanded = serviceItem.id === isExpanded;
19
22
  const isPetSeat = (Object.keys(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.pet_seat_info) || []).length > 0;
20
23
  let isSoldOut = serviceItem.available_seats <= 0;
24
+ const showPromo = Math.random() > 0.5;
25
+ const countdownSeconds = 7830;
26
+ const startCountdown = (node) => {
27
+ if (!node)
28
+ return;
29
+ const prevId = node.dataset.countdownId;
30
+ if (prevId)
31
+ clearInterval(Number(prevId));
32
+ let remaining = countdownSeconds;
33
+ const formatTime = (totalSecs) => {
34
+ const h = Math.floor(totalSecs / 3600);
35
+ const m = Math.floor((totalSecs % 3600) / 60);
36
+ const s = totalSecs % 60;
37
+ return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
38
+ };
39
+ node.textContent = formatTime(remaining);
40
+ const id = setInterval(() => {
41
+ remaining -= 1;
42
+ if (remaining <= 0) {
43
+ remaining = 0;
44
+ clearInterval(id);
45
+ }
46
+ node.textContent = formatTime(remaining);
47
+ }, 1000);
48
+ node.dataset.countdownId = String(id);
49
+ };
21
50
  const labelId = typeof serviceItem.boarding_stages === "string"
22
51
  ? serviceItem.boarding_stages.split("|")[0]
23
52
  : "";
@@ -35,146 +64,6 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
35
64
  return "";
36
65
  }
37
66
  };
38
- const seatTypes = () => {
39
- var _a, _b, _c, _d;
40
- let seatTypes = (_d = (_c = (_b = (_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.filter((item) => getFilteredSeats(item.label))) === null || _b === void 0 ? void 0 : _b.sort((a, b) => a.fare - b.fare) // Add this line to sort by fare
41
- ) === null || _c === void 0 ? void 0 : _c.slice(0, 2)) === null || _d === void 0 ? void 0 : _d.map((type, i) => {
42
- var _a;
43
- return exceptions.includes(type.label) ? null : (React.createElement("div", { className: ((_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length) > 2
44
- ? "w-[100%] flex flex-row justify-between "
45
- : "w-[100%] flex flex-row justify-between items-center", key: i },
46
- React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] ", style: {
47
- // marginLeft: "10px",
48
- color: isSoldOut ? "#bbb" : "#464647",
49
- } }, type.label),
50
- React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text", style: { color: isSoldOut ? "#bbb" : colors.seatPriceColor } }, commonService.currency(type.fare, currencySign))));
51
- });
52
- return seatTypes;
53
- };
54
- const seatTypesWithRemoveDuplicateSeats = () => {
55
- var _a, _b;
56
- const seatMap = new Map();
57
- (_b = (_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.filter((item) => getFilteredSeats(item.label))) === null || _b === void 0 ? void 0 : _b.forEach((item) => {
58
- if (exceptions.includes(item.key))
59
- return;
60
- const existing = seatMap.get(item.label);
61
- if (!existing ||
62
- parseFloat(item.fare) < parseFloat(existing.fare)) {
63
- seatMap.set(item.label, item);
64
- }
65
- });
66
- const uniqueSeats = Array.from(seatMap.values())
67
- .sort((a, b) => a.fare - b.fare)
68
- .slice(0, 3);
69
- return uniqueSeats.map((type, i) => {
70
- var _a;
71
- return exceptions.includes(type.label) ? null : (React.createElement("div", { className: ((_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length) > 2
72
- ? "w-[100%] flex flex-row justify-between "
73
- : "w-[100%] flex flex-row justify-between items-center", key: i },
74
- React.createElement("span", { className: "min-[420]:text-[13px] text-[11px] ", style: {
75
- // marginLeft: "10px",
76
- color: isSoldOut ? "#bbb" : "#464647",
77
- } }, commonService.truncateSeatLabel(type.label)),
78
- React.createElement("span", { className: "min-[420]:text-[13px] text-[11px] bold-text", style: { color: isSoldOut ? "#bbb" : colors.seatPriceColor } }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0 && !isPeru
79
- ? commonService.currency(0, currencySign)
80
- : commonService.currency(type.fare, currencySign))));
81
- });
82
- };
83
- const getFilteredSeats = (item) => {
84
- return item;
85
- };
86
- const getAmenitiesImage = (name) => {
87
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
88
- switch (name) {
89
- case "air_condtion.png": {
90
- return (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.airConditionIcon;
91
- }
92
- case "baggage.png": {
93
- return (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.baggageIcon;
94
- }
95
- case "charging_plug.png": {
96
- return (_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _c === void 0 ? void 0 : _c.chargingIcon;
97
- }
98
- case "coffee.png": {
99
- return (_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _d === void 0 ? void 0 : _d.coffeeIcon;
100
- }
101
- case "food_new_icon.png": {
102
- return (_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _e === void 0 ? void 0 : _e.foodIcon;
103
- }
104
- case "gaming.png": {
105
- return (_f = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _f === void 0 ? void 0 : _f.gamingIcon;
106
- }
107
- case "handicap.png": {
108
- return (_g = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _g === void 0 ? void 0 : _g.handicapIcon;
109
- }
110
- case "mobile_ticket.png": {
111
- return (_h = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _h === void 0 ? void 0 : _h.mobileTicketIcon;
112
- }
113
- case "movie.png": {
114
- return (_j = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _j === void 0 ? void 0 : _j.movieIcon;
115
- }
116
- case "restrooms.png": {
117
- return (_k = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _k === void 0 ? void 0 : _k.restroomsIcon;
118
- }
119
- case "snacks_new.png": {
120
- return (_l = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _l === void 0 ? void 0 : _l.snackIcon;
121
- }
122
- case "wifi.png": {
123
- return (_m = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _m === void 0 ? void 0 : _m.wifiIcon;
124
- }
125
- case "cortina_divisoria.png": {
126
- return (_o = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _o === void 0 ? void 0 : _o.cortinaIcon;
127
- }
128
- case "frazada.png": {
129
- return (_p = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _p === void 0 ? void 0 : _p.frazaIcon;
130
- }
131
- case "blanket.png": {
132
- return (_q = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _q === void 0 ? void 0 : _q.blankketIcon;
133
- }
134
- case "cctv.png": {
135
- return (_r = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _r === void 0 ? void 0 : _r.cctvIcon;
136
- }
137
- case "cup_holder.png": {
138
- return (_s = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _s === void 0 ? void 0 : _s.cupHolderIcon;
139
- }
140
- case "emergency_contact.png": {
141
- return (_t = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _t === void 0 ? void 0 : _t.emergencyContactIcon;
142
- }
143
- case "emergency_exit.png": {
144
- return (_u = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _u === void 0 ? void 0 : _u.emergencyExitIcon;
145
- }
146
- case "fire_extinguisher.png": {
147
- return (_v = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _v === void 0 ? void 0 : _v.fireExtinguisherIcon;
148
- }
149
- case "reading_light.png": {
150
- return (_w = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _w === void 0 ? void 0 : _w.readingLIghtIcon;
151
- }
152
- case "seat_belt.png": {
153
- return (_x = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _x === void 0 ? void 0 : _x.sercurityBeltIcon;
154
- }
155
- case "service_on_board.png": {
156
- return (_y = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _y === void 0 ? void 0 : _y.serviceOnBoardIcon;
157
- }
158
- case "personal_tv.png": {
159
- return (_z = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _z === void 0 ? void 0 : _z.personalTVIcon;
160
- }
161
- case "pet_admission.png": {
162
- return (_0 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _0 === void 0 ? void 0 : _0.petAdmissionIcon;
163
- }
164
- case "music.png": {
165
- return (_1 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _1 === void 0 ? void 0 : _1.musicIcon;
166
- }
167
- case "headset.png": {
168
- return (_2 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _2 === void 0 ? void 0 : _2.headPhoneIcon;
169
- }
170
- case "allows_cancellation.png": {
171
- return (_3 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _3 === void 0 ? void 0 : _3.allowCancellationIcon;
172
- }
173
- default: {
174
- return "";
175
- }
176
- }
177
- };
178
67
  const amenities = () => {
179
68
  var _a;
180
69
  const raw = (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[3];
@@ -185,7 +74,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
185
74
  : [];
186
75
  const nodes = list.slice(0, 2).map((am, i) => {
187
76
  var _a;
188
- return (React.createElement("img", { key: i, className: "amenity", height: 14, width: 14,
77
+ return (React.createElement("img", { key: i, className: "amenity", height: 12, width: 12,
189
78
  // src={getAmenitiesImage(amenitiesData?.[am]?.toLowerCase())}
190
79
  src: commonService.getAmenitiesImage((_a = amenitiesData === null || amenitiesData === void 0 ? void 0 : amenitiesData[am]) === null || _a === void 0 ? void 0 : _a.toLowerCase(), serviceItem), alt: "icon" }));
191
80
  });
@@ -205,140 +94,46 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
205
94
  if (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo) {
206
95
  isConexion = true;
207
96
  }
208
- const depTime = serviceItem.dep_time || "";
209
- // Extract hours and minutes and check for AM/PM
210
- const hasAM = depTime.includes("AM");
211
- const hasPM = depTime.includes("PM");
212
- const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
213
- const [hour, minute] = timePart.split(":").map(Number);
214
- // Convert to 24-hour format
215
- let cleanedDepTime;
216
- if (hasAM) {
217
- cleanedDepTime =
218
- hour === 12
219
- ? `00:${minute < 10 ? "0" + minute : minute}`
220
- : `${hour < 10 ? "0" + hour : hour}:${minute < 10 ? "0" + minute : minute}`;
221
- }
222
- else if (hasPM) {
223
- cleanedDepTime =
224
- hour === 12
225
- ? `${hour}:${minute < 10 ? "0" + minute : minute}`
226
- : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
227
- }
228
- else {
229
- cleanedDepTime = timePart;
230
- }
231
97
  return (React.createElement("div", { className: `relative ${serviceItem.offer_text ? "mb-[55px]" : "mb-[14px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
232
98
  isConexion ||
233
99
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
234
100
  showTopLabel
235
101
  ? "mt-[20px]"
236
102
  : "mt-[10px]"} `, style: { backgroundColor: "#fff", zIndex: 1 } },
237
- React.createElement("div", { className: "border border-[#E6E6E6] rounded-[20px]", style: { backgroundColor: "#fff", zIndex: 1 } },
238
- React.createElement("div", { className: `p-[12px] ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
239
- showTopLabel ||
240
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
241
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo)
242
- ? "mt-[10px]"
243
- : ""}` },
244
- React.createElement("div", { className: "flex justify-between mb-[8px]" },
245
- React.createElement("div", { className: "flex items-center w-[50%] justify-between" },
103
+ React.createElement("div", { className: " rounded-[20px]", style: {
104
+ backgroundColor: "#fff",
105
+ zIndex: 1,
106
+ // borderRadius: showTopLabel ? "10px 0 10px 10px" : "10px",
107
+ borderRadius: "12px",
108
+ border: "1px solid #ccc",
109
+ } },
110
+ React.createElement("div", { style: { padding: "12px 12px 8px 12px" } },
111
+ React.createElement("div", { className: "flex justify-between items-center mb-[10px]" },
112
+ React.createElement("div", { className: "flex items-center justify-between" },
246
113
  React.createElement("div", { className: "w-[120px] overflow-y-hidden" },
247
114
  React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: `w-[100px] h-auto object-contain ${isSoldOut ? "grayscale" : ""}` })),
248
- isCiva ? (React.createElement("div", { className: "black-text min-[420]:text-[12px] text-[12px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details[2])) : showRating ? (React.createElement("div", { className: "flex min-[420]:text-[13px] text-[12px] bold-text items-center" },
249
- React.createElement("img", { src: serviceItem.icons.rating, alt: "origin", className: `w-[12px] h-[12px] mr-[4px] object-contain ${isSoldOut ? "grayscale" : ""}` }),
250
- React.createElement("span", { style: { lineHeight: "normal" } }, getServiceStars(serviceItem)))) : null),
251
- showLastSeats ? (React.createElement("div", { className: "flex justify-end -mt-[5px] -mb-[5px] items-center pt-[5px] pb-[5px] text-center " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
252
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("span", { className: "text-[12px] text-[red] mt-1 flex justify-end pt-[5px] pb-[5px] pl-[15px] pr-[15px] rounded-[8px] ", style: {
253
- backgroundColor: colors.lastSeatBg,
254
- color: colors.lastSeatText,
255
- } }, "\u00A1 \u00DAltimos Asientos!")))) : null),
256
- React.createElement("div", { className: "flex justify-between gap-[5px] w-full", onClick: onBookButtonPress },
257
- React.createElement("div", { className: "min-h-[2.5rem] flex flex-col justify-between gap-[4px] w-[50%] ", style: { justifyContent: isCiva && "center" } },
258
- React.createElement("div", { className: `flex items-center min-[420]:text-[13px] text-[12px] justify-between ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
259
- React.createElement("div", { className: "flex items-center", style: { flex: 1 } },
260
- React.createElement("div", null,
261
- " ",
262
- orignLabel ? (React.createElement("div", { className: "w-[60px]" }, orignLabel)) : (React.createElement("div", { className: "w-[14px] h-auto mr-[5px]" },
263
- React.createElement("img", { src: (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.origin, alt: "origin", className: `w-[14px] h-auto mr-[5px] ${isSoldOut ? "grayscale" : ""}` })))),
264
- React.createElement("div", { className: "flex items-center relative capitalize justify-between ", style: { flex: 1 } },
265
- React.createElement("span", { className: "cursor-pointer black-text" }, DateService.getServiceItemDate(serviceItem.travel_date)),
266
- React.createElement("div", { className: "absolute left-[50%]" }, "\u2022"),
267
- React.createElement("div", { className: "font-[900] relative black-text" }, isLinatal ? (React.createElement("div", null,
268
- React.createElement("span", null,
269
- " ",
270
- cleanedDepTime,
271
- " ",
272
- React.createElement("span", null, hasPM ? "PM" : hasAM ? "AM" : "")),
273
- React.createElement("span", null, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dep_time.includes("AM")) ||
274
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dep_time.includes("PM"))
275
- ? null
276
- : DateService.ampmOnly(serviceItem.dep_time)))) : (DateService.formatTime(serviceItem.dep_time)))))),
277
- isCiva ? null : (React.createElement("div", { className: `flex items-center min-[420]:text-[13px] text-[12px] justify-between ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
278
- React.createElement("div", { className: "flex items-center", style: { flex: 1 } },
279
- React.createElement("div", null,
280
- " ",
281
- destinationLabel ? (React.createElement("div", { className: "w-[60px]" }, destinationLabel)) : (React.createElement("div", { className: "w-[14px] h-auto mr-[5px]" },
282
- React.createElement("img", { src: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.destination, alt: "destination", className: `w-[14px] h-auto mr-[5px] ${isSoldOut ? "grayscale" : ""}` })))),
283
- React.createElement("div", { className: "flex items-center relative capitalize justify-between ", style: { flex: 1 } },
284
- React.createElement("span", { className: "cursor-pointer black-text" }, DateService.getServiceItemDate(serviceItem.arrival_date)),
285
- React.createElement("div", { className: "absolute left-[50%]" }, "\u2022"),
286
- React.createElement("div", { className: "font-[900] relative black-text" }, DateService.formatTime(serviceItem.arr_time))))))),
287
- React.createElement("div", { style: {
288
- width: "1px",
289
- height: "2.5rem",
290
- backgroundColor: "#ccc",
291
- margin: "auto",
292
- } }),
293
- React.createElement("div", { className: "content-center", style: {
294
- width: isPeru ? "40%" : "40%",
295
- } },
296
- React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem] ", style: {
297
- gap: isSoldOut ? "0px" : "5px",
298
- justifyContent: ((_c = serviceItem.seat_types) === null || _c === void 0 ? void 0 : _c.length) > 2
299
- ? "space-between"
300
- : "center",
301
- } },
302
- removeDuplicateSeats
303
- ? seatTypesWithRemoveDuplicateSeats()
304
- : seatTypes(),
305
- isSoldOut ? (React.createElement("div", { className: "flex justify-end" },
306
- React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] text-[#ccc]" }, "Agotado"))) : null))),
307
- React.createElement("div", { className: "bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]" }),
308
- React.createElement("div", { className: `${"flex justify-between items-center items-center "}` },
309
- React.createElement("div", null,
310
- React.createElement("div", { className: "flex items-center " },
311
- React.createElement("div", { className: "flex items-center cursor-pointer ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
312
- React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px] bold-text" }, serviceItem.operator_details[2])))),
313
- React.createElement("div", { className: "flex relative ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
314
- React.createElement("div", { className: `w-[12px] h-auto mr-[2px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("hours", "14px")),
315
- "\u00A0",
316
- React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } },
317
- serviceItem.duration,
318
- "hrs")),
319
- React.createElement("div", { style: { opacity: isSoldOut ? 0.5 : 1 } }, amenities()),
320
- (serviceItem.is_change_ticket || isPetSeat) && (React.createElement("div", { onClick: () => {
321
- setShowDropdown(!showDropdown);
322
- setAmenetiesAtomValue({
323
- service: serviceItem,
324
- showTopLabel: showTopLabel,
325
- });
326
- }, className: "flex items-center" },
327
- serviceItem.pet_seat_info &&
328
- Object.keys(serviceItem.pet_seat_info).length > 0 ? (React.createElement("div", { className: "flex items-center" },
329
- React.createElement("div", { className: `relative group cursor-default ` },
115
+ isCiva ? (React.createElement("div", { className: "black-text min-[420]:text-[12px] text-[12px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details[2])) : showRating ? (React.createElement("div", { className: "flex min-[420]:text-[13px] text-[12px] items-center" },
116
+ React.createElement("div", { className: "flex items-center" },
330
117
  React.createElement("div", { className: "flex items-center" },
331
- React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
332
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.petFriendlyAnim, width: "20px", height: "20px" })))))) : null,
333
- serviceItem.is_change_ticket && (React.createElement("div", { className: "flex items-center" },
334
- React.createElement("div", { className: "relative group cursor-default" },
335
- React.createElement("div", { className: "flex items-center" },
336
- React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
337
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.flexibleAnim, width: "20px", height: "20px" })))))),
338
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: "flex items-center mr-[10px]" },
339
- React.createElement("div", { className: `h-auto mr-[4px] min-[420]:text-[13px] text-[11px] text-[#464647] ${isSoldOut ? "grayscale" : ""}` },
340
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.locationAnim, width: "20px", height: "20px" })))),
341
- (serviceItem.is_change_ticket || isPetSeat) && (React.createElement("img", { src: serviceItem.icons.plus, alt: "icon", width: 11 })))))),
118
+ React.createElement("img", { src: serviceItem.icons.rating, alt: "origin", className: `w-[12px] h-[12px] mr-[4px] object-contain ${isSoldOut ? "grayscale" : ""}` }),
119
+ React.createElement("span", { style: { lineHeight: "normal" } }, getServiceStars(serviceItem))),
120
+ React.createElement("div", { className: "flex items-center cursor-pointer ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
121
+ React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis" }, serviceItem.operator_details[2]))))) : null),
122
+ showLastSeats ? (React.createElement("div", { className: "flex justify-end " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
123
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[10px] text-[#464647] text-center" }, "\u00A1 \u00DAltimos Asientos!")))) : null),
124
+ React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.origin, destinationIcon: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats }),
125
+ React.createElement("div", { className: "bg-[#E6E6E6] mt-[10px] mb-[10px] h-[1px]" }),
126
+ React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_c = serviceItem.duration) === null || _c === void 0 ? void 0 : _c.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: isItemExpanded, setShowDropdown: () => setIsExpanded(isItemExpanded ? null : serviceItem.id),
127
+ // onDropdownToggle={() => {
128
+ // setShowDropdown(!showDropdown);
129
+ // setAmenetiesAtomValue({
130
+ // service: serviceItem,
131
+ // showTopLabel: showTopLabel,
132
+ // });
133
+ // }}
134
+ onDropdownToggle: () => {
135
+ setIsExpanded(isItemExpanded ? null : serviceItem.id);
136
+ } })),
342
137
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) && (React.createElement("div", { className: ` text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[35px] pt-[50px] z-10 rounded-b-[14px] min-[420]:text-[14px] text-[12px]`, style: {
343
138
  backgroundColor: isSoldOut ? "#ccc" : colors === null || colors === void 0 ? void 0 : colors.bottomStripColor,
344
139
  zIndex: -1,
@@ -347,9 +142,19 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
347
142
  opacity: isSoldOut ? 0.5 : 1,
348
143
  } },
349
144
  React.createElement(LottiePlayer, { animationData: serviceItem.icons.promoAnim, width: "18px", height: "18px" }),
350
- React.createElement("span", { className: "ml-[10px] text-[#fff] min-[380px]:text-[11px] text-[10px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text))),
351
- React.createElement("div", { className: "absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[20px] z-10 " },
352
- showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
145
+ React.createElement("div", { className: " flex items-center mt-[2px]" },
146
+ React.createElement("span", { className: "ml-[6px] text-[#fff] min-[380px]:text-[11px] text-[6px]" },
147
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) || "",
148
+ "\u00A0"),
149
+ " ",
150
+ "| Termina en\u00A0",
151
+ React.createElement("span", { className: "bold-text", ref: startCountdown, style: {
152
+ fontVariantNumeric: "tabular-nums",
153
+ display: "inline-block",
154
+ // minWidth: "70px",
155
+ } })))),
156
+ React.createElement("div", { className: "absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[13px] z-10 " },
157
+ showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2px] py-[4px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
353
158
  backgroundColor: isSoldOut ? "#ccc" : colors.ratingBottomColor,
354
159
  } },
355
160
  React.createElement("div", { className: isSoldOut ? "grayscale" : "" },
@@ -360,16 +165,20 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
360
165
  } },
361
166
  renderIcon("airportIcon", "14px"),
362
167
  React.createElement("div", null, "Conexi\u00F3n"))),
363
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
364
- backgroundColor: isSoldOut ? "#ddd" : colors.tooltipBgColor,
365
- color: isSoldOut ? "#bbb" : colors.directoColor,
366
- } },
367
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "16px", height: "16px" }),
368
- React.createElement("div", { className: "ml-[5px]" }, "Directo"))),
369
168
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
370
169
  backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
371
170
  } },
372
171
  React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "20px", height: "20px" }),
373
- React.createElement("div", null, "Tren Express")))))));
172
+ React.createElement("div", null, "Tren Express"))))),
173
+ React.createElement("div", { style: {
174
+ display: "grid",
175
+ gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
176
+ opacity: isItemExpanded ? 1 : 0,
177
+ transition: "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
178
+ position: "relative",
179
+ zIndex: -1,
180
+ } },
181
+ React.createElement("div", { style: { overflow: "hidden", minHeight: 0, marginTop: "-10px" } },
182
+ React.createElement(ExpandedDropdownMobile, { serviceItem: serviceItem })))));
374
183
  }
375
184
  export default ServiceItemMobile;
@@ -110,6 +110,9 @@ export interface MobileServiceItemProps {
110
110
  seatFallBackIcon: string;
111
111
  headPhoneIcon?: string;
112
112
  allowCancellationIcon?: string;
113
+ bombAnim?: string;
114
+ whiteBoardingIcon?: string;
115
+ downArrow?: string;
113
116
  [key: string]: string | Record<string, string | undefined> | undefined;
114
117
  };
115
118
  useLottieFor?: string[];
@@ -118,6 +121,8 @@ export interface MobileServiceItemProps {
118
121
  terminals?: any[];
119
122
  showDropdown?: boolean;
120
123
  setShowDropdown?: (value: boolean) => void;
124
+ isExpanded?: string | null;
125
+ setIsExpanded?: (value: string | null) => void;
121
126
  setAmenetiesAtomValue?: (value: {
122
127
  service: MobileServiceItemProps["serviceItem"];
123
128
  showTopLabel: string | boolean;
@@ -115,6 +115,9 @@ export interface ServiceItemProps {
115
115
  seatFallBackIcon: string;
116
116
  headPhoneIcon?: string;
117
117
  allowCancellationIcon?: string;
118
+ whiteBoardingIcon?: string;
119
+ bombJson?: string;
120
+ downArrow?: string;
118
121
  [key: string]: string | Record<string, string | undefined> | undefined;
119
122
  };
120
123
  useLottieFor?: string[];
@@ -190,7 +193,11 @@ export interface ServiceItemProps {
190
193
  petFriendlyAnim?: string;
191
194
  priorityStageAnim?: string;
192
195
  promoAnim?: string;
196
+ bombAnimation?: string;
193
197
  isPeru?: boolean;
194
198
  siteType?: "kupos" | "pullman" | "opsites" | "linatal";
195
199
  isAllinBus?: boolean;
200
+ isExpand?: any;
201
+ setIsExpand?: (value: any) => void;
202
+ coachKey?: number;
196
203
  }