kupos-ui-components-lib 10.4.12 → 10.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "10.4.12",
3
+ "version": "10.4.13",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1 +0,0 @@
1
- {"nm":"Main Scene","h":100,"w":100,"meta":{"g":"@lottiefiles/creator@1.89.0"},"layers":[{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":150,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[37,9]},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100],"t":1},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[109,109],"t":48},{"s":[100,100],"t":89}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[50,50]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","nm":"Group 1","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.51,0.27],[0.31,0.46],[0.14,0.56],[0,0.59],[-0.31,0.79],[-0.58,0.44],[-0.83,0],[-0.49,-0.27],[-0.26,-0.44],[-0.05,-0.49],[0,0],[0.25,0.2],[0.39,0],[0.27,-0.23],[0.15,-0.45],[0.02,-0.66],[0,-0.02],[0,-0.01],[-0.24,0.18],[-0.3,0.1],[-0.32,0],[-0.47,-0.26],[-0.28,-0.49],[0,-0.65],[0.3,-0.51],[0.52,-0.3],[0.67,0]],"o":[[-0.75,0],[-0.51,-0.28],[-0.31,-0.46],[-0.13,-0.57],[0,-1.1],[0.31,-0.8],[0.59,-0.44],[0.71,0],[0.49,0.27],[0.26,0.44],[0,0],[-0.07,-0.37],[-0.24,-0.21],[-0.37,0],[-0.27,0.22],[-0.15,0.45],[0,0.01],[0,0.02],[0.14,-0.24],[0.24,-0.18],[0.3,-0.1],[0.54,0],[0.47,0.25],[0.29,0.48],[0,0.61],[-0.29,0.5],[-0.51,0.3],[0,0]],"v":[[10.74,14.17],[8.85,13.76],[7.61,12.66],[6.94,11.13],[6.75,9.39],[7.21,6.55],[8.54,4.69],[10.67,4.03],[12.46,4.44],[13.58,5.5],[14.04,6.9],[12.08,6.9],[11.6,6.05],[10.65,5.74],[9.69,6.09],[9.06,7.1],[8.8,8.76],[8.8,8.81],[8.8,8.85],[9.38,8.22],[10.19,7.8],[11.11,7.64],[12.63,8.04],[13.75,9.14],[14.18,10.84],[13.73,12.52],[12.51,13.72],[10.74,14.17]]}}},{"ty":"sh","nm":"Path 2","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.23,0.12],[-0.13,0.22],[0,0.28],[0.14,0.21],[0.24,0.12],[0.31,0],[0.23,-0.12],[0.14,-0.22],[0,-0.29],[-0.14,-0.23],[-0.23,-0.13],[-0.31,0]],"o":[[0.3,0],[0.23,-0.13],[0.14,-0.22],[0,-0.31],[-0.13,-0.22],[-0.23,-0.13],[-0.3,0],[-0.23,0.12],[-0.14,0.22],[0,0.29],[0.14,0.22],[0.24,0.12],[0,0]],"v":[[10.62,12.38],[11.42,12.19],[11.97,11.66],[12.18,10.91],[11.97,10.12],[11.41,9.6],[10.6,9.41],[9.8,9.59],[9.24,10.11],[9.03,10.88],[9.24,11.66],[9.8,12.19],[10.62,12.38]]}}},{"ty":"sh","nm":"Path 3","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.64,0.43],[0.35,0.76],[0,1],[-0.35,0.76],[-0.64,0.43],[-0.91,0],[-0.64,-0.43],[-0.35,-0.77],[0,-1],[0.35,-0.77],[0.64,-0.43],[0.91,0]],"o":[[-0.91,0],[-0.64,-0.43],[-0.35,-0.77],[0,-1],[0.35,-0.77],[0.64,-0.43],[0.91,0],[0.64,0.43],[0.35,0.76],[0,1],[-0.35,0.76],[-0.64,0.43],[0,0]],"v":[[19.93,14.17],[17.61,13.52],[16.11,11.75],[15.59,9.1],[16.11,6.47],[17.61,4.68],[19.93,4.03],[22.25,4.68],[23.74,6.47],[24.27,9.1],[23.74,11.75],[22.25,13.52],[19.93,14.17]]}}},{"ty":"sh","nm":"Path 4","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.33,0.26],[-0.18,0.47],[0,0.65],[0.19,0.47],[0.34,0.25],[0.44,0],[0.34,-0.26],[0.19,-0.48],[0,-0.65],[-0.18,-0.48],[-0.33,-0.26],[-0.44,0]],"o":[[0.44,0],[0.34,-0.26],[0.19,-0.48],[0,-0.65],[-0.18,-0.48],[-0.33,-0.26],[-0.44,0],[-0.33,0.25],[-0.18,0.47],[0,0.65],[0.19,0.47],[0.34,0.26],[0,0]],"v":[[19.93,12.28],[21.08,11.89],[21.85,10.79],[22.13,9.1],[21.85,7.42],[21.08,6.33],[19.93,5.94],[18.77,6.33],[18,7.42],[17.73,9.1],[18,10.79],[18.77,11.89],[19.93,12.28]]}}},{"ty":"sh","nm":"Path 5","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[27.69,14],[33.13,4.2],[35.18,4.2],[29.73,14],[27.69,14]]}}},{"ty":"sh","nm":"Path 6","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.38,0.21],[0.22,0.38],[0,0.52],[-0.22,0.37],[-0.37,0.21],[-0.46,0],[-0.37,-0.21],[-0.21,-0.38],[0,-0.54],[0.22,-0.38],[0.37,-0.21],[0.47,0]],"o":[[-0.47,0],[-0.37,-0.21],[-0.22,-0.38],[0,-0.54],[0.22,-0.38],[0.38,-0.21],[0.48,0],[0.37,0.21],[0.22,0.37],[0,0.52],[-0.22,0.38],[-0.36,0.21],[0,0]],"v":[[34.94,14.17],[33.66,13.86],[32.77,12.98],[32.43,11.62],[32.77,10.25],[33.66,9.37],[34.92,9.06],[36.2,9.37],[37.08,10.25],[37.42,11.62],[37.08,12.98],[36.18,13.86],[34.94,14.17]]}}},{"ty":"sh","nm":"Path 7","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.13,0.08],[-0.07,0.17],[0,0.24],[0.07,0.17],[0.13,0.08],[0.17,0],[0.13,-0.09],[0.07,-0.17],[0,-0.25],[-0.07,-0.17],[-0.13,-0.09],[-0.17,0]],"o":[[0.17,0],[0.13,-0.09],[0.07,-0.17],[0,-0.26],[-0.07,-0.17],[-0.13,-0.09],[-0.17,0],[-0.13,0.08],[-0.07,0.17],[0,0.25],[0.07,0.17],[0.13,0.08],[0,0]],"v":[[34.92,12.75],[35.37,12.63],[35.68,12.24],[35.79,11.62],[35.68,10.98],[35.37,10.6],[34.92,10.46],[34.48,10.6],[34.17,10.98],[34.06,11.61],[34.17,12.24],[34.48,12.63],[34.92,12.75]]}}},{"ty":"sh","nm":"Path 8","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.38,0.21],[0.22,0.38],[0,0.52],[-0.22,0.37],[-0.37,0.21],[-0.47,0],[-0.37,-0.21],[-0.21,-0.38],[0,-0.54],[0.22,-0.38],[0.37,-0.21],[0.47,0]],"o":[[-0.47,0],[-0.37,-0.21],[-0.22,-0.38],[0,-0.54],[0.22,-0.38],[0.38,-0.21],[0.47,0],[0.37,0.21],[0.22,0.37],[0,0.52],[-0.21,0.38],[-0.37,0.21],[0,0]],"v":[[27.99,9.14],[26.72,8.83],[25.82,7.95],[25.49,6.59],[25.82,5.22],[26.72,4.34],[27.99,4.03],[29.25,4.34],[30.14,5.22],[30.47,6.59],[30.14,7.95],[29.25,8.83],[27.99,9.14]]}}},{"ty":"sh","nm":"Path 9","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.13,0.08],[-0.07,0.17],[0,0.24],[0.07,0.17],[0.13,0.08],[0.17,0],[0.13,-0.09],[0.07,-0.17],[0,-0.26],[-0.07,-0.17],[-0.13,-0.09],[-0.17,0]],"o":[[0.17,0],[0.13,-0.09],[0.07,-0.17],[0,-0.26],[-0.07,-0.17],[-0.13,-0.09],[-0.17,0],[-0.13,0.08],[-0.07,0.17],[0,0.24],[0.07,0.17],[0.13,0.08],[0,0]],"v":[[27.98,7.73],[28.43,7.6],[28.74,7.21],[28.85,6.59],[28.74,5.95],[28.43,5.57],[27.98,5.43],[27.53,5.57],[27.22,5.95],[27.11,6.59],[27.22,7.21],[27.53,7.6],[27.98,7.73]]}}},{"ty":"sh","nm":"Path 10","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0.73,0.43],[0.42,0.76],[0,1],[-0.41,0.76],[-0.73,0.43],[-0.96,0],[-0.74,-0.43],[-0.4,-0.77],[0,-1],[0.41,-0.77],[0.74,-0.43],[0.96,0]],"o":[[-0.96,0],[-0.73,-0.43],[-0.41,-0.77],[0,-1],[0.42,-0.77],[0.73,-0.43],[0.96,0],[0.74,0.43],[0.41,0.76],[0,1],[-0.4,0.76],[-0.74,0.43],[0,0]],"v":[[46.66,14.17],[44.12,13.52],[42.4,11.75],[41.79,9.1],[42.4,6.47],[44.12,4.68],[46.66,4.03],[49.21,4.68],[50.91,6.47],[51.53,9.1],[50.91,11.75],[49.21,13.52],[46.66,14.17]]}}},{"ty":"sh","nm":"Path 11","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[-0.4,0.26],[-0.22,0.47],[0,0.65],[0.22,0.47],[0.41,0.25],[0.57,0],[0.41,-0.26],[0.22,-0.48],[0,-0.65],[-0.22,-0.48],[-0.41,-0.26],[-0.55,0]],"o":[[0.57,0],[0.41,-0.26],[0.22,-0.48],[0,-0.65],[-0.22,-0.48],[-0.4,-0.26],[-0.55,0],[-0.41,0.25],[-0.22,0.47],[0,0.65],[0.22,0.47],[0.41,0.26],[0,0]],"v":[[46.66,12.28],[48.11,11.89],[49.07,10.79],[49.4,9.1],[49.07,7.42],[48.11,6.33],[46.66,5.94],[45.22,6.33],[44.26,7.42],[43.93,9.1],[44.26,10.79],[45.22,11.89],[46.66,12.28]]}}},{"ty":"sh","nm":"Path 12","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[53.1,14],[53.1,4.2],[59.61,4.2],[59.61,5.89],[55.2,5.89],[55.2,8.27],[58.67,8.27],[58.67,9.91],[55.2,9.91],[55.2,14],[53.1,14]]}}},{"ty":"sh","nm":"Path 13","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[60.99,14],[60.99,4.2],[67.5,4.2],[67.5,5.89],[63.09,5.89],[63.09,8.27],[66.56,8.27],[66.56,9.91],[63.09,9.91],[63.09,14],[60.99,14]]}}},{"ty":"fl","nm":"Fill","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[37.094,9.075]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[37.094,9.075]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Group 2","it":[{"ty":"sh","nm":"Path 14","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,-3.53],[0,0],[3.53,0],[0,0],[0,3.53],[0,0],[-3.53,0]],"o":[[0,0],[3.53,0],[0,0],[0,3.53],[0,0],[-3.53,0],[0,0],[0,-3.53],[0,0]],"v":[[6.4,0],[67.6,0],[74,6.4],[74,11.6],[67.6,18],[6.4,18],[0,11.6],[0,6.4],[6.4,0]]}}},{"ty":"fl","nm":"Fill","c":{"a":0,"k":[1,0.361,0.38]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[37,9]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[37,9]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":1}],"v":"5.7.0","fr":30,"op":89,"ip":0,"assets":[]}
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { PaymentOptionsProps } from "./type";
3
- declare const PaymentOptionsDesktop: (props: PaymentOptionsProps) => React.JSX.Element;
4
- export default PaymentOptionsDesktop;
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- const PaymentOptionsDesktop = (props) => {
3
- return React.createElement("div", null, "PaymentOptionsDesktop");
4
- };
5
- export default PaymentOptionsDesktop;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { PaymentOptionsProps } from "./type";
3
- declare const PaymentOptionsMobile: (props: PaymentOptionsProps) => React.JSX.Element;
4
- export default PaymentOptionsMobile;
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- const PaymentOptionsMobile = (props) => {
3
- return React.createElement("div", null, "PaymentOptionsMobile");
4
- };
5
- export default PaymentOptionsMobile;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { PaymentOptionsProps } from "./type";
3
- export default function ResponsivePaymentOptions(props: PaymentOptionsProps): React.JSX.Element;
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import PaymentOptionsDesktop from "./PaymentOptionsDesktop";
3
- import PaymentOptionsMobile from "./PaymentOptionsMobile";
4
- export default function ResponsivePaymentOptions(props) {
5
- const { variant } = props;
6
- if (variant === "mobile") {
7
- return React.createElement(PaymentOptionsMobile, Object.assign({}, props));
8
- }
9
- return React.createElement(PaymentOptionsDesktop, Object.assign({}, props));
10
- }
@@ -1,5 +0,0 @@
1
- import PaymentOptionsDesktop from "./PaymentOptionsDesktop";
2
- import PaymentOptionsMobile from "./PaymentOptionsMobile";
3
- import ResponsivePaymentOptions from "./ResponsivePaymentOptions";
4
- export { PaymentOptionsDesktop, PaymentOptionsMobile, ResponsivePaymentOptions };
5
- export type { PaymentOptionsProps } from "./type";
@@ -1,4 +0,0 @@
1
- import PaymentOptionsDesktop from "./PaymentOptionsDesktop";
2
- import PaymentOptionsMobile from "./PaymentOptionsMobile";
3
- import ResponsivePaymentOptions from "./ResponsivePaymentOptions";
4
- export { PaymentOptionsDesktop, PaymentOptionsMobile, ResponsivePaymentOptions };
File without changes
File without changes
@@ -1,4 +0,0 @@
1
- export interface PaymentOptionsProps {
2
- typeOfComponent: "paymentoptions";
3
- variant?: "desktop" | "mobile" | "auto";
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- interface ExpandedDropdownProps {
3
- serviceItem: {
4
- pet_seat_info?: Record<string, any>;
5
- is_change_ticket?: boolean;
6
- is_tracking_enabled?: boolean;
7
- };
8
- showPromo: boolean;
9
- colors: {
10
- priceColor?: string;
11
- };
12
- grayscaleClass: string;
13
- translation?: {
14
- [key: string]: string;
15
- };
16
- getAnimationIcon: (icon: string) => any;
17
- }
18
- declare function ExpandedDropdown({ serviceItem, showPromo, colors, grayscaleClass, translation, getAnimationIcon, }: ExpandedDropdownProps): React.ReactElement;
19
- export default ExpandedDropdown;
@@ -1,28 +0,0 @@
1
- import React from "react";
2
- import LottiePlayer from "../../assets/LottiePlayer";
3
- function ExpandedDropdown({ serviceItem, showPromo, colors, grayscaleClass, translation, getAnimationIcon, }) {
4
- const hasPetInfo = serviceItem.pet_seat_info &&
5
- Object.keys(serviceItem.pet_seat_info).length > 0;
6
- return (React.createElement("div", { className: "px-[15px] pt-[26px] pb-[14px] -mt-[16px] pt-[20px] relative -z-9", style: {
7
- backgroundColor: "#f5f5f5",
8
- borderRadius: "0 0 10px 10px",
9
- border: showPromo
10
- ? `1px solid ${colors.priceColor}`
11
- : "1px solid #ccc",
12
- borderTop: "none",
13
- } },
14
- React.createElement("div", { className: "flex flex-col gap-[12px] text-[13px] text-[#464647]" },
15
- hasPetInfo && (React.createElement("div", { className: "flex items-center gap-[10px]" },
16
- React.createElement(LottiePlayer, { animationData: getAnimationIcon("petFriendlyAnim"), width: "20px", height: "20px" }),
17
- React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647] bold-text" },
18
- React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.petFriendly)))),
19
- serviceItem.is_change_ticket && (React.createElement("div", { className: "flex items-center gap-[10px]" },
20
- React.createElement(LottiePlayer, { animationData: getAnimationIcon("flexibleIcon"), width: "20px", height: "20px" }),
21
- React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647] bold-text" },
22
- React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.flexible)))),
23
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: `${grayscaleClass} flex items-center gap-[10px]` },
24
- React.createElement(LottiePlayer, { animationData: getAnimationIcon("locationAnim"), width: "20px", height: "20px" }),
25
- React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647] bold-text" },
26
- React.createElement("span", null, "GPS Tracker")))))));
27
- }
28
- export default ExpandedDropdown;
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import { ServiceItemProps } from "./types";
3
- declare function ServiceItemDesktopPeru({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, originIconStyle, showAvailableSeats, isSeatIcon, isTurbus, t, }: ServiceItemProps & {
4
- currencySign?: string;
5
- }): React.ReactElement;
6
- export default ServiceItemDesktopPeru;
@@ -1,612 +0,0 @@
1
- import React from "react";
2
- import DateService from "../../utils/DateService";
3
- import CommonService from "../../utils/CommonService";
4
- import RatingHover from "./RatingHover";
5
- import ModalEventManager from "../../utils/ModalEventManager";
6
- import InternationalServicePopupBody from "../InternationalServicePopupBody";
7
- import LottiePlayer from "../../assets/LottiePlayer";
8
- const SEAT_EXCEPTIONS = ["Asiento mascota"];
9
- function ServiceItemDesktopPeru({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, originIconStyle, showAvailableSeats, isSeatIcon, isTurbus, t = (key) => key, }) {
10
- var _a, _b, _c, _d, _e, _f, _g;
11
- console.log("🚀 ~ ServiceItemPB ~ isSeatIcon:", serviceItem);
12
- const SvgAmenities = ({ moreAnemities, name, color, }) => {
13
- var _a;
14
- const amenityKey = (_a = name === null || name === void 0 ? void 0 : name.toLowerCase()) === null || _a === void 0 ? void 0 : _a.replace(/\s/g, "_");
15
- const getIconPath = () => {
16
- const amenityFileName = `${amenityKey}.png`;
17
- const imagePath = getAmenitiesImage(amenityFileName);
18
- if (!imagePath) {
19
- return `/public/images/amenities/${amenityKey}.svg`;
20
- }
21
- return imagePath;
22
- };
23
- const iconPath = getIconPath();
24
- return (React.createElement("img", { src: iconPath, alt: name, style: {
25
- filter: color === "white" ? "brightness(0) invert(1)" : "",
26
- }, className: `object-contain ${moreAnemities ? "w-[16px] h-[16px]" : "w-[16px] h-[16px]"}` }));
27
- };
28
- const getAmenitiesImage = (name) => {
29
- 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;
30
- switch (name) {
31
- case "air_condtion.png": {
32
- return (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.airConditionIcon;
33
- }
34
- case "baggage.png": {
35
- return (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.baggageIcon;
36
- }
37
- case "charging_plug.png": {
38
- return (_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _c === void 0 ? void 0 : _c.chargingIcon;
39
- }
40
- case "coffee.png": {
41
- return (_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _d === void 0 ? void 0 : _d.coffeeIcon;
42
- }
43
- case "food_new_icon.png": {
44
- return (_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _e === void 0 ? void 0 : _e.foodIcon;
45
- }
46
- case "gaming.png": {
47
- return (_f = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _f === void 0 ? void 0 : _f.gamingIcon;
48
- }
49
- case "handicap.png": {
50
- return (_g = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _g === void 0 ? void 0 : _g.handicapIcon;
51
- }
52
- case "mobile_ticket.png": {
53
- return (_h = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _h === void 0 ? void 0 : _h.mobileTicketIcon;
54
- }
55
- case "movie.png": {
56
- return (_j = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _j === void 0 ? void 0 : _j.movieIcon;
57
- }
58
- case "restrooms.png": {
59
- return (_k = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _k === void 0 ? void 0 : _k.restroomsIcon;
60
- }
61
- case "snacks_new.png": {
62
- return (_l = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _l === void 0 ? void 0 : _l.snackIcon;
63
- }
64
- case "wifi.png": {
65
- return (_m = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _m === void 0 ? void 0 : _m.wifiIcon;
66
- }
67
- case "cortina_divisoria.png": {
68
- return (_o = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _o === void 0 ? void 0 : _o.cortinaIcon;
69
- }
70
- case "frazada.png": {
71
- return (_p = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _p === void 0 ? void 0 : _p.frazaIcon;
72
- }
73
- case "blanket.png": {
74
- return (_q = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _q === void 0 ? void 0 : _q.blankketIcon;
75
- }
76
- case "cctv.png": {
77
- return (_r = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _r === void 0 ? void 0 : _r.cctvIcon;
78
- }
79
- case "cup_holder.png": {
80
- return (_s = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _s === void 0 ? void 0 : _s.cupHolderIcon;
81
- }
82
- case "emergency_contact.png": {
83
- return (_t = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _t === void 0 ? void 0 : _t.emergencyContactIcon;
84
- }
85
- case "emergency_exit.png": {
86
- return (_u = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _u === void 0 ? void 0 : _u.emergencyExitIcon;
87
- }
88
- case "fire_extinguisher.png": {
89
- return (_v = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _v === void 0 ? void 0 : _v.fireExtinguisherIcon;
90
- }
91
- case "reading_light.png": {
92
- return (_w = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _w === void 0 ? void 0 : _w.readingLIghtIcon;
93
- }
94
- case "seat_belt.png": {
95
- return (_x = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _x === void 0 ? void 0 : _x.sercurityBeltIcon;
96
- }
97
- case "service_on_board.png": {
98
- return (_y = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _y === void 0 ? void 0 : _y.serviceOnBoardIcon;
99
- }
100
- case "personal_tv.png": {
101
- return (_z = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _z === void 0 ? void 0 : _z.personalTVIcon;
102
- }
103
- case "pet_admission.png": {
104
- return (_0 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _0 === void 0 ? void 0 : _0.petAdmissionIcon;
105
- }
106
- case "music.png": {
107
- return (_1 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _1 === void 0 ? void 0 : _1.musicIcon;
108
- }
109
- default: {
110
- return "";
111
- }
112
- }
113
- };
114
- const getAmenityName = (rawAmenity) => {
115
- switch (rawAmenity) {
116
- case "mobile ticket":
117
- return "Ticket móvil";
118
- case "charging plug":
119
- return "Cargador";
120
- case "wifi":
121
- return "WiFi";
122
- case "movie":
123
- return "Entretenimiento";
124
- case "baggage":
125
- return "Equipaje";
126
- case "Restrooms":
127
- return "Baños";
128
- case "air condtion":
129
- return "Aire acondicionado";
130
- case "snacks new":
131
- return "Snacks";
132
- case "coffee":
133
- return "Café";
134
- case "cortina divisoria":
135
- return "Cortina Divisoria";
136
- case "frazada":
137
- return "Frazada";
138
- case "blanket":
139
- return "Mantas";
140
- case "cctv":
141
- return "Cámara de seguridad";
142
- case "cup holder":
143
- return "Portavasos";
144
- case "emergency contact":
145
- return "Contacto de emergencia";
146
- case "emergency exit":
147
- return "Salida de emergencia";
148
- case "fire extinguisher":
149
- return "Extintor de incendio";
150
- case "reading light":
151
- return "Luz de lectura";
152
- case "seat belt":
153
- return "Cinturón de seguridad";
154
- case "service on board":
155
- return "Servicio a bordo";
156
- case "personal tv":
157
- return "TV personal";
158
- case "pet admission":
159
- return "Admisión de mascotas";
160
- case "music":
161
- return "Música";
162
- default:
163
- return rawAmenity;
164
- }
165
- };
166
- const labelId = typeof serviceItem.boarding_stages === "string"
167
- ? serviceItem.boarding_stages.split("|")[0]
168
- : "";
169
- const showTopLabel = "";
170
- // busStage &&
171
- // busStage[labelId] &&
172
- // busStage[labelId].split("|")[1] === "true" &&
173
- // busStage[labelId].split("|")[0];
174
- const showTopLabelTurbus = busStage && busStage[labelId] && busStage[labelId][1]
175
- ? busStage[labelId][0]
176
- : null;
177
- const hideBoardingTime = (serviceItemApiType) => {
178
- var _a;
179
- let exceptions = (_a = metaData === null || metaData === void 0 ? void 0 : metaData.sibus_stage_api_types) !== null && _a !== void 0 ? _a : [];
180
- let found = false;
181
- if (exceptions && exceptions.length) {
182
- found = exceptions.includes(serviceItemApiType);
183
- }
184
- return found;
185
- };
186
- const renderStages = (stageData, direction = 1, terminals = null, hideTime = false) => {
187
- if (typeof stageData === "string") {
188
- const arr = direction === 1 ? stageData.split(",") : stageData.split(",");
189
- const formattedStages = [];
190
- for (let i = 0; i < arr.length; i++) {
191
- let terminal = arr[i].split("||")[1];
192
- let locationName = terminals[arr[i].split("||")[0].split("|")[0]] || "";
193
- let time = arr[i].split("||")[0].split("|")[1];
194
- if (direction !== 1 && i > 0) {
195
- }
196
- else {
197
- formattedStages.push(`${locationName} ${time}`);
198
- }
199
- }
200
- const extractTiming = (location) => {
201
- const timingIndex = location.lastIndexOf(" ") + 1;
202
- return location.substring(timingIndex);
203
- };
204
- const compareTimings = (locationA, locationB) => {
205
- const timingA = extractTiming(locationA);
206
- const timingB = extractTiming(locationB);
207
- return timingA.localeCompare(timingB);
208
- };
209
- const sortedStages = hideTime
210
- ? [...formattedStages].sort()
211
- : [...formattedStages].sort(compareTimings);
212
- return (React.createElement("div", { className: "flex flex-col space-y-3 text-justify gap-[4px]" }, sortedStages.map((item, key) => (React.createElement("div", { key: key, className: "font-normal", style: { fontWeight: 400 } }, hideTime
213
- ? item === null || item === void 0 ? void 0 : item.split("|")[0]
214
- : item
215
- .replace(/false/g, "")
216
- .replace("true", "")
217
- .replace("|", " |")
218
- .replace("||", " |"))))));
219
- }
220
- return null;
221
- };
222
- let isSoldOut = serviceItem.available_seats <= 0;
223
- const renderIcon = (iconKey, size = "14px") => {
224
- var _a;
225
- const iconValue = (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a[iconKey];
226
- if (iconValue) {
227
- if (typeof iconValue === "string") {
228
- return (React.createElement("img", { src: iconValue, alt: iconKey, className: `${`w-[${size}] h-[${size}]`} mr-[5px]` }));
229
- }
230
- }
231
- return null;
232
- };
233
- const getAllSeatTypes = () => {
234
- var _a;
235
- if (!((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length)) {
236
- return [{ label: "Salon cama", price: 0 }];
237
- }
238
- let seatTypesWithPrices = serviceItem.seat_types
239
- .filter((item) => getFilteredSeats(item))
240
- .map((val) => ({
241
- label: val === null || val === void 0 ? void 0 : val.label,
242
- price: val === null || val === void 0 ? void 0 : val.fare,
243
- }));
244
- seatTypesWithPrices.sort((a, b) => a.price - b.price);
245
- return seatTypesWithPrices;
246
- };
247
- const getSortedSeatTypes = () => {
248
- var _a;
249
- if (!((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length)) {
250
- return [{ label: "Salon cama", price: 0 }];
251
- }
252
- let seatTypesWithPrices = getAllSeatTypes();
253
- const premiumIndex = seatTypesWithPrices.findIndex((item) => item.label === "Premium");
254
- if (premiumIndex >= 3) {
255
- seatTypesWithPrices[2] = seatTypesWithPrices[premiumIndex];
256
- }
257
- seatTypesWithPrices = seatTypesWithPrices.slice(0, 2);
258
- return seatTypesWithPrices;
259
- };
260
- const getUniqueSeats = () => {
261
- const allSeatTypes = getAllSeatTypes();
262
- const seatMap = new Map();
263
- allSeatTypes.forEach((seat) => {
264
- if (SEAT_EXCEPTIONS.includes(seat.label))
265
- return;
266
- // Only check if the label already exists in the map, don't compare prices
267
- if (!seatMap.has(seat.label)) {
268
- seatMap.set(seat.label, seat);
269
- }
270
- });
271
- return Array.from(seatMap.values());
272
- };
273
- const getNumberOfSeats = () => {
274
- return serviceItem.seat_types.filter((val) => !SEAT_EXCEPTIONS.includes(val.label)).length;
275
- };
276
- const getSeatTypeIcon = (seatLabel) => {
277
- var _a, _b, _c, _d;
278
- // Default icons
279
- if (seatLabel.includes("180°"))
280
- return (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.seat180Icon;
281
- if (seatLabel.includes("160°"))
282
- return (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.seat160Icon;
283
- if (seatLabel.includes("140°"))
284
- return (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.seat140Icon;
285
- return (_d = serviceItem.icons) === null || _d === void 0 ? void 0 : _d.seatFallBackIcon;
286
- };
287
- const getSeatNames = () => {
288
- const uniqueSeats = getUniqueSeats();
289
- const sortedSeatTypes = getSortedSeatTypes();
290
- if (removeDuplicateSeats) {
291
- return uniqueSeats.map((val, key) => SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: `flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
292
- isSeatIcon && (React.createElement("img", { src: getSeatTypeIcon(val.label), alt: val.label, className: "w-[18px] h-[18px] mr-[6px]" })),
293
- typeof val.label === "string" || typeof val.label === "number"
294
- ? val.label
295
- : null)));
296
- }
297
- return sortedSeatTypes.map((val, key) => SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: `flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
298
- isSeatIcon && (React.createElement("img", { src: getSeatTypeIcon(val.label), alt: val.label, className: "w-[18px] h-[18px] mr-[6px]" })),
299
- typeof val.label === "string" || typeof val.label === "number"
300
- ? val.label
301
- : null)));
302
- };
303
- const getSeatPrice = () => {
304
- const sortedSeatTypes = getSortedSeatTypes();
305
- const uniqueSeats = getUniqueSeats();
306
- if (removeDuplicateSeats) {
307
- return uniqueSeats.map((val, key) => (React.createElement("span", { key: key }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0
308
- ? CommonService.currency(0, currencySign)
309
- : CommonService.currency(val.price, currencySign))));
310
- }
311
- return sortedSeatTypes.map((val, key) => {
312
- return SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: "flex items-center text-[13.33px] bold-text" }, typeof val.price === "string"
313
- ? (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0
314
- ? CommonService.currency(0, currencySign)
315
- : CommonService.currency(val.price, currencySign)
316
- : typeof val.price === "number"
317
- ? (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0
318
- ? CommonService.currency(0, currencySign)
319
- : CommonService.currency(val.price, currencySign)
320
- : null));
321
- });
322
- };
323
- const getFilteredSeats = (item) => {
324
- return item;
325
- };
326
- const checkMidnight = () => {
327
- var _a, _b;
328
- if ((cityOrigin === null || cityOrigin === void 0 ? void 0 : cityOrigin.label) &&
329
- (cityDestination === null || cityDestination === void 0 ? void 0 : cityDestination.label) &&
330
- ((cityOrigin.label.toLowerCase().includes("argentina") &&
331
- !cityDestination.label.toLowerCase().includes("argentina")) ||
332
- (!cityOrigin.label.toLowerCase().includes("argentina") &&
333
- cityDestination.label.toLowerCase().includes("argentina")))) {
334
- ModalEventManager.showPopup({
335
- modalIcon: (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.warningIcon,
336
- title: translation === null || translation === void 0 ? void 0 : translation.title,
337
- showPrimaryButton: false,
338
- primaryButtonText: translation === null || translation === void 0 ? void 0 : translation.continueButton,
339
- onSecondaryButtonClick: () => {
340
- onBookButtonPress && onBookButtonPress();
341
- },
342
- secondaryButtonText: translation === null || translation === void 0 ? void 0 : translation.okContinueButton,
343
- primaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.kuposButtonColor,
344
- primaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.primaryButtonTextColor,
345
- secondaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.secondaryBgColor,
346
- secondaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor,
347
- children: React.createElement(InternationalServicePopupBody, null),
348
- });
349
- return;
350
- }
351
- if (serviceItem.dep_validation_text) {
352
- ModalEventManager.showPopup({
353
- body: serviceItem.dep_validation_text,
354
- primaryButtonText: translation === null || translation === void 0 ? void 0 : translation.continueButton,
355
- secondaryButtonText: translation === null || translation === void 0 ? void 0 : translation.chooseAnotherTripButton,
356
- onPrimaryButtonClick: () => {
357
- onBookButtonPress && onBookButtonPress();
358
- },
359
- primaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.kuposButtonColor,
360
- primaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.primaryButtonTextColor,
361
- secondaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.secondaryBgColor,
362
- secondaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.secondaryTextColor,
363
- });
364
- return;
365
- }
366
- if (serviceItem.operator_service_name === "Classe Reale " &&
367
- cityOrigin.label.toLowerCase() === "santiago,chile" &&
368
- cityDestination.label.toLowerCase() === "portillo,chile") {
369
- ModalEventManager.showPopup({
370
- modalIcon: (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.warningIcon,
371
- title: translation === null || translation === void 0 ? void 0 : translation.title,
372
- primaryButtonText: translation === null || translation === void 0 ? void 0 : translation.okContinueButton,
373
- secondaryButtonText: translation === null || translation === void 0 ? void 0 : translation.chooseAnotherTripButton,
374
- onPrimaryButtonClick: () => {
375
- onBookButtonPress && onBookButtonPress();
376
- },
377
- showSecondaryButton: false,
378
- primaryButtonBgColor: colors === null || colors === void 0 ? void 0 : colors.kuposButtonColor,
379
- primaryButtonTextColor: colors === null || colors === void 0 ? void 0 : colors.primaryButtonTextColor,
380
- children: (React.createElement(React.Fragment, null,
381
- React.createElement("p", { className: "mt-[5px] text-justify" },
382
- translation.classeNormalText,
383
- React.createElement("span", { className: "bold-text" },
384
- "\u00A0",
385
- translation.classeBoldText),
386
- translation.classeNormalText1),
387
- React.createElement("p", { className: "mt-[10px] text-justify" },
388
- translation.classeNormalText2,
389
- "\u00A0",
390
- React.createElement("span", { className: "bold-text" },
391
- "\u00A0",
392
- translation.classeBoldText1),
393
- " ",
394
- translation.classeNormalText3))),
395
- });
396
- return;
397
- }
398
- else {
399
- onBookButtonPressHandler();
400
- }
401
- };
402
- const onBookButtonPressHandler = () => {
403
- onBookButtonPress();
404
- };
405
- return (React.createElement("div", { className: `relative ${serviceItem.offer_text ? "mb-[55px]" : "mb-[10px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
406
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
407
- showTopLabel
408
- ? "mt-[24px]"
409
- : "mt-[14px]"} ` },
410
- React.createElement("div", { className: "bg-white rounded-[20px] shadow-service mx-auto relative" },
411
- React.createElement("div", { className: "p-[15px] pt-[20px]" },
412
- React.createElement("div", { className: "grid text-[#464647] w-full [grid-template-columns:14%_32%_0.5%_24%_13.5%] gap-x-[4%] items-center", style: { marginTop: showTopLabel ? "8px" : "" } },
413
- React.createElement("div", { className: "flex items-center justify-center m-[auto]" },
414
- React.createElement("div", { className: " " },
415
- React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: ` h-auto object-contain ${isSoldOut ? "grayscale" : ""}` })),
416
- isCiva ? (React.createElement("div", { className: "text-[13.33px] black-text ml-2" }, serviceItem.operator_details[2])) : null),
417
- React.createElement("div", { className: `min-h-[2.5rem] grid grid-cols-[26px_auto_26%_1fr] gap-x-4 items-center text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: {
418
- // gridTemplateRows: isCiva ? "1fr" : "1fr 1fr",
419
- gridTemplateRows: "1fr",
420
- // gap: isCiva ? "0" : "10px 16px"
421
- } },
422
- React.createElement("div", { className: "flex flex-col gap-[10px]" },
423
- orignLabel ? (React.createElement("div", { className: "w-[60px] h-[20px] flex items-center mr-[50px]" }, orignLabel)) : (React.createElement("div", { className: "h-[20px] flex items-center" },
424
- React.createElement("img", { src: (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.origin, alt: "origin", className: `w-[18px] h-auto mr-[8px] ${isSoldOut ? "grayscale" : ""}` }))),
425
- !isCiva &&
426
- (destinationLabel ? (React.createElement("div", { className: "w-[60px] h-[20px] flex items-center" }, destinationLabel)) : (React.createElement("div", { className: "h-[20px] flex items-center" },
427
- React.createElement("img", { src: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.destination, className: `w-[18px] h-auto mr-[8px] ${isSoldOut ? "grayscale" : ""}`, style: { opacity: isSoldOut ? 0.5 : 1 } }))))),
428
- React.createElement("div", { className: "flex flex-col gap-[10px]" },
429
- React.createElement("div", { className: "h-[20px] flex items-center group relative" },
430
- React.createElement("span", { className: "cursor-pointer bold-text capitalize" }, DateService.getServiceItemDate(serviceItem.travel_date)),
431
- serviceItem.boarding_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
432
- React.createElement("div", { className: "tooltip-arrow absolute top-2 -left-[7px] w-0 h-0 \n border-t-8 border-b-8 border-r-8 \n border-t-transparent border-b-transparent", style: { borderRightColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } }),
433
- React.createElement("div", { className: "text-center text-[14px] font-normal", style: { fontWeight: 400 } }, renderStages(serviceItem.boarding_stages, 1, busStage, hideBoardingTime((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.api_type) || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.apiType))))))),
434
- !isCiva && (React.createElement("div", { className: "h-[20px] flex items-center group relative" },
435
- React.createElement("span", { className: "cursor-pointer bold-text capitalize" }, DateService.getServiceItemDate(serviceItem.arrival_date)),
436
- serviceItem.dropoff_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
437
- React.createElement("div", { className: "tooltip-arrow absolute top-2 -left-[7px] w-0 h-0 \n border-t-8 border-b-8 border-r-8 \n border-t-transparent border-b-transparent", style: {
438
- borderRightColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor,
439
- } }),
440
- React.createElement("div", { className: "text-center text-[14px] font-normal", style: { fontWeight: 400 } }, renderStages(serviceItem.dropoff_stages, 2, busStage, hideBoardingTime((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.api_type) || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.apiType))))))))),
441
- React.createElement("div", { className: "flex flex-col gap-[10px] items-center" },
442
- React.createElement("div", { className: "h-[20px] flex items-center justify-center" },
443
- React.createElement("div", null, "\u2022")),
444
- !isCiva && (React.createElement("div", { className: "h-[20px] flex items-center justify-center" }, removeArrivalTime ? null : serviceItem.arr_time ? (React.createElement("div", null, "\u2022")) : null))),
445
- React.createElement("div", { className: "flex flex-col gap-[10px]" },
446
- React.createElement("div", { className: "h-[20px] flex items-center group relative" },
447
- React.createElement("div", { className: "font-[900] bold-text" }, DateService.formatTime(serviceItem.dep_time)),
448
- serviceItem.boarding_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
449
- React.createElement("div", { className: "tooltip-arrow absolute top-2 -left-[7px] w-0 h-0 \n border-t-8 border-b-8 border-r-8 \n border-t-transparent border-b-transparent", style: { borderRightColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } }),
450
- React.createElement("div", { className: "text-center text-[14px] font-normal", style: { fontWeight: 400 } }, renderStages(serviceItem.boarding_stages, 1, busStage, hideBoardingTime((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.api_type) || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.apiType))))))),
451
- !isCiva && (React.createElement("div", { className: "h-[20px] flex items-center group relative" },
452
- React.createElement("div", { className: "font-[900] bold-text" }, removeArrivalTime
453
- ? null
454
- : serviceItem.arr_time
455
- ? DateService.formatTime(serviceItem.arr_time)
456
- : null),
457
- serviceItem.dropoff_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
458
- React.createElement("div", { className: "tooltip-arrow absolute top-2 -left-[7px] w-0 h-0 \n border-t-8 border-b-8 border-r-8 \n border-t-transparent border-b-transparent", style: {
459
- borderRightColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor,
460
- } }),
461
- React.createElement("div", { className: "text-center text-[14px] font-normal", style: { fontWeight: 400 } }, renderStages(serviceItem.dropoff_stages, 2, busStage, hideBoardingTime((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.api_type) || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.apiType)))))))))),
462
- React.createElement("div", { style: {
463
- width: "1px",
464
- height: "2.5rem",
465
- backgroundColor: "#ccc",
466
- margin: "auto",
467
- } }),
468
- React.createElement("div", { className: "content-center" },
469
- React.createElement("div", { className: `relative flex gap-[10px] text-[13.33px] justify-between min-h-[2.5rem] ${getNumberOfSeats() < 3 ? "" : ""}`, style: getNumberOfSeats() < 2 ? { alignItems: "center" } : {} },
470
- React.createElement("div", { className: "flex flex-col justify-between" }, getSeatNames()),
471
- React.createElement("div", { className: "flex flex-col justify-between absolute inset-y-0 right-0 left-1/2 h-full", style: {
472
- color: isSoldOut ? "#c0c0c0" : colors.priceColor,
473
- top: 0,
474
- bottom: 0,
475
- left: "68%",
476
- right: 0,
477
- justifyContent: getNumberOfSeats() < 2 ? "center" : "",
478
- } }, getSeatPrice()))),
479
- React.createElement("div", null,
480
- React.createElement("button", { onClick: () => (!isSoldOut ? checkMidnight() : null), disabled: serviceDetailsLoading, className: `w-full ${serviceDetailsLoading || isSoldOut ? "py-[12px]" : "py-[12px]"} text-[13.33px] font-bold text-white rounded-[10px] border-none px-[20px] flex items-center justify-center`, style: {
481
- backgroundColor: serviceDetailsLoading || isSoldOut
482
- ? "lightgray"
483
- : colors.kuposButtonColor,
484
- cursor: serviceDetailsLoading || isSoldOut
485
- ? "not-allowed"
486
- : "pointer",
487
- } },
488
- React.createElement("span", { className: "min-w-[75px] flex justify-center items-center bold-text uppercase" },
489
- isSoldOut ? renderIcon("soldOutIcon", "14px") : null,
490
- serviceDetailsLoading ? (React.createElement("span", { className: "loader-circle" })) : !isSoldOut ? (translation === null || translation === void 0 ? void 0 : translation.buyButton) : (translation === null || translation === void 0 ? void 0 : translation.soldOutButton))))),
491
- showLastSeats ? (React.createElement("div", { className: "flex justify-end mr-[11px]" }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
492
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[12px] text-[red] mt-1 text-center" }, "\u00A1 \u00DAltimos Asientos!")))) : null,
493
- React.createElement("div", { className: `${"flex justify-between items-center mt-[15px] items-center border-t border-[#eee] mt-[15px] pt-[10px]"}` },
494
- showAvailableSeats ? (React.createElement("div", { className: "text-[#464647] text-[13.33px]" }, serviceItem === null || serviceItem === void 0 ? void 0 :
495
- serviceItem.available_seats,
496
- " ",
497
- "Asientos restantes")) : (React.createElement("div", { className: "flex items-center " },
498
- React.createElement("div", { className: `flex items-center ${isSoldOut ? "grayscale" : ""} ${showRating ? "cursor-pointer" : ""}`, style: { color: isSoldOut ? "#c0c0c0" : "" } },
499
- showRating ? (React.createElement(RatingHover, { serviceItem: serviceItem, isSoldOut: isSoldOut, colors: colors, t: t, translation: translation })) : null,
500
- React.createElement("span", { className: "ml-[10px] text-[#464647] text-[13.33px]", style: { marginLeft: showRating ? "10px" : "0" } }, serviceItem.operator_details[2])))),
501
- serviceItem.duration && (React.createElement("div", { className: "flex items-baseline relative text-[#464647]" },
502
- React.createElement("div", { className: `w-[18px] h-auto mr-[4px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("hours", "14px")),
503
- React.createElement("div", { className: `cursor-default group text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
504
- serviceItem.duration,
505
- " ",
506
- translation.hours,
507
- React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[188px] text-center break-normal shadow-service text-[12px]", style: { backgroundColor: colors.tooltipColor } },
508
- React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: { borderBottomColor: colors.tooltipColor } }),
509
- "Duraci\u00F3n estimada del viaje")))),
510
- serviceItem.pet_seat_info &&
511
- Object.keys(serviceItem.pet_seat_info).length > 0 ? (React.createElement("div", { className: "flex items-center text-[13.33px]" },
512
- React.createElement("div", { className: `relative group cursor-default ` },
513
- React.createElement("div", { className: "flex items-center" },
514
- React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
515
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.petFriendlyAnim, width: "20px", height: "20px" })),
516
- React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647]" },
517
- React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.petFriendly))),
518
- React.createElement("div", { className: " hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[230px] text-center break-normal shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
519
- React.createElement("div", { className: "tooltip-arrow absolute text-[13.33px] -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: { borderBottomColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } }),
520
- "Este servicio incluye asientos para mascotas.")))) : null,
521
- serviceItem.is_change_ticket && (React.createElement("div", { className: "flex items-center" },
522
- React.createElement("div", { className: "relative group cursor-default" },
523
- React.createElement("div", { className: "flex items-center" },
524
- React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
525
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.flexibleAnim, width: "20px", height: "20px" })),
526
- React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647]" },
527
- React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.flexible))),
528
- React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[230px] text-center break-normal shadow-service text-[12px]", style: {
529
- backgroundColor: colors.tooltipColor,
530
- lineHeight: "1.5",
531
- } },
532
- React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent ", style: { borderBottomColor: colors.tooltipColor } }),
533
- "Esta empresa permite cambios sin costo hasta (", (_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.change_ticket_hours) !== null && _c !== void 0 ? _c : 6,
534
- ") horas antes del viaje.")))),
535
- React.createElement("div", { className: "flex items-center" },
536
- React.createElement("div", null, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: "flex items-center mr-[10px]" },
537
- React.createElement("div", { className: `h-auto mr-[4px] text-[13px] text-[#464647] ${isSoldOut ? "grayscale" : ""}` },
538
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.locationAnim, width: "20px", height: "20px" }))))),
539
- React.createElement("div", null, metaData && serviceItem.operator_details[4] && (React.createElement("div", { className: "flex items-center gap-[6px]" },
540
- (((_d = serviceItem.operator_details[3]) === null || _d === void 0 ? void 0 : _d.includes("18"))
541
- ? [...serviceItem.operator_details[4], "18"]
542
- : serviceItem.operator_details[4]).map((val, key) => {
543
- var _a, _b, _c, _d;
544
- return (key < 3 &&
545
- ((_b = (_a = metaData === null || metaData === void 0 ? void 0 : metaData.amenities[val]) === null || _a === void 0 ? void 0 : _a.split(".")[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== "WATER") ||
546
- val === "18" ? (React.createElement("div", { key: key, className: "relative mr-2 cursor-pointer" },
547
- React.createElement("div", { className: "group" },
548
- React.createElement("div", { className: `${isSoldOut ? "grayscale" : ""}` },
549
- React.createElement(SvgAmenities, { moreAnemities: false, name: (_c = metaData.amenities[val]) === null || _c === void 0 ? void 0 : _c.split(".")[0].toLowerCase() })),
550
- React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-nowrap mt-2.5 text-center shadow-service text-[13.33px]", style: {
551
- backgroundColor: colors.tooltipColor,
552
- zIndex: 21,
553
- } },
554
- React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: {
555
- borderBottomColor: colors.tooltipColor,
556
- } }),
557
- getAmenityName((_d = metaData.amenities[val]) === null || _d === void 0 ? void 0 : _d.split(".")[0].split("_").join(" ")))))) : null;
558
- }),
559
- ((_e = serviceItem.operator_details[4]) === null || _e === void 0 ? void 0 : _e.length) > 3 && (React.createElement("div", { className: "relative ml-1 cursor-pointer" },
560
- React.createElement("div", { className: "w-[16px] h-[16px] bg-gray-200 rounded-full flex justify-center text-sm font-bold group", style: { alignItems: "flex-end", marginTop: "3px" } },
561
- React.createElement("img", { src: ((_f = serviceItem.icons) === null || _f === void 0 ? void 0 : _f.plus) ||
562
- "/images/icons/amenities/icon_plus.svg", className: "w-[16px] h-[16px]", alt: "plus" }),
563
- React.createElement("div", { className: "hidden group-hover:block absolute -top-[13px] left-[40px] z-20 pl-[10px]" },
564
- React.createElement("div", { className: "flex flex-col gap-[10px] p-3 rounded-[8px] shadow-md animate-fadeIn relative", style: { backgroundColor: colors.tooltipColor } },
565
- metaData &&
566
- ((_g = serviceItem.operator_details[4]) === null || _g === void 0 ? void 0 : _g.map((val, key) => {
567
- var _a, _b, _c, _d, _e, _f, _g;
568
- const exceptions = [
569
- 1, 2, 5, 7, 8, 9, 12, 13, 14, 15,
570
- ];
571
- return exceptions.includes(key) ? null : key >= 3 &&
572
- ((_b = (_a = metaData.amenities[val]) === null || _a === void 0 ? void 0 : _a.split(".")[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== "WATER" ? (React.createElement("div", { key: key, className: "flex items-center gap-[5px] whitespace-nowrap text-[13.33px]" },
573
- React.createElement("div", { className: `${isSoldOut ? "grayscale" : ""}` },
574
- React.createElement(SvgAmenities, { moreAnemities: true, name: (_d = (_c = metaData.amenities[val]) === null || _c === void 0 ? void 0 : _c.split(".")[0]) === null || _d === void 0 ? void 0 : _d.toUpperCase(), color: "white" })),
575
- React.createElement("span", { className: "text-white text-xs" }, getAmenityName((_g = (_f = (_e = metaData.amenities[val]) === null || _e === void 0 ? void 0 : _e.split(".")[0]) === null || _f === void 0 ? void 0 : _f.split("_")) === null || _g === void 0 ? void 0 : _g.join(" "))))) : null;
576
- })),
577
- React.createElement("div", { className: "tooltip-arrow absolute -left-[6px] top-[15px] w-0 h-0 border-t-8 border-b-8 border-r-8 border-t-transparent border-b-transparent ", style: {
578
- borderRightColor: colors.tooltipColor,
579
- } }))))))))))))),
580
- children,
581
- (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-[36px] pt-[50px] -z-10 rounded-b-[14px] text-[14px]`, style: {
582
- backgroundColor: isSoldOut
583
- ? colors === null || colors === void 0 ? void 0 : colors.bottomStripColor
584
- : colors === null || colors === void 0 ? void 0 : colors.bottomStripColor,
585
- opacity: isSoldOut ? 0.5 : 1,
586
- } },
587
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.promoAnim, width: "18px", height: "18px" }),
588
- React.createElement("span", { className: "ml-[10px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text))),
589
- React.createElement("div", { className: "absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[15px] z-10 " },
590
- showTopLabel && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] px-[14px] rounded-[38px] text-[12.5px] z-20`, style: {
591
- backgroundColor: isSoldOut ? "#ddd" : colors.ratingBottomColor,
592
- } },
593
- React.createElement("div", { className: isSoldOut ? "grayscale" : "" },
594
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.priorityStageAnim, width: "14px", height: "14px" })),
595
- React.createElement("div", { className: isSoldOut ? "text-white" : `text-[${colors.topLabelColor}]` }, showTopLabel))),
596
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo) && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] text-white px-[14px] rounded-[38px] text-[12.5px] z-20`, style: {
597
- backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
598
- } },
599
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.connectingServiceIcon, width: "14px", height: "14px" }),
600
- React.createElement("div", null, "Conexión"))),
601
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] text-white px-[14px] rounded-[38px] text-[12.5px] z-20 `, style: {
602
- backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
603
- } },
604
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "14px", height: "14px" }),
605
- React.createElement("div", null, translation === null || translation === void 0 ? void 0 : translation.directService))),
606
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] text-white px-[14px] rounded-[38px] text-[12.5px] z-20 `, style: {
607
- backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
608
- } },
609
- React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "14px", height: "14px" }),
610
- React.createElement("div", null, "Tren Express"))))));
611
- }
612
- export default ServiceItemDesktopPeru;
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- interface PromoCountdownProps {
3
- countdownSeconds: number;
4
- }
5
- interface PromoCountdownState {
6
- remaining: number;
7
- }
8
- declare class PromoCountdown extends React.Component<PromoCountdownProps, PromoCountdownState> {
9
- private timer;
10
- constructor(props: PromoCountdownProps);
11
- componentDidMount(): void;
12
- componentDidUpdate(prevProps: PromoCountdownProps): void;
13
- componentWillUnmount(): void;
14
- private clearTimer;
15
- private startTimer;
16
- render(): React.JSX.Element;
17
- }
18
- export default PromoCountdown;
@@ -1,55 +0,0 @@
1
- import React from "react";
2
- class PromoCountdown extends React.Component {
3
- constructor(props) {
4
- super(props);
5
- this.timer = null;
6
- this.state = { remaining: props.countdownSeconds };
7
- }
8
- componentDidMount() {
9
- this.startTimer();
10
- }
11
- componentDidUpdate(prevProps) {
12
- if (prevProps.countdownSeconds !== this.props.countdownSeconds) {
13
- this.setState({ remaining: this.props.countdownSeconds }, () => {
14
- this.startTimer();
15
- });
16
- }
17
- }
18
- componentWillUnmount() {
19
- this.clearTimer();
20
- }
21
- clearTimer() {
22
- if (this.timer) {
23
- clearInterval(this.timer);
24
- this.timer = null;
25
- }
26
- }
27
- startTimer() {
28
- this.clearTimer();
29
- if (this.state.remaining <= 0)
30
- return;
31
- this.timer = setInterval(() => {
32
- this.setState((prev) => {
33
- if (prev.remaining <= 1) {
34
- this.clearTimer();
35
- return { remaining: 0 };
36
- }
37
- return { remaining: prev.remaining - 1 };
38
- });
39
- }, 1000);
40
- }
41
- render() {
42
- const { remaining } = this.state;
43
- const hrs = Math.floor(remaining / 3600);
44
- const mins = Math.floor((remaining % 3600) / 60);
45
- const secs = remaining % 60;
46
- const pad = (n) => String(n).padStart(2, "0");
47
- return (React.createElement("span", { className: "bold-text" },
48
- pad(hrs),
49
- ":",
50
- pad(mins),
51
- ":",
52
- pad(secs)));
53
- }
54
- }
55
- export default PromoCountdown;