@coras-io/embed 0.5.0 → 0.6.0
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/CHANGELOG.md +36 -0
- package/README.md +15 -2
- package/dist/components/accordion/accordion-item/accordion-item.component.js +9 -3
- package/dist/components/accordion/accordion-item/accordion-item.styles.js +4 -0
- package/dist/components/accordion/accordion.component.js +8 -0
- package/dist/components/alert/alert.component.d.ts +1 -1
- package/dist/components/alert/alert.component.js +4 -3
- package/dist/components/attraction-card/base/attraction-card.mixin.d.ts +0 -2
- package/dist/components/attraction-card/base/attraction-card.mixin.js +0 -6
- package/dist/components/attraction-card/base/attraction-card.types.d.ts +0 -1
- package/dist/components/basket-mobile/basket-mobile.component.d.ts +14 -3
- package/dist/components/basket-mobile/basket-mobile.component.js +71 -15
- package/dist/components/better-carousel/better-carousel.component.d.ts +3 -5
- package/dist/components/better-carousel/better-carousel.component.js +13 -34
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +5 -12
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.js +13 -5
- package/dist/components/breadcrumbs/breadcrumbs.component.d.ts +0 -1
- package/dist/components/breadcrumbs/breadcrumbs.component.js +5 -8
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +8 -2
- package/dist/components/button/button.constants.d.ts +1 -2
- package/dist/components/button/button.constants.js +0 -1
- package/dist/components/calendar/base/calendar.mixin.js +5 -1
- package/dist/components/calendar/multi/multi.component.d.ts +2 -2
- package/dist/components/calendar/multi/multi.component.js +12 -19
- package/dist/components/carousel/carousel.component.js +9 -2
- package/dist/components/categories-tree/categories-tree.component.d.ts +5 -3
- package/dist/components/categories-tree/categories-tree.component.js +22 -21
- package/dist/components/checkbox/checkbox.component.js +5 -1
- package/dist/components/checkbox-group/checkbox-group.component.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.styles.js +1 -1
- package/dist/components/chip/chip.component.js +8 -3
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.d.ts +6 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +15 -1
- package/dist/components/currencies-list/currencies-list.component.js +0 -1
- package/dist/components/dialog/dialog.component.js +52 -21
- package/dist/components/drawer/drawer.component.d.ts +3 -2
- package/dist/components/drawer/drawer.component.js +13 -18
- package/dist/components/drawer/drawer.styles.js +5 -2
- package/dist/components/dropdown/dropdown.component.js +6 -9
- package/dist/components/expiration-timer/expiration-timer.component.d.ts +2 -3
- package/dist/components/expiration-timer/expiration-timer.component.js +10 -8
- package/dist/components/explore-card/explore-card.component.js +3 -1
- package/dist/components/explore-card/explore-card.styles.js +31 -0
- package/dist/components/filters-drawer/filters-drawer.component.js +1 -1
- package/dist/components/flag-icon/flag-icon.component.d.ts +4 -2
- package/dist/components/flag-icon/flag-icon.component.js +16 -4
- package/dist/components/icon/icon.component.js +15 -2
- package/dist/components/image/image.component.js +4 -3
- package/dist/components/image-viewer/image-viewer.component.js +6 -4
- package/dist/components/input-field/input-field.component.js +10 -6
- package/dist/components/layout/layout.styles.js +1 -1
- package/dist/components/locales-list/locales-list.component.js +0 -1
- package/dist/components/location-image/location-image.component.js +0 -1
- package/dist/components/locations-results/locations-results.component.d.ts +10 -0
- package/dist/components/locations-results/locations-results.component.js +22 -15
- package/dist/components/locations-results/locations-results.styles.js +4 -1
- package/dist/components/message-card/message-card.component.d.ts +1 -1
- package/dist/components/message-card/message-card.component.js +4 -3
- package/dist/components/mobile-menu-item/mobile-menu-item.component.d.ts +0 -1
- package/dist/components/mobile-menu-item/mobile-menu-item.component.js +14 -16
- package/dist/components/mobile-menu-item/mobile-menu-item.styles.js +9 -5
- package/dist/components/option-group/option-chip/option-chip.component.d.ts +4 -1
- package/dist/components/option-group/option-chip/option-chip.component.js +23 -10
- package/dist/components/option-group/option-group.component.d.ts +3 -1
- package/dist/components/option-group/option-group.component.js +10 -3
- package/dist/components/overlay/overlay.component.d.ts +0 -5
- package/dist/components/overlay/overlay.component.js +3 -15
- package/dist/components/phone-country-code/phone-country-code.component.d.ts +4 -0
- package/dist/components/phone-country-code/phone-country-code.component.js +37 -0
- package/dist/components/phone-country-codes/phone-country-codes.component.js +1 -1
- package/dist/components/phone-field/phone-field.component.js +2 -2
- package/dist/components/search-button/search-button.component.d.ts +1 -1
- package/dist/components/search-button/search-button.component.js +13 -7
- package/dist/components/seated-selector/seated-selector.component.js +3 -3
- package/dist/components/seats-io/seats-io.component.d.ts +3 -2
- package/dist/components/seats-io/seats-io.component.js +31 -13
- package/dist/components/seats-io/seats-io.constants.d.ts +0 -2
- package/dist/components/seats-io/seats-io.constants.js +0 -3
- package/dist/components/seats-io/seats-io.transform.d.ts +1 -6
- package/dist/components/seats-io/seats-io.transform.js +1 -20
- package/dist/components/select-list/select-list.component.js +7 -2
- package/dist/components/select-list/select-option/select-option.component.d.ts +3 -1
- package/dist/components/select-list/select-option/select-option.component.js +10 -3
- package/dist/components/tabs/tabs.component.d.ts +2 -0
- package/dist/components/tabs/tabs.component.js +59 -5
- package/dist/components/time-tag/time-tag.component.js +1 -1
- package/dist/containers/basket/basket.component.d.ts +1 -1
- package/dist/containers/basket/basket.component.js +21 -20
- package/dist/containers/navbar/navbar.component.d.ts +12 -8
- package/dist/containers/navbar/navbar.component.js +108 -62
- package/dist/containers/navbar/navbar.styles.js +23 -5
- package/dist/containers/navbar/navbar.utils.js +4 -4
- package/dist/contexts/basket/basket.provider.d.ts +3 -4
- package/dist/contexts/basket/basket.provider.js +46 -61
- package/dist/contexts/basket/basket.types.d.ts +0 -2
- package/dist/controllers/time-expiration.d.ts +15 -2
- package/dist/controllers/time-expiration.js +47 -17
- package/dist/core/api/client.d.ts +9 -0
- package/dist/core/api/client.js +26 -0
- package/dist/core/api/middlewares/booking-session/booking-session.constants.d.ts +0 -2
- package/dist/core/api/middlewares/booking-session/booking-session.constants.js +0 -2
- package/dist/core/api/middlewares/booking-session/booking-session.js +3 -12
- package/dist/core/api/middlewares/booking-session/booking-session.utils.d.ts +0 -1
- package/dist/core/api/middlewares/booking-session/booking-session.utils.js +6 -28
- package/dist/core/api/middlewares/error-handler/error-handler.js +5 -1
- package/dist/core/api/middlewares/retry/retry.constants.d.ts +3 -0
- package/dist/core/api/middlewares/retry/retry.constants.js +7 -0
- package/dist/core/api/middlewares/retry/retry.d.ts +2 -0
- package/dist/core/api/middlewares/retry/retry.js +48 -0
- package/dist/core/api/queries.d.ts +13 -38
- package/dist/core/api/queries.js +16 -99
- package/dist/core/events.d.ts +2 -4
- package/dist/core/i18n/date.d.ts +14 -5
- package/dist/core/i18n/date.js +47 -20
- package/dist/core/i18n/localization.js +10 -3
- package/dist/core/images/helpers.js +6 -5
- package/dist/core/logger.d.ts +17 -0
- package/dist/core/logger.js +13 -0
- package/dist/core/types/api-schema.d.ts +7872 -0
- package/dist/core/types/seats-config.d.ts +5 -4
- package/dist/core/types/seats-config.js +10 -3
- package/dist/core/utils/crypto-address.d.ts +12 -0
- package/dist/core/utils/crypto-address.js +17 -0
- package/dist/core/utils/datetime.d.ts +13 -11
- package/dist/core/utils/datetime.js +41 -51
- package/dist/core/utils/loyalty.d.ts +8 -0
- package/dist/core/utils/loyalty.js +10 -0
- package/dist/core/utils/redaction.d.ts +9 -0
- package/dist/core/utils/redaction.js +58 -0
- package/dist/core/utils/time.js +2 -3
- package/dist/helpers/helpers.d.ts +6 -0
- package/dist/helpers/helpers.js +33 -16
- package/dist/locales/ar-SA.d.ts +38 -21
- package/dist/locales/ar-SA.js +38 -21
- package/dist/locales/da-DK.d.ts +38 -21
- package/dist/locales/da-DK.js +38 -21
- package/dist/locales/de-DE.d.ts +38 -21
- package/dist/locales/de-DE.js +38 -21
- package/dist/locales/en-IE.d.ts +38 -21
- package/dist/locales/en-IE.js +38 -21
- package/dist/locales/en-US.d.ts +38 -21
- package/dist/locales/en-US.js +38 -21
- package/dist/locales/es-ES.d.ts +38 -21
- package/dist/locales/es-ES.js +38 -21
- package/dist/locales/fr-FR.d.ts +38 -21
- package/dist/locales/fr-FR.js +38 -21
- package/dist/locales/fr-MA.d.ts +38 -21
- package/dist/locales/fr-MA.js +38 -21
- package/dist/locales/is-IS.d.ts +38 -21
- package/dist/locales/is-IS.js +38 -21
- package/dist/locales/it-IT.d.ts +38 -21
- package/dist/locales/it-IT.js +38 -21
- package/dist/locales/ms-MY.d.ts +38 -21
- package/dist/locales/ms-MY.js +38 -21
- package/dist/locales/nb-NO.d.ts +38 -21
- package/dist/locales/nb-NO.js +38 -21
- package/dist/locales/pl-PL.d.ts +38 -21
- package/dist/locales/pl-PL.js +38 -21
- package/dist/locales/pt-PT.d.ts +38 -21
- package/dist/locales/pt-PT.js +38 -21
- package/dist/locales/sv-SE.d.ts +38 -21
- package/dist/locales/sv-SE.js +38 -21
- package/dist/locales/th-TH.d.ts +38 -21
- package/dist/locales/th-TH.js +38 -21
- package/dist/locales/tr-TR.d.ts +38 -21
- package/dist/locales/tr-TR.js +38 -21
- package/dist/locales/zh-CN.d.ts +38 -21
- package/dist/locales/zh-CN.js +38 -21
- package/dist/locales/zh-HK.d.ts +38 -21
- package/dist/locales/zh-HK.js +38 -21
- package/dist/mixins/base.mixin.d.ts +3 -1
- package/dist/mixins/base.mixin.js +10 -7
- package/dist/mixins/coinbase.mixin.d.ts +13 -17
- package/dist/mixins/coinbase.mixin.js +251 -288
- package/dist/mixins/error-modal.mixin.js +8 -4
- package/dist/mixins/location-search/location-search.d.ts +13 -1
- package/dist/mixins/location-search/location-search.js +35 -27
- package/dist/mixins/overlay/overlay-mixin.js +39 -3
- package/dist/mixins/overlay/types.d.ts +1 -0
- package/dist/mixins/search-mixin/search-mixin.js +8 -5
- package/dist/sdk/diagnostics.js +2 -0
- package/dist/sdk/mount.d.ts +10 -0
- package/dist/sdk/mount.js +20 -1
- package/dist/sdk/page-registry.js +5 -0
- package/dist/sdk/params.d.ts +53 -0
- package/dist/sdk/params.js +180 -0
- package/dist/sdk/redaction.d.ts +1 -4
- package/dist/sdk/redaction.js +2 -41
- package/dist/sdk/types.d.ts +21 -7
- package/dist/sdk/url.d.ts +1 -1
- package/dist/sdk/url.js +12 -5
- package/dist/sdk/validation.d.ts +1 -26
- package/dist/sdk/validation.js +14 -152
- package/dist/styles/tokens.d.ts +1 -1
- package/dist/styles/tokens.generated.d.ts +1 -1
- package/dist/styles/tokens.generated.js +1 -1
- package/dist/views/chrome-only-page/chrome-only-page.component.d.ts +30 -0
- package/dist/views/chrome-only-page/chrome-only-page.component.js +24 -0
- package/dist/views/chrome-only-page/chrome-only-page.d.ts +8 -0
- package/dist/views/chrome-only-page/chrome-only-page.js +6 -0
- package/dist/views/chrome-only-page/chrome-only-page.styles.js +13 -0
- package/dist/views/details-page/details-page.component.d.ts +11 -4
- package/dist/views/details-page/details-page.component.js +263 -237
- package/dist/views/details-page/details-page.utilts.d.ts +63 -3
- package/dist/views/details-page/details-page.utilts.js +53 -5
- package/dist/views/details-page/partials/location-categories/location-categories.component.d.ts +29 -0
- package/dist/views/details-page/partials/location-categories/location-categories.component.js +149 -0
- package/dist/views/details-page/partials/location-categories/location-categories.d.ts +8 -0
- package/dist/views/details-page/partials/location-categories/location-categories.js +6 -0
- package/dist/views/details-page/partials/location-categories/location-categories.styles.js +35 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.d.ts +26 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.js +158 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.d.ts +8 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.js +6 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.styles.js +42 -0
- package/dist/views/details-page/partials/tour-description/tour-description.component.js +1 -4
- package/dist/views/help-page/help-page.component.d.ts +2 -0
- package/dist/views/help-page/help-page.component.js +37 -18
- package/dist/views/help-page/help-page.utils.js +6 -5
- package/dist/views/landing-page/landing-page.component.d.ts +5 -8
- package/dist/views/landing-page/landing-page.component.js +82 -97
- package/dist/views/payment-page/controllers/crypto-auth.controller.d.ts +10 -4
- package/dist/views/payment-page/controllers/crypto-auth.controller.js +53 -31
- package/dist/views/payment-page/controllers/crypto-transfer.controller.d.ts +9 -5
- package/dist/views/payment-page/controllers/crypto-transfer.controller.js +26 -39
- package/dist/views/payment-page/controllers/payment-flow.controller.d.ts +6 -1
- package/dist/views/payment-page/controllers/payment-flow.controller.js +1 -0
- package/dist/views/payment-page/controllers/stripe-payment.controller.d.ts +20 -2
- package/dist/views/payment-page/controllers/stripe-payment.controller.js +42 -19
- package/dist/views/payment-page/partials/activity-details/activity-details.component.d.ts +2 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.component.js +6 -3
- package/dist/views/payment-page/partials/billing-address/billing-address.component.d.ts +2 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.component.js +5 -1
- package/dist/views/payment-page/partials/confirmation/confirmation.component.js +2 -3
- package/dist/views/payment-page/partials/country-field/country-field.component.js +1 -1
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js +3 -3
- package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +2 -0
- package/dist/views/payment-page/partials/stripe/stripe.component.js +36 -7
- package/dist/views/payment-page/partials/stripe/stripe.utils.js +0 -3
- package/dist/views/payment-page/payment-page.component.d.ts +39 -6
- package/dist/views/payment-page/payment-page.component.js +302 -178
- package/dist/views/payment-page/payment-page.constants.d.ts +1 -27
- package/dist/views/payment-page/payment-page.constants.js +3 -30
- package/dist/views/payment-page/payment-page.types.d.ts +1 -19
- package/dist/views/payment-page/payment-page.utils.d.ts +22 -13
- package/dist/views/payment-page/payment-page.utils.js +57 -75
- package/dist/views/payment-page/services/payment-api.service.d.ts +16 -34
- package/dist/views/payment-page/services/payment-api.service.js +19 -27
- package/dist/views/search-page/search-page.component.d.ts +2 -0
- package/dist/views/search-page/search-page.component.js +39 -20
- package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +1 -0
- package/dist/views/suggestion-widget/suggestion-widget.component.js +6 -5
- package/package.json +24 -20
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.d.ts +0 -10
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.js +0 -43
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.d.ts +0 -8
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.js +0 -6
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.js +0 -23
- package/dist/components/attraction-discovery/attraction-discovery.component.d.ts +0 -10
- package/dist/components/attraction-discovery/attraction-discovery.component.js +0 -52
- package/dist/components/attraction-discovery/attraction-discovery.constants.d.ts +0 -4
- package/dist/components/attraction-discovery/attraction-discovery.constants.js +0 -5
- package/dist/components/attraction-discovery/attraction-discovery.d.ts +0 -8
- package/dist/components/attraction-discovery/attraction-discovery.js +0 -6
- package/dist/components/attraction-discovery/attraction-discovery.styles.js +0 -193
- package/dist/components/basket-rewards/basket-rewards.component.d.ts +0 -10
- package/dist/components/basket-rewards/basket-rewards.component.js +0 -52
- package/dist/components/basket-rewards/basket-rewards.d.ts +0 -8
- package/dist/components/basket-rewards/basket-rewards.js +0 -6
- package/dist/components/basket-rewards/basket-rewards.styles.js +0 -18
- package/dist/components/filter-chip/filter-chip.component.d.ts +0 -12
- package/dist/components/filter-chip/filter-chip.component.js +0 -68
- package/dist/components/filter-chip/filter-chip.constants.d.ts +0 -2
- package/dist/components/filter-chip/filter-chip.constants.js +0 -2
- package/dist/components/filter-chip/filter-chip.d.ts +0 -8
- package/dist/components/filter-chip/filter-chip.js +0 -6
- package/dist/components/filter-chip/filter-chip.styles.d.ts +0 -2
- package/dist/components/filter-chip/filter-chip.styles.js +0 -162
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.d.ts +0 -10
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.js +0 -43
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.js +0 -6
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.d.ts +0 -2
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.js +0 -28
- package/dist/components/image-carousel/image-carousel.component.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel.component.js +0 -36
- package/dist/components/image-carousel/image-carousel.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel.js +0 -6
- package/dist/components/image-carousel/image-carousel.styles.d.ts +0 -2
- package/dist/components/image-carousel/image-carousel.styles.js +0 -72
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.d.ts +0 -9
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.js +0 -45
- package/dist/components/itinerary/itinerary-item/itinerary-item.d.ts +0 -8
- package/dist/components/itinerary/itinerary-item/itinerary-item.js +0 -6
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.d.ts +0 -2
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.js +0 -70
- package/dist/components/itinerary/itinerary.component.d.ts +0 -7
- package/dist/components/itinerary/itinerary.component.js +0 -23
- package/dist/components/itinerary/itinerary.d.ts +0 -8
- package/dist/components/itinerary/itinerary.js +0 -6
- package/dist/components/itinerary/itinerary.styles.d.ts +0 -2
- package/dist/components/itinerary/itinerary.styles.js +0 -15
- package/dist/components/marketing-tag/marketing-tag.component.d.ts +0 -5
- package/dist/components/marketing-tag/marketing-tag.component.js +0 -8
- package/dist/components/marketing-tag/marketing-tag.d.ts +0 -8
- package/dist/components/marketing-tag/marketing-tag.js +0 -6
- package/dist/components/marketing-tag/marketing-tag.styles.d.ts +0 -2
- package/dist/components/marketing-tag/marketing-tag.styles.js +0 -36
- package/dist/components/price/price.component.d.ts +0 -12
- package/dist/components/price/price.component.js +0 -38
- package/dist/components/price/price.d.ts +0 -8
- package/dist/components/price/price.js +0 -6
- package/dist/components/reviews/review/review.component.d.ts +0 -9
- package/dist/components/reviews/review/review.component.js +0 -41
- package/dist/components/reviews/review/review.d.ts +0 -8
- package/dist/components/reviews/review/review.js +0 -6
- package/dist/components/reviews/review/review.styles.d.ts +0 -2
- package/dist/components/reviews/review/review.styles.js +0 -45
- package/dist/components/reviews/reviews.component.d.ts +0 -9
- package/dist/components/reviews/reviews.component.js +0 -56
- package/dist/components/reviews/reviews.d.ts +0 -8
- package/dist/components/reviews/reviews.js +0 -6
- package/dist/components/reviews/reviews.styles.d.ts +0 -2
- package/dist/components/reviews/reviews.styles.js +0 -73
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.d.ts +0 -10
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.js +0 -51
- package/dist/components/selected-tickets-preview/selected-tickets-preview.d.ts +0 -8
- package/dist/components/selected-tickets-preview/selected-tickets-preview.js +0 -6
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.d.ts +0 -2
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.js +0 -89
- package/dist/components/tag/tag.component.d.ts +0 -8
- package/dist/components/tag/tag.component.js +0 -33
- package/dist/components/tag/tag.constants.d.ts +0 -1
- package/dist/components/tag/tag.constants.js +0 -1
- package/dist/components/tag/tag.d.ts +0 -8
- package/dist/components/tag/tag.js +0 -6
- package/dist/components/tag/tag.styles.d.ts +0 -2
- package/dist/components/tag/tag.styles.js +0 -56
- package/dist/components/tooltip/tooltip.component.d.ts +0 -19
- package/dist/components/tooltip/tooltip.component.js +0 -124
- package/dist/components/tooltip/tooltip.d.ts +0 -8
- package/dist/components/tooltip/tooltip.js +0 -6
- package/dist/components/tooltip/tooltip.styles.d.ts +0 -2
- package/dist/components/tooltip/tooltip.styles.js +0 -79
- package/dist/core/signals.d.ts +0 -2
- package/dist/core/signals.js +0 -3
- package/dist/core/storybook/argTypes.d.ts +0 -1
- package/dist/core/storybook/argTypes.js +0 -46
- package/dist/core/storybook/cssprops.d.ts +0 -30
- package/dist/core/storybook/cssprops.js +0 -46
- package/dist/core/storybook/demo.d.ts +0 -4
- package/dist/core/storybook/demo.js +0 -17
- package/dist/core/types/api-errors.d.ts +0 -8
- package/dist/core/types/api-errors.js +0 -1
- package/dist/styles/contrast-fixtures.d.ts +0 -5
- package/dist/styles/contrast-fixtures.js +0 -131
- package/dist/views/payment-page/domain/payment-mappers.d.ts +0 -7
- package/dist/views/payment-page/domain/payment-mappers.js +0 -7
- package/dist/views/payment-page/domain/payment-validators.d.ts +0 -6
- package/dist/views/payment-page/domain/payment-validators.js +0 -6
- package/dist/views/payment-page/domain/recovery-payload.d.ts +0 -8
- package/dist/views/payment-page/domain/recovery-payload.js +0 -7
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.d.ts +0 -22
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.js +0 -65
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.d.ts +0 -8
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.js +0 -6
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.d.ts +0 -2
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.js +0 -12
- package/dist/views/payment-page/payment-page.validation-schema.d.ts +0 -28
- package/dist/views/payment-page/payment-page.validation-schema.js +0 -42
- /package/dist/{components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.d.ts → views/chrome-only-page/chrome-only-page.styles.d.ts} +0 -0
- /package/dist/{components/attraction-discovery/attraction-discovery.styles.d.ts → views/details-page/partials/location-categories/location-categories.styles.d.ts} +0 -0
- /package/dist/{components/basket-rewards/basket-rewards.styles.d.ts → views/details-page/partials/location-highlights/location-highlights.styles.d.ts} +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { components } from "./api-schema.js";
|
|
2
|
+
type ConfigResponse = components["schemas"]["GetConfigSuccessfulResponse"];
|
|
3
|
+
export type SeatsIoRegion = ConfigResponse["seatsio_region"];
|
|
2
4
|
export interface SeatsIoConfig {
|
|
3
5
|
workspaceKey: string;
|
|
4
|
-
region:
|
|
6
|
+
region: SeatsIoRegion;
|
|
5
7
|
}
|
|
6
|
-
type ConfigResponse = components["schemas"]["GetConfigSuccessfulResponse"];
|
|
7
8
|
/**
|
|
8
9
|
* Reads the seats.io workspace key + region from `/config`. Returns null when
|
|
9
|
-
* seats.io is not configured
|
|
10
|
-
* back to the section picker.
|
|
10
|
+
* seats.io is not configured or the region is not a known one, which keeps
|
|
11
|
+
* seated selection disabled and falls back to the section picker.
|
|
11
12
|
*/
|
|
12
13
|
export declare const readSeatsIoConfig: (config: ConfigResponse | undefined) => SeatsIoConfig | null;
|
|
13
14
|
export {};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
// The region becomes part of a script URL loaded into the page, so only the
|
|
2
|
+
// values the schema enumerates are accepted at runtime.
|
|
3
|
+
const SEATS_IO_REGIONS = ["eu", "na", "sa", "oc"];
|
|
1
4
|
/**
|
|
2
5
|
* Reads the seats.io workspace key + region from `/config`. Returns null when
|
|
3
|
-
* seats.io is not configured
|
|
4
|
-
* back to the section picker.
|
|
6
|
+
* seats.io is not configured or the region is not a known one, which keeps
|
|
7
|
+
* seated selection disabled and falls back to the section picker.
|
|
5
8
|
*/
|
|
6
9
|
export const readSeatsIoConfig = (config) => {
|
|
7
10
|
const workspaceKey = config?.seatsio_public_workspace_key;
|
|
8
|
-
|
|
11
|
+
const region = config?.seatsio_region;
|
|
12
|
+
if (!workspaceKey || !region || !SEATS_IO_REGIONS.includes(region)) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return { workspaceKey, region };
|
|
9
16
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zero address constant - transfers to this address permanently burn tokens.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ZERO_ADDRESS: "0x0000000000000000000000000000000000000000";
|
|
5
|
+
/**
|
|
6
|
+
* Validates that an address is both a valid Ethereum address and not the zero address.
|
|
7
|
+
* Zero address is technically valid by format but represents a burn address
|
|
8
|
+
* that would cause irreversible loss of funds.
|
|
9
|
+
*
|
|
10
|
+
* @throws Error if address is invalid or zero
|
|
11
|
+
*/
|
|
12
|
+
export declare function assertNonZeroAddress(address: string, label: string): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isAddress } from "viem/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Zero address constant - transfers to this address permanently burn tokens.
|
|
4
|
+
*/
|
|
5
|
+
export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
6
|
+
/**
|
|
7
|
+
* Validates that an address is both a valid Ethereum address and not the zero address.
|
|
8
|
+
* Zero address is technically valid by format but represents a burn address
|
|
9
|
+
* that would cause irreversible loss of funds.
|
|
10
|
+
*
|
|
11
|
+
* @throws Error if address is invalid or zero
|
|
12
|
+
*/
|
|
13
|
+
export function assertNonZeroAddress(address, label) {
|
|
14
|
+
if (!isAddress(address) || address.toLowerCase() === ZERO_ADDRESS) {
|
|
15
|
+
throw new Error(`${label} is invalid or zero-address`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -38,13 +38,15 @@ export declare const formatDateTimeForDisplay: (apiData: DateTimeApiData, option
|
|
|
38
38
|
*
|
|
39
39
|
* @param dateString - ISO date string
|
|
40
40
|
* @param timezone - Timezone string
|
|
41
|
+
* @param locale - Locale for month and weekday names
|
|
41
42
|
* @param formatString - Format string for date-fns
|
|
42
43
|
* @param includeTime - Whether to include time
|
|
43
44
|
* @returns Formatted date/time string
|
|
44
45
|
*/
|
|
45
|
-
export declare const formatDateTimeWithTimezone: ({ dateString, timezone, formatString, timeFormatString, includeTime, }: {
|
|
46
|
+
export declare const formatDateTimeWithTimezone: ({ dateString, timezone, locale, formatString, timeFormatString, includeTime, }: {
|
|
46
47
|
dateString: string;
|
|
47
48
|
timezone?: string;
|
|
49
|
+
locale: SupportedLocales;
|
|
48
50
|
formatString?: string;
|
|
49
51
|
timeFormatString?: string;
|
|
50
52
|
includeTime?: boolean;
|
|
@@ -58,20 +60,20 @@ export declare const formatDateTimeWithTimezone: ({ dateString, timezone, format
|
|
|
58
60
|
*/
|
|
59
61
|
export declare const formatTimeForDisplay: (apiData: DateTimeApiData, format12Hour?: boolean) => string;
|
|
60
62
|
/**
|
|
61
|
-
* Groups availability items by
|
|
63
|
+
* Groups availability items by their start instant, in chronological order.
|
|
64
|
+
*
|
|
65
|
+
* The key is the instant (`Date.parse(start_datetime)`) so ordering never
|
|
66
|
+
* depends on how a locale renders a time; `label` is the locale-formatted
|
|
67
|
+
* time for display only.
|
|
62
68
|
*
|
|
63
69
|
* @param items - Array of items with start_datetime and timezone
|
|
64
70
|
* @param locale - User's locale
|
|
65
|
-
* @returns Map of
|
|
71
|
+
* @returns Map of start instants to their display label and grouped items
|
|
66
72
|
*/
|
|
67
73
|
export declare const groupItemsByTime: <T extends {
|
|
68
74
|
start_datetime?: string;
|
|
69
75
|
timezone?: string;
|
|
70
|
-
}>(items: T[], locale?: SupportedLocales) => Map<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* @param times - Array of time strings
|
|
75
|
-
* @returns Sorted array of time strings
|
|
76
|
-
*/
|
|
77
|
-
export declare const sortTimeStrings: (times: string[]) => string[];
|
|
76
|
+
}>(items: T[], locale?: SupportedLocales) => Map<number, {
|
|
77
|
+
label: string;
|
|
78
|
+
items: T[];
|
|
79
|
+
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { parseISO } from "date-fns";
|
|
2
2
|
import { format as formatTZ, toZonedTime } from "date-fns-tz";
|
|
3
3
|
import { intlFormat } from "date-fns";
|
|
4
|
+
import { getCalendarLocale } from "../i18n/date.js";
|
|
4
5
|
/**
|
|
5
6
|
* Formats a date/time from API data for display to users
|
|
6
7
|
* This function handles locale and timezone conversion for proper user display
|
|
@@ -22,15 +23,18 @@ export const formatDateTimeForDisplay = (apiData, options = {}) => {
|
|
|
22
23
|
const isDateOnly = /^\d{4}-\d{2}-\d{2}$/.test(apiData.dateTime);
|
|
23
24
|
const timezone = isDateOnly ? undefined : apiData.timezone;
|
|
24
25
|
const date = parseISO(apiData.dateTime);
|
|
26
|
+
const locale = apiData.locale || "en-GB";
|
|
25
27
|
// If custom format is provided, use date-fns-tz for timezone support
|
|
26
28
|
if (customFormat) {
|
|
29
|
+
const formatOptions = { locale: getCalendarLocale(locale) };
|
|
27
30
|
if (timezone) {
|
|
28
31
|
const zonedDate = toZonedTime(date, timezone);
|
|
29
32
|
return formatTZ(zonedDate, customFormat, {
|
|
33
|
+
...formatOptions,
|
|
30
34
|
timeZone: timezone,
|
|
31
35
|
});
|
|
32
36
|
}
|
|
33
|
-
return formatTZ(date, customFormat);
|
|
37
|
+
return formatTZ(date, customFormat, formatOptions);
|
|
34
38
|
}
|
|
35
39
|
// Use Intl.DateTimeFormat for locale-aware formatting
|
|
36
40
|
const formatOptions = {
|
|
@@ -43,13 +47,10 @@ export const formatDateTimeForDisplay = (apiData, options = {}) => {
|
|
|
43
47
|
}),
|
|
44
48
|
...(timezone && { timeZone: timezone }),
|
|
45
49
|
};
|
|
46
|
-
return intlFormat(date, formatOptions, {
|
|
47
|
-
locale: apiData.locale || "en-GB",
|
|
48
|
-
});
|
|
50
|
+
return intlFormat(date, formatOptions, { locale });
|
|
49
51
|
}
|
|
50
|
-
catch
|
|
51
|
-
|
|
52
|
-
return apiData.dateTime; // Fallback to original string
|
|
52
|
+
catch {
|
|
53
|
+
return apiData.dateTime;
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
/**
|
|
@@ -58,27 +59,26 @@ export const formatDateTimeForDisplay = (apiData, options = {}) => {
|
|
|
58
59
|
*
|
|
59
60
|
* @param dateString - ISO date string
|
|
60
61
|
* @param timezone - Timezone string
|
|
62
|
+
* @param locale - Locale for month and weekday names
|
|
61
63
|
* @param formatString - Format string for date-fns
|
|
62
64
|
* @param includeTime - Whether to include time
|
|
63
65
|
* @returns Formatted date/time string
|
|
64
66
|
*/
|
|
65
|
-
export const formatDateTimeWithTimezone = ({ dateString, timezone, formatString = "d MMM yyyy", timeFormatString = "d MMM yyyy HH:mm", includeTime = false, }) => {
|
|
67
|
+
export const formatDateTimeWithTimezone = ({ dateString, timezone, locale, formatString = "d MMM yyyy", timeFormatString = "d MMM yyyy HH:mm", includeTime = false, }) => {
|
|
66
68
|
if (!dateString) {
|
|
67
69
|
return "";
|
|
68
70
|
}
|
|
69
71
|
try {
|
|
70
72
|
const date = parseISO(dateString);
|
|
73
|
+
const formatOptions = { locale: getCalendarLocale(locale) };
|
|
71
74
|
if (timezone) {
|
|
72
75
|
const zonedDate = toZonedTime(date, timezone);
|
|
73
|
-
return formatTZ(zonedDate, includeTime ? timeFormatString : formatString, {
|
|
74
|
-
timeZone: timezone,
|
|
75
|
-
});
|
|
76
|
+
return formatTZ(zonedDate, includeTime ? timeFormatString : formatString, { ...formatOptions, timeZone: timezone });
|
|
76
77
|
}
|
|
77
|
-
return formatTZ(date, includeTime ? timeFormatString : formatString);
|
|
78
|
+
return formatTZ(date, includeTime ? timeFormatString : formatString, formatOptions);
|
|
78
79
|
}
|
|
79
|
-
catch
|
|
80
|
-
|
|
81
|
-
return dateString; // Fallback to original string
|
|
80
|
+
catch {
|
|
81
|
+
return dateString;
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
/**
|
|
@@ -107,53 +107,43 @@ export const formatTimeForDisplay = (apiData, format12Hour) => {
|
|
|
107
107
|
}
|
|
108
108
|
return date.toLocaleTimeString(locale, formatOptions);
|
|
109
109
|
}
|
|
110
|
-
catch
|
|
111
|
-
console.error("Error formatting time for display:", error);
|
|
110
|
+
catch {
|
|
112
111
|
return apiData.dateTime;
|
|
113
112
|
}
|
|
114
113
|
};
|
|
115
114
|
/**
|
|
116
|
-
* Groups availability items by
|
|
115
|
+
* Groups availability items by their start instant, in chronological order.
|
|
116
|
+
*
|
|
117
|
+
* The key is the instant (`Date.parse(start_datetime)`) so ordering never
|
|
118
|
+
* depends on how a locale renders a time; `label` is the locale-formatted
|
|
119
|
+
* time for display only.
|
|
117
120
|
*
|
|
118
121
|
* @param items - Array of items with start_datetime and timezone
|
|
119
122
|
* @param locale - User's locale
|
|
120
|
-
* @returns Map of
|
|
123
|
+
* @returns Map of start instants to their display label and grouped items
|
|
121
124
|
*/
|
|
122
125
|
export const groupItemsByTime = (items, locale = "en-GB") => {
|
|
123
126
|
const timeGroups = new Map();
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
const datedItems = items
|
|
128
|
+
.flatMap((item) => item.start_datetime
|
|
129
|
+
? [{ instant: Date.parse(item.start_datetime), item }]
|
|
130
|
+
: [])
|
|
131
|
+
.filter(({ instant }) => !Number.isNaN(instant))
|
|
132
|
+
.sort((a, b) => a.instant - b.instant);
|
|
133
|
+
datedItems.forEach(({ instant, item }) => {
|
|
134
|
+
let group = timeGroups.get(instant);
|
|
135
|
+
if (!group) {
|
|
136
|
+
group = {
|
|
137
|
+
label: formatTimeForDisplay({
|
|
138
|
+
dateTime: item.start_datetime,
|
|
139
|
+
timezone: item.timezone,
|
|
140
|
+
locale,
|
|
141
|
+
}),
|
|
142
|
+
items: [],
|
|
143
|
+
};
|
|
144
|
+
timeGroups.set(instant, group);
|
|
127
145
|
}
|
|
128
|
-
|
|
129
|
-
dateTime: item.start_datetime,
|
|
130
|
-
timezone: item.timezone,
|
|
131
|
-
locale,
|
|
132
|
-
});
|
|
133
|
-
if (!timeGroups.has(timeString)) {
|
|
134
|
-
timeGroups.set(timeString, []);
|
|
135
|
-
}
|
|
136
|
-
timeGroups.get(timeString).push(item);
|
|
146
|
+
group.items.push(item);
|
|
137
147
|
});
|
|
138
148
|
return timeGroups;
|
|
139
149
|
};
|
|
140
|
-
/**
|
|
141
|
-
* Sorts time strings in chronological order
|
|
142
|
-
*
|
|
143
|
-
* @param times - Array of time strings
|
|
144
|
-
* @returns Sorted array of time strings
|
|
145
|
-
*/
|
|
146
|
-
export const sortTimeStrings = (times) => {
|
|
147
|
-
return [...times].sort((a, b) => {
|
|
148
|
-
try {
|
|
149
|
-
// Create dates with same day to compare times
|
|
150
|
-
const dateA = new Date(`1970/01/01 ${a}`);
|
|
151
|
-
const dateB = new Date(`1970/01/01 ${b}`);
|
|
152
|
-
return dateA.getTime() - dateB.getTime();
|
|
153
|
-
}
|
|
154
|
-
catch {
|
|
155
|
-
// Fallback to string comparison if parsing fails
|
|
156
|
-
return a.localeCompare(b);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { components } from "../types/api-schema.js";
|
|
2
|
+
/** The loyalty token the API keys pay and earn amounts by. */
|
|
3
|
+
export declare const LOYALTY_TOKEN_SYMBOL = "FIDA";
|
|
4
|
+
/**
|
|
5
|
+
* Reads the loyalty token amount to pay or earn. The API keys the amount by
|
|
6
|
+
* token symbol; anything missing or non-numeric counts as 0.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getLoyaltyAmount(loyalty: components["schemas"]["LoyaltySchema"] | null | undefined, field: "pay" | "earn"): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The loyalty token the API keys pay and earn amounts by. */
|
|
2
|
+
export const LOYALTY_TOKEN_SYMBOL = "FIDA";
|
|
3
|
+
/**
|
|
4
|
+
* Reads the loyalty token amount to pay or earn. The API keys the amount by
|
|
5
|
+
* token symbol; anything missing or non-numeric counts as 0.
|
|
6
|
+
*/
|
|
7
|
+
export function getLoyaltyAmount(loyalty, field) {
|
|
8
|
+
const amount = Number(loyalty?.[field]?.[LOYALTY_TOKEN_SYMBOL] ?? 0);
|
|
9
|
+
return Number.isNaN(amount) ? 0 : amount;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data minimization for public payloads (P-038). Public errors, observability
|
|
3
|
+
* events, and logs must never carry secrets or unnecessary PII. These helpers
|
|
4
|
+
* scrub the values the SDK forwards to host callbacks, events, and reporters.
|
|
5
|
+
*/
|
|
6
|
+
/** Mask sensitive substrings inside a string. */
|
|
7
|
+
export declare function redactString(value: string): string;
|
|
8
|
+
/** Recursively redact string values inside a JSON-ish structure. */
|
|
9
|
+
export declare function redactValue(value: unknown): unknown;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data minimization for public payloads (P-038). Public errors, observability
|
|
3
|
+
* events, and logs must never carry secrets or unnecessary PII. These helpers
|
|
4
|
+
* scrub the values the SDK forwards to host callbacks, events, and reporters.
|
|
5
|
+
*/
|
|
6
|
+
const REDACTED = "[redacted]";
|
|
7
|
+
const SENSITIVE_PATTERNS = [
|
|
8
|
+
// Email addresses.
|
|
9
|
+
/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}/gi,
|
|
10
|
+
// Stripe-style secrets / keys / payment intents.
|
|
11
|
+
/\b(?:sk|pk|rk)_(?:live|test)_[a-z0-9]+/gi,
|
|
12
|
+
/\b(?:pi|seti|cs|pm|ch)_[a-z0-9]+_secret_[a-z0-9]+/gi,
|
|
13
|
+
/client_secret["':=\s]+[a-z0-9_-]+/gi,
|
|
14
|
+
// Bearer / access tokens.
|
|
15
|
+
/\bBearer\s+[a-z0-9._-]+/gi,
|
|
16
|
+
];
|
|
17
|
+
// Card-like number runs (13-19 digits, optionally space/dash separated). A
|
|
18
|
+
// millisecond timestamp is also 13 digits, so a run is only masked when it
|
|
19
|
+
// passes the Luhn check every card number satisfies.
|
|
20
|
+
const CARD_LIKE_PATTERN = /\b(?:\d[ -]?){13,19}\b/g;
|
|
21
|
+
function isLuhnValid(digits) {
|
|
22
|
+
let sum = 0;
|
|
23
|
+
let double = false;
|
|
24
|
+
for (let i = digits.length - 1; i >= 0; i--) {
|
|
25
|
+
let digit = Number(digits[i]);
|
|
26
|
+
if (double) {
|
|
27
|
+
digit *= 2;
|
|
28
|
+
if (digit > 9)
|
|
29
|
+
digit -= 9;
|
|
30
|
+
}
|
|
31
|
+
sum += digit;
|
|
32
|
+
double = !double;
|
|
33
|
+
}
|
|
34
|
+
return sum % 10 === 0;
|
|
35
|
+
}
|
|
36
|
+
/** Mask sensitive substrings inside a string. */
|
|
37
|
+
export function redactString(value) {
|
|
38
|
+
let result = value;
|
|
39
|
+
for (const pattern of SENSITIVE_PATTERNS) {
|
|
40
|
+
result = result.replace(pattern, REDACTED);
|
|
41
|
+
}
|
|
42
|
+
return result.replace(CARD_LIKE_PATTERN, (run) => isLuhnValid(run.replace(/[ -]/g, "")) ? REDACTED : run);
|
|
43
|
+
}
|
|
44
|
+
/** Recursively redact string values inside a JSON-ish structure. */
|
|
45
|
+
export function redactValue(value) {
|
|
46
|
+
if (typeof value === "string")
|
|
47
|
+
return redactString(value);
|
|
48
|
+
if (Array.isArray(value))
|
|
49
|
+
return value.map(redactValue);
|
|
50
|
+
if (value && typeof value === "object") {
|
|
51
|
+
const out = {};
|
|
52
|
+
for (const [key, item] of Object.entries(value)) {
|
|
53
|
+
out[key] = redactValue(item);
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
}
|
package/dist/core/utils/time.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { formatDuration, intervalToDuration } from "date-fns";
|
|
2
|
-
import {
|
|
2
|
+
import { getCalendarLocale } from "../i18n/date.js";
|
|
3
3
|
export const formatMinutesDuration = (minutes, locale) => {
|
|
4
4
|
if (minutes < 0) {
|
|
5
5
|
return "";
|
|
6
6
|
}
|
|
7
7
|
const duration = intervalToDuration({ start: 0, end: minutes * 60 * 1000 });
|
|
8
|
-
|
|
9
|
-
return formatDuration(duration, { locale: localeObject });
|
|
8
|
+
return formatDuration(duration, { locale: getCalendarLocale(locale) });
|
|
10
9
|
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { SupportedLocales } from "../core/types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Pick the supported locale for a visitor: the browser's languages in
|
|
4
|
+
* preference order, then the given fallbacks, then the default. A candidate
|
|
5
|
+
* matches a supported locale exactly, or by language alone (so `de` and
|
|
6
|
+
* `pt-BR` resolve to `de-DE` and `pt-PT`). The first hit wins.
|
|
7
|
+
*/
|
|
2
8
|
export declare function getLocale(fallbackLocale?: string | string[]): SupportedLocales;
|
|
3
9
|
export declare function isLocaleSupported(locale: string): boolean;
|
|
4
10
|
export declare const getCurrency: (locale: string) => "AED" | "ALL" | "AUD" | "CAD" | "CHF" | "CNY" | "DKK" | "EUR" | "GBP" | "HUF" | "IDR" | "ISK" | "JPY" | "MAD" | "MYR" | "NOK" | "PHP" | "PLN" | "SAR" | "SEK" | "SGD" | "THB" | "TRY" | "USD" | "VND";
|
package/dist/helpers/helpers.js
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
import { allLocales } from "../core/i18n/locale-codes.js";
|
|
2
2
|
import { localeToCurrencyMapping, supportedCurrencies, } from "../core/currency/constants.js";
|
|
3
3
|
import { DEFAULT_CURRENCY, DEFAULT_LOCALE } from "../views/constants.js";
|
|
4
|
+
/**
|
|
5
|
+
* Pick the supported locale for a visitor: the browser's languages in
|
|
6
|
+
* preference order, then the given fallbacks, then the default. A candidate
|
|
7
|
+
* matches a supported locale exactly, or by language alone (so `de` and
|
|
8
|
+
* `pt-BR` resolve to `de-DE` and `pt-PT`). The first hit wins.
|
|
9
|
+
*/
|
|
4
10
|
export function getLocale(fallbackLocale) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
const browserLanguages = typeof navigator === "undefined"
|
|
12
|
+
? []
|
|
13
|
+
: navigator.languages?.length
|
|
14
|
+
? navigator.languages
|
|
15
|
+
: [navigator.language];
|
|
16
|
+
const fallbacks = Array.isArray(fallbackLocale)
|
|
17
|
+
? fallbackLocale
|
|
18
|
+
: fallbackLocale
|
|
19
|
+
? [fallbackLocale]
|
|
20
|
+
: [];
|
|
21
|
+
for (const candidate of [...browserLanguages, ...fallbacks]) {
|
|
22
|
+
const match = matchSupportedLocale(candidate);
|
|
23
|
+
if (match)
|
|
24
|
+
return match;
|
|
9
25
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
return DEFAULT_LOCALE;
|
|
27
|
+
}
|
|
28
|
+
function matchSupportedLocale(candidate) {
|
|
29
|
+
if (typeof candidate !== "string")
|
|
30
|
+
return undefined;
|
|
31
|
+
const wanted = candidate.trim().replace(/_/g, "-").toLowerCase();
|
|
32
|
+
if (!wanted)
|
|
33
|
+
return undefined;
|
|
34
|
+
const exact = allLocales.find((locale) => locale.toLowerCase() === wanted);
|
|
35
|
+
if (exact)
|
|
36
|
+
return exact;
|
|
37
|
+
const language = wanted.split("-")[0];
|
|
38
|
+
return allLocales.find((locale) => locale.split("-")[0] === language);
|
|
22
39
|
}
|
|
23
40
|
export function isLocaleSupported(locale) {
|
|
24
41
|
return allLocales.includes(locale);
|
package/dist/locales/ar-SA.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
2
|
h0453a9c8ddf1e74c: import("lit").TemplateResult<1>;
|
|
3
|
-
h0f22760eabebc0d2: import("lit").TemplateResult<1>;
|
|
4
3
|
h41ee003df7011ba3: import("lit").TemplateResult<1>;
|
|
5
4
|
h4653b4623e11cce8: import("lit").TemplateResult<1>;
|
|
6
5
|
h62aa06b7d898393a: import("lit").TemplateResult<1>;
|
|
@@ -9,7 +8,6 @@ export declare const templates: {
|
|
|
9
8
|
s003d3f04ab3c63af: string;
|
|
10
9
|
s01769b46d7a9bcbe: string;
|
|
11
10
|
s01ca6f3c6dcac61b: string;
|
|
12
|
-
s0230dfb6b6c1e011: string;
|
|
13
11
|
s02cbd3b6873bf3cc: string;
|
|
14
12
|
s0379fc73608ab971: string;
|
|
15
13
|
s0487f33d9ddaabde: string;
|
|
@@ -31,7 +29,6 @@ export declare const templates: {
|
|
|
31
29
|
s0fb0fc272e807ad1: string;
|
|
32
30
|
s11602ea206accf6e: string;
|
|
33
31
|
s11cc9ffa7ddc8e94: string;
|
|
34
|
-
s13a66c3ef0b5bf5f: string;
|
|
35
32
|
s14cc42e0b8fe4c84: string;
|
|
36
33
|
s15194cf12eb014cd: string;
|
|
37
34
|
s1726f691155bad09: string;
|
|
@@ -45,7 +42,6 @@ export declare const templates: {
|
|
|
45
42
|
s208665855189c10c: string;
|
|
46
43
|
s214bac601e6d7da8: string;
|
|
47
44
|
s2220ac9a490a6aad: string;
|
|
48
|
-
s22771f6bba73d648: string;
|
|
49
45
|
s2468b69d10791c82: string;
|
|
50
46
|
s24836d5e8de2ef53: string;
|
|
51
47
|
s255857544a9d5ec0: string;
|
|
@@ -57,7 +53,6 @@ export declare const templates: {
|
|
|
57
53
|
s2af92d203c6533c4: string;
|
|
58
54
|
s2b62420bebf9e6e4: import("@lit/localize").StrResult;
|
|
59
55
|
s2d1d27aa9a7ab857: string;
|
|
60
|
-
s2d6ceb2ed95d2aec: string;
|
|
61
56
|
s302b8b3db5e19407: string;
|
|
62
57
|
s30953bd831efad6c: string;
|
|
63
58
|
s318aefcc44f6fbdc: string;
|
|
@@ -77,14 +72,12 @@ export declare const templates: {
|
|
|
77
72
|
s3bd9192a47014fac: string;
|
|
78
73
|
s3d0bb0448ae28706: string;
|
|
79
74
|
s3d1d2fdc677de804: string;
|
|
80
|
-
s3d52d1be2d6d171d: string;
|
|
81
75
|
s3dc9fd50cee69d30: string;
|
|
82
76
|
s3e7884bf4f412c6f: string;
|
|
83
77
|
s40d76f1f51639ec0: string;
|
|
84
78
|
s42211e5b076304b9: string;
|
|
85
79
|
s42c3f76163444278: string;
|
|
86
80
|
s42cbc1ed3d490ba8: import("@lit/localize").StrResult;
|
|
87
|
-
s4356163009e59310: string;
|
|
88
81
|
s43f528d2fff00362: import("@lit/localize").StrResult;
|
|
89
82
|
s4543ff29118e088d: string;
|
|
90
83
|
s463b8c4e92751ba5: string;
|
|
@@ -103,7 +96,6 @@ export declare const templates: {
|
|
|
103
96
|
s56d9d499ce21aa71: string;
|
|
104
97
|
s589ade03e24b3dec: string;
|
|
105
98
|
s5921af1f9988e939: string;
|
|
106
|
-
s5b0cdec697634a43: string;
|
|
107
99
|
s5baecf6a8b5e582f: string;
|
|
108
100
|
s5bd685b647375404: string;
|
|
109
101
|
s5c843d9e674e1c41: import("@lit/localize").StrResult;
|
|
@@ -119,7 +111,6 @@ export declare const templates: {
|
|
|
119
111
|
s63a8d5c967692fd8: import("@lit/localize").StrResult;
|
|
120
112
|
s6434ccb2ab38de1e: string;
|
|
121
113
|
s64c725e7c35bfc44: string;
|
|
122
|
-
s65d8b64cc2edc07f: string;
|
|
123
114
|
s66241ced41f02eaa: string;
|
|
124
115
|
s6765e69c04d66039: string;
|
|
125
116
|
s67b559eeb2136588: string;
|
|
@@ -131,24 +122,20 @@ export declare const templates: {
|
|
|
131
122
|
s6d84c67f663fb24d: string;
|
|
132
123
|
s6e8059179423bfa0: string;
|
|
133
124
|
s6f932154a669cc49: string;
|
|
134
|
-
s709af33057592dd8: string;
|
|
135
125
|
s70ab5bb776df5e7c: string;
|
|
136
126
|
s732385cbc938b7a1: string;
|
|
137
127
|
s732d031b2be46181: string;
|
|
138
128
|
s7571bffb300cd56a: string;
|
|
139
129
|
s7572f8d1e64214a9: string;
|
|
140
130
|
s76e508e5ee58da2d: string;
|
|
141
|
-
s771897106728d3f6: string;
|
|
142
131
|
s77dde5ef6c52def6: string;
|
|
143
132
|
s791ef75ce61f73be: string;
|
|
144
133
|
s7aa03410a4afcc96: string;
|
|
145
134
|
s7ac23a5b8153fad5: string;
|
|
146
|
-
s7f3437809d931336: string;
|
|
147
135
|
s8195430312d62be0: string;
|
|
148
136
|
s8315ddc4161a498b: string;
|
|
149
137
|
s84a7ee7d2559f1e1: string;
|
|
150
138
|
s8654133f4227b6dc: string;
|
|
151
|
-
s86d7da761b5e390d: string;
|
|
152
139
|
s86e180b4d89f9bbe: string;
|
|
153
140
|
s871b1fe6d1846958: string;
|
|
154
141
|
s87bae2710b2492c3: string;
|
|
@@ -157,9 +144,7 @@ export declare const templates: {
|
|
|
157
144
|
s8dd38519f42fc289: string;
|
|
158
145
|
s8f683174898a4afa: string;
|
|
159
146
|
s8f94436e63f36047: string;
|
|
160
|
-
s90e83b2c18f39409: string;
|
|
161
147
|
s9145aa93cf917ae4: string;
|
|
162
|
-
s9181c89c4a58402a: string;
|
|
163
148
|
s92921878e886e36d: string;
|
|
164
149
|
s93c046d8c5bb2047: string;
|
|
165
150
|
s953fc82dcd20c9f8: string;
|
|
@@ -177,14 +162,12 @@ export declare const templates: {
|
|
|
177
162
|
sa61534a5c0c71f5e: string;
|
|
178
163
|
sa6ab5184d6315895: string;
|
|
179
164
|
sa7d09574ece17145: string;
|
|
180
|
-
sa8535600e6997bcf: string;
|
|
181
165
|
sa8beb6b1182241ac: string;
|
|
182
166
|
sa8e8cc2558962d51: string;
|
|
183
167
|
saaf58da3a384352a: import("@lit/localize").StrResult;
|
|
184
168
|
sab459038e3c6bcb8: string;
|
|
185
169
|
sac33f8b1ee0a8a70: import("@lit/localize").StrResult;
|
|
186
170
|
sad4a0401aafaab57: string;
|
|
187
|
-
sb05eb16313ad5810: string;
|
|
188
171
|
sb074169ce94feeb0: string;
|
|
189
172
|
sb182f52b56175d8c: string;
|
|
190
173
|
sb26e53053d747113: string;
|
|
@@ -221,16 +204,13 @@ export declare const templates: {
|
|
|
221
204
|
scbaa2a2ceb044c0a: string;
|
|
222
205
|
scc1db59d292cbc4c: string;
|
|
223
206
|
scd0b9d7c6f9c597d: string;
|
|
224
|
-
scd1ca177bf7ddf98: string;
|
|
225
207
|
scd1dd6ff53d0d01a: string;
|
|
226
208
|
scd525a733e4c9110: string;
|
|
227
209
|
sce2300ea82130155: string;
|
|
228
|
-
scf61ccc6056c17d2: string;
|
|
229
210
|
sd002a6411d593b33: string;
|
|
230
211
|
sd0827f83a77da218: string;
|
|
231
212
|
sd15de0dcd2378a55: string;
|
|
232
213
|
sd1797c5a30652800: string;
|
|
233
|
-
sd20a2299b31382f0: string;
|
|
234
214
|
sd4d1e43525fd598a: string;
|
|
235
215
|
sd574f2d5de170480: string;
|
|
236
216
|
sd715e3f32ad86586: string;
|
|
@@ -241,7 +221,6 @@ export declare const templates: {
|
|
|
241
221
|
sdf566eeae04c0483: string;
|
|
242
222
|
se046d97f0d9dd903: string;
|
|
243
223
|
se256f991824c9ae0: string;
|
|
244
|
-
se2b298fd65f45cc7: string;
|
|
245
224
|
se374a10ee87f7f8c: string;
|
|
246
225
|
se3d2b191408a6254: string;
|
|
247
226
|
se46604e4550a957d: string;
|
|
@@ -272,8 +251,46 @@ export declare const templates: {
|
|
|
272
251
|
sfa28319e707cf5d5: string;
|
|
273
252
|
sfd25dcb1e3a468be: string;
|
|
274
253
|
sffdadf0a576fd802: string;
|
|
254
|
+
s8ffdc67bd6500a2f: string;
|
|
255
|
+
sb4f1dffbb6be6302: string;
|
|
256
|
+
scd0ddab5a7a0f930: string;
|
|
257
|
+
s5d929ff1619ac0c9: string;
|
|
258
|
+
s7d628682e66e0d3a: string;
|
|
259
|
+
s6d8c02aee480af7a: string;
|
|
260
|
+
sc50d09edf9325339: string;
|
|
261
|
+
s52ac41b0b9dd0a9f: string;
|
|
262
|
+
sf3ff78cc329d3528: string;
|
|
263
|
+
s0fbf6dc6a1966408: string;
|
|
264
|
+
sea4f08110bb8f15d: string;
|
|
265
|
+
sbb980b38227e171f: string;
|
|
266
|
+
sc97edc0c4bf27853: string;
|
|
267
|
+
sde0f21c1e57481c9: string;
|
|
268
|
+
s2698862401bb7f50: import("@lit/localize").StrResult;
|
|
269
|
+
s1515b0f2c5188380: import("@lit/localize").StrResult;
|
|
270
|
+
sdc71496dfa9818bc: string;
|
|
271
|
+
sfc405bfeccadb01f: import("@lit/localize").StrResult;
|
|
272
|
+
s61d8ba5db13903be: import("@lit/localize").StrResult;
|
|
275
273
|
h12f3bd3a64c46efe: import("lit").TemplateResult<1>;
|
|
276
274
|
h82c989f2494613fa: import("lit").TemplateResult<1>;
|
|
277
275
|
hb3090d5e6b53fe7c: import("lit").TemplateResult<1>;
|
|
276
|
+
s3e006a806d3b4691: string;
|
|
277
|
+
sc3b5f0655f7e750e: string;
|
|
278
|
+
sd22efd1a56ff1273: string;
|
|
279
|
+
s1a48fb64b48125fe: string;
|
|
280
|
+
s51fc854463fe00f2: string;
|
|
281
|
+
seae566f3b8648763: string;
|
|
282
|
+
s7c9e442fd5d7403d: string;
|
|
283
|
+
s3ea043a36287930c: string;
|
|
284
|
+
s1e2b6f4c6cb2282b: string;
|
|
285
|
+
sf562460f1ffdc5e1: string;
|
|
286
|
+
see08734dfee6e873: string;
|
|
287
|
+
s6e95582c3d7ff15e: string;
|
|
288
|
+
s008e64897466dd2a: string;
|
|
289
|
+
s028ef49bb8631312: string;
|
|
290
|
+
s73d4afc47ac92ccf: string;
|
|
291
|
+
sfe88d270aa3e71da: string;
|
|
292
|
+
sc0c8035281ee7caf: string;
|
|
293
|
+
s417d2615b024887d: string;
|
|
294
|
+
s628f46be0c3e83be: string;
|
|
278
295
|
hc94338efbdc293e0: import("lit").TemplateResult<1>;
|
|
279
296
|
};
|