@blaze-cms/react-page-builder 0.124.0-alpha.4 → 0.124.0-alpha.40
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 +320 -0
- package/README.md +9 -0
- package/example.env +1 -0
- package/lib/BannerContext/index.js.map +1 -1
- package/lib/HOC/withInfiniteScroll.js.map +1 -1
- package/lib/HOC/withTitle.js.map +1 -1
- package/lib/PBContext/index.js.map +1 -1
- package/lib/application/query/index.js +9 -3
- package/lib/application/query/index.js.map +1 -1
- package/lib/components/BackToTop/BackToTop.js.map +1 -1
- package/lib/components/Banner/AdSlotRender.js.map +1 -1
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/Banner/helpers.js.map +1 -1
- package/lib/components/Banner/index.js.map +1 -1
- package/lib/components/BlazeLink.js.map +1 -1
- package/lib/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardContainer.js +3 -7
- package/lib/components/Card/CardContainer.js.map +1 -1
- package/lib/components/Card/CardFactory.js +6 -3
- package/lib/components/Card/CardFactory.js.map +1 -1
- package/lib/components/Card/CardRender.js.map +1 -1
- package/lib/components/Card/helpers/filter-query-setup.js.map +1 -1
- package/lib/components/Card/helpers/filters-setup.js.map +1 -1
- package/lib/components/Card/helpers/get-dynamic-grid-classes.js.map +1 -1
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselImage/CarouselImage.js.map +1 -1
- package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
- package/lib/components/CarouselWrapper.js +2 -2
- package/lib/components/CarouselWrapper.js.map +1 -1
- package/lib/components/ClickWrapper.js.map +1 -1
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/Code/ScriptTag.js.map +1 -1
- package/lib/components/Code/helpers/wrap-script-tags.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryFactory.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-data-summary-query.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-link-based-on-value.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-prop-value.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-value-from-array.js.map +1 -1
- package/lib/components/DataSummary/helpers/strip-summary-props-content.js.map +1 -1
- package/lib/components/EmailConfirm/EmailConfirm.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/NavButton.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/index.js.map +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/ImageDetails.js.map +1 -1
- package/lib/components/Image/ImageFactory.js.map +1 -1
- package/lib/components/Image/ImageRender.js +5 -1
- package/lib/components/Image/ImageRender.js.map +1 -1
- package/lib/components/Image/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/ItemList/ItemListButton/ItemListButton.js +161 -0
- package/lib/components/ItemList/ItemListButton/ItemListButton.js.map +1 -0
- package/lib/components/ItemList/ItemListButton/index.js +16 -0
- package/lib/components/ItemList/ItemListButton/index.js.map +1 -0
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js +83 -0
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -0
- package/lib/components/ItemList/ItemListCounter/index.js +16 -0
- package/lib/components/ItemList/ItemListCounter/index.js.map +1 -0
- package/lib/components/ItemList/ItemListNew/ItemListNew.js +87 -0
- package/lib/components/ItemList/ItemListNew/ItemListNew.js.map +1 -0
- package/lib/components/ItemList/ItemListNew/index.js +16 -0
- package/lib/components/ItemList/ItemListNew/index.js.map +1 -0
- package/lib/components/ItemList/constants.js +19 -0
- package/lib/components/ItemList/constants.js.map +1 -0
- package/lib/components/ItemList/helpers/get-item-list-data.js +17 -0
- package/lib/components/ItemList/helpers/get-item-list-data.js.map +1 -0
- package/lib/components/ItemList/helpers/get-item-list-id.js +23 -0
- package/lib/components/ItemList/helpers/get-item-list-id.js.map +1 -0
- package/lib/components/ItemList/helpers/get-item-list-ids.js +28 -0
- package/lib/components/ItemList/helpers/get-item-list-ids.js.map +1 -0
- package/lib/components/ItemList/helpers/index.js +50 -0
- package/lib/components/ItemList/helpers/index.js.map +1 -0
- package/lib/components/ItemList/helpers/set-item-list-id.js +22 -0
- package/lib/components/ItemList/helpers/set-item-list-id.js.map +1 -0
- package/lib/components/ItemList/helpers/set-param-and-redirect.js +51 -0
- package/lib/components/ItemList/helpers/set-param-and-redirect.js.map +1 -0
- package/lib/components/ItemList/hooks/index.js +18 -0
- package/lib/components/ItemList/hooks/index.js.map +1 -0
- package/lib/components/ItemList/hooks/use-item-list-id.js +45 -0
- package/lib/components/ItemList/hooks/use-item-list-id.js.map +1 -0
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/Layout/helpers/check-if-row-has-columns.js.map +1 -1
- package/lib/components/LazyImage/LazyImage.js +5 -1
- package/lib/components/LazyImage/LazyImage.js.map +1 -1
- package/lib/components/LazyImage/index.js.map +1 -1
- package/lib/components/List/ListBuilder.js +12 -6
- package/lib/components/List/ListBuilder.js.map +1 -1
- package/lib/components/List/ListFactory.js +34 -7
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/ListRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardRenderWithInfiniteScroll.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderItem.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderWrapper.js.map +1 -1
- package/lib/components/List/components/Full/FullRender.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderWithInfiniteScroll.js.map +1 -1
- package/lib/components/List/components/Header/ListHeader.js.map +1 -1
- package/lib/components/List/components/Pagination/Classic.js.map +1 -1
- package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
- package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
- package/lib/components/List/helpers/build-az-aggregations.js.map +1 -1
- package/lib/components/List/helpers/build-az-url.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-items.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-url.js.map +1 -1
- package/lib/components/List/helpers/has-required-item-list-details.js +29 -0
- package/lib/components/List/helpers/has-required-item-list-details.js.map +1 -0
- package/lib/components/List/helpers/index.js +8 -0
- package/lib/components/List/helpers/index.js.map +1 -1
- package/lib/components/Login/LoggedInMessage.js.map +1 -1
- package/lib/components/Login/Login.js.map +1 -1
- package/lib/components/Login/LoginForm.js.map +1 -1
- package/lib/components/Menu/Menu.js +41 -28
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/MenuContext.js +20 -0
- package/lib/components/Menu/MenuContext.js.map +1 -0
- package/lib/components/MenuItem/MenuItem.js +26 -7
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/PasswordReset/PasswordReset.js.map +1 -1
- package/lib/components/PasswordReset/helpers/validatePassword.js.map +1 -1
- package/lib/components/PasswordResetRequest/PasswordResetRequest.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js +183 -0
- package/lib/components/SearchContent/SearchContent.js.map +1 -0
- package/lib/components/SearchContent/SearchContentItems.js +51 -0
- package/lib/components/SearchContent/SearchContentItems.js.map +1 -0
- package/lib/components/SearchContent/SearchContentResults.js +45 -0
- package/lib/components/SearchContent/SearchContentResults.js.map +1 -0
- package/lib/components/SearchContent/SearchContentToggleIcon.js +42 -0
- package/lib/components/SearchContent/SearchContentToggleIcon.js.map +1 -0
- package/lib/components/SearchContent/index.js +2 -233
- package/lib/components/SearchContent/index.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/CloseMobileForm.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/FiltersList.js +2 -4
- package/lib/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/MobileFormToolbar.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/ResetDesktopForm.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +27 -69
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +87 -23
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/components/Checkbox.js +19 -9
- package/lib/components/SearchFilter/components/Checkbox.js.map +1 -1
- package/lib/components/SearchFilter/components/Range.js.map +1 -1
- package/lib/components/SearchFilter/components/Select.js +27 -11
- package/lib/components/SearchFilter/components/Select.js.map +1 -1
- package/lib/components/SearchFilter/components/TextSearch.js +1 -5
- package/lib/components/SearchFilter/components/TextSearch.js.map +1 -1
- package/lib/components/SearchFilter/constants.js +1 -1
- package/lib/components/SearchFilter/constants.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-filters-query.js +87 -0
- package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/build-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-raw-query-stringified.js +2 -1
- package/lib/components/SearchFilter/helpers/build-raw-query-stringified.js.map +1 -1
- package/lib/components/SearchFilter/helpers/calculate-min-max.js.map +1 -1
- package/lib/components/SearchFilter/helpers/check-if-range-updated.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-intersected-prop.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-range-value.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-responsive-filter-classnames.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-select-options.js.map +1 -1
- package/lib/components/SearchFilter/helpers/index.js +8 -0
- package/lib/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/components/SocialFollow/SFItem.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollow.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollowRender.js.map +1 -1
- package/lib/components/SubMenu/SubMenu.js.map +1 -1
- package/lib/components/TextBlock/TextBlockRender.js.map +1 -1
- package/lib/components/TextBlock/index.js.map +1 -1
- package/lib/components/Video/Video.js.map +1 -1
- package/lib/components/Video/VideoModal.js.map +1 -1
- package/lib/components/Video/VideoRender.js.map +1 -1
- package/lib/components/Video/providers/Default.js.map +1 -1
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YouTubeProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib/components/Video/providers/get-provider.js.map +1 -1
- package/lib/components/Wrapper.js.map +1 -1
- package/lib/components/index.js +16 -1
- package/lib/components/index.js.map +1 -1
- package/lib/constants/index.js +3 -1
- package/lib/constants/index.js.map +1 -1
- package/lib/helpers/build-inherited-filters.js.map +1 -1
- package/lib/helpers/build-raw-query-base.js.map +1 -1
- package/lib/helpers/build-raw-query.js.map +1 -1
- package/lib/helpers/build-search-values-checkbox-select.js.map +1 -1
- package/lib/helpers/check-props-to-use.js.map +1 -1
- package/lib/helpers/get-entities-with-banner.js.map +1 -1
- package/lib/helpers/get-entity-data.js.map +1 -1
- package/lib/helpers/get-entity-render-props.js.map +1 -1
- package/lib/helpers/get-filter-props.js.map +1 -1
- package/lib/helpers/get-generic-props.js.map +1 -1
- package/lib/helpers/get-generic-render-variables.js.map +1 -1
- package/lib/helpers/get-image-ids.js.map +1 -1
- package/lib/helpers/get-parsed-prop-values.js.map +1 -1
- package/lib/helpers/get-prop-values.js.map +1 -1
- package/lib/helpers/get-query-filters.js.map +1 -1
- package/lib/helpers/get-query-props.js.map +1 -1
- package/lib/helpers/get-updated-filter-by.js.map +1 -1
- package/lib/helpers/inject-banner.js.map +1 -1
- package/lib/helpers/inject-banners-to-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/helpers/group-node-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/inject-multiple-banners.js.map +1 -1
- package/lib/helpers/is-filter-entitys-id.js.map +1 -1
- package/lib/helpers/parse-TextBlock.js.map +1 -1
- package/lib/helpers/parse-props-to-display.js.map +1 -1
- package/lib/helpers/render-children.js.map +1 -1
- package/lib/helpers/sort-response-data.js.map +1 -1
- package/lib/hooks/helpers/RenderComponent.js.map +1 -1
- package/lib/hooks/helpers/append-gtm-classname.js +1 -0
- package/lib/hooks/helpers/append-gtm-classname.js.map +1 -1
- package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
- package/lib/hooks/helpers/getComponent.js.map +1 -1
- package/lib/hooks/helpers/inject-element-banners.js.map +1 -1
- package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
- package/lib/hooks/helpers/insert-banners.js.map +1 -1
- package/lib/hooks/helpers/update-targetings.js.map +1 -1
- package/lib/hooks/use-banner-insertion.js.map +1 -1
- package/lib/hooks/use-check-mobile-screen.js.map +1 -1
- package/lib/hooks/use-get-entity-schema.js.map +1 -1
- package/lib/hooks/use-get-entity-schemas-as-obj.js.map +1 -1
- package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
- package/lib/hooks/use-get-images.js.map +1 -1
- package/lib/hooks/use-get-single-entity-schema.js.map +1 -1
- package/lib/hooks/use-page-builder.js.map +1 -1
- package/lib/utils/get-class-modifiers.js.map +1 -1
- package/lib/utils/get-image-data.js.map +1 -1
- package/lib-es/application/query/index.js +49 -1
- package/lib-es/application/query/index.js.map +1 -1
- package/lib-es/components/Card/CardContainer.js +3 -7
- package/lib-es/components/Card/CardContainer.js.map +1 -1
- package/lib-es/components/Card/CardFactory.js +7 -4
- package/lib-es/components/Card/CardFactory.js.map +1 -1
- package/lib-es/components/CarouselWrapper.js +2 -2
- package/lib-es/components/CarouselWrapper.js.map +1 -1
- package/lib-es/components/Image/ImageRender.js +4 -1
- package/lib-es/components/Image/ImageRender.js.map +1 -1
- package/lib-es/components/ItemList/ItemListButton/ItemListButton.js +111 -0
- package/lib-es/components/ItemList/ItemListButton/ItemListButton.js.map +1 -0
- package/lib-es/components/ItemList/ItemListButton/index.js +3 -0
- package/lib-es/components/ItemList/ItemListButton/index.js.map +1 -0
- package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js +60 -0
- package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -0
- package/lib-es/components/ItemList/ItemListCounter/index.js +3 -0
- package/lib-es/components/ItemList/ItemListCounter/index.js.map +1 -0
- package/lib-es/components/ItemList/ItemListNew/ItemListNew.js +64 -0
- package/lib-es/components/ItemList/ItemListNew/ItemListNew.js.map +1 -0
- package/lib-es/components/ItemList/ItemListNew/index.js +3 -0
- package/lib-es/components/ItemList/ItemListNew/index.js.map +1 -0
- package/lib-es/components/ItemList/constants.js +6 -0
- package/lib-es/components/ItemList/constants.js.map +1 -0
- package/lib-es/components/ItemList/helpers/get-item-list-data.js +7 -0
- package/lib-es/components/ItemList/helpers/get-item-list-data.js.map +1 -0
- package/lib-es/components/ItemList/helpers/get-item-list-id.js +11 -0
- package/lib-es/components/ItemList/helpers/get-item-list-id.js.map +1 -0
- package/lib-es/components/ItemList/helpers/get-item-list-ids.js +13 -0
- package/lib-es/components/ItemList/helpers/get-item-list-ids.js.map +1 -0
- package/lib-es/components/ItemList/helpers/index.js +6 -0
- package/lib-es/components/ItemList/helpers/index.js.map +1 -0
- package/lib-es/components/ItemList/helpers/set-item-list-id.js +10 -0
- package/lib-es/components/ItemList/helpers/set-item-list-id.js.map +1 -0
- package/lib-es/components/ItemList/helpers/set-param-and-redirect.js +20 -0
- package/lib-es/components/ItemList/helpers/set-param-and-redirect.js.map +1 -0
- package/lib-es/components/ItemList/hooks/index.js +2 -0
- package/lib-es/components/ItemList/hooks/index.js.map +1 -0
- package/lib-es/components/ItemList/hooks/use-item-list-id.js +26 -0
- package/lib-es/components/ItemList/hooks/use-item-list-id.js.map +1 -0
- package/lib-es/components/LazyImage/LazyImage.js +4 -1
- package/lib-es/components/LazyImage/LazyImage.js.map +1 -1
- package/lib-es/components/List/ListBuilder.js +12 -6
- package/lib-es/components/List/ListBuilder.js.map +1 -1
- package/lib-es/components/List/ListFactory.js +33 -9
- package/lib-es/components/List/ListFactory.js.map +1 -1
- package/lib-es/components/List/helpers/has-required-item-list-details.js +20 -0
- package/lib-es/components/List/helpers/has-required-item-list-details.js.map +1 -0
- package/lib-es/components/List/helpers/index.js +1 -0
- package/lib-es/components/List/helpers/index.js.map +1 -1
- package/lib-es/components/Menu/Menu.js +54 -46
- package/lib-es/components/Menu/Menu.js.map +1 -1
- package/lib-es/components/Menu/MenuContext.js +6 -0
- package/lib-es/components/Menu/MenuContext.js.map +1 -0
- package/lib-es/components/MenuItem/MenuItem.js +24 -9
- package/lib-es/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-es/components/SearchContent/SearchContent.js +129 -0
- package/lib-es/components/SearchContent/SearchContent.js.map +1 -0
- package/lib-es/components/SearchContent/SearchContentItems.js +33 -0
- package/lib-es/components/SearchContent/SearchContentItems.js.map +1 -0
- package/lib-es/components/SearchContent/SearchContentResults.js +31 -0
- package/lib-es/components/SearchContent/SearchContentResults.js.map +1 -0
- package/lib-es/components/SearchContent/SearchContentToggleIcon.js +30 -0
- package/lib-es/components/SearchContent/SearchContentToggleIcon.js.map +1 -0
- package/lib-es/components/SearchContent/index.js +1 -172
- package/lib-es/components/SearchContent/index.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/FiltersList.js +2 -4
- package/lib-es/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +21 -46
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js +70 -15
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Checkbox.js +18 -9
- package/lib-es/components/SearchFilter/components/Checkbox.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Select.js +23 -8
- package/lib-es/components/SearchFilter/components/Select.js.map +1 -1
- package/lib-es/components/SearchFilter/components/TextSearch.js +1 -5
- package/lib-es/components/SearchFilter/components/TextSearch.js.map +1 -1
- package/lib-es/components/SearchFilter/constants.js +1 -1
- package/lib-es/components/SearchFilter/constants.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js +54 -0
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/build-raw-query-stringified.js +2 -1
- package/lib-es/components/SearchFilter/helpers/build-raw-query-stringified.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/index.js +2 -1
- package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib-es/components/index.js +10 -1
- package/lib-es/components/index.js.map +1 -1
- package/lib-es/constants/index.js +2 -1
- package/lib-es/constants/index.js.map +1 -1
- package/lib-es/helpers/build-raw-query.js.map +1 -1
- package/lib-es/hooks/helpers/append-gtm-classname.js +1 -0
- package/lib-es/hooks/helpers/append-gtm-classname.js.map +1 -1
- package/package.json +5 -4
- package/src/application/query/index.js +55 -1
- package/src/components/Card/CardContainer.js +2 -6
- package/src/components/Card/CardFactory.js +5 -3
- package/src/components/CarouselWrapper.js +2 -2
- package/src/components/Image/ImageRender.js +3 -0
- package/src/components/ItemList/ItemListButton/ItemListButton.js +94 -0
- package/src/components/ItemList/ItemListButton/index.js +3 -0
- package/src/components/ItemList/ItemListCounter/ItemListCounter.js +52 -0
- package/src/components/ItemList/ItemListCounter/index.js +3 -0
- package/src/components/ItemList/ItemListNew/ItemListNew.js +51 -0
- package/src/components/ItemList/ItemListNew/index.js +3 -0
- package/src/components/ItemList/constants.js +5 -0
- package/src/components/ItemList/helpers/get-item-list-data.js +6 -0
- package/src/components/ItemList/helpers/get-item-list-id.js +11 -0
- package/src/components/ItemList/helpers/get-item-list-ids.js +10 -0
- package/src/components/ItemList/helpers/index.js +5 -0
- package/src/components/ItemList/helpers/set-item-list-id.js +9 -0
- package/src/components/ItemList/helpers/set-param-and-redirect.js +20 -0
- package/src/components/ItemList/hooks/index.js +1 -0
- package/src/components/ItemList/hooks/use-item-list-id.js +27 -0
- package/src/components/LazyImage/LazyImage.js +11 -1
- package/src/components/List/ListBuilder.js +10 -5
- package/src/components/List/ListFactory.js +48 -12
- package/src/components/List/helpers/has-required-item-list-details.js +14 -0
- package/src/components/List/helpers/index.js +1 -0
- package/src/components/Menu/Menu.js +61 -54
- package/src/components/Menu/MenuContext.js +5 -0
- package/src/components/MenuItem/MenuItem.js +39 -14
- package/src/components/SearchContent/SearchContent.js +136 -0
- package/src/components/SearchContent/SearchContentItems.js +28 -0
- package/src/components/SearchContent/SearchContentResults.js +27 -0
- package/src/components/SearchContent/SearchContentToggleIcon.js +27 -0
- package/src/components/SearchContent/index.js +1 -177
- package/src/components/SearchFilter/SearchFilter/FiltersList.js +30 -37
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +20 -28
- package/src/components/SearchFilter/SearchFilterContainer.js +58 -16
- package/src/components/SearchFilter/components/Checkbox.js +23 -8
- package/src/components/SearchFilter/components/Select.js +18 -11
- package/src/components/SearchFilter/components/TextSearch.js +1 -3
- package/src/components/SearchFilter/constants.js +1 -1
- package/src/components/SearchFilter/helpers/build-filters-query.js +40 -0
- package/src/components/SearchFilter/helpers/build-raw-query-stringified.js +2 -1
- package/src/components/SearchFilter/helpers/get-initial-filter-values.js +1 -0
- package/src/components/SearchFilter/helpers/index.js +3 -1
- package/src/components/index.js +10 -1
- package/src/constants/index.js +2 -0
- package/src/helpers/build-raw-query.js +1 -0
- package/src/hooks/helpers/append-gtm-classname.js +3 -0
- package/tests/helpers/mocks.js +4 -4
- package/tests/unit/src/components/ItemList/ItemListButton.test.js +175 -0
- package/tests/unit/src/components/ItemList/ItemListCounter.test.js +65 -0
- package/tests/unit/src/components/ItemList/ItemListNew.test.js +164 -0
- package/tests/unit/src/components/ItemList/__snapshots__/ItemListButton.test.js.snap +107 -0
- package/tests/unit/src/components/ItemList/__snapshots__/ItemListCounter.test.js.snap +31 -0
- package/tests/unit/src/components/ItemList/__snapshots__/ItemListNew.test.js.snap +27 -0
- package/tests/unit/src/components/ItemList/helpers/get-item-list-data.test.js +28 -0
- package/tests/unit/src/components/ItemList/helpers/get-item-list-id.test.js +20 -0
- package/tests/unit/src/components/ItemList/helpers/get-item-list-ids.test.js +19 -0
- package/tests/unit/src/components/ItemList/helpers/set-item-list-id.test.js +13 -0
- package/tests/unit/src/components/ItemList/helpers/set-param-and-redirect.test.js +30 -0
- package/tests/unit/src/components/ItemList/hooks/use-item-list-id.test.js +32 -0
- package/tests/unit/src/components/List/helpers/has-required-item-list-details.test.js +30 -0
- package/tests/unit/src/components/Menu/Menu.test.js +9 -3
- package/tests/unit/src/components/Menu/__snapshots__/Menu.test.js.snap +12 -11
- package/tests/unit/src/components/MenuItem/MenuItem.test.js +1 -1
- package/tests/unit/src/components/MenuItem/SubMenu.test.js +5 -1
- package/tests/unit/src/components/MenuItem/__snapshots__/MenuItem.test.js.snap +54 -10
- package/tests/unit/src/components/SearchContent/SearchContent.test.js +29 -0
- package/tests/unit/src/components/SearchContent/__snapshots__/SearchContent.test.js.snap +9 -0
- package/tests/unit/src/components/SearchFilter/SearchFilter/SearchFilter.test.js +26 -7
- package/tests/unit/src/components/SearchFilter/SearchFilter/__snapshots__/SearchFilter.test.js.snap +4 -0
- package/tests/unit/src/components/SearchFilter/components/__snapshots__/Checkbox.test.js.snap +2 -0
- package/tests/unit/src/components/SearchFilter/components/__snapshots__/Select.test.js.snap +4 -0
- package/tests/unit/src/components/__snapshots__/index.test.js.snap +12 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-inherited-filters.js","names":["getRelationData","entityData","relationName","currentRelationNames","length","arrayOfRelations","map","name","filter","Boolean","checkIfArrayHasData","isDataArray","relationData","setFiltersNoRelation","arrayHasData","filters","filterValues","reduce","acc","relationValue","push","buildInheritedFilters","inheritedFilters","currentSchema","filterEntitySchema","itemId","relationFilters","currentEntityId","identifier","forEach","filterName","entityName","relationProp","relationEntityName","relationForeignKeys","shouldIgnoreFilter","Array","isArray","filtersNoRelation"],"sources":["../../src/helpers/build-inherited-filters.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport isFilterEntitysId from './is-filter-entitys-id';\nimport getFilterProps from './get-filter-props';\n\nconst getRelationData = (entityData, relationName, currentRelationNames) => {\n if (!entityData) return null;\n if (currentRelationNames && currentRelationNames.length) {\n const arrayOfRelations = currentRelationNames.map(name => entityData[name]).filter(Boolean);\n return arrayOfRelations.length ? flatten(arrayOfRelations) : null;\n }\n return entityData[relationName];\n};\n\nconst checkIfArrayHasData = (isDataArray, relationData) => isDataArray && !!relationData.length;\n\nconst setFiltersNoRelation = (isDataArray, arrayHasData, relationData, relationName) => {\n const filters = [];\n if (arrayHasData) {\n const filterValues = relationData.reduce((acc, relationValue) => {\n if (relationValue && typeof relationValue !== 'object')\n acc.push(`${relationName}/${relationValue}`);\n return acc;\n }, []);\n filters.push(...filterValues);\n } else if (!isDataArray && typeof relationData !== 'object') {\n filters.push(`${relationName}/${relationData}`);\n }\n\n return filters;\n};\nconst buildInheritedFilters = (\n entityData,\n inheritedFilters,\n currentSchema,\n filterEntitySchema,\n itemId\n) => {\n const relationFilters = [];\n const { identifier: currentEntityId } = currentSchema;\n\n inheritedFilters.forEach(filter => {\n const {\n filterName,\n entityName,\n relationName,\n relationProp,\n relationEntityName,\n relationForeignKeys,\n shouldIgnoreFilter\n } = getFilterProps(filter, currentSchema, filterEntitySchema);\n\n const relationData = getRelationData(entityData, relationName, relationForeignKeys);\n\n if (\n (currentEntityId === entityName && isFilterEntitysId(filterName, currentEntityId)) ||\n shouldIgnoreFilter\n ) {\n relationFilters.push(`${filterName}/${itemId}`);\n }\n\n if (!relationData) return;\n\n const isDataArray = Array.isArray(relationData);\n const arrayHasData = checkIfArrayHasData(isDataArray, relationData);\n\n if (!relationEntityName) {\n const filtersNoRelation = setFiltersNoRelation(\n isDataArray,\n arrayHasData,\n relationData,\n relationName\n );\n relationFilters.push(...filtersNoRelation);\n }\n\n if (arrayHasData) {\n const filterValues = relationData.reduce((acc, relationValue) => {\n if (relationValue[relationProp]) acc.push(`${filterName}/${relationValue[relationProp]}`);\n return acc;\n }, []);\n relationFilters.push(...filterValues);\n } else if (!isDataArray && relationData[relationProp]) {\n relationFilters.push(`${filterName}/${relationData[relationProp]}`);\n }\n });\n\n return relationFilters;\n};\n\nexport default buildInheritedFilters;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,UAAD,EAAaC,YAAb,EAA2BC,oBAA3B,EAAoD;EAC1E,IAAI,CAACF,UAAL,EAAiB,OAAO,IAAP;;EACjB,IAAIE,oBAAoB,IAAIA,oBAAoB,CAACC,MAAjD,EAAyD;IACvD,IAAMC,gBAAgB,GAAGF,oBAAoB,CAACG,GAArB,CAAyB,UAAAC,IAAI;MAAA,OAAIN,UAAU,CAACM,IAAD,CAAd;IAAA,CAA7B,EAAmDC,MAAnD,CAA0DC,OAA1D,CAAzB;IACA,OAAOJ,gBAAgB,CAACD,MAAjB,GAA0B,
|
|
1
|
+
{"version":3,"file":"build-inherited-filters.js","names":["getRelationData","entityData","relationName","currentRelationNames","length","arrayOfRelations","map","name","filter","Boolean","flatten","checkIfArrayHasData","isDataArray","relationData","setFiltersNoRelation","arrayHasData","filters","filterValues","reduce","acc","relationValue","push","buildInheritedFilters","inheritedFilters","currentSchema","filterEntitySchema","itemId","relationFilters","currentEntityId","identifier","forEach","getFilterProps","filterName","entityName","relationProp","relationEntityName","relationForeignKeys","shouldIgnoreFilter","isFilterEntitysId","Array","isArray","filtersNoRelation"],"sources":["../../src/helpers/build-inherited-filters.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport isFilterEntitysId from './is-filter-entitys-id';\nimport getFilterProps from './get-filter-props';\n\nconst getRelationData = (entityData, relationName, currentRelationNames) => {\n if (!entityData) return null;\n if (currentRelationNames && currentRelationNames.length) {\n const arrayOfRelations = currentRelationNames.map(name => entityData[name]).filter(Boolean);\n return arrayOfRelations.length ? flatten(arrayOfRelations) : null;\n }\n return entityData[relationName];\n};\n\nconst checkIfArrayHasData = (isDataArray, relationData) => isDataArray && !!relationData.length;\n\nconst setFiltersNoRelation = (isDataArray, arrayHasData, relationData, relationName) => {\n const filters = [];\n if (arrayHasData) {\n const filterValues = relationData.reduce((acc, relationValue) => {\n if (relationValue && typeof relationValue !== 'object')\n acc.push(`${relationName}/${relationValue}`);\n return acc;\n }, []);\n filters.push(...filterValues);\n } else if (!isDataArray && typeof relationData !== 'object') {\n filters.push(`${relationName}/${relationData}`);\n }\n\n return filters;\n};\nconst buildInheritedFilters = (\n entityData,\n inheritedFilters,\n currentSchema,\n filterEntitySchema,\n itemId\n) => {\n const relationFilters = [];\n const { identifier: currentEntityId } = currentSchema;\n\n inheritedFilters.forEach(filter => {\n const {\n filterName,\n entityName,\n relationName,\n relationProp,\n relationEntityName,\n relationForeignKeys,\n shouldIgnoreFilter\n } = getFilterProps(filter, currentSchema, filterEntitySchema);\n\n const relationData = getRelationData(entityData, relationName, relationForeignKeys);\n\n if (\n (currentEntityId === entityName && isFilterEntitysId(filterName, currentEntityId)) ||\n shouldIgnoreFilter\n ) {\n relationFilters.push(`${filterName}/${itemId}`);\n }\n\n if (!relationData) return;\n\n const isDataArray = Array.isArray(relationData);\n const arrayHasData = checkIfArrayHasData(isDataArray, relationData);\n\n if (!relationEntityName) {\n const filtersNoRelation = setFiltersNoRelation(\n isDataArray,\n arrayHasData,\n relationData,\n relationName\n );\n relationFilters.push(...filtersNoRelation);\n }\n\n if (arrayHasData) {\n const filterValues = relationData.reduce((acc, relationValue) => {\n if (relationValue[relationProp]) acc.push(`${filterName}/${relationValue[relationProp]}`);\n return acc;\n }, []);\n relationFilters.push(...filterValues);\n } else if (!isDataArray && relationData[relationProp]) {\n relationFilters.push(`${filterName}/${relationData[relationProp]}`);\n }\n });\n\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3B,oBAAoB,CAC5CF,WAD4C,EAE5CG,YAF4C,EAG5CF,YAH4C,EAI5CX,YAJ4C,CAA9C;MAMAyB,eAAe,CAACN,IAAhB,OAAAM,eAAe,sCAASc,iBAAT,EAAf;IACD;;IAED,IAAI1B,YAAJ,EAAkB;MAChB,IAAME,YAAY,GAAGJ,YAAY,CAACK,MAAb,CAAoB,UAACC,GAAD,EAAMC,aAAN,EAAwB;QAC/D,IAAIA,aAAa,CAACc,YAAD,CAAjB,EAAiCf,GAAG,CAACE,IAAJ,WAAYW,UAAZ,cAA0BZ,aAAa,CAACc,YAAD,CAAvC;QACjC,OAAOf,GAAP;MACD,CAHoB,EAGlB,EAHkB,CAArB;MAIAQ,eAAe,CAACN,IAAhB,OAAAM,eAAe,sCAASV,YAAT,EAAf;IACD,CAND,MAMO,IAAI,CAACL,WAAD,IAAgBC,YAAY,CAACqB,YAAD,CAAhC,EAAgD;MACrDP,eAAe,CAACN,IAAhB,WAAwBW,UAAxB,cAAsCnB,YAAY,CAACqB,YAAD,CAAlD;IACD;EACF,CA5CD;EA8CA,OAAOP,eAAP;AACD,CAzDD;;eA2DeL,qB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-raw-query-base.js","names":["buildCheckboxFilters","checkboxFilters","reduce","acc","checkboxFilter","push","match","buildFilterValues","listFilterValues","relations","stringProps","listFilterValuesKeys","Object","keys","map","key","values","el","updatedKey","isRelation","includes","split","relationName","relationProp","filter","localField","relation","entityIdentifier","fieldName","KEYWORD","bool","should","buildItemsToDisplayValues","itemsToDisplay","length","itemToDisplayIds","ids","buildRawQueryBase","docType","id","filterValues","filterOperator","addListFiltersToQuery","listFilterFinalValues","checkboxFiltersValue","itemsToDisplayValues","isOperatorOr","OR","queryFilters","baseBoolObject","must","term","OR_OPERATOR","mustNot","undefined","queryFilter","must_not"],"sources":["../../src/helpers/build-raw-query-base.js"],"sourcesContent":["import getItemsToDisplayIds from './get-items-to-display-ids';\nimport { OR, OR_OPERATOR, KEYWORD } from '../constants';\n\nconst buildCheckboxFilters = checkboxFilters =>\n checkboxFilters.reduce((acc, checkboxFilter) => {\n acc.push({ match: { [checkboxFilter]: true } });\n return acc;\n }, []);\n\nconst buildFilterValues = (listFilterValues, relations, stringProps) => {\n const listFilterValuesKeys = Object.keys(listFilterValues);\n\n return listFilterValuesKeys.map(key => {\n const values = listFilterValues[key].map(el => {\n let updatedKey = key;\n\n const isRelation = key.includes('.');\n\n if (isRelation) {\n const [relationName, relationProp] = key.split('.');\n const [relation] = relations.filter(({ localField }) => localField === relationName);\n const { entityIdentifier = '' } = relation || {};\n if (entityIdentifier && entityIdentifier !== relationName)\n updatedKey = `${entityIdentifier}.${relationProp}`;\n }\n const fieldName = stringProps.includes(updatedKey) ? `${key}.${KEYWORD}` : key;\n return { match: { [fieldName]: el } };\n });\n return { bool: { should: values } };\n });\n};\n\nconst buildItemsToDisplayValues = itemsToDisplay => {\n if (!itemsToDisplay || !itemsToDisplay.length) return [];\n const itemToDisplayIds = getItemsToDisplayIds(itemsToDisplay);\n return [{ ids: { values: itemToDisplayIds } }];\n};\n\nconst buildRawQueryBase = ({\n docType,\n id,\n filterValues: { checkboxFilters = [], listFilterValues = {} } = {},\n filterOperator,\n relations,\n stringProps,\n itemsToDisplay,\n addListFiltersToQuery = false\n}) => {\n const listFilterFinalValues = buildFilterValues(listFilterValues, relations, stringProps);\n const checkboxFiltersValue = buildCheckboxFilters(checkboxFilters);\n const itemsToDisplayValues = buildItemsToDisplayValues(itemsToDisplay);\n const isOperatorOr = filterOperator === OR;\n\n const queryFilters = [];\n const baseBoolObject = {\n must: [\n {\n term: {\n docType\n }\n },\n ...itemsToDisplayValues,\n ...checkboxFiltersValue\n ]\n };\n\n if (isOperatorOr) {\n if (addListFiltersToQuery) {\n queryFilters.push(...listFilterFinalValues);\n } else {\n baseBoolObject.must.push({ bool: { [OR_OPERATOR]: [...listFilterFinalValues] } });\n }\n } else {\n baseBoolObject.must.push(...listFilterFinalValues);\n }\n\n const mustNot = id ? [{ ids: { values: [id] } }] : undefined;\n\n const queryFilter = queryFilters.length\n ? { [OR_OPERATOR]: queryFilters, minimum_should_match: 1 }\n : {};\n return {\n ...queryFilter,\n filter: {\n bool: baseBoolObject\n },\n must_not: mustNot\n };\n};\n\nexport default buildRawQueryBase;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAAAC,eAAe;EAAA,OAC1CA,eAAe,CAACC,MAAhB,CAAuB,UAACC,GAAD,EAAMC,cAAN,EAAyB;IAC9CD,GAAG,CAACE,IAAJ,CAAS;MAAEC,KAAK,uCAAKF,cAAL,EAAsB,IAAtB;IAAP,CAAT;IACA,OAAOD,GAAP;EACD,CAHD,EAGG,EAHH,CAD0C;AAAA,CAA5C;;AAMA,IAAMI,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,gBAAD,EAAmBC,SAAnB,EAA8BC,WAA9B,EAA8C;EACtE,IAAMC,oBAAoB,GAAGC,MAAM,CAACC,IAAP,CAAYL,gBAAZ,CAA7B;EAEA,OAAOG,oBAAoB,CAACG,GAArB,CAAyB,UAAAC,GAAG,EAAI;IACrC,IAAMC,MAAM,GAAGR,gBAAgB,CAACO,GAAD,CAAhB,CAAsBD,GAAtB,CAA0B,UAAAG,EAAE,EAAI;MAC7C,IAAIC,UAAU,GAAGH,GAAjB;MAEA,IAAMI,UAAU,GAAGJ,GAAG,CAACK,QAAJ,CAAa,GAAb,CAAnB;;MAEA,IAAID,UAAJ,EAAgB;QACd,iBAAqCJ,GAAG,CAACM,KAAJ,CAAU,GAAV,CAArC;QAAA;QAAA,IAAOC,YAAP;QAAA,IAAqBC,YAArB;;QACA,wBAAmBd,SAAS,CAACe,MAAV,CAAiB;UAAA,IAAGC,UAAH,QAAGA,UAAH;UAAA,OAAoBA,UAAU,KAAKH,YAAnC;QAAA,CAAjB,CAAnB;QAAA;QAAA,IAAOI,QAAP;;QACA,YAAkCA,QAAQ,IAAI,EAA9C;QAAA,kCAAQC,gBAAR;QAAA,IAAQA,gBAAR,sCAA2B,EAA3B;;QACA,IAAIA,gBAAgB,IAAIA,gBAAgB,KAAKL,YAA7C,EACEJ,UAAU,aAAMS,gBAAN,cAA0BJ,YAA1B,CAAV;MACH;;MACD,IAAMK,SAAS,GAAGlB,WAAW,CAACU,QAAZ,CAAqBF,UAArB,cAAsCH,GAAtC,cAA6Cc,kBAA7C,IAAyDd,GAA3E;MACA,OAAO;QAAET,KAAK,uCAAKsB,SAAL,EAAiBX,EAAjB;MAAP,CAAP;IACD,CAdc,CAAf;IAeA,OAAO;MAAEa,IAAI,EAAE;QAAEC,MAAM,EAAEf;MAAV;IAAR,CAAP;EACD,CAjBM,CAAP;AAkBD,CArBD;;AAuBA,IAAMgB,yBAAyB,GAAG,SAA5BA,yBAA4B,CAAAC,cAAc,EAAI;EAClD,IAAI,CAACA,cAAD,IAAmB,CAACA,cAAc,CAACC,MAAvC,EAA+C,OAAO,EAAP;EAC/C,IAAMC,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"build-raw-query-base.js","names":["buildCheckboxFilters","checkboxFilters","reduce","acc","checkboxFilter","push","match","buildFilterValues","listFilterValues","relations","stringProps","listFilterValuesKeys","Object","keys","map","key","values","el","updatedKey","isRelation","includes","split","relationName","relationProp","filter","localField","relation","entityIdentifier","fieldName","KEYWORD","bool","should","buildItemsToDisplayValues","itemsToDisplay","length","itemToDisplayIds","getItemsToDisplayIds","ids","buildRawQueryBase","docType","id","filterValues","filterOperator","addListFiltersToQuery","listFilterFinalValues","checkboxFiltersValue","itemsToDisplayValues","isOperatorOr","OR","queryFilters","baseBoolObject","must","term","OR_OPERATOR","mustNot","undefined","queryFilter","must_not"],"sources":["../../src/helpers/build-raw-query-base.js"],"sourcesContent":["import getItemsToDisplayIds from './get-items-to-display-ids';\nimport { OR, OR_OPERATOR, KEYWORD } from '../constants';\n\nconst buildCheckboxFilters = checkboxFilters =>\n checkboxFilters.reduce((acc, checkboxFilter) => {\n acc.push({ match: { [checkboxFilter]: true } });\n return acc;\n }, []);\n\nconst buildFilterValues = (listFilterValues, relations, stringProps) => {\n const listFilterValuesKeys = Object.keys(listFilterValues);\n\n return listFilterValuesKeys.map(key => {\n const values = listFilterValues[key].map(el => {\n let updatedKey = key;\n\n const isRelation = key.includes('.');\n\n if (isRelation) {\n const [relationName, relationProp] = key.split('.');\n const [relation] = relations.filter(({ localField }) => localField === relationName);\n const { entityIdentifier = '' } = relation || {};\n if (entityIdentifier && entityIdentifier !== relationName)\n updatedKey = `${entityIdentifier}.${relationProp}`;\n }\n const fieldName = stringProps.includes(updatedKey) ? `${key}.${KEYWORD}` : key;\n return { match: { [fieldName]: el } };\n });\n return { bool: { should: values } };\n });\n};\n\nconst buildItemsToDisplayValues = itemsToDisplay => {\n if (!itemsToDisplay || !itemsToDisplay.length) return [];\n const itemToDisplayIds = getItemsToDisplayIds(itemsToDisplay);\n return [{ ids: { values: itemToDisplayIds } }];\n};\n\nconst buildRawQueryBase = ({\n docType,\n id,\n filterValues: { checkboxFilters = [], listFilterValues = {} } = {},\n filterOperator,\n relations,\n stringProps,\n itemsToDisplay,\n addListFiltersToQuery = false\n}) => {\n const listFilterFinalValues = buildFilterValues(listFilterValues, relations, stringProps);\n const checkboxFiltersValue = buildCheckboxFilters(checkboxFilters);\n const itemsToDisplayValues = buildItemsToDisplayValues(itemsToDisplay);\n const isOperatorOr = filterOperator === OR;\n\n const queryFilters = [];\n const baseBoolObject = {\n must: [\n {\n term: {\n docType\n }\n },\n ...itemsToDisplayValues,\n ...checkboxFiltersValue\n ]\n };\n\n if (isOperatorOr) {\n if (addListFiltersToQuery) {\n queryFilters.push(...listFilterFinalValues);\n } else {\n baseBoolObject.must.push({ bool: { [OR_OPERATOR]: [...listFilterFinalValues] } });\n }\n } else {\n baseBoolObject.must.push(...listFilterFinalValues);\n }\n\n const mustNot = id ? [{ ids: { values: [id] } }] : undefined;\n\n const queryFilter = queryFilters.length\n ? { [OR_OPERATOR]: queryFilters, minimum_should_match: 1 }\n : {};\n return {\n ...queryFilter,\n filter: {\n bool: baseBoolObject\n },\n must_not: mustNot\n };\n};\n\nexport default buildRawQueryBase;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAAAC,eAAe;EAAA,OAC1CA,eAAe,CAACC,MAAhB,CAAuB,UAACC,GAAD,EAAMC,cAAN,EAAyB;IAC9CD,GAAG,CAACE,IAAJ,CAAS;MAAEC,KAAK,uCAAKF,cAAL,EAAsB,IAAtB;IAAP,CAAT;IACA,OAAOD,GAAP;EACD,CAHD,EAGG,EAHH,CAD0C;AAAA,CAA5C;;AAMA,IAAMI,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,gBAAD,EAAmBC,SAAnB,EAA8BC,WAA9B,EAA8C;EACtE,IAAMC,oBAAoB,GAAGC,MAAM,CAACC,IAAP,CAAYL,gBAAZ,CAA7B;EAEA,OAAOG,oBAAoB,CAACG,GAArB,CAAyB,UAAAC,GAAG,EAAI;IACrC,IAAMC,MAAM,GAAGR,gBAAgB,CAACO,GAAD,CAAhB,CAAsBD,GAAtB,CAA0B,UAAAG,EAAE,EAAI;MAC7C,IAAIC,UAAU,GAAGH,GAAjB;MAEA,IAAMI,UAAU,GAAGJ,GAAG,CAACK,QAAJ,CAAa,GAAb,CAAnB;;MAEA,IAAID,UAAJ,EAAgB;QACd,iBAAqCJ,GAAG,CAACM,KAAJ,CAAU,GAAV,CAArC;QAAA;QAAA,IAAOC,YAAP;QAAA,IAAqBC,YAArB;;QACA,wBAAmBd,SAAS,CAACe,MAAV,CAAiB;UAAA,IAAGC,UAAH,QAAGA,UAAH;UAAA,OAAoBA,UAAU,KAAKH,YAAnC;QAAA,CAAjB,CAAnB;QAAA;QAA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docType","operator","searchValues","filterData","id","itemsToDisplay","shouldApplySort","azOptions","searchValuesText","searchValuesCheckboxSelectRange","searchValuesCheckboxOr","filterValues","filterOperator","relations","stringProps","azFilter","shouldReturnAggs","isAZ","searchValuesTextCheckboxSelectJoined","AND_OPERATOR","searchValuesTextCheckboxOr","length","finalValue","finalValueWithCheckboxOrValues","must","bool","should","finalValueIfNoCheckboxOrValues","mustValues","query","azQueryBits","itemsToDisplayIds","push","ids","values","sort","_script","type","script","lang","source","params","sortOrder","order"],"sources":["../../src/helpers/build-raw-query.js"],"sourcesContent":["import buildRawQueryBase from './build-raw-query-base';\nimport getItemsToDisplayIds from './get-items-to-display-ids';\nimport getExtraAzBits from './get-extra-az-bits';\nimport buildAzFilter from './build-az-filter';\nimport { AND_OPERATOR } from '../constants';\n\nconst buildRawQuery = (\n docType,\n operator,\n searchValues,\n filterData,\n id,\n itemsToDisplay,\n shouldApplySort,\n azOptions\n) => {\n const {\n searchValuesText,\n searchValuesCheckboxSelectRange,\n searchValuesCheckboxOr\n } = searchValues;\n\n const { filterValues, filterOperator, relations, stringProps, azFilter } = filterData;\n const { shouldReturnAggs, isAZ } = azOptions || {};\n const searchValuesTextCheckboxSelectJoined =\n operator === AND_OPERATOR ? [...searchValuesText, ...searchValuesCheckboxSelectRange] : [];\n let searchValuesTextCheckboxOr = searchValuesText;\n if (searchValuesCheckboxOr.length) {\n searchValuesTextCheckboxOr = [...searchValuesText, ...searchValuesCheckboxOr];\n }\n\n let finalValue;\n\n if (searchValuesTextCheckboxSelectJoined.length) {\n const finalValueWithCheckboxOrValues = {\n must: [...searchValuesTextCheckboxSelectJoined, { bool: { should: searchValuesCheckboxOr } }]\n };\n const finalValueIfNoCheckboxOrValues = { must: searchValuesTextCheckboxSelectJoined };\n finalValue = searchValuesCheckboxOr.length\n ? finalValueWithCheckboxOrValues\n : finalValueIfNoCheckboxOrValues;\n } else {\n finalValue = {\n must: [...searchValuesCheckboxSelectRange, { bool: { should: searchValuesTextCheckboxOr } }]\n };\n }\n const mustValues = [\n {\n bool: finalValue\n }\n ];\n\n buildAzFilter(azFilter, mustValues);\n\n const query = {\n bool: {\n must: mustValues,\n ...buildRawQueryBase({ docType, id, filterValues, filterOperator, relations, stringProps })\n }\n };\n const azQueryBits = getExtraAzBits(shouldReturnAggs, isAZ, azFilter);\n\n if (itemsToDisplay && itemsToDisplay.length) {\n const itemsToDisplayIds = getItemsToDisplayIds(itemsToDisplay);\n query.bool.must.push({ ids: { values: itemsToDisplayIds } });\n if (shouldApplySort) {\n return {\n query,\n sort: {\n _script: {\n type: 'number',\n script: {\n lang: 'painless',\n source:\n \"!doc['id.keyword'].empty ? params.sortOrder.indexOf(doc['id.keyword'].value) : 0\",\n params: {\n sortOrder: itemsToDisplayIds\n }\n },\n order: 'asc'\n }\n },\n ...azQueryBits\n };\n }\n }\n\n return isAZ\n ? {\n query,\n ...azQueryBits\n }\n : query;\n};\n\nexport default buildRawQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CACpBC,OADoB,EAEpBC,QAFoB,EAGpBC,YAHoB,EAIpBC,UAJoB,EAKpBC,EALoB,EAMpBC,cANoB,EAOpBC,eAPoB,EAQpBC,SARoB,EASjB;EACH,IACEC,gBADF,GAIIN,YAJJ,CACEM,gBADF;EAAA,IAEEC,+BAFF,GAIIP,YAJJ,CAEEO,+BAFF;EAAA,IAGEC,sBAHF,GAIIR,YAJJ,CAGEQ,sBAHF;EAMA,IAAQC,YAAR,GAA2ER,UAA3E,CAAQQ,YAAR;EAAA,IAAsBC,cAAtB,GAA2ET,UAA3E,CAAsBS,cAAtB;EAAA,IAAsCC,SAAtC,GAA2EV,UAA3E,CAAsCU,SAAtC;EAAA,IAAiDC,WAAjD,GAA2EX,UAA3E,CAAiDW,WAAjD;EAAA,IAA8DC,QAA9D,GAA2EZ,UAA3E,CAA8DY,QAA9D;;EACA,WAAmCR,SAAS,IAAI,EAAhD;EAAA,IAAQS,gBAAR,QAAQA,gBAAR;EAAA,IAA0BC,IAA1B,QAA0BA,IAA1B;;EACA,IAAMC,oCAAoC,GACxCjB,QAAQ,KAAKkB,uBAAb,iDAAgCX,gBAAhC,uCAAqDC,+BAArD,KAAwF,EAD1F;EAEA,IAAIW,0BAA0B,GAAGZ,gBAAjC;;EACA,IAAIE,sBAAsB,CAACW,MAA3B,EAAmC;IACjCD,0BAA0B,iDAAOZ,gBAAP,uCAA4BE,sBAA5B,EAA1B;EACD;;EAED,IAAIY,UAAJ;;EAEA,IAAIJ,oCAAoC,CAACG,MAAzC,EAAiD;IAC/C,IAAME,8BAA8B,GAAG;MACrCC,IAAI,gDAAMN,oCAAN,IAA4C;QAAEO,IAAI,EAAE;UAAEC,MAAM,EAAEhB;QAAV;MAAR,CAA5C;IADiC,CAAvC;IAGA,IAAMiB,8BAA8B,GAAG;MAAEH,IAAI,EAAEN;IAAR,CAAvC;IACAI,UAAU,GAAGZ,sBAAsB,CAACW,MAAvB,GACTE,8BADS,GAETI,8BAFJ;EAGD,CARD,MAQO;IACLL,UAAU,GAAG;MACXE,IAAI,gDAAMf,+BAAN,IAAuC;QAAEgB,IAAI,EAAE;UAAEC,MAAM,EAAEN;QAAV;MAAR,CAAvC;IADO,CAAb;EAGD;;EACD,IAAMQ,UAAU,GAAG,CACjB;IACEH,IAAI,EAAEH;EADR,CADiB,CAAnB;EAMA
|
|
1
|
+
{"version":3,"file":"build-raw-query.js","names":["buildRawQuery","docType","operator","searchValues","filterData","id","itemsToDisplay","shouldApplySort","azOptions","searchValuesText","searchValuesCheckboxSelectRange","searchValuesCheckboxOr","filterValues","filterOperator","relations","stringProps","azFilter","shouldReturnAggs","isAZ","searchValuesTextCheckboxSelectJoined","AND_OPERATOR","searchValuesTextCheckboxOr","length","finalValue","finalValueWithCheckboxOrValues","must","bool","should","finalValueIfNoCheckboxOrValues","mustValues","buildAzFilter","query","buildRawQueryBase","azQueryBits","getExtraAzBits","itemsToDisplayIds","getItemsToDisplayIds","push","ids","values","sort","_script","type","script","lang","source","params","sortOrder","order"],"sources":["../../src/helpers/build-raw-query.js"],"sourcesContent":["import buildRawQueryBase from './build-raw-query-base';\nimport getItemsToDisplayIds from './get-items-to-display-ids';\nimport getExtraAzBits from './get-extra-az-bits';\nimport buildAzFilter from './build-az-filter';\nimport { AND_OPERATOR } from '../constants';\n\nconst buildRawQuery = (\n docType,\n operator,\n searchValues,\n filterData,\n id,\n itemsToDisplay,\n shouldApplySort,\n azOptions\n) => {\n const {\n searchValuesText,\n searchValuesCheckboxSelectRange,\n searchValuesCheckboxOr\n } = searchValues;\n\n const { filterValues, filterOperator, relations, stringProps, azFilter } = filterData;\n const { shouldReturnAggs, isAZ } = azOptions || {};\n const searchValuesTextCheckboxSelectJoined =\n operator === AND_OPERATOR ? [...searchValuesText, ...searchValuesCheckboxSelectRange] : [];\n let searchValuesTextCheckboxOr = searchValuesText;\n if (searchValuesCheckboxOr.length) {\n searchValuesTextCheckboxOr = [...searchValuesText, ...searchValuesCheckboxOr];\n }\n\n let finalValue;\n\n if (searchValuesTextCheckboxSelectJoined.length) {\n const finalValueWithCheckboxOrValues = {\n must: [...searchValuesTextCheckboxSelectJoined, { bool: { should: searchValuesCheckboxOr } }]\n };\n const finalValueIfNoCheckboxOrValues = { must: searchValuesTextCheckboxSelectJoined };\n finalValue = searchValuesCheckboxOr.length\n ? finalValueWithCheckboxOrValues\n : finalValueIfNoCheckboxOrValues;\n } else {\n finalValue = {\n must: [...searchValuesCheckboxSelectRange, { bool: { should: searchValuesTextCheckboxOr } }]\n };\n }\n const mustValues = [\n {\n bool: finalValue\n }\n ];\n\n buildAzFilter(azFilter, mustValues);\n\n const query = {\n bool: {\n must: mustValues,\n ...buildRawQueryBase({ docType, id, filterValues, filterOperator, relations, stringProps })\n }\n };\n const azQueryBits = getExtraAzBits(shouldReturnAggs, isAZ, azFilter);\n\n if (itemsToDisplay && itemsToDisplay.length) {\n const itemsToDisplayIds = getItemsToDisplayIds(itemsToDisplay);\n\n query.bool.must.push({ ids: { values: itemsToDisplayIds } });\n if (shouldApplySort) {\n return {\n query,\n sort: {\n _script: {\n type: 'number',\n script: {\n lang: 'painless',\n source:\n \"!doc['id.keyword'].empty ? params.sortOrder.indexOf(doc['id.keyword'].value) : 0\",\n params: {\n sortOrder: itemsToDisplayIds\n }\n },\n order: 'asc'\n }\n },\n ...azQueryBits\n };\n }\n }\n\n return isAZ\n ? {\n query,\n ...azQueryBits\n }\n : query;\n};\n\nexport default buildRawQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CACpBC,OADoB,EAEpBC,QAFoB,EAGpBC,YAHoB,EAIpBC,UAJoB,EAKpBC,EALoB,EAMpBC,cANoB,EAOpBC,eAPoB,EAQpBC,SARoB,EASjB;EACH,IACEC,gBADF,GAIIN,YAJJ,CACEM,gBADF;EAAA,IAEEC,+BAFF,GAIIP,YAJJ,CAEEO,+BAFF;EAAA,IAGEC,sBAHF,GAIIR,YAJJ,CAGEQ,sBAHF;EAMA,IAAQC,YAAR,GAA2ER,UAA3E,CAAQQ,YAAR;EAAA,IAAsBC,cAAtB,GAA2ET,UAA3E,CAAsBS,cAAtB;EAAA,IAAsCC,SAAtC,GAA2EV,UAA3E,CAAsCU,SAAtC;EAAA,IAAiDC,WAAjD,GAA2EX,UAA3E,CAAiDW,WAAjD;EAAA,IAA8DC,QAA9D,GAA2EZ,UAA3E,CAA8DY,QAA9D;;EACA,WAAmCR,SAAS,IAAI,EAAhD;EAAA,IAAQS,gBAAR,QAAQA,gBAAR;EAAA,IAA0BC,IAA1B,QAA0BA,IAA1B;;EACA,IAAMC,oCAAoC,GACxCjB,QAAQ,KAAKkB,uBAAb,iDAAgCX,gBAAhC,uCAAqDC,+BAArD,KAAwF,EA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,CAA1B;IAEAyB,KAAK,CAACL,IAAN,CAAWD,IAAX,CAAgBY,IAAhB,CAAqB;MAAEC,GAAG,EAAE;QAAEC,MAAM,EAAEJ;MAAV;IAAP,CAArB;;IACA,IAAI5B,eAAJ,EAAqB;MACnB;QACEwB,KAAK,EAALA,KADF;QAEES,IAAI,EAAE;UACJC,OAAO,EAAE;YACPC,IAAI,EAAE,QADC;YAEPC,MAAM,EAAE;cACNC,IAAI,EAAE,UADA;cAENC,MAAM,EACJ,kFAHI;cAINC,MAAM,EAAE;gBACNC,SAAS,EAAEZ;cADL;YAJF,CAFD;YAUPa,KAAK,EAAE;UAVA;QADL;MAFR,GAgBKf,WAhBL;IAkBD;EACF;;EAED,OAAOf,IAAI;IAELa,KAAK,EAALA;EAFK,GAGFE,WAHE,IAKPF,KALJ;AAMD,CAxFD;;eA0Fe/B,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-search-values-checkbox-select.js","names":["buildFieldName","fieldName","KEYWORD","getFiltersProps","filters","map","propsToDisplay","buildSearchValuesCheckboxSelect","query","rangeFilters","checkboxFilters","selectFilters","queryParams","Object","keys","filter","param","SEARCH_TERM","rangeFilterProps","checkboxFilterProps","selectFilterProps","reduce","acc","queryParam","isQueryParamString","includes","split","min","max","values","push","range","gte","Number","lte","match","checkboxFilter","firstPropToDisplay","length","shouldBuildCheckboxOrValues","operator","AND","fieldToPush","valuesOr","forEach","value"],"sources":["../../src/helpers/build-search-values-checkbox-select.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { SEARCH_TERM, AND, KEYWORD } from '../constants';\n\nconst buildFieldName = fieldName => `${fieldName}.${KEYWORD}`;\n\nconst getFiltersProps = filters => flatten(filters.map(({ propsToDisplay }) => propsToDisplay));\n\nconst buildSearchValuesCheckboxSelect = (query, rangeFilters, checkboxFilters, selectFilters) => {\n const queryParams = Object.keys(query).filter(param => param !== SEARCH_TERM);\n\n const rangeFilterProps = getFiltersProps(rangeFilters);\n const checkboxFilterProps = getFiltersProps(checkboxFilters);\n const selectFilterProps = getFiltersProps(selectFilters);\n\n const { values, valuesOr } = queryParams.reduce(\n (acc, queryParam) => {\n const isQueryParamString = typeof query[queryParam] === 'string';\n if (isQueryParamString) {\n if (rangeFilterProps.includes(queryParam)) {\n const [min, max] = query[queryParam].split('-');\n acc.values.push({\n range: {\n [queryParam]: {\n gte: Number(min),\n lte: Number(max)\n }\n }\n });\n } else if (\n checkboxFilterProps.includes(queryParam) ||\n selectFilterProps.includes(queryParam)\n ) {\n acc.values.push({\n match: { [buildFieldName(queryParam)]: query[queryParam] }\n });\n }\n } else {\n const checkboxFilter = checkboxFilters.filter(\n ({ propsToDisplay: [firstPropToDisplay] }) => firstPropToDisplay === queryParam\n );\n\n if (!checkboxFilter.length) return acc;\n\n const shouldBuildCheckboxOrValues = checkboxFilter.filter(\n ({ operator }) => operator !== AND\n ).length;\n\n const fieldToPush = shouldBuildCheckboxOrValues ? acc.valuesOr : acc.values;\n\n query[queryParam].forEach(value => {\n fieldToPush.push({ match: { [buildFieldName(queryParam)]: value } });\n });\n }\n\n return acc;\n },\n {\n values: [],\n valuesOr: []\n }\n );\n\n return { values, valuesOr };\n};\n\nexport default buildSearchValuesCheckboxSelect;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,SAAS;EAAA,iBAAOA,SAAP,cAAoBC,kBAApB;AAAA,CAAhC;;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,OAAO;EAAA,OAAI,
|
|
1
|
+
{"version":3,"file":"build-search-values-checkbox-select.js","names":["buildFieldName","fieldName","KEYWORD","getFiltersProps","filters","flatten","map","propsToDisplay","buildSearchValuesCheckboxSelect","query","rangeFilters","checkboxFilters","selectFilters","queryParams","Object","keys","filter","param","SEARCH_TERM","rangeFilterProps","checkboxFilterProps","selectFilterProps","reduce","acc","queryParam","isQueryParamString","includes","split","min","max","values","push","range","gte","Number","lte","match","checkboxFilter","firstPropToDisplay","length","shouldBuildCheckboxOrValues","operator","AND","fieldToPush","valuesOr","forEach","value"],"sources":["../../src/helpers/build-search-values-checkbox-select.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { SEARCH_TERM, AND, KEYWORD } from '../constants';\n\nconst buildFieldName = fieldName => `${fieldName}.${KEYWORD}`;\n\nconst getFiltersProps = filters => flatten(filters.map(({ propsToDisplay }) => propsToDisplay));\n\nconst buildSearchValuesCheckboxSelect = (query, rangeFilters, checkboxFilters, selectFilters) => {\n const queryParams = Object.keys(query).filter(param => param !== SEARCH_TERM);\n\n const rangeFilterProps = getFiltersProps(rangeFilters);\n const checkboxFilterProps = getFiltersProps(checkboxFilters);\n const selectFilterProps = getFiltersProps(selectFilters);\n\n const { values, valuesOr } = queryParams.reduce(\n (acc, queryParam) => {\n const isQueryParamString = typeof query[queryParam] === 'string';\n if (isQueryParamString) {\n if (rangeFilterProps.includes(queryParam)) {\n const [min, max] = query[queryParam].split('-');\n acc.values.push({\n range: {\n [queryParam]: {\n gte: Number(min),\n lte: Number(max)\n }\n }\n });\n } else if (\n checkboxFilterProps.includes(queryParam) ||\n selectFilterProps.includes(queryParam)\n ) {\n acc.values.push({\n match: { [buildFieldName(queryParam)]: query[queryParam] }\n });\n }\n } else {\n const checkboxFilter = checkboxFilters.filter(\n ({ propsToDisplay: [firstPropToDisplay] }) => firstPropToDisplay === queryParam\n );\n\n if (!checkboxFilter.length) return acc;\n\n const shouldBuildCheckboxOrValues = checkboxFilter.filter(\n ({ operator }) => operator !== AND\n ).length;\n\n const fieldToPush = shouldBuildCheckboxOrValues ? acc.valuesOr : acc.values;\n\n query[queryParam].forEach(value => {\n fieldToPush.push({ match: { [buildFieldName(queryParam)]: value } });\n });\n }\n\n return acc;\n },\n {\n values: [],\n valuesOr: []\n }\n );\n\n return { values, valuesOr };\n};\n\nexport default buildSearchValuesCheckboxSelect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AgBA,QAAhB;;EAgDA,OAAO;IAAEd,MAAM,EAANA,MAAF;IAAUc,QAAQ,EAARA;EAAV,CAAP;AACD,CAxDD;;eA0DepC,+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-props-to-use.js","names":["checkPropsToUse","propsToDisplay","map","propertiesToDisplay"],"sources":["../../src/helpers/check-props-to-use.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport isObject from './is-object';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst checkPropsToUse = (propsToDisplay = []) =>\n propsToDisplay && isObject(propsToDisplay[0])\n ? flatten(propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay))\n : propsToDisplay;\n\nexport default checkPropsToUse;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;AACA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB;EAAA,IAACC,cAAD,uEAAkB,EAAlB;EAAA,OACtBA,cAAc,IAAI,
|
|
1
|
+
{"version":3,"file":"check-props-to-use.js","names":["checkPropsToUse","propsToDisplay","isObject","flatten","map","propertiesToDisplay"],"sources":["../../src/helpers/check-props-to-use.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport isObject from './is-object';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst checkPropsToUse = (propsToDisplay = []) =>\n propsToDisplay && isObject(propsToDisplay[0])\n ? flatten(propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay))\n : propsToDisplay;\n\nexport default checkPropsToUse;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;AACA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB;EAAA,IAACC,cAAD,uEAAkB,EAAlB;EAAA,OACtBA,cAAc,IAAI,IAAAC,oBAAA,EAASD,cAAc,CAAC,CAAD,CAAvB,CAAlB,GACI,IAAAE,kBAAA,EAAQF,cAAc,CAACG,GAAf,CAAmB;IAAA,IAAGC,mBAAH,QAAGA,mBAAH;IAAA,OAA6BA,mBAA7B;EAAA,CAAnB,CAAR,CADJ,GAEIJ,cAHkB;AAAA,CAAxB;;eAKeD,e"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-entities-with-banner.js","names":["getEntitiesWithBanner","entities","options","hasBanner"],"sources":["../../src/helpers/get-entities-with-banner.js"],"sourcesContent":["import injectBannersToEntities from './inject-banners-to-entities';\n\nexport default function getEntitiesWithBanner(entities, options) {\n const { hasBanner } = options;\n\n if (!hasBanner) return entities;\n\n return injectBannersToEntities(entities, options);\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEe,SAASA,qBAAT,CAA+BC,QAA/B,EAAyCC,OAAzC,EAAkD;EAC/D,IAAQC,SAAR,GAAsBD,OAAtB,CAAQC,SAAR;EAEA,IAAI,CAACA,SAAL,EAAgB,OAAOF,QAAP;EAEhB,OAAO,
|
|
1
|
+
{"version":3,"file":"get-entities-with-banner.js","names":["getEntitiesWithBanner","entities","options","hasBanner","injectBannersToEntities"],"sources":["../../src/helpers/get-entities-with-banner.js"],"sourcesContent":["import injectBannersToEntities from './inject-banners-to-entities';\n\nexport default function getEntitiesWithBanner(entities, options) {\n const { hasBanner } = options;\n\n if (!hasBanner) return entities;\n\n return injectBannersToEntities(entities, options);\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEe,SAASA,qBAAT,CAA+BC,QAA/B,EAAyCC,OAAzC,EAAkD;EAC/D,IAAQC,SAAR,GAAsBD,OAAtB,CAAQC,SAAR;EAEA,IAAI,CAACA,SAAL,EAAgB,OAAOF,QAAP;EAEhB,OAAO,IAAAG,mCAAA,EAAwBH,QAAxB,EAAkCC,OAAlC,CAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-entity-data.js","names":["getEntityData","entity","schema","publishedDocType","publishedEntityType","interfaces","nestedInterfaces","interfacesToCheck","includes","docType","entityType"],"sources":["../../src/helpers/get-entity-data.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport camelcase from 'lodash.camelcase';\n\nconst getEntityData = (entity, schema) => {\n const publishedDocType = `published_${entity}`;\n const publishedEntityType = `Published${upperFirst(camelcase(entity))}`;\n\n if (schema) {\n const { interfaces, [entity]: { interfaces: nestedInterfaces } = {} } = schema || {};\n const interfacesToCheck = interfaces || nestedInterfaces;\n if (interfacesToCheck && !interfacesToCheck.includes('publish/publishable')) {\n return { docType: entity, entityType: upperFirst(camelcase(entity)) };\n }\n }\n\n return { docType: publishedDocType, entityType: publishedEntityType };\n};\n\nexport default getEntityData;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,MAAD,EAASC,MAAT,EAAoB;EACxC,IAAMC,gBAAgB,uBAAgBF,MAAhB,CAAtB;EACA,IAAMG,mBAAmB,sBAAe,
|
|
1
|
+
{"version":3,"file":"get-entity-data.js","names":["getEntityData","entity","schema","publishedDocType","publishedEntityType","upperFirst","camelcase","interfaces","nestedInterfaces","interfacesToCheck","includes","docType","entityType"],"sources":["../../src/helpers/get-entity-data.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport camelcase from 'lodash.camelcase';\n\nconst getEntityData = (entity, schema) => {\n const publishedDocType = `published_${entity}`;\n const publishedEntityType = `Published${upperFirst(camelcase(entity))}`;\n\n if (schema) {\n const { interfaces, [entity]: { interfaces: nestedInterfaces } = {} } = schema || {};\n const interfacesToCheck = interfaces || nestedInterfaces;\n if (interfacesToCheck && !interfacesToCheck.includes('publish/publishable')) {\n return { docType: entity, entityType: upperFirst(camelcase(entity)) };\n }\n }\n\n return { docType: publishedDocType, entityType: publishedEntityType };\n};\n\nexport default getEntityData;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,MAAD,EAASC,MAAT,EAAoB;EACxC,IAAMC,gBAAgB,uBAAgBF,MAAhB,CAAtB;EACA,IAAMG,mBAAmB,sBAAe,IAAAC,kBAAA,EAAW,IAAAC,mBAAA,EAAUL,MAAV,CAAX,CAAf,CAAzB;;EAEA,IAAIC,MAAJ,EAAY;IACV,WAAwEA,MAAM,IAAI,EAAlF;IAAA,IAAQK,UAAR,QAAQA,UAAR;IAAA,uBAAqBN,MAArB;;IAAA,uCAAiE,EAAjE;IAAA,IAA4CO,gBAA5C,eAAgCD,UAAhC;IACA,IAAME,iBAAiB,GAAGF,UAAU,IAAIC,gBAAxC;;IACA,IAAIC,iBAAiB,IAAI,CAACA,iBAAiB,CAACC,QAAlB,CAA2B,qBAA3B,CAA1B,EAA6E;MAC3E,OAAO;QAAEC,OAAO,EAAEV,MAAX;QAAmBW,UAAU,EAAE,IAAAP,kBAAA,EAAW,IAAAC,mBAAA,EAAUL,MAAV,CAAX;MAA/B,CAAP;IACD;EACF;;EAED,OAAO;IAAEU,OAAO,EAAER,gBAAX;IAA6BS,UAAU,EAAER;EAAzC,CAAP;AACD,CAbD;;eAeeJ,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-entity-render-props.js","names":["getEntityRenderProps","queryProps","data","dataSchema","isPreview","getEntitySchema","actions","getAllPublished","getAll","actionKey","action"],"sources":["../../src/helpers/get-entity-render-props.js"],"sourcesContent":["import { dataSchema } from './entities/constants';\nimport { getAction } from '../application/query';\n\nfunction getEntityRenderProps(queryProps, data = dataSchema, isPreview = false) {\n const { getEntitySchema } = data;\n\n const {\n actions: { getAllPublished, getAll }\n } = getEntitySchema;\n const actionKey = isPreview ? getAll : getAllPublished || getAll;\n const action = getAction(actionKey, queryProps);\n\n return { actionKey, action };\n}\n\nexport default getEntityRenderProps;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA,SAASA,oBAAT,CAA8BC,UAA9B,EAAgF;EAAA,IAAtCC,IAAsC,uEAA/BC,qBAA+B;EAAA,IAAnBC,SAAmB,uEAAP,KAAO;EAC9E,IAAQC,eAAR,GAA4BH,IAA5B,CAAQG,eAAR;EAEA,4BAEIA,eAFJ,CACEC,OADF;EAAA,IACaC,eADb,yBACaA,eADb;EAAA,IAC8BC,MAD9B,yBAC8BA,MAD9B;EAGA,IAAMC,SAAS,GAAGL,SAAS,GAAGI,MAAH,GAAYD,eAAe,IAAIC,MAA1D;EACA,IAAME,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"get-entity-render-props.js","names":["getEntityRenderProps","queryProps","data","dataSchema","isPreview","getEntitySchema","actions","getAllPublished","getAll","actionKey","action","getAction"],"sources":["../../src/helpers/get-entity-render-props.js"],"sourcesContent":["import { dataSchema } from './entities/constants';\nimport { getAction } from '../application/query';\n\nfunction getEntityRenderProps(queryProps, data = dataSchema, isPreview = false) {\n const { getEntitySchema } = data;\n\n const {\n actions: { getAllPublished, getAll }\n } = getEntitySchema;\n const actionKey = isPreview ? getAll : getAllPublished || getAll;\n const action = getAction(actionKey, queryProps);\n\n return { actionKey, action };\n}\n\nexport default getEntityRenderProps;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA,SAASA,oBAAT,CAA8BC,UAA9B,EAAgF;EAAA,IAAtCC,IAAsC,uEAA/BC,qBAA+B;EAAA,IAAnBC,SAAmB,uEAAP,KAAO;EAC9E,IAAQC,eAAR,GAA4BH,IAA5B,CAAQG,eAAR;EAEA,4BAEIA,eAFJ,CACEC,OADF;EAAA,IACaC,eADb,yBACaA,eADb;EAAA,IAC8BC,MAD9B,yBAC8BA,MAD9B;EAGA,IAAMC,SAAS,GAAGL,SAAS,GAAGI,MAAH,GAAYD,eAAe,IAAIC,MAA1D;EACA,IAAME,MAAM,GAAG,IAAAC,gBAAA,EAAUF,SAAV,EAAqBR,UAArB,CAAf;EAEA,OAAO;IAAEQ,SAAS,EAATA,SAAF;IAAaC,MAAM,EAANA;EAAb,CAAP;AACD;;eAEcV,oB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-filter-props.js","names":["getFilterLocalKeys","relationName","relations","find","localField","entityIdentifier","getRelationEntity","filterName","filterEntityRelations","foreignKey","getFilterProps","filter","currentEntityRelations","properties","currentEntityProperties","dynamicProperties","currentEntityDynamicProperties","currentEntityId","identifier","filteryEntityId","split","relationProp","hasProperty","relationEntityName","filterNameEntity","propertyEntityName","entityName","isEntityItself","shouldCheckRelationNames","relationForeignKeys","shouldIgnoreFilter","length"],"sources":["../../src/helpers/get-filter-props.js"],"sourcesContent":["import getFilterRelationKeys from './get-filter-relation-keys';\n\nconst getFilterLocalKeys = (relationName, relations) => {\n const { entityIdentifier } =\n relations.find(({ localField }) => localField === relationName) || {};\n return entityIdentifier;\n};\n\nconst getRelationEntity = (filterName, filterEntityRelations) => {\n const { entityIdentifier } =\n filterEntityRelations.find(({ foreignKey }) => foreignKey === filterName) || {};\n return entityIdentifier;\n};\n\nconst getFilterProps = (\n filter,\n {\n relations: currentEntityRelations = [],\n properties: currentEntityProperties = {},\n dynamicProperties: currentEntityDynamicProperties = {},\n identifier: currentEntityId\n } = {},\n { relations: filterEntityRelations = [], identifier: filteryEntityId } = {}\n) => {\n const [filterName] = filter.split('/');\n const [relationName, relationProp] = filterName.split('.');\n const hasProperty = !!(\n currentEntityProperties[filterName] || currentEntityDynamicProperties[filterName]\n );\n const relationEntityName = relationProp\n ? getFilterLocalKeys(relationName, currentEntityRelations)\n : null;\n const filterNameEntity = getRelationEntity(filterName, filterEntityRelations);\n\n const propertyEntityName = relationEntityName || filterNameEntity;\n const entityName = filterNameEntity ? filteryEntityId : relationEntityName;\n const isEntityItself = currentEntityId === propertyEntityName;\n const shouldCheckRelationNames = !hasProperty && !relationEntityName;\n const relationForeignKeys = shouldCheckRelationNames\n ? getFilterRelationKeys(propertyEntityName, currentEntityRelations, currentEntityProperties)\n : [];\n const shouldIgnoreFilter = shouldCheckRelationNames && !relationForeignKeys.length;\n\n return {\n filterName,\n entityName,\n relationName,\n relationProp,\n hasProperty,\n relationEntityName,\n isEntityItself,\n relationForeignKeys,\n shouldIgnoreFilter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P,UAAD,CAAvB,IAAuCS,8BAA8B,CAACT,UAAD,CADlD,CAArB;EAGA,IAAMgB,kBAAkB,GAAGF,YAAY,GACnCrB,kBAAkB,CAACC,YAAD,EAAeW,sBAAf,CADiB,GAEnC,IAFJ;EAGA,IAAMY,gBAAgB,GAAGlB,iBAAiB,CAACC,UAAD,EAAaC,qBAAb,CAA1C;EAEA,IAAMiB,kBAAkB,GAAGF,kBAAkB,IAAIC,gBAAjD;EACA,IAAME,UAAU,GAAGF,gBAAgB,GAAGL,eAAH,GAAqBI,kBAAxD;EACA,IAAMI,cAAc,GAAGV,eAAe,KAAKQ,kBAA3C;EACA,IAAMG,wBAAwB,GAAG,CAACN,WAAD,IAAgB,CAACC,kBAAlD;EACA,IAAMM,mBAAmB,GAAGD,wBAAwB,GAChD,
|
|
1
|
+
{"version":3,"file":"get-filter-props.js","names":["getFilterLocalKeys","relationName","relations","find","localField","entityIdentifier","getRelationEntity","filterName","filterEntityRelations","foreignKey","getFilterProps","filter","currentEntityRelations","properties","currentEntityProperties","dynamicProperties","currentEntityDynamicProperties","currentEntityId","identifier","filteryEntityId","split","relationProp","hasProperty","relationEntityName","filterNameEntity","propertyEntityName","entityName","isEntityItself","shouldCheckRelationNames","relationForeignKeys","getFilterRelationKeys","shouldIgnoreFilter","length"],"sources":["../../src/helpers/get-filter-props.js"],"sourcesContent":["import getFilterRelationKeys from './get-filter-relation-keys';\n\nconst getFilterLocalKeys = (relationName, relations) => {\n const { entityIdentifier } =\n relations.find(({ localField }) => localField === relationName) || {};\n return entityIdentifier;\n};\n\nconst getRelationEntity = (filterName, filterEntityRelations) => {\n const { entityIdentifier } =\n filterEntityRelations.find(({ foreignKey }) => foreignKey === filterName) || {};\n return entityIdentifier;\n};\n\nconst getFilterProps = (\n filter,\n {\n relations: currentEntityRelations = [],\n properties: currentEntityProperties = {},\n dynamicProperties: currentEntityDynamicProperties = {},\n identifier: currentEntityId\n } = {},\n { relations: filterEntityRelations = [], identifier: filteryEntityId } = {}\n) => {\n const [filterName] = filter.split('/');\n const [relationName, relationProp] = filterName.split('.');\n const hasProperty = !!(\n currentEntityProperties[filterName] || currentEntityDynamicProperties[filterName]\n );\n const relationEntityName = relationProp\n ? getFilterLocalKeys(relationName, currentEntityRelations)\n : null;\n const filterNameEntity = getRelationEntity(filterName, filterEntityRelations);\n\n const propertyEntityName = relationEntityName || filterNameEntity;\n const entityName = filterNameEntity ? filteryEntityId : relationEntityName;\n const isEntityItself = currentEntityId === propertyEntityName;\n const shouldCheckRelationNames = !hasProperty && !relationEntityName;\n const relationForeignKeys = shouldCheckRelationNames\n ? getFilterRelationKeys(propertyEntityName, currentEntityRelations, currentEntityProperties)\n : [];\n const shouldIgnoreFilter = shouldCheckRelationNames && !relationForeignKeys.length;\n\n return {\n filterName,\n entityName,\n relationName,\n relationProp,\n hasProperty,\n relationEntityName,\n isEntityItself,\n relationForeignKeys,\n shouldIgnoreFilter\n };\n};\n\nexport default getFilterProps;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,YAAD,EAAeC,SAAf,EAA6B;EACtD,WACEA,SAAS,CAACC,IAAV,CAAe;IAAA,IAAGC,UAAH,SAAGA,UAAH;IAAA,OAAoBA,UAAU,KAAKH,YAAnC;EAAA,CAAf,KAAmE,EADrE;EAAA,IAAQI,gBAAR,QAAQA,gBAAR;;EAEA,OAAOA,gBAAP;AACD,CAJD;;AAMA,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,UAAD,EAAaC,qBAAb,EAAuC;EAC/D,YACEA,qBAAqB,CAACL,IAAtB,CAA2B;IAAA,IAAGM,UAAH,SAAGA,UAAH;IAAA,OAAoBA,UAAU,KAAKF,UAAnC;EAAA,CAA3B,KAA6E,EAD/E;EAAA,IAAQF,gBAAR,SAAQA,gBAAR;;EAEA,OAAOA,gBAAP;AACD,CAJD;;AAMA,IAAMK,cAAc,GAAG,SAAjBA,cAAiB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AO;IACLzB,UAAU,EAAVA,UADK;IAELmB,UAAU,EAAVA,UAFK;IAGLzB,YAAY,EAAZA,YAHK;IAILoB,YAAY,EAAZA,YAJK;IAKLC,WAAW,EAAXA,WALK;IAMLC,kBAAkB,EAAlBA,kBANK;IAOLI,cAAc,EAAdA,cAPK;IAQLE,mBAAmB,EAAnBA,mBARK;IASLE,kBAAkB,EAAlBA;EATK,CAAP;AAWD,CAxCD;;eA0CerB,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-generic-props.js","names":["getGenericProps","props","propsSchema","itemsPerRow","gridModifier"],"sources":["../../src/helpers/get-generic-props.js"],"sourcesContent":["import getDictionaryMatch from './get-dictionary-match';\nimport { propsSchema } from './entities/constants';\n\nfunction getGenericProps(props = propsSchema) {\n const { itemsPerRow } = props;\n const gridModifier = getDictionaryMatch(itemsPerRow);\n\n return { gridModifier, ...props };\n}\n\nexport default getGenericProps;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,SAASA,eAAT,GAA8C;EAAA,IAArBC,KAAqB,uEAAbC,sBAAa;EAC5C,IAAQC,WAAR,GAAwBF,KAAxB,CAAQE,WAAR;EACA,IAAMC,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"get-generic-props.js","names":["getGenericProps","props","propsSchema","itemsPerRow","gridModifier","getDictionaryMatch"],"sources":["../../src/helpers/get-generic-props.js"],"sourcesContent":["import getDictionaryMatch from './get-dictionary-match';\nimport { propsSchema } from './entities/constants';\n\nfunction getGenericProps(props = propsSchema) {\n const { itemsPerRow } = props;\n const gridModifier = getDictionaryMatch(itemsPerRow);\n\n return { gridModifier, ...props };\n}\n\nexport default getGenericProps;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,SAASA,eAAT,GAA8C;EAAA,IAArBC,KAAqB,uEAAbC,sBAAa;EAC5C,IAAQC,WAAR,GAAwBF,KAAxB,CAAQE,WAAR;EACA,IAAMC,YAAY,GAAG,IAAAC,8BAAA,EAAmBF,WAAnB,CAArB;EAEA;IAASC,YAAY,EAAZA;EAAT,GAA0BH,KAA1B;AACD;;eAEcD,e"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-generic-render-variables.js","names":["buildSortValues","sortFilters","relations","stringProps","length","sort","sortValues","map","propsToDisplay","sortFieldName","toLowerCase","filter","Boolean","join","getCorrectSort","filterProps","isTextSearchApplied","sortby","sortProperties","getGenericRenderVariables","rawQuery","isTextSearchFilterApplied","useRandomSort","limit","DEFAULT_LIMIT","offset","limitToUse","Number","offsetToUse","DEFAULT_OFFSET","rawQueryStringified","JSON","stringify","query","function_score","random_score","boost_mode"],"sources":["../../src/helpers/get-generic-render-variables.js"],"sourcesContent":["import getSortbyFieldName from './get-sort-by-field-name';\nimport { DEFAULT_LIMIT, DEFAULT_OFFSET } from '../constants';\n\nconst buildSortValues = (sortFilters, relations, stringProps) => {\n if (!sortFilters || !sortFilters.length) return { sort: [] };\n\n const sortValues = sortFilters\n .map(({ sort, propsToDisplay }) => {\n if (!sort) return null;\n\n const sortFieldName = getSortbyFieldName(relations, propsToDisplay, stringProps);\n return sortFieldName ? `${sortFieldName}:${sort.toLowerCase()}` : null;\n })\n .filter(Boolean)\n .join(',');\n\n return { sort: sortValues };\n};\nconst getCorrectSort = (relations, filterProps, stringProps, isTextSearchApplied) => {\n if (isTextSearchApplied) {\n return {};\n }\n const { sort, sortby, sortProperties = [] } = filterProps;\n\n return buildSortValues(\n [{ sort, propsToDisplay: sortby }, ...sortProperties],\n relations,\n stringProps\n );\n};\n\nconst getGenericRenderVariables = (\n relations,\n filterProps = {},\n stringProps = [],\n rawQuery = {},\n isTextSearchFilterApplied = false,\n useRandomSort = false\n) => {\n const { limit = DEFAULT_LIMIT, offset } = filterProps;\n const limitToUse = Number(limit || DEFAULT_LIMIT);\n const offsetToUse = Number(offset || DEFAULT_OFFSET);\n\n if (useRandomSort) {\n const rawQueryStringified = JSON.stringify({\n query: {\n function_score: {\n query: rawQuery && rawQuery.query ? rawQuery.query : rawQuery,\n random_score: {},\n boost_mode: 'replace'\n }\n }\n });\n\n return {\n limit: limitToUse,\n offset: offsetToUse,\n rawQueryStringified\n };\n }\n\n const sort = getCorrectSort(relations, filterProps, stringProps, isTextSearchFilterApplied);\n\n return {\n limit: limitToUse,\n offset: offsetToUse,\n ...sort,\n rawQueryStringified: JSON.stringify(rawQuery)\n };\n};\n\nexport default getGenericRenderVariables;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,WAAD,EAAcC,SAAd,EAAyBC,WAAzB,EAAyC;EAC/D,IAAI,CAACF,WAAD,IAAgB,CAACA,WAAW,CAACG,MAAjC,EAAyC,OAAO;IAAEC,IAAI,EAAE;EAAR,CAAP;EAEzC,IAAMC,UAAU,GAAGL,WAAW,CAC3BM,GADgB,CACZ,gBAA8B;IAAA,IAA3BF,IAA2B,QAA3BA,IAA2B;IAAA,IAArBG,cAAqB,QAArBA,cAAqB;IACjC,IAAI,CAACH,IAAL,EAAW,OAAO,IAAP;IAEX,IAAMI,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"get-generic-render-variables.js","names":["buildSortValues","sortFilters","relations","stringProps","length","sort","sortValues","map","propsToDisplay","sortFieldName","getSortbyFieldName","toLowerCase","filter","Boolean","join","getCorrectSort","filterProps","isTextSearchApplied","sortby","sortProperties","getGenericRenderVariables","rawQuery","isTextSearchFilterApplied","useRandomSort","limit","DEFAULT_LIMIT","offset","limitToUse","Number","offsetToUse","DEFAULT_OFFSET","rawQueryStringified","JSON","stringify","query","function_score","random_score","boost_mode"],"sources":["../../src/helpers/get-generic-render-variables.js"],"sourcesContent":["import getSortbyFieldName from './get-sort-by-field-name';\nimport { DEFAULT_LIMIT, DEFAULT_OFFSET } from '../constants';\n\nconst buildSortValues = (sortFilters, relations, stringProps) => {\n if (!sortFilters || !sortFilters.length) return { sort: [] };\n\n const sortValues = sortFilters\n .map(({ sort, propsToDisplay }) => {\n if (!sort) return null;\n\n const sortFieldName = getSortbyFieldName(relations, propsToDisplay, stringProps);\n return sortFieldName ? `${sortFieldName}:${sort.toLowerCase()}` : null;\n })\n .filter(Boolean)\n .join(',');\n\n return { sort: sortValues };\n};\nconst getCorrectSort = (relations, filterProps, stringProps, isTextSearchApplied) => {\n if (isTextSearchApplied) {\n return {};\n }\n const { sort, sortby, sortProperties = [] } = filterProps;\n\n return buildSortValues(\n [{ sort, propsToDisplay: sortby }, ...sortProperties],\n relations,\n stringProps\n );\n};\n\nconst getGenericRenderVariables = (\n relations,\n filterProps = {},\n stringProps = [],\n rawQuery = {},\n isTextSearchFilterApplied = false,\n useRandomSort = false\n) => {\n const { limit = DEFAULT_LIMIT, offset } = filterProps;\n const limitToUse = Number(limit || DEFAULT_LIMIT);\n const offsetToUse = Number(offset || DEFAULT_OFFSET);\n\n if (useRandomSort) {\n const rawQueryStringified = JSON.stringify({\n query: {\n function_score: {\n query: rawQuery && rawQuery.query ? rawQuery.query : rawQuery,\n random_score: {},\n boost_mode: 'replace'\n }\n }\n });\n\n return {\n limit: limitToUse,\n offset: offsetToUse,\n rawQueryStringified\n };\n }\n\n const sort = getCorrectSort(relations, filterProps, stringProps, isTextSearchFilterApplied);\n\n return {\n limit: limitToUse,\n offset: offsetToUse,\n ...sort,\n rawQueryStringified: JSON.stringify(rawQuery)\n };\n};\n\nexport default getGenericRenderVariables;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,WAAD,EAAcC,SAAd,EAAyBC,WAAzB,EAAyC;EAC/D,IAAI,CAACF,WAAD,IAAgB,CAACA,WAAW,CAACG,MAAjC,EAAyC,OAAO;IAAEC,I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1C,CAAQQ,KAAR;EAAA,IAAQA,KAAR,mCAAgBC,wBAAhB;EAAA,IAA+BC,MAA/B,GAA0CV,WAA1C,CAA+BU,MAA/B;EACA,IAAMC,UAAU,GAAGC,MAAM,CAACJ,KAAK,IAAIC,wBAAV,CAAzB;EACA,IAAMI,WAAW,GAAGD,MAAM,CAACF,MAAM,IAAII,yBAAX,CAA1B;;EAEA,IAAIP,aAAJ,EAAmB;IACjB,IAAMQ,mBAAmB,GAAGC,IAAI,CAACC,SAAL,CAAe;MACzCC,KAAK,EAAE;QACLC,cAAc,EAAE;UACdD,KAAK,EAAEb,QAAQ,IAAIA,QAAQ,CAACa,KAArB,GAA6Bb,QAAQ,CAACa,KAAtC,GAA8Cb,QADvC;UAEde,YAAY,EAAE,EAFA;UAGdC,UAAU,EAAE;QAHE;MADX;IADkC,CAAf,CAA5B;IAUA,OAAO;MACLb,KAAK,EAAEG,UADF;MAELD,MAAM,EAAEG,WAFH;MAGLE,mBAAmB,EAAnBA;IAHK,CAAP;EAKD;;EAED,IAAM1B,IAAI,GAAGU,cAAc,CAACb,SAAD,EAAYc,WAAZ,EAAyBb,WAAzB,EAAsCmB,yBAAtC,CAA3B;EAEA;IACEE,KAAK,EAAEG,UADT;IAEED,MAAM,EAAEG;EAFV,GAGKxB,IAHL;IAIE0B,mBAAmB,EAAEC,IAAI,CAACC,SAAL,CAAeZ,QAAf;EAJvB;AAMD,CAtCD;;eAwCeD,yB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-image-ids.js","names":["getIdsFromArray","relationImageData","relationProp","imageId","length","map","image","Object","keys","filter","Boolean","getImageIds","imageRelation","relationData","imageIdArray","entityData","imageData","split","relationName","Array","isArray"],"sources":["../../src/helpers/get-image-ids.js"],"sourcesContent":["import isPlainObject from 'lodash.isplainobject';\n\nconst getIdsFromArray = (relationImageData, relationProp, imageId) => {\n if (!relationImageData.length) return [imageId];\n return relationImageData\n .map(image => {\n if (!Object.keys(image).length) return '';\n return image[relationProp];\n })\n .filter(Boolean);\n};\n\nconst getImageIds = (imageRelation, relationData, imageId) => {\n const imageIdArray = imageId ? [imageId] : [];\n if (relationData && relationData.entityData) {\n const [imageData] = imageRelation;\n const [relationName, relationProp] = imageData.split('.');\n const relationImageData = relationData.entityData[relationName];\n\n if (!relationImageData) return imageIdArray;\n\n if (Array.isArray(relationImageData))\n return getIdsFromArray(relationImageData, relationProp, imageId);\n\n if (isPlainObject(relationImageData) && Object.keys(relationImageData).length) {\n return Array.isArray(relationImageData[relationProp])\n ? relationImageData[relationProp]\n : [relationImageData[relationProp]];\n }\n }\n\n return imageIdArray;\n};\n\nexport default getImageIds;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,iBAAD,EAAoBC,YAApB,EAAkCC,OAAlC,EAA8C;EACpE,IAAI,CAACF,iBAAiB,CAACG,MAAvB,EAA+B,OAAO,CAACD,OAAD,CAAP;EAC/B,OAAOF,iBAAiB,CACrBI,GADI,CACA,UAAAC,KAAK,EAAI;IACZ,IAAI,CAACC,MAAM,CAACC,IAAP,CAAYF,KAAZ,EAAmBF,MAAxB,EAAgC,OAAO,EAAP;IAChC,OAAOE,KAAK,CAACJ,YAAD,CAAZ;EACD,CAJI,EAKJO,MALI,CAKGC,OALH,CAAP;AAMD,CARD;;AAUA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,aAAD,EAAgBC,YAAhB,EAA8BV,OAA9B,EAA0C;EAC5D,IAAMW,YAAY,GAAGX,OAAO,GAAG,CAACA,OAAD,CAAH,GAAe,EAA3C;;EACA,IAAIU,YAAY,IAAIA,YAAY,CAACE,UAAjC,EAA6C;IAC3C,qDAAoBH,aAApB;IAAA,IAAOI,SAAP;;IACA,uBAAqCA,SAAS,CAACC,KAAV,CAAgB,GAAhB,CAArC;IAAA;IAAA,IAAOC,YAAP;IAAA,IAAqBhB,YAArB;;IACA,IAAMD,iBAAiB,GAAGY,YAAY,CAACE,UAAb,CAAwBG,YAAxB,CAA1B;IAEA,IAAI,CAACjB,iBAAL,EAAwB,OAAOa,YAAP;IAExB,IAAIK,KAAK,CAACC,OAAN,CAAcnB,iBAAd,CAAJ,EACE,OAAOD,eAAe,CAACC,iBAAD,EAAoBC,YAApB,EAAkCC,OAAlC,CAAtB;;IAEF,IAAI,
|
|
1
|
+
{"version":3,"file":"get-image-ids.js","names":["getIdsFromArray","relationImageData","relationProp","imageId","length","map","image","Object","keys","filter","Boolean","getImageIds","imageRelation","relationData","imageIdArray","entityData","imageData","split","relationName","Array","isArray","isPlainObject"],"sources":["../../src/helpers/get-image-ids.js"],"sourcesContent":["import isPlainObject from 'lodash.isplainobject';\n\nconst getIdsFromArray = (relationImageData, relationProp, imageId) => {\n if (!relationImageData.length) return [imageId];\n return relationImageData\n .map(image => {\n if (!Object.keys(image).length) return '';\n return image[relationProp];\n })\n .filter(Boolean);\n};\n\nconst getImageIds = (imageRelation, relationData, imageId) => {\n const imageIdArray = imageId ? [imageId] : [];\n if (relationData && relationData.entityData) {\n const [imageData] = imageRelation;\n const [relationName, relationProp] = imageData.split('.');\n const relationImageData = relationData.entityData[relationName];\n\n if (!relationImageData) return imageIdArray;\n\n if (Array.isArray(relationImageData))\n return getIdsFromArray(relationImageData, relationProp, imageId);\n\n if (isPlainObject(relationImageData) && Object.keys(relationImageData).length) {\n return Array.isArray(relationImageData[relationProp])\n ? relationImageData[relationProp]\n : [relationImageData[relationProp]];\n }\n }\n\n return imageIdArray;\n};\n\nexport default getImageIds;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,iBAAD,EAAoBC,YAApB,EAAkCC,OAAlC,EAA8C;EACpE,IAAI,CAACF,iBAAiB,CAACG,MAAvB,EAA+B,OAAO,CAACD,OAAD,CAAP;EAC/B,OAAOF,iBAAiB,CACrBI,GADI,CACA,UAAAC,KAAK,EAAI;IACZ,IAAI,CAACC,MAAM,CAACC,IAAP,CAAYF,KAAZ,EAAmBF,MAAxB,EAAgC,OAAO,EAAP;IAChC,OAAOE,KAAK,CAACJ,YAAD,CAAZ;EACD,CAJI,EAKJO,MALI,CAKGC,OALH,CAAP;AAMD,CARD;;AAUA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACC,aAAD,EAAgBC,YAAhB,EAA8BV,OAA9B,EAA0C;EAC5D,IAAMW,YAAY,GAAGX,OAAO,GAAG,CAACA,OAAD,CAAH,GAAe,EAA3C;;EACA,IAAIU,YAAY,IAAIA,YAAY,CAACE,UAAjC,EAA6C;IAC3C,qDAAoBH,aAApB;IAAA,IAAOI,SAAP;;IACA,uBAAqCA,SAAS,CAACC,KAAV,CAAgB,GAAhB,CAArC;IAAA;IAAA,IAAOC,YAAP;IAAA,IAAqBhB,YAArB;;IACA,IAAMD,iBAAiB,GAAGY,YAAY,CAACE,UAAb,CAAwBG,YAAxB,CAA1B;IAEA,IAAI,CAACjB,iBAAL,EAAwB,OAAOa,YAAP;IAExB,IAAIK,KAAK,CAACC,OAAN,CAAcnB,iBAAd,CAAJ,EACE,OAAOD,eAAe,CAACC,iBAAD,EAAoBC,YAApB,EAAkCC,OAAlC,CAAtB;;IAEF,IAAI,IAAAkB,kBAAA,EAAcpB,iBAAd,KAAoCM,MAAM,CAACC,IAAP,CAAYP,iBAAZ,EAA+BG,MAAvE,EAA+E;MAC7E,OAAOe,KAAK,CAACC,OAAN,CAAcnB,iBAAiB,CAACC,YAAD,CAA/B,IACHD,iBAAiB,CAACC,YAAD,CADd,GAEH,CAACD,iBAAiB,CAACC,YAAD,CAAlB,CAFJ;IAGD;EACF;;EAED,OAAOY,YAAP;AACD,CApBD;;eAsBeH,W"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-parsed-prop-values.js","names":["getParsedPropValues","propertiesToDisplay","props","enableLink","shouldStrip","map","property","split","filteredProperty","subtype","value","Array","isArray","prop","index","propValue","sanitizedValue","isLastValue","length","parsedValue","concat","linkKey","join","url","filter","Boolean"],"sources":["../../src/helpers/get-parsed-prop-values.js"],"sourcesContent":["import React from 'react';\nimport { Link } from '@blaze-cms/nextjs-components';\nimport isObject from './is-object';\nimport removeUnwantedCharacters from './remove-unwanted-characters';\n\nconst getParsedPropValues = ({ propertiesToDisplay, props, enableLink, shouldStrip }) =>\n propertiesToDisplay\n .map(property => {\n const [filteredProperty, subtype] = property.split('.');\n const value = props[filteredProperty];\n\n if (Array.isArray(value)) {\n return value.map((prop, index) => {\n const propValue = subtype ? prop[subtype] : prop;\n const sanitizedValue = shouldStrip ? removeUnwantedCharacters(propValue) : propValue;\n\n const isLastValue = index === value.length - 1;\n const parsedValue = isLastValue ? sanitizedValue : sanitizedValue.concat(', ');\n const linkKey = [filteredProperty, prop[subtype], index].join('-');\n\n return enableLink && prop.url ? (\n <Link key={linkKey} href={prop.url}>\n {parsedValue}\n </Link>\n ) : (\n parsedValue\n );\n });\n }\n\n if (isObject(value)) {\n return shouldStrip ? removeUnwantedCharacters(value[subtype]) : value[subtype];\n }\n\n return shouldStrip ? removeUnwantedCharacters(value) : value;\n })\n .filter(Boolean);\n\nexport default getParsedPropValues;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAsB;EAAA,IAAGC,mBAAH,QAAGA,mBAAH;EAAA,IAAwBC,KAAxB,QAAwBA,KAAxB;EAAA,IAA+BC,UAA/B,QAA+BA,UAA/B;EAAA,IAA2CC,WAA3C,QAA2CA,WAA3C;EAAA,OAC1BH,mBAAmB,CAChBI,GADH,CACO,UAAAC,QAAQ,EAAI;IACf,sBAAoCA,QAAQ,CAACC,KAAT,CAAe,GAAf,CAApC;IAAA;IAAA,IAAOC,gBAAP;IAAA,IAAyBC,OAAzB;;IACA,IAAMC,KAAK,GAAGR,KAAK,CAACM,gBAAD,CAAnB;;IAEA,IAAIG,KAAK,CAACC,OAAN,CAAcF,KAAd,CAAJ,EAA0B;MACxB,OAAOA,KAAK,CAACL,GAAN,CAAU,UAACQ,IAAD,EAAOC,KAAP,EAAiB;QAChC,IAAMC,SAAS,GAAGN,OAAO,GAAGI,IAAI,CAACJ,OAAD,CAAP,GAAmBI,IAA5C;QACA,IAAMG,cAAc,GAAGZ,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"get-parsed-prop-values.js","names":["getParsedPropValues","propertiesToDisplay","props","enableLink","shouldStrip","map","property","split","filteredProperty","subtype","value","Array","isArray","prop","index","propValue","sanitizedValue","removeUnwantedCharacters","isLastValue","length","parsedValue","concat","linkKey","join","url","isObject","filter","Boolean"],"sources":["../../src/helpers/get-parsed-prop-values.js"],"sourcesContent":["import React from 'react';\nimport { Link } from '@blaze-cms/nextjs-components';\nimport isObject from './is-object';\nimport removeUnwantedCharacters from './remove-unwanted-characters';\n\nconst getParsedPropValues = ({ propertiesToDisplay, props, enableLink, shouldStrip }) =>\n propertiesToDisplay\n .map(property => {\n const [filteredProperty, subtype] = property.split('.');\n const value = props[filteredProperty];\n\n if (Array.isArray(value)) {\n return value.map((prop, index) => {\n const propValue = subtype ? prop[subtype] : prop;\n const sanitizedValue = shouldStrip ? removeUnwantedCharacters(propValue) : propValue;\n\n const isLastValue = index === value.length - 1;\n const parsedValue = isLastValue ? sanitizedValue : sanitizedValue.concat(', ');\n const linkKey = [filteredProperty, prop[subtype], index].join('-');\n\n return enableLink && prop.url ? (\n <Link key={linkKey} href={prop.url}>\n {parsedValue}\n </Link>\n ) : (\n parsedValue\n );\n });\n }\n\n if (isObject(value)) {\n return shouldStrip ? removeUnwantedCharacters(value[subtype]) : value[subtype];\n }\n\n return shouldStrip ? removeUnwantedCharacters(value) : value;\n })\n .filter(Boolean);\n\nexport default getParsedPropValues;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA,IAAMA,mBAA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AW,GAAG,IAAAa,oCAAA,EAAyBP,KAAK,CAACD,OAAD,CAA9B,CAAH,GAA8CC,KAAK,CAACD,OAAD,CAArE;IACD;;IAED,OAAOL,WAAW,GAAG,IAAAa,oCAAA,EAAyBP,KAAzB,CAAH,GAAqCA,KAAvD;EACD,CA7BH,EA8BGgB,MA9BH,CA8BUC,OA9BV,CAD0B;AAAA,CAA5B;;eAiCe3B,mB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-prop-values.js","names":["getPropValues","propertiesToDisplay","props","map","property","split","filteredProperty","subtype","value","Array","isArray","prop","filter","Boolean"],"sources":["../../src/helpers/get-prop-values.js"],"sourcesContent":["import isObject from './is-object';\n\nconst getPropValues = (propertiesToDisplay, props) =>\n propertiesToDisplay\n .map(property => {\n const [filteredProperty, subtype] = property.split('.');\n const value = props[filteredProperty];\n\n if (Array.isArray(value)) {\n return value.map(prop => (subtype ? prop[subtype] : prop));\n }\n\n if (isObject(value)) {\n return value[subtype];\n }\n\n return value;\n })\n .filter(Boolean);\n\nexport default getPropValues;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,mBAAD,EAAsBC,KAAtB;EAAA,OACpBD,mBAAmB,CAChBE,GADH,CACO,UAAAC,QAAQ,EAAI;IACf,sBAAoCA,QAAQ,CAACC,KAAT,CAAe,GAAf,CAApC;IAAA;IAAA,IAAOC,gBAAP;IAAA,IAAyBC,OAAzB;;IACA,IAAMC,KAAK,GAAGN,KAAK,CAACI,gBAAD,CAAnB;;IAEA,IAAIG,KAAK,CAACC,OAAN,CAAcF,KAAd,CAAJ,EAA0B;MACxB,OAAOA,KAAK,CAACL,GAAN,CAAU,UAAAQ,IAAI;QAAA,OAAKJ,OAAO,GAAGI,IAAI,CAACJ,OAAD,CAAP,GAAmBI,IAA/B;MAAA,CAAd,CAAP;IACD;;IAED,IAAI,
|
|
1
|
+
{"version":3,"file":"get-prop-values.js","names":["getPropValues","propertiesToDisplay","props","map","property","split","filteredProperty","subtype","value","Array","isArray","prop","isObject","filter","Boolean"],"sources":["../../src/helpers/get-prop-values.js"],"sourcesContent":["import isObject from './is-object';\n\nconst getPropValues = (propertiesToDisplay, props) =>\n propertiesToDisplay\n .map(property => {\n const [filteredProperty, subtype] = property.split('.');\n const value = props[filteredProperty];\n\n if (Array.isArray(value)) {\n return value.map(prop => (subtype ? prop[subtype] : prop));\n }\n\n if (isObject(value)) {\n return value[subtype];\n }\n\n return value;\n })\n .filter(Boolean);\n\nexport default getPropValues;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,mBAAD,EAAsBC,KAAtB;EAAA,OACpBD,mBAAmB,CAChBE,GADH,CACO,UAAAC,QAAQ,EAAI;IACf,sBAAoCA,QAAQ,CAACC,KAAT,CAAe,GAAf,CAApC;IAAA;IAAA,IAAOC,gBAAP;IAAA,IAAyBC,OAAzB;;IACA,IAAMC,KAAK,GAAGN,KAAK,CAACI,gBAAD,CAAnB;;IAEA,IAAIG,KAAK,CAACC,OAAN,CAAcF,KAAd,CAAJ,EAA0B;MACxB,OAAOA,KAAK,CAACL,GAAN,CAAU,UAAAQ,IAAI;QAAA,OAAKJ,OAAO,GAAGI,IAAI,CAACJ,OAAD,CAAP,GAAmBI,IAA/B;MAAA,CAAd,CAAP;IACD;;IAED,IAAI,IAAAC,oBAAA,EAASJ,KAAT,CAAJ,EAAqB;MACnB,OAAOA,KAAK,CAACD,OAAD,CAAZ;IACD;;IAED,OAAOC,KAAP;EACD,CAdH,EAeGK,MAfH,CAeUC,OAfV,CADoB;AAAA,CAAtB;;eAkBed,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-query-filters.js","names":["getQueryFilters","searchFilter","query","settings","filters","valuesAnd","valuesOr","rangeFilters","RANGE","checkboxFilters","CHECKBOX","selectFilters","SELECT","values"],"sources":["../../src/helpers/get-query-filters.js"],"sourcesContent":["import getSearchFilterType from './get-search-filter-type';\nimport buildSearchValuesCheckboxSelect from './build-search-values-checkbox-select';\nimport { RANGE, CHECKBOX, SELECT } from '../constants';\n\nconst getQueryFilters = (searchFilter, query) => {\n if (!searchFilter.settings || !searchFilter.settings.filters) {\n return { valuesAnd: [], valuesOr: [] };\n }\n\n const rangeFilters = getSearchFilterType(searchFilter, RANGE);\n const checkboxFilters = getSearchFilterType(searchFilter, CHECKBOX);\n const selectFilters = getSearchFilterType(searchFilter, SELECT);\n\n const { values: valuesAnd, valuesOr } = buildSearchValuesCheckboxSelect(\n query,\n rangeFilters,\n checkboxFilters,\n selectFilters\n );\n return { valuesAnd, valuesOr };\n};\n\nexport default getQueryFilters;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,YAAD,EAAeC,KAAf,EAAyB;EAC/C,IAAI,CAACD,YAAY,CAACE,QAAd,IAA0B,CAACF,YAAY,CAACE,QAAb,CAAsBC,OAArD,EAA8D;IAC5D,OAAO;MAAEC,SAAS,EAAE,EAAb;MAAiBC,QAAQ,EAAE;IAA3B,CAAP;EACD;;EAED,IAAMC,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"get-query-filters.js","names":["getQueryFilters","searchFilter","query","settings","filters","valuesAnd","valuesOr","rangeFilters","getSearchFilterType","RANGE","checkboxFilters","CHECKBOX","selectFilters","SELECT","buildSearchValuesCheckboxSelect","values"],"sources":["../../src/helpers/get-query-filters.js"],"sourcesContent":["import getSearchFilterType from './get-search-filter-type';\nimport buildSearchValuesCheckboxSelect from './build-search-values-checkbox-select';\nimport { RANGE, CHECKBOX, SELECT } from '../constants';\n\nconst getQueryFilters = (searchFilter, query) => {\n if (!searchFilter.settings || !searchFilter.settings.filters) {\n return { valuesAnd: [], valuesOr: [] };\n }\n\n const rangeFilters = getSearchFilterType(searchFilter, RANGE);\n const checkboxFilters = getSearchFilterType(searchFilter, CHECKBOX);\n const selectFilters = getSearchFilterType(searchFilter, SELECT);\n\n const { values: valuesAnd, valuesOr } = buildSearchValuesCheckboxSelect(\n query,\n rangeFilters,\n checkboxFilters,\n selectFilters\n );\n return { valuesAnd, valuesOr };\n};\n\nexport default getQueryFilters;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,YAAD,EAAeC,KAAf,EAAyB;EAC/C,IAAI,CAACD,YAAY,CAACE,QAAd,IAA0B,CAACF,YAAY,CAACE,QAAb,CAAsBC,OAArD,EAA8D;IAC5D,OAAO;MAAEC,SAAS,EAAE,EAAb;MAAiBC,QAAQ,EAAE;IAA3B,CAAP;EACD;;EAED,IAAMC,YAAY,GAAG,IAAAC,+BAAA,EAAoBP,YAApB,EAAkCQ,gBAAlC,CAArB;EACA,IAAMC,eAAe,GAAG,IAAAF,+BAAA,EAAoBP,YAApB,EAAkCU,mBAAlC,CAAxB;EACA,IAAMC,aAAa,GAAG,IAAAJ,+BAAA,EAAoBP,YAApB,EAAkCY,iBAAlC,CAAtB;;EAEA,4BAAwC,IAAAC,2CAAA,EACtCZ,KADsC,EAEtCK,YAFsC,EAGtCG,eAHsC,EAItCE,aAJsC,CAAxC;EAAA,IAAgBP,SAAhB,yBAAQU,MAAR;EAAA,IAA2BT,QAA3B,yBAA2BA,QAA3B;;EAMA,OAAO;IAAED,SAAS,EAATA,SAAF;IAAaC,QAAQ,EAARA;EAAb,CAAP;AACD,CAhBD;;eAkBeN,e"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-query-props.js","names":["getQueryProps","inheritedFilters","currentSchema","filterEntitySchema","length","ID","currentEntityId","identifier","reduce","acc","filter","filterName","relationName","relationProp","relationEntityName","isEntityItself","relationForeignKeys","shouldIgnoreFilter","join","queryProp","queryPropFinalValue"],"sources":["../../src/helpers/get-query-props.js"],"sourcesContent":["import isFilterEntitysId from './is-filter-entitys-id';\nimport getFilterProps from './get-filter-props';\nimport { ID } from '../constants';\n\nconst getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema) => {\n if (!currentSchema || !inheritedFilters.length) return ID;\n\n const { identifier: currentEntityId } = currentSchema;\n\n return inheritedFilters.reduce((acc, filter) => {\n const {\n filterName,\n relationName,\n relationProp,\n relationEntityName,\n isEntityItself,\n relationForeignKeys,\n shouldIgnoreFilter\n } = getFilterProps(filter, currentSchema, filterEntitySchema);\n\n if (shouldIgnoreFilter) return acc;\n if (relationForeignKeys && relationForeignKeys.length) {\n return `${acc} ${relationForeignKeys.join(' ')}`;\n }\n\n const queryProp = relationEntityName ? `${relationName} { ${relationProp} }` : filterName;\n const queryPropFinalValue =\n isEntityItself && isFilterEntitysId(filterName, currentEntityId) ? ID : queryProp;\n\n return `${acc} ${queryPropFinalValue} `;\n }, ID);\n};\n\nexport default getQueryProps;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,gBAAD,EAAmBC,aAAnB,EAAkCC,kBAAlC,EAAyD;EAC7E,IAAI,CAACD,aAAD,IAAkB,CAACD,gBAAgB,CAACG,MAAxC,EAAgD,OAAOC,aAAP;EAEhD,IAAoBC,eAApB,GAAwCJ,aAAxC,CAAQK,UAAR;EAEA,OAAON,gBAAgB,CAACO,MAAjB,CAAwB,UAACC,GAAD,EAAMC,MAAN,EAAiB;IAC9C,sBAQI,
|
|
1
|
+
{"version":3,"file":"get-query-props.js","names":["getQueryProps","inheritedFilters","currentSchema","filterEntitySchema","length","ID","currentEntityId","identifier","reduce","acc","filter","getFilterProps","filterName","relationName","relationProp","relationEntityName","isEntityItself","relationForeignKeys","shouldIgnoreFilter","join","queryProp","queryPropFinalValue","isFilterEntitysId"],"sources":["../../src/helpers/get-query-props.js"],"sourcesContent":["import isFilterEntitysId from './is-filter-entitys-id';\nimport getFilterProps from './get-filter-props';\nimport { ID } from '../constants';\n\nconst getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema) => {\n if (!currentSchema || !inheritedFilters.length) return ID;\n\n const { identifier: currentEntityId } = currentSchema;\n\n return inheritedFilters.reduce((acc, filter) => {\n const {\n filterName,\n relationName,\n relationProp,\n relationEntityName,\n isEntityItself,\n relationForeignKeys,\n shouldIgnoreFilter\n } = getFilterProps(filter, currentSchema, filterEntitySchema);\n\n if (shouldIgnoreFilter) return acc;\n if (relationForeignKeys && relationForeignKeys.length) {\n return `${acc} ${relationForeignKeys.join(' ')}`;\n }\n\n const queryProp = relationEntityName ? `${relationName} { ${relationProp} }` : filterName;\n const queryPropFinalValue =\n isEntityItself && isFilterEntitysId(filterName, currentEntityId) ? ID : queryProp;\n\n return `${acc} ${queryPropFinalValue} `;\n }, ID);\n};\n\nexport default getQueryProps;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,gBAAD,EAAmBC,aAAnB,EAAkCC,kBAAlC,EAAyD;EAC7E,IAAI,CAACD,aAAD,IAAkB,CAACD,gBAAgB,CAACG,MAAxC,EAAgD,OAAOC,aAAP;EAEhD,IAAoBC,eAApB,GAAwCJ,aAAxC,CAAQK,UAAR;EAEA,OAAON,gBAAgB,CAACO,MAAjB,CAAwB,UAACC,GAAD,EAAMC,MAAN,EAAiB;IAC9C,sBAQI,IAAAC,2BAAA,EAAeD,MAAf,EAAuBR,aAAvB,EAAsCC,kBAAtC,CARJ;IAAA,IACES,UADF,mBACEA,UADF;IAAA,IAEEC,YAFF,mBAEEA,YAFF;IAAA,IAGEC,YAHF,mBAGEA,YAHF;IAAA,IAIEC,kBAJF,mBAIEA,kBAJF;IAAA,IAKEC,cALF,mBAKEA,cALF;IAAA,IAMEC,mBANF,mBAMEA,mBANF;IAAA,IAOEC,kBAPF,mBAOEA,kBAPF;;IAUA,IAAIA,kBAAJ,EAAwB,OAAOT,GAAP;;IACxB,IAAIQ,mBAAmB,IAAIA,mBAAmB,CAACb,MAA/C,EAAuD;MACrD,iBAAUK,GAAV,cAAiBQ,mBAAmB,CAACE,IAApB,CAAyB,GAAzB,CAAjB;IACD;;IAED,IAAMC,SAAS,GAAGL,kBAAkB,aAAMF,YAAN,gBAAwBC,YAAxB,UAA2CF,UAA/E;IACA,IAAMS,mBAAmB,GACvBL,cAAc,IAAI,IAAAM,6BAAA,EAAkBV,UAAlB,EAA8BN,eAA9B,CAAlB,GAAmED,aAAnE,GAAwEe,SAD1E;IAGA,iBAAUX,GAAV,cAAiBY,mBAAjB;EACD,CArBM,EAqBJhB,aArBI,CAAP;AAsBD,CA3BD;;eA6BeL,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-updated-filter-by.js","names":["getUpdatedFilterBy","inheritedFilters","entityData","currentSchema","filterEntitySchema","itemId","props","length","relationFilters","filterBy"],"sources":["../../src/helpers/get-updated-filter-by.js"],"sourcesContent":["import uniq from 'lodash.uniq';\nimport buildInheritedFilters from './build-inherited-filters';\n\nconst getUpdatedFilterBy = (\n inheritedFilters,\n entityData,\n currentSchema,\n filterEntitySchema,\n itemId,\n props\n) => {\n if (inheritedFilters && inheritedFilters.length) {\n const relationFilters = buildInheritedFilters(\n entityData,\n inheritedFilters,\n currentSchema,\n filterEntitySchema,\n itemId\n );\n\n return relationFilters.length ? uniq([...props.filterBy, ...relationFilters]) : null;\n }\n return [];\n};\n\nexport default getUpdatedFilterBy;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CACzBC,gBADyB,EAEzBC,UAFyB,EAGzBC,aAHyB,EAIzBC,kBAJyB,EAKzBC,MALyB,EAMzBC,KANyB,EAOtB;EACH,IAAIL,gBAAgB,IAAIA,gBAAgB,CAACM,MAAzC,EAAiD;IAC/C,IAAMC,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"get-updated-filter-by.js","names":["getUpdatedFilterBy","inheritedFilters","entityData","currentSchema","filterEntitySchema","itemId","props","length","relationFilters","buildInheritedFilters","uniq","filterBy"],"sources":["../../src/helpers/get-updated-filter-by.js"],"sourcesContent":["import uniq from 'lodash.uniq';\nimport buildInheritedFilters from './build-inherited-filters';\n\nconst getUpdatedFilterBy = (\n inheritedFilters,\n entityData,\n currentSchema,\n filterEntitySchema,\n itemId,\n props\n) => {\n if (inheritedFilters && inheritedFilters.length) {\n const relationFilters = buildInheritedFilters(\n entityData,\n inheritedFilters,\n currentSchema,\n filterEntitySchema,\n itemId\n );\n\n return relationFilters.length ? uniq([...props.filterBy, ...relationFilters]) : null;\n }\n return [];\n};\n\nexport default getUpdatedFilterBy;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CACzBC,gBADyB,EAEzBC,UAFyB,EAGzBC,aAHyB,EAIzBC,kBAJyB,EAKzBC,MALyB,EAMzBC,KANyB,EAOtB;EACH,IAAIL,gBAAgB,IAAIA,gBAAgB,CAACM,MAAzC,EAAiD;IAC/C,IAAMC,eAAe,GAAG,IAAAC,iCAAA,EACtBP,UADsB,EAEtBD,gBAFsB,EAGtBE,aAHsB,EAItBC,kBAJsB,EAKtBC,MALsB,CAAxB;IAQA,OAAOG,eAAe,CAACD,MAAhB,GAAyB,IAAAG,kBAAA,gDAASJ,KAAK,CAACK,QAAf,uCAA4BH,eAA5B,GAAzB,GAAyE,IAAhF;EACD;;EACD,OAAO,EAAP;AACD,CApBD;;eAsBeR,kB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-banner.js","names":["injectBanner","entities","banner","interval","transform","parsedInterval","entitySet","bannerElement","splice"],"sources":["../../src/helpers/inject-banner.js"],"sourcesContent":["import React from 'react';\nimport parseInterval from './parse-interval';\nimport Banner from '../components/Banner';\n\nexport default function injectBanner(entities, banner) {\n const { interval, transform = false } = banner;\n const parsedInterval = parseInterval(interval);\n const entitySet = [...entities];\n\n const bannerElement = transform ? <Banner {...banner} /> : banner;\n\n entitySet.splice(parsedInterval, 0, bannerElement);\n\n return entitySet;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEe,SAASA,YAAT,CAAsBC,QAAtB,EAAgCC,MAAhC,EAAwC;EACrD,IAAQC,QAAR,GAAwCD,MAAxC,CAAQC,QAAR;EAAA,wBAAwCD,MAAxC,CAAkBE,SAAlB;EAAA,IAAkBA,SAAlB,kCAA8B,KAA9B;EACA,IAAMC,cAAc,GAAG
|
|
1
|
+
{"version":3,"file":"inject-banner.js","names":["injectBanner","entities","banner","interval","transform","parsedInterval","parseInterval","entitySet","bannerElement","splice"],"sources":["../../src/helpers/inject-banner.js"],"sourcesContent":["import React from 'react';\nimport parseInterval from './parse-interval';\nimport Banner from '../components/Banner';\n\nexport default function injectBanner(entities, banner) {\n const { interval, transform = false } = banner;\n const parsedInterval = parseInterval(interval);\n const entitySet = [...entities];\n\n const bannerElement = transform ? <Banner {...banner} /> : banner;\n\n entitySet.splice(parsedInterval, 0, bannerElement);\n\n return entitySet;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEe,SAASA,YAAT,CAAsBC,QAAtB,EAAgCC,MAAhC,EAAwC;EACrD,IAAQC,QAAR,GAAwCD,MAAxC,CAAQC,QAAR;EAAA,wBAAwCD,MAAxC,CAAkBE,SAAlB;EAAA,IAAkBA,SAAlB,kCAA8B,KAA9B;EACA,IAAMC,cAAc,GAAG,IAAAC,yBAAA,EAAcH,QAAd,CAAvB;EACA,IAAMI,SAAS,uCAAON,QAAP,CAAf;EAEA,IAAMO,aAAa,GAAGJ,SAAS,gBAAG,gCAAC,kBAAD,EAAYF,MAAZ,CAAH,GAA4BA,MAA3D;EAEAK,SAAS,CAACE,MAAV,CAAiBJ,cAAjB,EAAiC,CAAjC,EAAoCG,aAApC;EAEA,OAAOD,SAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-banners-to-entities.js","names":["injectBannersToEntities","entities","banner","options","length","repeat","bannerData","entitiesWithBanner"],"sources":["../../src/helpers/inject-banners-to-entities.js"],"sourcesContent":["import injectBanner from './inject-banner';\nimport getBannerData from './get-banner-data';\nimport injectMultipleBanners from './inject-multiple-banners';\n\nexport default function injectBannersToEntities(entities, { banner, ...options }) {\n if (!entities.length) return [];\n\n const { repeat } = banner;\n const bannerData = getBannerData(banner, options);\n\n const entitiesWithBanner = repeat\n ? injectMultipleBanners(entities, bannerData)\n : injectBanner(entities, bannerData);\n\n return entitiesWithBanner;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;AAEe,SAASA,uBAAT,CAAiCC,QAAjC,QAAmE;EAAA,IAAtBC,MAAsB,QAAtBA,MAAsB;EAAA,IAAXC,OAAW;EAChF,IAAI,CAACF,QAAQ,CAACG,MAAd,EAAsB,OAAO,EAAP;EAEtB,IAAQC,MAAR,GAAmBH,MAAnB,CAAQG,MAAR;EACA,IAAMC,UAAU,GAAG
|
|
1
|
+
{"version":3,"file":"inject-banners-to-entities.js","names":["injectBannersToEntities","entities","banner","options","length","repeat","bannerData","getBannerData","entitiesWithBanner","injectMultipleBanners","injectBanner"],"sources":["../../src/helpers/inject-banners-to-entities.js"],"sourcesContent":["import injectBanner from './inject-banner';\nimport getBannerData from './get-banner-data';\nimport injectMultipleBanners from './inject-multiple-banners';\n\nexport default function injectBannersToEntities(entities, { banner, ...options }) {\n if (!entities.length) return [];\n\n const { repeat } = banner;\n const bannerData = getBannerData(banner, options);\n\n const entitiesWithBanner = repeat\n ? injectMultipleBanners(entities, bannerData)\n : injectBanner(entities, bannerData);\n\n return entitiesWithBanner;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;AAEe,SAASA,uBAAT,CAAiCC,QAAjC,QAAmE;EAAA,IAAtBC,MAAsB,QAAtBA,MAAsB;EAAA,IAAXC,OAAW;EAChF,IAAI,CAACF,QAAQ,CAACG,MAAd,EAAsB,OAAO,EAAP;EAEtB,IAAQC,MAAR,GAAmBH,MAAnB,CAAQG,MAAR;EACA,IAAMC,UAAU,GAAG,IAAAC,yBAAA,EAAcL,MAAd,EAAsBC,OAAtB,CAAnB;EAEA,IAAMK,kBAAkB,GAAGH,MAAM,GAC7B,IAAAI,iCAAA,EAAsBR,QAAtB,EAAgCK,UAAhC,CAD6B,GAE7B,IAAAI,wBAAA,EAAaT,QAAb,EAAuBK,UAAvB,CAFJ;EAIA,OAAOE,kBAAP;AACD"}
|
package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-banners-for-entities.js","names":["getBannersForEntities","entitiesSet","banner","interval","limit","controlledLimit","length","groups","entitiesWithBanner","map","chunk","sanitizedEntities","slice"],"sources":["../../../../src/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport groupEntities from '../../group-entities';\nimport injectBanner from '../../inject-banner';\n\nexport default function getBannersForEntities(entitiesSet, banner) {\n const { interval, limit } = banner;\n const controlledLimit = limit || entitiesSet.length;\n\n const groups = groupEntities(entitiesSet, interval - 1);\n\n const entitiesWithBanner = groups.map(chunk => injectBanner(chunk, banner));\n\n const sanitizedEntities = flatten(entitiesWithBanner).slice(0, controlledLimit);\n\n return sanitizedEntities;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEe,SAASA,qBAAT,CAA+BC,WAA/B,EAA4CC,MAA5C,EAAoD;EACjE,IAAQC,QAAR,GAA4BD,MAA5B,CAAQC,QAAR;EAAA,IAAkBC,KAAlB,GAA4BF,MAA5B,CAAkBE,KAAlB;EACA,IAAMC,eAAe,GAAGD,KAAK,IAAIH,WAAW,CAACK,MAA7C;EAEA,IAAMC,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"get-banners-for-entities.js","names":["getBannersForEntities","entitiesSet","banner","interval","limit","controlledLimit","length","groups","groupEntities","entitiesWithBanner","map","chunk","injectBanner","sanitizedEntities","flatten","slice"],"sources":["../../../../src/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport groupEntities from '../../group-entities';\nimport injectBanner from '../../inject-banner';\n\nexport default function getBannersForEntities(entitiesSet, banner) {\n const { interval, limit } = banner;\n const controlledLimit = limit || entitiesSet.length;\n\n const groups = groupEntities(entitiesSet, interval - 1);\n\n const entitiesWithBanner = groups.map(chunk => injectBanner(chunk, banner));\n\n const sanitizedEntities = flatten(entitiesWithBanner).slice(0, controlledLimit);\n\n return sanitizedEntities;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEe,SAASA,qBAAT,CAA+BC,WAA/B,EAA4CC,MAA5C,EAAoD;EACjE,IAAQC,QAAR,GAA4BD,MAA5B,CAAQC,QAAR;EAAA,IAAkBC,KAAlB,GAA4BF,MAA5B,CAAkBE,KAAlB;EACA,IAAMC,eAAe,GAAGD,KAAK,IAAIH,WAAW,CAACK,MAA7C;EAEA,IAAMC,MAAM,GAAG,IAAAC,yBAAA,EAAcP,WAAd,EAA2BE,QAAQ,GAAG,CAAtC,CAAf;EAEA,IAAMM,kBAAkB,GAAGF,MAAM,CAACG,GAAP,CAAW,UAAAC,KAAK;IAAA,OAAI,IAAAC,wBAAA,EAAaD,KAAb,EAAoBT,MAApB,CAAJ;EAAA,CAAhB,CAA3B;EAEA,IAAMW,iBAAiB,GAAG,IAAAC,kBAAA,EAAQL,kBAAR,EAA4BM,KAA5B,CAAkC,CAAlC,EAAqCV,eAArC,CAA1B;EAEA,OAAOQ,iBAAP;AACD"}
|
package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-banners-for-nodes.js","names":["getBannersForNodes","entitiesSet","banner","groups","nodesWithBanner","map","chunk","index","key","adunit","interval","length","flatten"],"sources":["../../../../src/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { groupNodeEntities } from './helpers';\nimport injectBanner from '../../inject-banner';\n\nexport default function getBannersForNodes(entitiesSet, banner) {\n const groups = groupNodeEntities(entitiesSet, banner);\n const nodesWithBanner = groups\n .map((chunk, index) => {\n const key = `${banner.adunit}-${index}`;\n const interval = chunk.length + 1;\n\n return injectBanner(chunk, { ...banner, key, interval });\n })\n .map(flatten);\n\n return nodesWithBanner;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAEe,SAASA,kBAAT,CAA4BC,WAA5B,EAAyCC,MAAzC,EAAiD;EAC9D,IAAMC,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"get-banners-for-nodes.js","names":["getBannersForNodes","entitiesSet","banner","groups","groupNodeEntities","nodesWithBanner","map","chunk","index","key","adunit","interval","length","injectBanner","flatten"],"sources":["../../../../src/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { groupNodeEntities } from './helpers';\nimport injectBanner from '../../inject-banner';\n\nexport default function getBannersForNodes(entitiesSet, banner) {\n const groups = groupNodeEntities(entitiesSet, banner);\n const nodesWithBanner = groups\n .map((chunk, index) => {\n const key = `${banner.adunit}-${index}`;\n const interval = chunk.length + 1;\n\n return injectBanner(chunk, { ...banner, key, interval });\n })\n .map(flatten);\n\n return nodesWithBanner;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAEe,SAASA,kBAAT,CAA4BC,WAA5B,EAAyCC,MAAzC,EAAiD;EAC9D,IAAMC,MAAM,GAAG,IAAAC,0BAAA,EAAkBH,WAAlB,EAA+BC,MAA/B,CAAf;EACA,IAAMG,eAAe,GAAGF,MAAM,CAC3BG,GADqB,CACjB,UAACC,KAAD,EAAQC,KAAR,EAAkB;IACrB,IAAMC,GAAG,aAAMP,MAAM,CAACQ,MAAb,cAAuBF,KAAvB,CAAT;IACA,IAAMG,QAAQ,GAAGJ,KAAK,CAACK,MAAN,GAAe,CAAhC;IAEA,OAAO,IAAAC,wBAAA,EAAaN,KAAb,kCAAyBL,MAAzB;MAAiCO,GAAG,EAAHA,GAAjC;MAAsCE,QAAQ,EAARA;IAAtC,GAAP;EACD,CANqB,EAOrBL,GAPqB,CAOjBQ,kBAPiB,CAAxB;EASA,OAAOT,eAAP;AACD"}
|
package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/helpers/group-node-entities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-node-entities.js","names":["groupNodeEntities","entities","options","interval","entitySet","chunks","lastSliceIndex","validNodeIndexes","map","validIndex","props","hasValidChildren","children","length","filter","indexCandidate","refChunks","forEach","ref","end","start","newChunk","slice","push"],"sources":["../../../../../src/helpers/inject-multiple-banners/get-banners-for-nodes/helpers/group-node-entities.js"],"sourcesContent":["import groupEntities from '../../../group-entities';\n\nexport default function groupNodeEntities(entities, options) {\n const { interval } = options;\n const entitySet = [...entities];\n const chunks = [];\n let lastSliceIndex = 0;\n\n const validNodeIndexes = entitySet\n .map(({ props }, validIndex) => {\n const hasValidChildren = props && props.children && props.children.length;\n\n if (hasValidChildren) return validIndex;\n\n return null;\n })\n .filter(indexCandidate => typeof indexCandidate === 'number');\n\n const refChunks = groupEntities(validNodeIndexes, interval - 1);\n\n refChunks.forEach(ref => {\n const end = ref[ref.length - 1] + 1;\n const start = lastSliceIndex || ref[0];\n\n const newChunk = entitySet.slice(start, end);\n\n lastSliceIndex = end;\n\n if (newChunk.length) chunks.push(newChunk);\n });\n\n return chunks;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEe,SAASA,iBAAT,CAA2BC,QAA3B,EAAqCC,OAArC,EAA8C;EAC3D,IAAQC,QAAR,GAAqBD,OAArB,CAAQC,QAAR;EACA,IAAMC,SAAS,uCAAOH,QAAP,CAAf;EACA,IAAMI,MAAM,GAAG,EAAf;EACA,IAAIC,cAAc,GAAG,CAArB;EAEA,IAAMC,gBAAgB,GAAGH,SAAS,CAC/BI,GADsB,CAClB,gBAAYC,UAAZ,EAA2B;IAAA,IAAxBC,KAAwB,QAAxBA,KAAwB;IAC9B,IAAMC,gBAAgB,GAAGD,KAAK,IAAIA,KAAK,CAACE,QAAf,IAA2BF,KAAK,CAACE,QAAN,CAAeC,MAAnE;IAEA,IAAIF,gBAAJ,EAAsB,OAAOF,UAAP;IAEtB,OAAO,IAAP;EACD,CAPsB,EAQtBK,MARsB,CAQf,UAAAC,cAAc;IAAA,OAAI,OAAOA,cAAP,KAA0B,QAA9B;EAAA,CARC,CAAzB;EAUA,IAAMC,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"group-node-entities.js","names":["groupNodeEntities","entities","options","interval","entitySet","chunks","lastSliceIndex","validNodeIndexes","map","validIndex","props","hasValidChildren","children","length","filter","indexCandidate","refChunks","groupEntities","forEach","ref","end","start","newChunk","slice","push"],"sources":["../../../../../src/helpers/inject-multiple-banners/get-banners-for-nodes/helpers/group-node-entities.js"],"sourcesContent":["import groupEntities from '../../../group-entities';\n\nexport default function groupNodeEntities(entities, options) {\n const { interval } = options;\n const entitySet = [...entities];\n const chunks = [];\n let lastSliceIndex = 0;\n\n const validNodeIndexes = entitySet\n .map(({ props }, validIndex) => {\n const hasValidChildren = props && props.children && props.children.length;\n\n if (hasValidChildren) return validIndex;\n\n return null;\n })\n .filter(indexCandidate => typeof indexCandidate === 'number');\n\n const refChunks = groupEntities(validNodeIndexes, interval - 1);\n\n refChunks.forEach(ref => {\n const end = ref[ref.length - 1] + 1;\n const start = lastSliceIndex || ref[0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AAOjB,MAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-multiple-banners.js","names":["injectMultipleBanners","entities","banner","transform","entitiesSet","injectedEntities"],"sources":["../../../src/helpers/inject-multiple-banners/inject-multiple-banners.js"],"sourcesContent":["import getBannersForEntities from './get-banners-for-entities';\nimport getBannersForNodes from './get-banners-for-nodes';\n\nexport default function injectMultipleBanners(entities, banner) {\n const { transform } = banner;\n const entitiesSet = [...entities];\n\n const injectedEntities = transform\n ? getBannersForNodes(entitiesSet, banner)\n : getBannersForEntities(entitiesSet, banner);\n\n return injectedEntities;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEe,SAASA,qBAAT,CAA+BC,QAA/B,EAAyCC,MAAzC,EAAiD;EAC9D,IAAQC,SAAR,GAAsBD,MAAtB,CAAQC,SAAR;EACA,IAAMC,WAAW,uCAAOH,QAAP,CAAjB;EAEA,IAAMI,gBAAgB,GAAGF,SAAS,GAC9B,
|
|
1
|
+
{"version":3,"file":"inject-multiple-banners.js","names":["injectMultipleBanners","entities","banner","transform","entitiesSet","injectedEntities","getBannersForNodes","getBannersForEntities"],"sources":["../../../src/helpers/inject-multiple-banners/inject-multiple-banners.js"],"sourcesContent":["import getBannersForEntities from './get-banners-for-entities';\nimport getBannersForNodes from './get-banners-for-nodes';\n\nexport default function injectMultipleBanners(entities, banner) {\n const { transform } = banner;\n const entitiesSet = [...entities];\n\n const injectedEntities = transform\n ? getBannersForNodes(entitiesSet, banner)\n : getBannersForEntities(entitiesSet, banner);\n\n return injectedEntities;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEe,SAASA,qBAAT,CAA+BC,QAA/B,EAAyCC,MAAzC,EAAiD;EAC9D,IAAQC,SAAR,GAAsBD,MAAtB,CAAQC,SAAR;EACA,IAAMC,WAAW,uCAAOH,QAAP,CAAjB;EAEA,IAAMI,gBAAgB,GAAGF,SAAS,GAC9B,IAAAG,8BAAA,EAAmBF,WAAnB,EAAgCF,MAAhC,CAD8B,GAE9B,IAAAK,iCAAA,EAAsBH,WAAtB,EAAmCF,MAAnC,CAFJ;EAIA,OAAOG,gBAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-filter-entitys-id.js","names":["isFilterEntitysId","entityName","itemEntityUpdated","id","ID","includes"],"sources":["../../src/helpers/is-filter-entitys-id.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport { ID } from '../constants';\n\nconst isFilterEntitysId = (entityName, itemEntityUpdated) => {\n const id = upperFirst(ID);\n return [\n `${itemEntityUpdated}${id}`,\n `${itemEntityUpdated}s${id}`,\n `${itemEntityUpdated}${id}s`,\n `${itemEntityUpdated}s${id}s`\n ].includes(entityName);\n};\n\nexport default isFilterEntitysId;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,UAAD,EAAaC,iBAAb,EAAmC;EAC3D,IAAMC,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"is-filter-entitys-id.js","names":["isFilterEntitysId","entityName","itemEntityUpdated","id","upperFirst","ID","includes"],"sources":["../../src/helpers/is-filter-entitys-id.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport { ID } from '../constants';\n\nconst isFilterEntitysId = (entityName, itemEntityUpdated) => {\n const id = upperFirst(ID);\n return [\n `${itemEntityUpdated}${id}`,\n `${itemEntityUpdated}s${id}`,\n `${itemEntityUpdated}${id}s`,\n `${itemEntityUpdated}s${id}s`\n ].includes(entityName);\n};\n\nexport default isFilterEntitysId;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,UAAD,EAAaC,iBAAb,EAAmC;EAC3D,IAAMC,EAAE,GAAG,IAAAC,kBAAA,EAAWC,aAAX,CAAX;EACA,OAAO,WACFH,iBADE,SACkBC,EADlB,aAEFD,iBAFE,cAEmBC,EAFnB,aAGFD,iBAHE,SAGkBC,EAHlB,kBAIFD,iBAJE,cAImBC,EAJnB,QAKLG,QALK,CAKIL,UALJ,CAAP;AAMD,CARD;;eAUeD,iB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-TextBlock.js","names":["parseTextBlock","config","html","LinkWrapper","useTargetBlank","options","replace","domNode","attribs","children","tagName","name","ANCHOR_TAG","target","TARGET_BLANK"],"sources":["../../src/helpers/parse-TextBlock.js"],"sourcesContent":["import parseHTML, { domToReact } from 'html-react-parser';\nimport React from 'react';\nimport { ANCHOR_TAG, TARGET_BLANK } from '../constants';\n\nfunction parseTextBlock(config) {\n const { html, LinkWrapper, useTargetBlank } = config;\n\n const options = {\n replace: domNode => {\n const { attribs, children, name: tagName } = domNode;\n if (tagName === ANCHOR_TAG) {\n const target = useTargetBlank ? TARGET_BLANK : attribs.target;\n\n return LinkWrapper ? (\n <LinkWrapper {...attribs} target={target}>\n {domToReact(children, options)}\n </LinkWrapper>\n ) : (\n domNode\n );\n }\n return null;\n }\n };\n\n return parseHTML(html, options);\n}\n\nexport default parseTextBlock;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAEA,SAASA,cAAT,CAAwBC,MAAxB,EAAgC;EAC9B,IAAQC,IAAR,GAA8CD,MAA9C,CAAQC,IAAR;EAAA,IAAcC,WAAd,GAA8CF,MAA9C,CAAcE,WAAd;EAAA,IAA2BC,cAA3B,GAA8CH,MAA9C,CAA2BG,cAA3B;EAEA,IAAMC,OAAO,GAAG;IACdC,OAAO,EAAE,iBAAAC,OAAO,EAAI;MAClB,IAAQC,OAAR,GAA6CD,OAA7C,CAAQC,OAAR;MAAA,IAAiBC,QAAjB,GAA6CF,OAA7C,CAAiBE,QAAjB;MAAA,IAAiCC,OAAjC,GAA6CH,OAA7C,CAA2BI,IAA3B;;MACA,IAAID,OAAO,KAAKE,qBAAhB,EAA4B;QAC1B,IAAMC,MAAM,GAAGT,cAAc,GAAGU,uBAAH,GAAkBN,OAAO,CAACK,MAAvD;QAEA,OAAOV,WAAW,gBAChB,gCAAC,WAAD,gCAAiBK,OAAjB;UAA0B,MAAM,EAAEK;QAAlC,IACG,
|
|
1
|
+
{"version":3,"file":"parse-TextBlock.js","names":["parseTextBlock","config","html","LinkWrapper","useTargetBlank","options","replace","domNode","attribs","children","tagName","name","ANCHOR_TAG","target","TARGET_BLANK","domToReact","parseHTML"],"sources":["../../src/helpers/parse-TextBlock.js"],"sourcesContent":["import parseHTML, { domToReact } from 'html-react-parser';\nimport React from 'react';\nimport { ANCHOR_TAG, TARGET_BLANK } from '../constants';\n\nfunction parseTextBlock(config) {\n const { html, LinkWrapper, useTargetBlank } = config;\n\n const options = {\n replace: domNode => {\n const { attribs, children, name: tagName } = domNode;\n if (tagName === ANCHOR_TAG) {\n const target = useTargetBlank ? TARGET_BLANK : attribs.target;\n\n return LinkWrapper ? (\n <LinkWrapper {...attribs} target={target}>\n {domToReact(children, options)}\n </LinkWrapper>\n ) : (\n domNode\n );\n }\n return null;\n }\n };\n\n return parseHTML(html, options);\n}\n\nexport default parseTextBlock;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAEA,SAASA,cAAT,CAAwBC,MAAxB,EAAgC;EAC9B,IAAQC,IAAR,GAA8CD,MAA9C,CAAQC,IAAR;EAAA,IAAcC,WAAd,GAA8CF,MAA9C,CAAcE,WAAd;EAAA,IAA2BC,cAA3B,GAA8CH,MAA9C,CAA2BG,cAA3B;EAEA,IAAMC,OAAO,GAAG;IACdC,OAAO,EAAE,iBAAAC,OAAO,EAAI;MAClB,IAAQC,OAAR,GAA6CD,OAA7C,CAAQC,OAAR;MAAA,IAAiBC,QAAjB,GAA6CF,OAA7C,CAAiBE,QAAjB;MAAA,IAAiCC,OAAjC,GAA6CH,OAA7C,CAA2BI,IAA3B;;MACA,IAAID,OAAO,KAAKE,qBAAhB,EAA4B;QAC1B,IAAMC,MAAM,GAAGT,cAAc,GAAGU,uBAAH,GAAkBN,OAAO,CAACK,MAAvD;QAEA,OAAOV,WAAW,gBAChB,gCAAC,WAAD,gCAAiBK,OAAjB;UAA0B,MAAM,EAAEK;QAAlC,IACG,IAAAE,2BAAA,EAAWN,QAAX,EAAqBJ,OAArB,CADH,CADgB,GAKhBE,OALF;MAOD;;MACD,OAAO,IAAP;IACD;EAfa,CAAhB;EAkBA,OAAO,IAAAS,2BAAA,EAAUd,IAAV,EAAgBG,OAAhB,CAAP;AACD;;eAEcL,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-props-to-display.js","names":["parsePropsToDisplay","props","propsToDisplay","filter","Boolean","map","currentIndex","bold","propertiesToDisplay","prefix","suffix","shouldStrip","enableLink","Wrapper","BOLD_TAG","Fragment","parsedPropValues","sanitizedPropValues","length","stringEndBlank","BLANK_SPACE_UNICODE_STRING"],"sources":["../../src/helpers/parse-props-to-display.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport at from 'lodash.at';\nimport isObject from './is-object';\nimport getParsedPropValues from './get-parsed-prop-values';\nimport getSanitizedPropValues from './get-sanitized-prop-values';\nimport { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst parsePropsToDisplay = (props = {}, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);\n\n return propsToDisplay.map(\n ({ bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink }, currentIndex) => {\n const Wrapper = bold ? BOLD_TAG : Fragment;\n\n const parsedPropValues = getParsedPropValues({\n propertiesToDisplay,\n props,\n enableLink,\n shouldStrip\n });\n\n const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);\n if (!sanitizedPropValues || !sanitizedPropValues.length) return null;\n const stringEndBlank =\n currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;\n\n return (\n <Wrapper>\n {prefix} {sanitizedPropValues} {suffix}\n {stringEndBlank}\n </Wrapper>\n );\n }\n );\n};\n\nexport default parsePropsToDisplay;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA;AACA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAsB,GAAqC;EAAA,IAApCC,KAAoC,uEAA5B,EAA4B;EAAA,IAAxBC,cAAwB,uEAAP,EAAO;EAC/D,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"parse-props-to-display.js","names":["parsePropsToDisplay","props","propsToDisplay","isObject","at","filter","Boolean","map","currentIndex","bold","propertiesToDisplay","prefix","suffix","shouldStrip","enableLink","Wrapper","BOLD_TAG","Fragment","parsedPropValues","getParsedPropValues","sanitizedPropValues","getSanitizedPropValues","length","stringEndBlank","BLANK_SPACE_UNICODE_STRING"],"sources":["../../src/helpers/parse-props-to-display.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport at from 'lodash.at';\nimport isObject from './is-object';\nimport getParsedPropValues from './get-parsed-prop-values';\nimport getSanitizedPropValues from './get-sanitized-prop-values';\nimport { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst parsePropsToDisplay = (props = {}, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);\n\n return propsToDisplay.map(\n ({ bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink }, currentIndex) => {\n const Wrapper = bold ? BOLD_TAG : Fragment;\n\n const parsedPropValues = getParsedPropValues({\n propertiesToDisplay,\n props,\n enableLink,\n shouldStrip\n });\n\n const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);\n if (!sanitizedPropValues || !sanitizedPropValues.length) return null;\n const stringEndBlank =\n currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;\n\n return (\n <Wrapper>\n {prefix} {sanitizedPropValues} {suffix}\n {stringEndBlank}\n </Wrapper>\n );\n }\n );\n};\n\nexport default parsePropsToDisplay;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA;AACA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAsB,GAAqC;EAAA,IAApCC,KAAoC,uEAA5B,EAA4B;EAAA,IAAxBC,cAAwB,uEAAP,EAAO;EAC/D,IAAI,CAAC,IAAAC,oBAAA,EAASD,cAAc,CAAC,CAAD,CAAvB,CAAL,EAAkC,OAAO,IAAAE,kBAAA,EAAGH,KAAH,EAAUC,cAAV,EAA0BG,MAA1B,CAAiCC,OAAjC,CAAP;EAElC,OAAOJ,cAAc,CAACK,GAAf,CACL,gBAAyEC,YAAzE,EAA0F;IAAA,IAAvFC,IAAuF,QAAvFA,IAAuF;IAAA,IAAjFC,mBAAiF,QAAjFA,mBAAiF;IAAA,IAA5DC,MAA4D,QAA5DA,MAA4D;IAAA,IAApDC,MAAoD,QAApDA,MAAoD;IAAA,IAA5CC,WAA4C,QAA5CA,WAA4C;IAAA,IAA/BC,UAA+B,QAA/BA,UAA+B;IACxF,IAAMC,OAAO,GAAGN,IAAI,GAAGO,mBAAH,GAAcC,eAAlC;IAEA,IAAMC,gBAAgB,GAAG,IAAAC,+BAAA,EAAoB;MAC3CT,mBAAmB,EAAnBA,mBAD2C;MAE3CT,KAAK,EAALA,KAF2C;MAG3Ca,UAAU,EAAVA,UAH2C;MAI3CD,WAAW,EAAXA;IAJ2C,CAApB,CAAzB;IAOA,IAAMO,mBAAmB,GAAG,IAAAC,kCAAA,EAAuBH,gBAAvB,CAA5B;IACA,IAAI,CAACE,mBAAD,IAAwB,CAACA,mBAAmB,CAACE,MAAjD,EAAyD,OAAO,IAAP;IACzD,IAAMC,cAAc,GAClBf,YAAY,GAAG,CAAf,KAAqBN,cAAc,CAACoB,MAApC,GAA6C,EAA7C,GAAkDE,qCADpD;IAGA,oBACE,gCAAC,OAAD,QACGb,MADH,OACYS,mBADZ,OACkCR,MADlC,EAEGW,cAFH,CADF;EAMD,CAtBI,CAAP;AAwBD,CA3BD;;eA6BevB,mB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-children.js","names":["buildChildProps","childProps","parentProps","propsToOverride","CHILD_PROPS_TO_USE","forEach","prop","renderChildren","children","otherProps","React","Children","map","child","childrenElements","props","Array","isArray","length","nestedChildren","nestedChild","cloneElement"],"sources":["../../src/helpers/render-children.js"],"sourcesContent":["import React from 'react';\nimport { CHILD_PROPS_TO_USE } from '../constants';\n\nconst buildChildProps = (childProps, parentProps) => {\n const propsToOverride = {};\n CHILD_PROPS_TO_USE.forEach(prop => (propsToOverride[prop] = childProps[prop]));\n return { ...parentProps, ...propsToOverride };\n};\n\nconst renderChildren = (children, otherProps = {}) =>\n React.Children.map(children, child => {\n const childrenElements = child.props.children;\n if (Array.isArray(childrenElements) && childrenElements.length) {\n const [, nestedChildren] = child.props.children;\n return (\n Array.isArray(nestedChildren) &&\n nestedChildren.map(nestedChild => renderChildren(nestedChild, otherProps))\n );\n }\n const childProps = buildChildProps(child.props, otherProps);\n return React.cloneElement(child, { ...childProps });\n });\n\nexport default renderChildren;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,UAAD,EAAaC,WAAb,EAA6B;EACnD,IAAMC,eAAe,GAAG,EAAxB;;EACAC,
|
|
1
|
+
{"version":3,"file":"render-children.js","names":["buildChildProps","childProps","parentProps","propsToOverride","CHILD_PROPS_TO_USE","forEach","prop","renderChildren","children","otherProps","React","Children","map","child","childrenElements","props","Array","isArray","length","nestedChildren","nestedChild","cloneElement"],"sources":["../../src/helpers/render-children.js"],"sourcesContent":["import React from 'react';\nimport { CHILD_PROPS_TO_USE } from '../constants';\n\nconst buildChildProps = (childProps, parentProps) => {\n const propsToOverride = {};\n CHILD_PROPS_TO_USE.forEach(prop => (propsToOverride[prop] = childProps[prop]));\n return { ...parentProps, ...propsToOverride };\n};\n\nconst renderChildren = (children, otherProps = {}) =>\n React.Children.map(children, child => {\n const childrenElements = child.props.children;\n if (Array.isArray(childrenElements) && childrenElements.length) {\n const [, nestedChildren] = child.props.children;\n return (\n Array.isArray(nestedChildren) &&\n nestedChildren.map(nestedChild => renderChildren(nestedChild, otherProps))\n );\n }\n const childProps = buildChildProps(child.props, otherProps);\n return React.cloneElement(child, { ...childProps });\n });\n\nexport default renderChildren;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,UAAD,EAAaC,WAAb,EAA6B;EACnD,IAAMC,eAAe,GAAG,EAAxB;;EACAC,6BAAA,CAAmBC,OAAnB,CAA2B,UAAAC,IAAI;IAAA,OAAKH,eAAe,CAACG,IAAD,CAAf,GAAwBL,UAAU,CAACK,IAAD,CAAvC;EAAA,CAA/B;;EACA,uCAAYJ,WAAZ,GAA4BC,eAA5B;AACD,CAJD;;AAMA,IAAMI,cAAc,GAAG,SAAjBA,cAAiB,CAACC,QAAD;EAAA,IAAWC,UAAX,uEAAwB,EAAxB;EAAA,OACrBC,iBAAA,CAAMC,QAAN,CAAeC,GAAf,CAAmBJ,QAAnB,EAA6B,UAAAK,KAAK,EAAI;IACpC,IAAMC,gBAAgB,GAAGD,KAAK,CAACE,KAAN,CAAYP,QAArC;;IACA,IAAIQ,KAAK,CAACC,OAAN,CAAcH,gBAAd,KAAmCA,gBAAgB,CAACI,MAAxD,EAAgE;MAC9D,4DAA2BL,KAAK,CAACE,KAAN,CAAYP,QAAvC;MAAA,IAASW,cAAT;;MACA,OACEH,KAAK,CAACC,OAAN,CAAcE,cAAd,KACAA,cAAc,CAACP,GAAf,CAAmB,UAAAQ,WAAW;QAAA,OAAIb,cAAc,CAACa,WAAD,EAAcX,UAAd,CAAlB;MAAA,CAA9B,CAFF;IAID;;IACD,IAAMR,UAAU,GAAGD,eAAe,CAACa,KAAK,CAACE,KAAP,EAAcN,UAAd,CAAlC;IACA,oBAAOC,iBAAA,CAAMW,YAAN,CAAmBR,KAAnB,oBAA+BZ,UAA/B,EAAP;EACD,CAXD,CADqB;AAAA,CAAvB;;eAceM,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-response-data.js","names":["sortResponseData","data","itemsToDisplay","idsToDisplay","length","map","id","find","resultId","filter","Boolean"],"sources":["../../src/helpers/sort-response-data.js"],"sourcesContent":["import getItemsToDisplayIds from './get-items-to-display-ids';\n\nconst sortResponseData = (data = [], itemsToDisplay = []) => {\n const idsToDisplay = getItemsToDisplayIds(itemsToDisplay);\n if (!idsToDisplay.length) return data;\n return idsToDisplay.map(id => data.find(({ id: resultId }) => id === resultId)).filter(Boolean);\n};\n\nexport default sortResponseData;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,GAAoC;EAAA,IAAnCC,IAAmC,uEAA5B,EAA4B;EAAA,IAAxBC,cAAwB,uEAAP,EAAO;EAC3D,IAAMC,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"sort-response-data.js","names":["sortResponseData","data","itemsToDisplay","idsToDisplay","getItemsToDisplayIds","length","map","id","find","resultId","filter","Boolean"],"sources":["../../src/helpers/sort-response-data.js"],"sourcesContent":["import getItemsToDisplayIds from './get-items-to-display-ids';\n\nconst sortResponseData = (data = [], itemsToDisplay = []) => {\n const idsToDisplay = getItemsToDisplayIds(itemsToDisplay);\n if (!idsToDisplay.length) return data;\n return idsToDisplay.map(id => data.find(({ id: resultId }) => id === resultId)).filter(Boolean);\n};\n\nexport default sortResponseData;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,GAAoC;EAAA,IAAnCC,IAAmC,uEAA5B,EAA4B;EAAA,IAAxBC,cAAwB,uEAAP,EAAO;EAC3D,IAAMC,YAAY,GAAG,IAAAC,gCAAA,EAAqBF,cAArB,CAArB;EACA,IAAI,CAACC,YAAY,CAACE,MAAlB,EAA0B,OAAOJ,IAAP;EAC1B,OAAOE,YAAY,CAACG,GAAb,CAAiB,UAAAC,EAAE;IAAA,OAAIN,IAAI,CAACO,IAAL,CAAU;MAAA,IAAOC,QAAP,QAAGF,EAAH;MAAA,OAAsBA,EAAE,KAAKE,QAA7B;IAAA,CAAV,CAAJ;EAAA,CAAnB,EAAyEC,MAAzE,CAAgFC,OAAhF,CAAP;AACD,CAJD;;eAMeX,gB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderComponent.js","names":["RenderComponent","component","imageProps","childComponents","options","textBlockBanners","hasTextBlockBanners","siblings","nestedComponentsProps","type","settings","id","name","Component","isImage","PB_TYPE_IMAGE","PB_TYPE_BANNER","PB_TYPE_TEXTBLOCK","PB_TYPE_CAROUSEL","includes","imageOptions","updatedSettings","propTypes","PropTypes","shape","string","object","items","array","isRequired","node","bool","defaultProps"],"sources":["../../../src/hooks/helpers/RenderComponent.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport getComponent from './getComponent';\nimport appendGtmClassName from './append-gtm-classname';\nimport { PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL } from './constants';\nimport { BannerContextProvider } from '../../BannerContext';\n\nconst RenderComponent = ({\n component,\n imageProps,\n childComponents,\n options = {},\n textBlockBanners,\n hasTextBlockBanners,\n siblings,\n ...nestedComponentsProps\n}) => {\n const { type, settings, id, name } = component;\n const Component = getComponent(type);\n const isImage = [PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL].includes(\n type\n );\n const imageOptions = isImage ? imageProps : {};\n if (!Component) return null;\n const updatedSettings = appendGtmClassName(settings, childComponents);\n\n return (\n <Component\n key={id}\n type={type}\n {...options}\n {...imageOptions}\n {...nestedComponentsProps}\n {...updatedSettings}\n name={name || settings.name}>\n {hasTextBlockBanners ? (\n <BannerContextProvider siblings={siblings} banners={textBlockBanners} pbOptions={options}>\n {childComponents}\n </BannerContextProvider>\n ) : (\n childComponents\n )}\n </Component>\n );\n};\n\nRenderComponent.propTypes = {\n component: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.string,\n name: PropTypes.string,\n settings: PropTypes.object,\n items: PropTypes.array\n }).isRequired,\n imageProps: PropTypes.object.isRequired,\n options: PropTypes.object.isRequired,\n childComponents: PropTypes.node.isRequired,\n textBlockBanners: PropTypes.array,\n hasTextBlockBanners: PropTypes.bool,\n siblings: PropTypes.array\n};\n\nRenderComponent.defaultProps = { textBlockBanners: null, hasTextBlockBanners: false, siblings: [] };\n\nexport default RenderComponent;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,OASlB;EAAA,IARJC,SAQI,QARJA,SAQI;EAAA,IAPJC,UAOI,QAPJA,UAOI;EAAA,IANJC,eAMI,QANJA,eAMI;EAAA,wBALJC,OAKI;EAAA,IALJA,OAKI,6BALM,EAKN;EAAA,IAJJC,gBAII,QAJJA,gBAII;EAAA,IAHJC,mBAGI,QAHJA,mBAGI;EAAA,IAFJC,QAEI,QAFJA,QAEI;EAAA,IADDC,qBACC;EACJ,IAAQC,IAAR,GAAqCR,SAArC,CAAQQ,IAAR;EAAA,IAAcC,QAAd,GAAqCT,SAArC,CAAcS,QAAd;EAAA,IAAwBC,EAAxB,GAAqCV,SAArC,CAAwBU,EAAxB;EAAA,IAA4BC,IAA5B,GAAqCX,SAArC,CAA4BW,IAA5B;EACA,IAAMC,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"RenderComponent.js","names":["RenderComponent","component","imageProps","childComponents","options","textBlockBanners","hasTextBlockBanners","siblings","nestedComponentsProps","type","settings","id","name","Component","getComponent","isImage","PB_TYPE_IMAGE","PB_TYPE_BANNER","PB_TYPE_TEXTBLOCK","PB_TYPE_CAROUSEL","includes","imageOptions","updatedSettings","appendGtmClassName","propTypes","PropTypes","shape","string","object","items","array","isRequired","node","bool","defaultProps"],"sources":["../../../src/hooks/helpers/RenderComponent.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport getComponent from './getComponent';\nimport appendGtmClassName from './append-gtm-classname';\nimport { PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL } from './constants';\nimport { BannerContextProvider } from '../../BannerContext';\n\nconst RenderComponent = ({\n component,\n imageProps,\n childComponents,\n options = {},\n textBlockBanners,\n hasTextBlockBanners,\n siblings,\n ...nestedComponentsProps\n}) => {\n const { type, settings, id, name } = component;\n const Component = getComponent(type);\n const isImage = [PB_TYPE_IMAGE, PB_TYPE_BANNER, PB_TYPE_TEXTBLOCK, PB_TYPE_CAROUSEL].includes(\n type\n );\n const imageOptions = isImage ? imageProps : {};\n if (!Component) return null;\n const updatedSettings = appendGtmClassName(settings, childComponents);\n\n return (\n <Component\n key={id}\n type={type}\n {...options}\n {...imageOptions}\n {...nestedComponentsProps}\n {...updatedSettings}\n name={name || settings.name}>\n {hasTextBlockBanners ? (\n <BannerContextProvider siblings={siblings} banners={textBlockBanners} pbOptions={options}>\n {childComponents}\n </BannerContextProvider>\n ) : (\n childComponents\n )}\n </Component>\n );\n};\n\nRenderComponent.propTypes = {\n component: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.string,\n name: PropTypes.string,\n settings: PropTypes.object,\n items: PropTypes.array\n }).isRequired,\n imageProps: PropTypes.object.isRequired,\n options: PropTypes.object.isRequired,\n childComponents: PropTypes.node.isRequired,\n textBlockBanners: PropTypes.array,\n hasTextBlockBanners: PropTypes.bool,\n siblings: PropTypes.array\n};\n\nRenderComponent.defaultProps = { textBlockBanners: null, hasTextBlockBanners: false, siblings: [] };\n\nexport default RenderComponent;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,OASlB;EAAA,IARJC,SAQI,QARJA,SAQI;EAAA,IAPJC,UAOI,QAPJA,UAOI;EAAA,IANJC,eAMI,QANJA,eAMI;EAAA,wBALJC,OAKI;EAAA,IALJA,OAKI,6BALM,EAKN;EAAA,IAJJC,gBAII,QAJJA,gBAII;EAAA,IAHJC,mBAGI,QAHJA,mBAGI;EAAA,IAFJC,QAEI,QAFJA,QAEI;EAAA,IADDC,qBACC;EACJ,IAAQC,IAAR,GAAqCR,SAArC,CAAQQ,IAAR;EAAA,IAAcC,QAAd,GAAqCT,SAArC,CAAcS,QAAd;EAAA,IAAwBC,EAAxB,GAAqCV,SAArC,CAAwBU,EAAxB;EAAA,IAA4BC,IAA5B,GAAqCX,SAArC,CAA4BW,IAA5B;EACA,IAAMC,SAAS,GAAG,IAAAC,wBAAA,EAAaL,IAAb,CAAlB;EACA,IAAMM,OAAO,GAAG,CAACC,wBAAD,EAAgBC,yBAAhB,EAAgCC,4BAAhC,EAAmDC,2BAAnD,EAAqEC,QAArE,CACdX,IADc,CAAhB;EAGA,IAAMY,YAAY,GAAGN,OAAO,GAAGb,UAAH,GAAgB,EAA5C;EACA,IAAI,CAACW,SAAL,EAAgB,OAAO,IAAP;EAChB,IAAMS,eAAe,GAAG,IAAAC,8BAAA,EAAmBb,QAAnB,EAA6BP,eAA7B,CAAxB;EAEA,oBACE,gCAAC,SAAD;IACE,GAAG,EAAEQ,EADP;IAEE,IAAI,EAAEF;EAFR,GAGML,OAHN,EAIMiB,YAJN,EAKMb,qBALN,EAMMc,eANN;IAOE,IAAI,EAAEV,IAAI,IAAIF,QAAQ,CAACE;EAPzB,IAQGN,mBAAmB,gBAClB,gCAAC,oCAAD;IAAuB,QAAQ,EAAEC,QAAjC;IAA2C,OAAO,EAAEF,gBAApD;IAAsE,SAAS,EAAED;EAAjF,GACGD,eADH,CADkB,GAKlBA,eAbJ,CADF;AAkBD,CArCD;;AAuCAH,eAAe,CAACwB,SAAhB,GAA4B;EAC1BvB,SAAS,EAAEwB,qBAAA,CAAUC,KAAV,CAAgB;IACzBjB,IAAI,EAAEgB,qBAAA,CAAUE,MADS;IAEzBhB,EAAE,EAAEc,qBAAA,CAAUE,MAFW;IAGzBf,IAAI,EAAEa,qBAAA,CAAUE,MAHS;IAIzBjB,QAAQ,EAAEe,qBAAA,CAAUG,MAJK;IAKzBC,KAAK,EAAEJ,qBAAA,CAAUK;EALQ,CAAhB,EAMRC,UAPuB;EAQ1B7B,UAAU,EAAEuB,qBAAA,CAAUG,MAAV,CAAiBG,UARH;EAS1B3B,OAAO,EAAEqB,qBAAA,CAAUG,MAAV,CAAiBG,UATA;EAU1B5B,eAAe,EAAEsB,qBAAA,CAAUO,IAAV,CAAeD,UAVN;EAW1B1B,gBAAgB,EAAEoB,qBAAA,CAAUK,KAXF;EAY1BxB,mBAAmB,EAAEmB,qBAAA,CAAUQ,IAZL;EAa1B1B,QAAQ,EAAEkB,qBAAA,CAAUK;AAbM,CAA5B;AAgBA9B,eAAe,CAACkC,YAAhB,GAA+B;EAAE7B,gBAAgB,EAAE,IAApB;EAA0BC,mBAAmB,EAAE,KAA/C;EAAsDC,QAAQ,EAAE;AAAhE,CAA/B;eAEeP,e"}
|
|
@@ -53,6 +53,7 @@ var appendGtmClassName = function appendGtmClassName(settings, childComponents)
|
|
|
53
53
|
var _childComponents$prop = (0, _slicedToArray2["default"])(childComponents.props.children, 2),
|
|
54
54
|
compChildren = _childComponents$prop[1];
|
|
55
55
|
|
|
56
|
+
if (!compChildren || !Array.isArray(compChildren)) return settings;
|
|
56
57
|
var gtmClassNames = compChildren.filter(function (_ref) {
|
|
57
58
|
var type = _ref.props.component.type;
|
|
58
59
|
return type === _constants.GTM;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"append-gtm-classname.js","names":["appendGtmClassName","settings","childComponents","Array","isArray","props","children","compChildren","gtmClassNames","filter","type","component","GTM","map","gtmClassName","Boolean","join","length","modifier","updatedModifier","trim"],"sources":["../../../src/hooks/helpers/append-gtm-classname.js"],"sourcesContent":["import { GTM } from '../../constants';\n\nconst appendGtmClassName = (settings, childComponents) => {\n if (!childComponents || Array.isArray(childComponents)) return settings;\n const {\n props: {\n children: [, compChildren]\n }\n } = childComponents;\n const gtmClassNames = compChildren\n .filter(\n ({\n props: {\n component: { type }\n }\n }) => type === GTM\n )\n .map(\n ({\n props: {\n component: {\n settings: { gtmClassName }\n }\n }\n }) => gtmClassName\n )\n .filter(Boolean)\n .join(' ');\n if (!gtmClassNames.length) return settings;\n const { modifier } = settings;\n const updatedModifier = `${modifier || ''} ${gtmClassNames}`.trim();\n\n return { ...settings, modifier: updatedModifier };\n};\n\nexport default appendGtmClassName;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,QAAD,EAAWC,eAAX,EAA+B;EACxD,IAAI,CAACA,eAAD,IAAoBC,KAAK,CAACC,OAAN,CAAcF,eAAd,CAAxB,EAAwD,OAAOD,QAAP;;EACxD,4DAIIC,eAJJ,CACEG,KADF,CAEIC,QAFJ;EAAA,IAEiBC,YAFjB;;
|
|
1
|
+
{"version":3,"file":"append-gtm-classname.js","names":["appendGtmClassName","settings","childComponents","Array","isArray","props","children","compChildren","gtmClassNames","filter","type","component","GTM","map","gtmClassName","Boolean","join","length","modifier","updatedModifier","trim"],"sources":["../../../src/hooks/helpers/append-gtm-classname.js"],"sourcesContent":["import { GTM } from '../../constants';\n\nconst appendGtmClassName = (settings, childComponents) => {\n if (!childComponents || Array.isArray(childComponents)) return settings;\n const {\n props: {\n children: [, compChildren]\n }\n } = childComponents;\n\n if (!compChildren || !Array.isArray(compChildren)) return settings;\n\n const gtmClassNames = compChildren\n .filter(\n ({\n props: {\n component: { type }\n }\n }) => type === GTM\n )\n .map(\n ({\n props: {\n component: {\n settings: { gtmClassName }\n }\n }\n }) => gtmClassName\n )\n .filter(Boolean)\n .join(' ');\n if (!gtmClassNames.length) return settings;\n const { modifier } = settings;\n const updatedModifier = `${modifier || ''} ${gtmClassNames}`.trim();\n\n return { ...settings, modifier: updatedModifier };\n};\n\nexport default appendGtmClassName;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,QAAD,EAAWC,eAAX,EAA+B;EACxD,IAAI,CAACA,eAAD,IAAoBC,KAAK,CAACC,OAAN,CAAcF,eAAd,CAAxB,EAAwD,OAAOD,QAAP;;EACxD,4DAIIC,eAJJ,CACEG,KADF,CAEIC,QAFJ;EAAA,IAEiBC,YAFjB;;EAMA,IAAI,CAACA,YAAD,IAAiB,CAACJ,KAAK,CAACC,OAAN,CAAcG,YAAd,CAAtB,EAAmD,OAAON,QAAP;EAEnD,IAAMO,aAAa,GAAGD,YAAY,CAC/BE,MADmB,CAElB;IAAA,IAEiBC,IAFjB,QACEL,KADF,CAEIM,SAFJ,CAEiBD,IAFjB;IAAA,OAIMA,IAAI,KAAKE,cAJf;EAAA,CAFkB,EAQnBC,GARmB,CASlB;IAAA,IAGkBC,YAHlB,SACET,KADF,CAEIM,SAFJ,CAGMV,QAHN,CAGkBa,YAHlB;IAAA,OAMMA,YANN;EAAA,CATkB,EAiBnBL,MAjBmB,CAiBZM,OAjBY,EAkBnBC,IAlBmB,CAkBd,GAlBc,CAAtB;EAmBA,IAAI,CAACR,aAAa,CAACS,MAAnB,EAA2B,OAAOhB,QAAP;EAC3B,IAAQiB,QAAR,GAAqBjB,QAArB,CAAQiB,QAAR;EACA,IAAMC,eAAe,GAAG,UAAGD,QAAQ,IAAI,EAAf,cAAqBV,aAArB,EAAqCY,IAArC,EAAxB;EAEA,uCAAYnB,QAAZ;IAAsBiB,QAAQ,EAAEC;EAAhC;AACD,CAlCD;;eAoCenB,kB"}
|