@salla.sa/twilight-components 2.14.589 → 2.14.591
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/dist/cjs/{filepond-BbRL5Spe.js → filepond-DkObEO32.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DVUBjaQx.js → filepond-plugin-file-poster-wXgeY5cU.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BR7SoIq0.js → filepond-plugin-file-validate-size-CWleid1C.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CEkMfiUA.js → filepond-plugin-file-validate-type-CJLl2hbe.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-p-XQj23Q.js → filepond-plugin-image-edit-Bp6AxXM9.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DeRO_gvX.js → filepond-plugin-image-exif-orientation-abWKSX9-.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Bfm8Swyp.js → filepond-plugin-image-preview-DxprNycS.js} +1 -1
- package/dist/cjs/{index-CfGnMoB7.js → index-DBN0LueR.js} +10 -14
- package/dist/cjs/{intlTelInput-Pqo18emd.js → intlTelInput-B6H18Td2.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +2664 -106
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/{salla-gift-card-redeem.cjs.entry.js → salla-gift-card-redeem_2.cjs.entry.js} +36 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +35 -6
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DWuMUfiW.js → vanilla-picker-Cm71HMBs.js} +1 -1
- package/dist/collection/components/salla-conditional-offer/cart-update-window.js +34 -0
- package/dist/collection/components/salla-conditional-offer/interfaces.js +1 -0
- package/dist/collection/components/salla-conditional-offer/salla-conditional-offer.css +456 -191
- package/dist/collection/components/salla-conditional-offer/salla-conditional-offer.js +1790 -106
- package/dist/collection/components/salla-products-list/salla-products-list.js +35 -6
- package/dist/collection/shared/cart-free-gifts.js +448 -0
- package/dist/collection/shared/offer-stages.js +453 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-conditional-offer.js +2672 -116
- package/dist/components/salla-products-list2.js +34 -5
- package/dist/docs.json +22 -9
- package/dist/esm/{filepond-CJqzOtq7.js → filepond-Cstf5r6K.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CPydcEjJ.js → filepond-plugin-file-poster-GibBgGHW.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Yy4pNy1Q.js → filepond-plugin-file-validate-size-CLc6zco6.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-Ck1P2E4e.js → filepond-plugin-file-validate-type-Ca3dc8p0.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DEUmnuGf.js → filepond-plugin-image-edit-CNGBLi7d.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BPgJye8E.js → filepond-plugin-image-exif-orientation-Dmmu9-UQ.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CqUSx6BO.js → filepond-plugin-image-preview-KX15tx60.js} +1 -1
- package/dist/esm/{index-BnDYuqv2.js → index-UnmOIma5.js} +10 -14
- package/dist/esm/{intlTelInput-Z8OsAFtr.js → intlTelInput-C-F-rxZ3.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +2664 -106
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/{salla-gift-card-redeem.entry.js → salla-gift-card-redeem_2.entry.js} +36 -2
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_3.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +35 -6
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search-product-card.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/salla-wishlist-summary.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-DnAUrfGC.js → vanilla-picker-DMAcm04D.js} +1 -1
- package/dist/twilight/{p-fdb16a84.entry.js → p-06268aeb.entry.js} +1 -1
- package/dist/twilight/{p-cff5dd0b.entry.js → p-0bee12ba.entry.js} +1 -1
- package/dist/twilight/{p-dfdd4c78.entry.js → p-13215fa2.entry.js} +1 -1
- package/dist/twilight/{p-ef5a0e71.entry.js → p-170a29db.entry.js} +1 -1
- package/dist/twilight/{p-179c76df.entry.js → p-1762cfe3.entry.js} +1 -1
- package/dist/twilight/{p-3319b19b.entry.js → p-18b786f4.entry.js} +1 -1
- package/dist/twilight/{p-9932f7a0.entry.js → p-1a7bee69.entry.js} +1 -1
- package/dist/twilight/{p-152cac66.entry.js → p-1aaed68f.entry.js} +1 -1
- package/dist/twilight/{p-1bafeac8.entry.js → p-1dc68727.entry.js} +1 -1
- package/dist/twilight/{p-d38ae081.entry.js → p-2059ac26.entry.js} +1 -1
- package/dist/twilight/{p-45b9c237.entry.js → p-21358994.entry.js} +1 -1
- package/dist/twilight/{p-c895701a.entry.js → p-2308e70c.entry.js} +1 -1
- package/dist/twilight/{p-35dabed0.entry.js → p-27366663.entry.js} +1 -1
- package/dist/twilight/{p-80ead7f0.entry.js → p-2d983198.entry.js} +1 -1
- package/dist/twilight/{p-c5948d07.entry.js → p-2e204cbc.entry.js} +1 -1
- package/dist/twilight/{p-eb0c5e39.entry.js → p-2e971549.entry.js} +1 -1
- package/dist/twilight/{p-721b6019.entry.js → p-2f1c8e60.entry.js} +1 -1
- package/dist/twilight/{p-7eeb788a.entry.js → p-328e352d.entry.js} +1 -1
- package/dist/twilight/{p-53dc0615.entry.js → p-35163279.entry.js} +1 -1
- package/dist/twilight/{p-df933610.entry.js → p-36ac5a06.entry.js} +1 -1
- package/dist/twilight/{p-2cdcd70d.entry.js → p-3845541d.entry.js} +1 -1
- package/dist/twilight/{p-e0b0e90f.entry.js → p-38956156.entry.js} +1 -1
- package/dist/twilight/{p-ad7814d7.entry.js → p-398e864d.entry.js} +1 -1
- package/dist/twilight/{p-c2858bed.entry.js → p-3d535509.entry.js} +1 -1
- package/dist/twilight/{p-827fa966.entry.js → p-3d7fdd11.entry.js} +1 -1
- package/dist/twilight/p-40a7f8c6.entry.js +4 -0
- package/dist/twilight/{p-ba61073e.entry.js → p-426ac7ab.entry.js} +1 -1
- package/dist/twilight/{p-0ecf936e.entry.js → p-42d6eb6b.entry.js} +1 -1
- package/dist/twilight/{p-1c812d90.entry.js → p-46ef2b4e.entry.js} +1 -1
- package/dist/twilight/{p-700f2c8b.entry.js → p-47e519e4.entry.js} +1 -1
- package/dist/twilight/{p-08a8a1ff.entry.js → p-48f9cd45.entry.js} +1 -1
- package/dist/twilight/{p-47d94d77.entry.js → p-49f2ad4a.entry.js} +1 -1
- package/dist/twilight/{p-652ab33d.entry.js → p-4b135194.entry.js} +1 -1
- package/dist/twilight/p-4b175320.entry.js +4 -0
- package/dist/twilight/{p-4d0df0fe.entry.js → p-51d7a9f2.entry.js} +1 -1
- package/dist/twilight/{p-ed7c4f53.entry.js → p-52b99743.entry.js} +1 -1
- package/dist/twilight/{p-11a1c557.entry.js → p-540992c1.entry.js} +1 -1
- package/dist/twilight/{p-1a598e9b.entry.js → p-5c313f74.entry.js} +1 -1
- package/dist/twilight/{p-cdad2ba2.entry.js → p-62842639.entry.js} +1 -1
- package/dist/twilight/{p-f5ccd5d1.entry.js → p-635cf0ae.entry.js} +1 -1
- package/dist/twilight/{p-4e50bc09.entry.js → p-6a68c551.entry.js} +1 -1
- package/dist/twilight/{p-085aac95.entry.js → p-6b277129.entry.js} +1 -1
- package/dist/twilight/{p-81cdd5c5.entry.js → p-6dcfc119.entry.js} +1 -1
- package/dist/twilight/{p-5537738b.entry.js → p-6e7a12dd.entry.js} +1 -1
- package/dist/twilight/{p-018629e9.entry.js → p-700cf9fc.entry.js} +1 -1
- package/dist/twilight/{p-7c9e88d3.entry.js → p-71372771.entry.js} +1 -1
- package/dist/twilight/{p-760d1b6c.entry.js → p-78d1e145.entry.js} +1 -1
- package/dist/twilight/{p-bf7e7835.entry.js → p-7f23b98d.entry.js} +1 -1
- package/dist/twilight/{p-80228706.entry.js → p-7f93ea69.entry.js} +1 -1
- package/dist/twilight/{p-bd559920.entry.js → p-81294230.entry.js} +1 -1
- package/dist/twilight/{p-c0304211.entry.js → p-833fb416.entry.js} +1 -1
- package/dist/twilight/{p-cbeff415.entry.js → p-8e938bfa.entry.js} +1 -1
- package/dist/twilight/{p-ae8b1d8b.entry.js → p-8ec3b9f0.entry.js} +1 -1
- package/dist/twilight/{p-56f0cfcb.entry.js → p-9b01e5c2.entry.js} +1 -1
- package/dist/twilight/{p-85f0dcd7.entry.js → p-9c284764.entry.js} +1 -1
- package/dist/twilight/{p-0efb20f7.entry.js → p-9d0658a0.entry.js} +1 -1
- package/dist/twilight/{p-444e6c0b.entry.js → p-9d680306.entry.js} +1 -1
- package/dist/twilight/{p-CR5J1D0q.js → p-BOWrmsKT.js} +1 -1
- package/dist/twilight/{p-B7eX2j-t.js → p-C3HaKgMG.js} +1 -1
- package/dist/twilight/{p-G2sLbl_C.js → p-CjeoBv5q.js} +1 -1
- package/dist/twilight/{p-DTfPuMCT.js → p-CtQLzZ1X.js} +1 -1
- package/dist/twilight/{p-BXv9XzTR.js → p-DVatlmKV.js} +1 -1
- package/dist/twilight/{p-DV1rxosP.js → p-D_C0F9n5.js} +1 -1
- package/dist/twilight/{p-3jS5Dm-u.js → p-Dq91sWJh.js} +1 -1
- package/dist/twilight/{p-BnDYuqv2.js → p-UnmOIma5.js} +1 -1
- package/dist/twilight/{p-0b53b377.entry.js → p-a0e1d5f7.entry.js} +1 -1
- package/dist/twilight/{p-6f26c1cd.entry.js → p-a192abb7.entry.js} +1 -1
- package/dist/twilight/{p-6ca5c1b6.entry.js → p-a1d0c650.entry.js} +1 -1
- package/dist/twilight/{p-171e4a2f.entry.js → p-a1d251d4.entry.js} +1 -1
- package/dist/twilight/{p-71c70e04.entry.js → p-a32fb61e.entry.js} +1 -1
- package/dist/twilight/{p-cfe6fbe3.entry.js → p-a5c693c1.entry.js} +1 -1
- package/dist/twilight/{p-11b351be.entry.js → p-acd9c538.entry.js} +1 -1
- package/dist/twilight/{p-d38e101f.entry.js → p-adfc54e4.entry.js} +1 -1
- package/dist/twilight/{p-ea8379b8.entry.js → p-b5d6ddd7.entry.js} +1 -1
- package/dist/twilight/{p-e1a8f943.entry.js → p-b70cdf88.entry.js} +1 -1
- package/dist/twilight/{p-8cf71ac9.entry.js → p-b7399739.entry.js} +1 -1
- package/dist/twilight/{p-9bc5c3d5.entry.js → p-bb4a95d9.entry.js} +1 -1
- package/dist/twilight/{p-66ae8f3b.entry.js → p-c1eab306.entry.js} +1 -1
- package/dist/twilight/{p-3b14f3d4.entry.js → p-c1eaf8c3.entry.js} +1 -1
- package/dist/twilight/{p-67e24689.entry.js → p-ca47204f.entry.js} +1 -1
- package/dist/twilight/{p-612fb2e8.entry.js → p-caec4a90.entry.js} +1 -1
- package/dist/twilight/{p-7ccdd251.entry.js → p-ce0c6667.entry.js} +1 -1
- package/dist/twilight/{p-df3feae1.entry.js → p-ce7450a9.entry.js} +1 -1
- package/dist/twilight/{p-4262b4d7.entry.js → p-d11b211f.entry.js} +1 -1
- package/dist/twilight/{p-8e679d21.entry.js → p-d62c6529.entry.js} +1 -1
- package/dist/twilight/{p-8ef3ef7d.entry.js → p-da14ac3f.entry.js} +1 -1
- package/dist/twilight/{p-0f5846fe.entry.js → p-e0ce5d4c.entry.js} +1 -1
- package/dist/twilight/{p-aac26dda.entry.js → p-e1d59b7e.entry.js} +1 -1
- package/dist/twilight/{p-00bc0e76.entry.js → p-e3066c95.entry.js} +1 -1
- package/dist/twilight/{p-1d1315d7.entry.js → p-e34ff202.entry.js} +1 -1
- package/dist/twilight/{p-ff5362e3.entry.js → p-e3c46eea.entry.js} +1 -1
- package/dist/twilight/{p-661755d7.entry.js → p-e6de2f79.entry.js} +1 -1
- package/dist/twilight/{p-331fe074.entry.js → p-ea07afaa.entry.js} +1 -1
- package/dist/twilight/{p-f70bf6b0.entry.js → p-efb67446.entry.js} +1 -1
- package/dist/twilight/p-efb9f953.entry.js +4 -0
- package/dist/twilight/{p-343a9ec3.entry.js → p-f08ff103.entry.js} +1 -1
- package/dist/twilight/{p-ba5f879e.entry.js → p-f5605df6.entry.js} +1 -1
- package/dist/twilight/{p-9fd926a2.entry.js → p-f69a3e84.entry.js} +1 -1
- package/dist/twilight/{p-0e1f8e61.entry.js → p-f7b65338.entry.js} +1 -1
- package/dist/twilight/{p-dcaaa19e.entry.js → p-f92f10c7.entry.js} +1 -1
- package/dist/twilight/{p-e49ce881.entry.js → p-fa3c4bcf.entry.js} +1 -1
- package/dist/twilight/{p-3771c21e.entry.js → p-fb8395de.entry.js} +1 -1
- package/dist/twilight/{p-3d08b459.entry.js → p-ff65be76.entry.js} +1 -1
- package/dist/twilight/{p-DpkirgB4.js → p-iC3SM6Ji.js} +1 -1
- package/dist/twilight/{p-8Y4Ctfsa.js → p-xX3a9YdQ.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-conditional-offer/cart-update-window.d.ts +31 -0
- package/dist/types/components/salla-conditional-offer/interfaces.d.ts +70 -13
- package/dist/types/components/salla-conditional-offer/salla-conditional-offer.d.ts +656 -10
- package/dist/types/components/salla-products-list/salla-products-list.d.ts +4 -0
- package/dist/types/components.d.ts +2 -2
- package/dist/types/shared/cart-free-gifts.d.ts +141 -0
- package/dist/types/shared/offer-stages.d.ts +288 -0
- package/package.json +5 -5
- package/dist/cjs/salla-tooltip.cjs.entry.js +0 -42
- package/dist/esm/salla-tooltip.entry.js +0 -40
- package/dist/twilight/p-483551e7.entry.js +0 -4
- package/dist/twilight/p-648a4d8d.entry.js +0 -4
- package/dist/twilight/p-afc3d17b.entry.js +0 -4
- package/dist/twilight/p-bdf47e97.entry.js +0 -4
|
@@ -35,6 +35,8 @@ export declare class SallaProductsList {
|
|
|
35
35
|
limit: number;
|
|
36
36
|
/**
|
|
37
37
|
* Sorting the list of products
|
|
38
|
+
* On the main filterable search page, the initial order follows search relevance
|
|
39
|
+
* unless the shopper supplies `sort` or `by` in the URL. Later updates still apply.
|
|
38
40
|
*/
|
|
39
41
|
sortBy?: string | 'ourSuggest' | 'bestSell' | 'topRated' | 'priceFromTopToLow' | 'priceFromLowToTop';
|
|
40
42
|
/**
|
|
@@ -244,6 +246,8 @@ export declare class SallaProductsList {
|
|
|
244
246
|
* Clear the current selection.
|
|
245
247
|
*/
|
|
246
248
|
clearSelection(): Promise<void>;
|
|
249
|
+
private isSearchPageList;
|
|
250
|
+
private syncSearchSortControl;
|
|
247
251
|
componentWillLoad(): any;
|
|
248
252
|
componentDidLoad(): Promise<void>;
|
|
249
253
|
private canRender;
|
|
@@ -2581,7 +2581,7 @@ export namespace Components {
|
|
|
2581
2581
|
*/
|
|
2582
2582
|
"setFilters": (filters: any) => Promise<void>;
|
|
2583
2583
|
/**
|
|
2584
|
-
* Sorting the list of products
|
|
2584
|
+
* Sorting the list of products On the main filterable search page, the initial order follows search relevance unless the shopper supplies `sort` or `by` in the URL. Later updates still apply.
|
|
2585
2585
|
*/
|
|
2586
2586
|
"sortBy"?: | string
|
|
2587
2587
|
| 'ourSuggest'
|
|
@@ -7912,7 +7912,7 @@ declare namespace LocalJSX {
|
|
|
7912
7912
|
*/
|
|
7913
7913
|
"selectable"?: boolean;
|
|
7914
7914
|
/**
|
|
7915
|
-
* Sorting the list of products
|
|
7915
|
+
* Sorting the list of products On the main filterable search page, the initial order follows search relevance unless the shopper supplies `sort` or `by` in the URL. Later updates still apply.
|
|
7916
7916
|
*/
|
|
7917
7917
|
"sortBy"?: | string
|
|
7918
7918
|
| 'ourSuggest'
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared free-gift lookup for the cart.
|
|
3
|
+
*
|
|
4
|
+
* The gift feature is twilight-only: no theme passes `added-by-offer` /
|
|
5
|
+
* `free-gift-quantity` attributes. `salla-conditional-offer` resolves the gift LINES it
|
|
6
|
+
* lists (read-only, as information) and the cart line count from here, never from theme
|
|
7
|
+
* attributes.
|
|
8
|
+
*
|
|
9
|
+
* Data source: `salla.api.cart.details()` — it hits the `api.cart.show`
|
|
10
|
+
* route, which IS in `CartPresenter::$routesWithItems`, so the response
|
|
11
|
+
* carries `data.cart.items[]` with the per-item keys `added_by_offer`
|
|
12
|
+
* (bool), `offer_id` (int|null) and `free_gift_quantity` (int) set by
|
|
13
|
+
* `CartItemTransformer.php`. Those three names are a pinned
|
|
14
|
+
* contract — do not rename them here or on the components that consume them.
|
|
15
|
+
*
|
|
16
|
+
* We deliberately never read these fields off a `cart::updated` payload:
|
|
17
|
+
* that event fires from `latest()` too, and `api.cart.latest` is NOT in
|
|
18
|
+
* `$routesWithItems`, so a `cart::updated` payload legitimately carries no
|
|
19
|
+
* `items` at all. Callers must fetch on mount and call
|
|
20
|
+
* `refreshCartFreeGifts()` on the event — this module never derives from
|
|
21
|
+
* event payloads.
|
|
22
|
+
*
|
|
23
|
+
* The banner asks for the gift lines and the cart line count on the same tick (initial
|
|
24
|
+
* mount, and again on every `cart::updated`). Concurrent callers share a
|
|
25
|
+
* single in-flight promise, mirroring `_pendingOffersRequest` in
|
|
26
|
+
* `twilight/packages/twilight/src/api/cart.js:831-846`.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* A gift cart LINE, with the few display fields `salla-conditional-offer` needs to
|
|
30
|
+
* render its free-gifts card: a thumbnail, the
|
|
31
|
+
* product name, the price it would have cost, and the cart-item id it is keyed by.
|
|
32
|
+
*
|
|
33
|
+
* `originalPrice` is the price the shopper is NOT paying. Cart items report the price
|
|
34
|
+
* under several near-synonymous keys (`original_price`, `product_price`, `price`) whose
|
|
35
|
+
* shapes differ — `Money` objects serialize as `{amount, currency}`, plain columns as
|
|
36
|
+
* numbers — so it is coerced here rather than at each call site, and is `null` when
|
|
37
|
+
* nothing usable was sent (render nothing, never "0").
|
|
38
|
+
*/
|
|
39
|
+
export interface CartFreeGiftItem {
|
|
40
|
+
/** Cart-item id (already a route key / string). */
|
|
41
|
+
id: string;
|
|
42
|
+
offerId: number | null;
|
|
43
|
+
/** Free units granted by the offer, i.e. what the gifts card shows as "free". */
|
|
44
|
+
quantity: number;
|
|
45
|
+
/**
|
|
46
|
+
* The two halves of a MERGED line, kept separate and unfused.
|
|
47
|
+
*
|
|
48
|
+
* `AddToCart.php:543-544` grants a gift by incrementing an EXISTING line when the
|
|
49
|
+
* shopper already owns that product, so one line can be quantity 3 of which
|
|
50
|
+
* `free_gift_quantity` is 1 and the other 2 were PAID for. `quantity` (the free half)
|
|
51
|
+
* is what the gifts card shows; `lineQuantity` is the whole line.
|
|
52
|
+
*/
|
|
53
|
+
freeQuantity: number;
|
|
54
|
+
lineQuantity: number;
|
|
55
|
+
name: string;
|
|
56
|
+
imageUrl: string;
|
|
57
|
+
imageAlt: string;
|
|
58
|
+
url: string;
|
|
59
|
+
originalPrice: number | null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The SDK's own name for "this visitor has no cart at all".
|
|
63
|
+
*
|
|
64
|
+
* `salla.api.cart.details()` resolves its id through
|
|
65
|
+
* `getCurrentCartId(false, …, allowCreate = false)`, which returns `null` for a guest with
|
|
66
|
+
* no stored cart id rather than creating one server-side; `details()` then throws this
|
|
67
|
+
* (twilight/src/api/cart.js:192-199). It is a STATEMENT ABOUT THE CART, not a failure to
|
|
68
|
+
* reach the server — no cart means no items — so it is the one rejection that resolves to
|
|
69
|
+
* a hard 0 instead of "unknown".
|
|
70
|
+
*
|
|
71
|
+
* Matched on `name`, never on message text: the wording is not a contract, the name is.
|
|
72
|
+
*/
|
|
73
|
+
export declare const CART_NOT_CREATED = "CartNotCreated";
|
|
74
|
+
export declare function isCartNotCreated(error: any): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Every free-gift LINE currently in the cart, in cart order.
|
|
77
|
+
*
|
|
78
|
+
* Shares the cache, the in-flight promise and the generation guard with
|
|
79
|
+
* `getCartItemCount()` — the banner asking for both still issues exactly ONE
|
|
80
|
+
* `details()` request per cart mutation.
|
|
81
|
+
*/
|
|
82
|
+
export declare function getCartFreeGiftItems(): Promise<CartFreeGiftItem[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Whether the cached cart picture came from a response that was actually reached and
|
|
85
|
+
* parsed, rather than from the fallback a rejected lookup publishes.
|
|
86
|
+
*
|
|
87
|
+
* For the ONE consumer that has to tell "the cart is empty" apart from "the lookup could
|
|
88
|
+
* not say, and guessed empty": `salla-conditional-offer` stops before it even asks for the
|
|
89
|
+
* offer when the count is `0`, which is unrecoverable if that `0` was a guess. Everything
|
|
90
|
+
* else should just read the values — they are already the best available answer.
|
|
91
|
+
*
|
|
92
|
+
* Synchronous and side-effect free: it reports on what is cached NOW, so a caller that
|
|
93
|
+
* wants a fresh answer must still await one of the lookups above.
|
|
94
|
+
*/
|
|
95
|
+
export declare function hasAuthoritativeCartData(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* How many LINES the cart holds — `null` while that is genuinely UNKNOWN (nothing has
|
|
98
|
+
* loaded yet, or the lookup failed), never `0` for either.
|
|
99
|
+
*
|
|
100
|
+
* The distinction is the whole point: `salla-conditional-offer` hides its banner on an
|
|
101
|
+
* empty cart, and a `0` that really meant "still loading" would make the banner flicker
|
|
102
|
+
* or disappear on a populated one. Shares the cache, the in-flight promise and the
|
|
103
|
+
* generation guard with `getCartFreeGiftItems()`, so asking for the count costs no
|
|
104
|
+
* request of its own.
|
|
105
|
+
*/
|
|
106
|
+
export declare function getCartItemCount(): Promise<number | null>;
|
|
107
|
+
/**
|
|
108
|
+
* Invalidates the cache and re-fetches — call this from a `cart::updated`
|
|
109
|
+
* handler, ignoring the event payload entirely.
|
|
110
|
+
*
|
|
111
|
+
* Bumps `generation` first so that any request already in flight (started
|
|
112
|
+
* before this invalidation) can no longer publish into `cache` when it
|
|
113
|
+
* settles — mirrors `salla.event.on('cart::updated', () => { Salla.api.cart._pendingOffersRequest = null; })`
|
|
114
|
+
* in `twilight/packages/twilight/src/api/cart.js:81`, which abandons its
|
|
115
|
+
* own in-flight promise on cart update for the same reason.
|
|
116
|
+
*
|
|
117
|
+
* Then chains a fresh fetch BEHIND whatever was already in flight (rather
|
|
118
|
+
* than firing a second request in parallel): once that prior request
|
|
119
|
+
* settles — its result now guaranteed to be discarded by the generation
|
|
120
|
+
* check above — `fetchAndCache()` starts a request under the new
|
|
121
|
+
* generation, which is free to publish.
|
|
122
|
+
*
|
|
123
|
+
* `pendingRefresh` de-dupes concurrent callers of THIS function the same
|
|
124
|
+
* way `pendingRequest` de-dupes concurrent fetches: N components all
|
|
125
|
+
* invalidating within the same synchronous `cart::updated` dispatch share
|
|
126
|
+
* one refresh chain and therefore, ultimately, one fresh HTTP request.
|
|
127
|
+
*
|
|
128
|
+
* That sharing window is deliberately NARROW — it closes the instant the
|
|
129
|
+
* fresh request goes out, NOT when it comes back. Holding it open for the
|
|
130
|
+
* whole round trip silently coalesced two DIFFERENT cart mutations into one
|
|
131
|
+
* refresh: the second `cart::updated` got handed the first one's promise, so
|
|
132
|
+
* it never bumped `generation` and never issued a request, and the response
|
|
133
|
+
* that eventually published had been asked for BEFORE the second mutation
|
|
134
|
+
* happened. The cart then sat on pre-mutation gift data — a merged line
|
|
135
|
+
* showing yesterday's paid quantity beside yesterday's corrected total —
|
|
136
|
+
* until some later mutation happened to come along. A shopper clicking "+"
|
|
137
|
+
* twice inside one round trip is all it took.
|
|
138
|
+
*/
|
|
139
|
+
export declare function refreshCartFreeGifts(): Promise<void>;
|
|
140
|
+
/** @internal exported for tests only — resets module-level state between specs. */
|
|
141
|
+
export declare function __resetCartFreeGiftsForTests(): void;
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-stage promotion progress.
|
|
3
|
+
*
|
|
4
|
+
* Pure, component-agnostic helpers for turning a shopper's current cart value
|
|
5
|
+
* plus a list of stage thresholds into "which stage is Locked / Current /
|
|
6
|
+
* Completed, and how full is each segment".
|
|
7
|
+
*
|
|
8
|
+
* Deliberately NOT shared with `salla-tiered-offer`'s `TierUtils`:
|
|
9
|
+
* - `TierUtils.findCurrentTierIndex` is 1-based with `0` overloaded to mean
|
|
10
|
+
* "no tier reached", which cannot express "stage 0 is reached".
|
|
11
|
+
* - It takes `TieredOfferTier[]`, a shape a conditional-offer `Discount` does
|
|
12
|
+
* not share a single field with.
|
|
13
|
+
* - It assumes its caller already sorted; the conditional-offer payload is
|
|
14
|
+
* emitted UNSORTED by the backend.
|
|
15
|
+
*
|
|
16
|
+
* So this module takes plain numbers, is 0-based, uses an explicit
|
|
17
|
+
* `NO_STAGE_REACHED` sentinel, and sorts defensively on every call.
|
|
18
|
+
*
|
|
19
|
+
* ONE deliberate exception to "pure": `getCurrencyDecimals()` reads the store's money
|
|
20
|
+
* precision off `salla.config` so that `getRemainingToStage()` can round AT THE SOURCE
|
|
21
|
+
* and every consumer — including the `products_count` path that never touches
|
|
22
|
+
* `salla.money()` — benefits without each of them remembering to. It is fully guarded and
|
|
23
|
+
* falls back to `DEFAULT_CURRENCY_DECIMALS`, so a missing SDK degrades rather than throws;
|
|
24
|
+
* callers that want it hermetic can pass the measure and stub `salla.config`.
|
|
25
|
+
*
|
|
26
|
+
* ---------------------------------------------------------------------------
|
|
27
|
+
* WHO DECIDES A TIER IS UNLOCKED
|
|
28
|
+
* ---------------------------------------------------------------------------
|
|
29
|
+
* The ENGINE does, and it now says so: every `details.discounts[]` entry carries
|
|
30
|
+
* `is_applied`. Threshold arithmetic here is a PROJECTION ("how far to go"), never a
|
|
31
|
+
* CLAIM about what the engine granted, because the engine's formula
|
|
32
|
+
*
|
|
33
|
+
* ($subtotal - $alreadyAppliedDiscount) - $excludedItemsAmount >= min_spend
|
|
34
|
+
*
|
|
35
|
+
* uses two terms that are not in the payload at all. On beta a gift tier at `min_spend`
|
|
36
|
+
* 300 with `current_value` 300 rendered as unlocked while the engine had refused it (the
|
|
37
|
+
* gift's own price is in that tier's excluded set), so no arithmetic over shipped keys
|
|
38
|
+
* could ever have agreed with it.
|
|
39
|
+
*
|
|
40
|
+
* BUT `is_applied` IS NOT "THE SHOPPER IS PAST THIS TIER". It answers a narrower
|
|
41
|
+
* question, and reading it as the broader one is what produced the second beta report.
|
|
42
|
+
* `CartOfferDiscount::apply()` walks the tiers, keeps the LAST one whose conditions pass
|
|
43
|
+
* and calls `discountItem()` ONCE after the loop, so a cart offer grants EXACTLY ONE
|
|
44
|
+
* reward — the best qualifying tier. Every earlier tier is therefore `is_applied: false`
|
|
45
|
+
* even for a shopper who sailed past it: its reward is SUPERSEDED, not out of reach. A
|
|
46
|
+
* cart at `current_value` 510 came back as `false / false / true` and the badge row read
|
|
47
|
+
* LOCKED / LOCKED / CHECKED, which is unreadable as a progress stepper.
|
|
48
|
+
*
|
|
49
|
+
* So there are TWO questions and this module answers both, separately:
|
|
50
|
+
* - "which tier gave the reward" — the single winner, `appliedIndex`.
|
|
51
|
+
* - "is the shopper past this tier" — cumulative, `met`, which is what the ✓, the
|
|
52
|
+
* strikethrough, the lock and the "N of M" count render from.
|
|
53
|
+
*
|
|
54
|
+
* The passed tiers carry a ✓ AND a strikethrough while the tier ahead carries a lock.
|
|
55
|
+
* Struck-through means superseded, so a ✓ means THRESHOLD PASSED, not REWARD GRANTED.
|
|
56
|
+
*
|
|
57
|
+
* Hence the split, and it is load-bearing:
|
|
58
|
+
* - `met` / `metCount` / `nextUnmetIndex` / `allMet` are the ENGINE-DERIVED verdict.
|
|
59
|
+
* Render from these.
|
|
60
|
+
* - `appliedIndex` names the one tier that actually paid out. Diagnostics only so far.
|
|
61
|
+
* - `lastReachedIndex` / `currentIndex` / `isComplete` / `fills` / `overallPercentage`
|
|
62
|
+
* are pure threshold projections. Use them for distance and bar geometry only.
|
|
63
|
+
*
|
|
64
|
+
* `is_applied` is TRI-STATE, because twilight and the Store package deploy independently:
|
|
65
|
+
* absent means "this backend does not report it yet" and falls back to the arithmetic,
|
|
66
|
+
* while `false` is a real verdict and outranks the arithmetic. See `readAppliedFlag`.
|
|
67
|
+
*
|
|
68
|
+
* `salla-tiered-offer` keeps its own copy of the defensive ascending sort and the
|
|
69
|
+
* completed/total ratio; that duplication is deliberate and not migrated here.
|
|
70
|
+
*/
|
|
71
|
+
/** Explicit sentinel: no stage has been reached yet (or there is no next stage). */
|
|
72
|
+
export declare const NO_STAGE_REACHED = -1;
|
|
73
|
+
export declare enum OfferStageState {
|
|
74
|
+
LOCKED = "locked",
|
|
75
|
+
CURRENT = "current",
|
|
76
|
+
COMPLETED = "completed"
|
|
77
|
+
}
|
|
78
|
+
/** The backend sends `end_value` as a string under `s-source: mobile`, so every numeric field is coerced. */
|
|
79
|
+
export type NumericLike = number | string | null | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* The engine's verdict for one tier, as a TRI-STATE.
|
|
82
|
+
*
|
|
83
|
+
* - `true` the engine granted this tier.
|
|
84
|
+
* - `false` the engine did NOT grant it. A REAL answer — never overridden by arithmetic.
|
|
85
|
+
* - `undefined` the backend said nothing (older Store/SpecialOffer-Module deploy). Only
|
|
86
|
+
* this case falls back to `current_value >= min_spend`.
|
|
87
|
+
*
|
|
88
|
+
* Distinguishing the middle case from the last one IS the fix, so anything that is not an
|
|
89
|
+
* unambiguous yes/no is read as `undefined` — a half-understood value must degrade to the
|
|
90
|
+
* old behaviour, not invent a verdict.
|
|
91
|
+
*/
|
|
92
|
+
export type AppliedFlag = boolean | undefined;
|
|
93
|
+
export interface OfferStageProgress {
|
|
94
|
+
/** Defensively ascending-sorted, numeric-coerced copy of the thresholds. */
|
|
95
|
+
thresholds: number[];
|
|
96
|
+
/**
|
|
97
|
+
* THE STEPPER, index-aligned with `thresholds`: has the shopper got past this tier?
|
|
98
|
+
*
|
|
99
|
+
* Everything shopper-visible — badge, tooltip row, ✓/lock, strikethrough, "N of M" —
|
|
100
|
+
* renders from HERE, never from `lastReachedIndex` and never from `applied` directly.
|
|
101
|
+
*
|
|
102
|
+
* MONOTONIC BY CONSTRUCTION: `true`s form a prefix, so a lock can never sit below a ✓.
|
|
103
|
+
* That is the fix. Derived as `index <= appliedIndex` once the engine has granted
|
|
104
|
+
* anything, all-`false` when the engine granted nothing, and `value >= threshold` only
|
|
105
|
+
* when this backend reports no verdict at all. See `computeOfferStageProgress`.
|
|
106
|
+
*/
|
|
107
|
+
met: boolean[];
|
|
108
|
+
/** The raw tri-state flags, index-aligned with `thresholds`. `undefined` = the backend sent none. */
|
|
109
|
+
applied: AppliedFlag[];
|
|
110
|
+
/**
|
|
111
|
+
* 0-based index of the tier that actually PAID OUT — the highest `is_applied: true` —
|
|
112
|
+
* or `NO_STAGE_REACHED` when the engine granted nothing or reported nothing.
|
|
113
|
+
*
|
|
114
|
+
* A cart offer grants one reward, so this is the winner. `met` is the prefix it closes;
|
|
115
|
+
* do not render a ✓ from this field alone.
|
|
116
|
+
*/
|
|
117
|
+
appliedIndex: number;
|
|
118
|
+
/** True when at least one tier carried a real `is_applied`, i.e. this backend reports the verdict. */
|
|
119
|
+
hasEngineVerdict: boolean;
|
|
120
|
+
/** How many tiers are met. `appliedIndex + 1` under a verdict — see `met`. */
|
|
121
|
+
metCount: number;
|
|
122
|
+
/** 0-based index of the FIRST tier that is not met, or `NO_STAGE_REACHED` when all are. */
|
|
123
|
+
nextUnmetIndex: number;
|
|
124
|
+
/**
|
|
125
|
+
* True when every tier is met. The congratulations gate — `isComplete` is not.
|
|
126
|
+
*
|
|
127
|
+
* Under a verdict this means the LAST tier is the winner, which is exactly when the
|
|
128
|
+
* shopper has the offer's best reward in the cart and "you have unlocked this offer" is
|
|
129
|
+
* true. It stays false whenever the engine granted nothing, however affordable the
|
|
130
|
+
* thresholds look.
|
|
131
|
+
*/
|
|
132
|
+
allMet: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* 0-based index of the highest stage whose THRESHOLD is reached, or `NO_STAGE_REACHED`.
|
|
135
|
+
* A projection, not a verdict: it drives the bar, not the ✓. See `met`.
|
|
136
|
+
*/
|
|
137
|
+
lastReachedIndex: number;
|
|
138
|
+
/**
|
|
139
|
+
* 0-based index of the first stage whose THRESHOLD is unreached, or `NO_STAGE_REACHED`.
|
|
140
|
+
* A projection, not a verdict — for the next TARGET use `nextUnmetIndex`.
|
|
141
|
+
*/
|
|
142
|
+
currentIndex: number;
|
|
143
|
+
/** True when the final THRESHOLD has been reached. A projection, not a verdict — see `allMet`. */
|
|
144
|
+
isComplete: boolean;
|
|
145
|
+
/** `currentValue`, clamped to `[0, finalThreshold]` so a stale/overshooting server value can never render out of range. */
|
|
146
|
+
value: number;
|
|
147
|
+
/**
|
|
148
|
+
* The cart's progress AS EACH TIER COUNTS IT, index-aligned with `thresholds` and clamped
|
|
149
|
+
* like `value`.
|
|
150
|
+
*
|
|
151
|
+
* The engine measures every tier by that tier's own rule — it leaves a tier's gift
|
|
152
|
+
* product out of the count toward that tier — so the progress toward tier 2 can be lower
|
|
153
|
+
* than the offer-level figure, and "how far to tier 2" is only right against tier 2's
|
|
154
|
+
* own number. An entry is the tier's `current_value` when the backend sent a readable
|
|
155
|
+
* one and `value` otherwise, so on a backend that sends none every entry IS `value`.
|
|
156
|
+
*/
|
|
157
|
+
values: number[];
|
|
158
|
+
/** Baseline the first segment fills from (`details.start_value`). */
|
|
159
|
+
startValue: number;
|
|
160
|
+
/** 0..100 fill of the segment leading INTO each stage, index-aligned with `thresholds`. */
|
|
161
|
+
fills: number[];
|
|
162
|
+
/** 0..100 overall completion across all stages. Exactly 100 when `isComplete`. */
|
|
163
|
+
overallPercentage: number;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Read one tier's `is_applied` as a tri-state.
|
|
167
|
+
*
|
|
168
|
+
* `true`/`false` booleans are what `CartOffersTransformer` casts and emits. The numeric
|
|
169
|
+
* and string spellings are accepted too because the `s-source: mobile` pipeline already
|
|
170
|
+
* stringifies numeric fields in this very payload (`end_value`), and reading a `0` there
|
|
171
|
+
* as "absent" would silently restore the bug this exists to fix.
|
|
172
|
+
*
|
|
173
|
+
* EVERYTHING ELSE — key missing, `undefined`, `null`, `''`, an object — is ABSENT, not
|
|
174
|
+
* `false`: a value we cannot interpret is not the engine saying no, and must degrade to
|
|
175
|
+
* the arithmetic fallback rather than lock a tier the shopper has genuinely earned.
|
|
176
|
+
*/
|
|
177
|
+
export declare function readAppliedFlag(value: unknown): AppliedFlag;
|
|
178
|
+
/**
|
|
179
|
+
* Whether a THRESHOLD is usable.
|
|
180
|
+
*
|
|
181
|
+
* Thresholds get the opposite policy to values: an unparseable threshold is DROPPED,
|
|
182
|
+
* never coerced to 0, because a 0 threshold is satisfied by an empty cart and would
|
|
183
|
+
* render as an already-COMPLETED stage — reintroducing exactly the synthetic-zeroth-
|
|
184
|
+
* checkpoint bug this component was rewritten to remove.
|
|
185
|
+
*
|
|
186
|
+
* Callers that keep their own parallel array of stage objects MUST filter it with this
|
|
187
|
+
* predicate so their index alignment with `progress.thresholds` survives the drop.
|
|
188
|
+
*/
|
|
189
|
+
export declare function isUsableThreshold(value: NumericLike): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Stable ascending sort of arbitrary items by a numeric threshold accessor.
|
|
192
|
+
*
|
|
193
|
+
* Ties are broken by `getIdentity` when supplied and readable on BOTH sides — the tier
|
|
194
|
+
* `id` (0 = base tier, 1..N = configured options in the order the engine walks them), so
|
|
195
|
+
* two tiers sharing a `min_spend` order by what they ARE rather than by where they
|
|
196
|
+
* happened to land in an unsorted payload. Without it (or when either id is unreadable)
|
|
197
|
+
* ties keep their original relative order, which is the previous behaviour exactly.
|
|
198
|
+
*/
|
|
199
|
+
export declare function sortByThreshold<T>(items: T[], getThreshold: (item: T) => NumericLike, getIdentity?: (item: T) => NumericLike): T[];
|
|
200
|
+
/**
|
|
201
|
+
* Derive the full stage picture from the server's `current_value`.
|
|
202
|
+
*
|
|
203
|
+
* @param currentValue the server-computed cart value — never recomputed client-side.
|
|
204
|
+
* @param rawThresholds each stage's `min_spend`, in any order.
|
|
205
|
+
* @param rawStartValue the baseline the first segment fills from (`details.start_value`).
|
|
206
|
+
* @param rawApplied each stage's `is_applied`, POSITIONALLY ALIGNED WITH `rawThresholds`
|
|
207
|
+
* before any sorting or dropping happens here. Omit it and every tier reads as
|
|
208
|
+
* absent, i.e. the threshold behaviour, unchanged.
|
|
209
|
+
* @param rawTierValues each stage's OWN `current_value`, aligned the same way. A tier
|
|
210
|
+
* without a readable one is measured by `currentValue`, so omitting it — an older
|
|
211
|
+
* backend — changes nothing. See `OfferStageProgress.values`.
|
|
212
|
+
*/
|
|
213
|
+
export declare function computeOfferStageProgress(currentValue: NumericLike, rawThresholds: NumericLike[], rawStartValue?: NumericLike, rawApplied?: unknown[], rawTierValues?: NumericLike[]): OfferStageProgress;
|
|
214
|
+
/**
|
|
215
|
+
* Locked / Current / Completed for one 0-based stage index — from `met`, so a tier the
|
|
216
|
+
* engine withheld outright reads LOCKED even with its threshold met, and every tier the
|
|
217
|
+
* shopper has passed on the way to a granted one reads COMPLETED.
|
|
218
|
+
*
|
|
219
|
+
* - Completed: `met[index]` — index at or below the winner.
|
|
220
|
+
* - Current: exactly `nextUnmetIndex`, the first tier ABOVE the winner.
|
|
221
|
+
* - Locked: every other unmet stage, and any out-of-range index.
|
|
222
|
+
*/
|
|
223
|
+
export declare function getStageState(index: number, progress: OfferStageProgress): OfferStageState;
|
|
224
|
+
/**
|
|
225
|
+
* How the offer MEASURES its thresholds, which is also what its remainder rounds to.
|
|
226
|
+
*
|
|
227
|
+
* Mirrors `OfferType` in `salla-conditional-offer/interfaces.ts` without importing it —
|
|
228
|
+
* this module stays free of the component's payload types (see the header) — so a caller
|
|
229
|
+
* maps `details.based_on` onto it at the call site.
|
|
230
|
+
*/
|
|
231
|
+
export declare enum OfferStageMeasure {
|
|
232
|
+
/** `order_amount` — a money value, rounded to the store's currency precision. */
|
|
233
|
+
CURRENCY = "currency",
|
|
234
|
+
/** `products_count` — whole products, so the remainder is a whole number. */
|
|
235
|
+
COUNT = "count"
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* The precision to fall back to when the store publishes none.
|
|
239
|
+
*
|
|
240
|
+
* 2 is the platform default (SAR/USD/AED); a store on a 3-decimal currency (KWD, BHD)
|
|
241
|
+
* that reports its precision gets 3, and only a store that reports NOTHING readable
|
|
242
|
+
* lands here.
|
|
243
|
+
*/
|
|
244
|
+
export declare const DEFAULT_CURRENCY_DECIMALS = 2;
|
|
245
|
+
/**
|
|
246
|
+
* The store's money precision — THE ONE IMPURITY IN THIS MODULE (see the header note).
|
|
247
|
+
*
|
|
248
|
+
* Asked in the order the platform answers it:
|
|
249
|
+
* 1. `salla.config.currency()` — the ACTIVE currency's own precision, which is the only
|
|
250
|
+
* source that can differ per currency (a store displaying KWD wants 3 while its SAR
|
|
251
|
+
* prices want 2).
|
|
252
|
+
* 2. `salla.config.get('store.currency.decimals')` — the store-level key
|
|
253
|
+
* `salla-bought-together.tsx:142` already rounds its basket total by.
|
|
254
|
+
* 3. `DEFAULT_CURRENCY_DECIMALS`.
|
|
255
|
+
*
|
|
256
|
+
* Every step is guarded: this runs inside `render()`, where an SDK that is not on the
|
|
257
|
+
* page yet (or a `config` that throws) must degrade to the default, never take the banner
|
|
258
|
+
* down.
|
|
259
|
+
*/
|
|
260
|
+
export declare function getCurrencyDecimals(): number;
|
|
261
|
+
/**
|
|
262
|
+
* How much more of the cart value is needed to reach the given stage, rounded UP at the
|
|
263
|
+
* display precision. Never negative.
|
|
264
|
+
*
|
|
265
|
+
* `threshold - value` is raw IEEE-754 subtraction over two server-sent floats, so
|
|
266
|
+
* `300 - 289.599993` is `10.400007000000012`. Nothing downstream cleans that up:
|
|
267
|
+
* `salla.money()` only swaps digits and appends a symbol (`base/src/helpers/numbers.ts:74-84`).
|
|
268
|
+
* Rounding here, at the source, covers every consumer, including the `products_count`
|
|
269
|
+
* path that never reaches `salla.money`.
|
|
270
|
+
*
|
|
271
|
+
* Rounding goes UP, never to the nearest unit: the displayed amount must be enough to
|
|
272
|
+
* unlock the tier. Rounding 10.400007 to 10.40 asks for an amount that leaves the cart
|
|
273
|
+
* at 299.999993, still below the threshold. Float noise is guarded (see `CEIL_TOLERANCE`)
|
|
274
|
+
* so an exact 10.40 stays 10.40.
|
|
275
|
+
*
|
|
276
|
+
* A count remainder is a WHOLE number, because `salla.lang.choice('blocks.header.products_count', 10.4)`
|
|
277
|
+
* matches no plural interval and a shopper cannot add 0.4 of a product.
|
|
278
|
+
*
|
|
279
|
+
* Only the derived remainder is rounded. `progress.values` and `progress.thresholds` are
|
|
280
|
+
* server facts and stay as sent: rounding them would move the unlocked/locked boundary,
|
|
281
|
+
* which is the engine's call.
|
|
282
|
+
*
|
|
283
|
+
* A positive remainder never becomes 0: `getGuidanceMessage` drops its line on
|
|
284
|
+
* `remaining <= 0`, so a genuinely unmet tier must still ask for at least one unit of the
|
|
285
|
+
* precision (0.01 for a 2-decimal currency, 1 for a count). Exact zero, a met tier,
|
|
286
|
+
* still returns 0.
|
|
287
|
+
*/
|
|
288
|
+
export declare function getRemainingToStage(index: number, progress: OfferStageProgress, measure?: OfferStageMeasure): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight-components",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.591",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"author": "Salla Team <support@salla.dev> (https://salla.dev)",
|
|
6
6
|
"bugs": {
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"@googlemaps/markerclusterer": "2.6.2",
|
|
85
|
-
"@salla.sa/applepay": "2.14.
|
|
86
|
-
"@salla.sa/twilight": "2.14.
|
|
87
|
-
"@salla.sa/twilight-tailwind-theme": "2.14.
|
|
85
|
+
"@salla.sa/applepay": "2.14.591",
|
|
86
|
+
"@salla.sa/twilight": "2.14.591",
|
|
87
|
+
"@salla.sa/twilight-tailwind-theme": "2.14.591",
|
|
88
88
|
"@salla.sa/ui-address-autocomplete-widget": "1.2.1",
|
|
89
89
|
"@salla.sa/ui-google-map-render": "1.2.1",
|
|
90
90
|
"@types/node": "^20.4.8",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"vanilla-lazyload": "^17.8.5",
|
|
106
106
|
"vanilla-picker": "^2.12.2"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "be20f9d830b0e7869d43be890e1579b34d346467"
|
|
109
109
|
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
var index = require('./index-CfGnMoB7.js');
|
|
7
|
-
|
|
8
|
-
const sallaTooltipCss = "/*!twlt*/.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:\"\";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}.block{display:block}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}";
|
|
9
|
-
|
|
10
|
-
const SallaTooltip = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
/**
|
|
14
|
-
* The theme of the tooltip (default, dark)
|
|
15
|
-
*/
|
|
16
|
-
this.theme = 'default';
|
|
17
|
-
this.show = false;
|
|
18
|
-
this.targetElement = null;
|
|
19
|
-
}
|
|
20
|
-
handleMouseOver(event) {
|
|
21
|
-
if (this.targetElement && this.targetElement.contains(event.target)) {
|
|
22
|
-
this.show = true;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
handleMouseOut(event) {
|
|
26
|
-
if (this.targetElement && this.targetElement.contains(event.target)) {
|
|
27
|
-
this.show = false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
componentDidLoad() {
|
|
31
|
-
// Find the target element based on the targetSelector prop
|
|
32
|
-
this.targetElement = document.getElementById(this.targetId);
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
const validTheme = ['default', 'dark'].includes(this.theme) ? this.theme : 'default';
|
|
36
|
-
return (index.h("div", { key: '4027073cb58fa70679f54f6009ed1ca95fd3f3d0', class: "s-tooltip-container" }, index.h("div", { key: 'ea50ad74b456fa3c89cfef2b69b2c9d5630d63bd', class: `s-tooltip-item s-tooltip-item--${validTheme}`, style: { display: this.show ? 'block' : 'none' } }, this.text ? index.h("span", null, this.text) : index.h("slot", null))));
|
|
37
|
-
}
|
|
38
|
-
get el() { return index.getElement(this); }
|
|
39
|
-
};
|
|
40
|
-
SallaTooltip.style = sallaTooltipCss;
|
|
41
|
-
|
|
42
|
-
exports.salla_tooltip = SallaTooltip;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import { r as registerInstance, h, a as getElement } from './index-BnDYuqv2.js';
|
|
5
|
-
|
|
6
|
-
const sallaTooltipCss = "/*!twlt*/.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:\"\";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}.block{display:block}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}";
|
|
7
|
-
|
|
8
|
-
const SallaTooltip = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
/**
|
|
12
|
-
* The theme of the tooltip (default, dark)
|
|
13
|
-
*/
|
|
14
|
-
this.theme = 'default';
|
|
15
|
-
this.show = false;
|
|
16
|
-
this.targetElement = null;
|
|
17
|
-
}
|
|
18
|
-
handleMouseOver(event) {
|
|
19
|
-
if (this.targetElement && this.targetElement.contains(event.target)) {
|
|
20
|
-
this.show = true;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
handleMouseOut(event) {
|
|
24
|
-
if (this.targetElement && this.targetElement.contains(event.target)) {
|
|
25
|
-
this.show = false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
componentDidLoad() {
|
|
29
|
-
// Find the target element based on the targetSelector prop
|
|
30
|
-
this.targetElement = document.getElementById(this.targetId);
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
const validTheme = ['default', 'dark'].includes(this.theme) ? this.theme : 'default';
|
|
34
|
-
return (h("div", { key: '4027073cb58fa70679f54f6009ed1ca95fd3f3d0', class: "s-tooltip-container" }, h("div", { key: 'ea50ad74b456fa3c89cfef2b69b2c9d5630d63bd', class: `s-tooltip-item s-tooltip-item--${validTheme}`, style: { display: this.show ? 'block' : 'none' } }, this.text ? h("span", null, this.text) : h("slot", null))));
|
|
35
|
-
}
|
|
36
|
-
get el() { return getElement(this); }
|
|
37
|
-
};
|
|
38
|
-
SallaTooltip.style = sallaTooltipCss;
|
|
39
|
-
|
|
40
|
-
export { SallaTooltip as salla_tooltip };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,h as o,a as r}from"./p-BnDYuqv2.js";const a=class{constructor(o){t(this,o),this.theme="default",this.show=!1,this.targetElement=null}handleMouseOver(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!0)}handleMouseOut(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!1)}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){const t=["default","dark"].includes(this.theme)?this.theme:"default";return o("div",{key:"4027073cb58fa70679f54f6009ed1ca95fd3f3d0",class:"s-tooltip-container"},o("div",{key:"ea50ad74b456fa3c89cfef2b69b2c9d5630d63bd",class:`s-tooltip-item s-tooltip-item--${t}`,style:{display:this.show?"block":"none"}},this.text?o("span",null,this.text):o("slot",null)))}get el(){return r(this)}};a.style='/*!twlt*/.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}.block{display:block}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}';export{a as salla_tooltip}
|