@salla.sa/twilight-components 2.14.252 → 2.14.253
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/{app-globals-ChKTQEJ9.js → app-globals-BoVwS_2u.js} +3 -3
- package/dist/cjs/{app-globals-ChKTQEJ9.js.map → app-globals-BoVwS_2u.js.map} +1 -1
- package/dist/cjs/{index-DtXwvL5X.js → index-DxXe1Ylr.js} +16 -16
- package/dist/cjs/index-DxXe1Ylr.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/salla-accordion.salla-accordion-body.salla-accordion-head.salla-order-details-options.entry.cjs.js.map +1 -0
- package/dist/cjs/salla-accordion_4.cjs.entry.js +202 -0
- package/dist/cjs/salla-accordion_4.cjs.entry.js.map +1 -0
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +48 -48
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +2 -2
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +80 -0
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js.map +1 -0
- package/dist/cjs/salla-order-details-multiple-bundle-product.entry.cjs.js.map +1 -0
- package/dist/cjs/salla-order-details.cjs.entry.js +53 -0
- package/dist/cjs/salla-order-details.cjs.entry.js.map +1 -0
- package/dist/cjs/salla-order-details.entry.cjs.js.map +1 -0
- package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +2 -2
- package/dist/cjs/salla-reviews-page.cjs.entry.js +2 -2
- package/dist/cjs/salla-reviews.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
- package/dist/collection/components/salla-accordion/salla-accordion-head.js.map +1 -1
- package/dist/collection/components/salla-accordion/salla-accordion.js +43 -1
- package/dist/collection/components/salla-accordion/salla-accordion.js.map +1 -1
- package/dist/collection/components/salla-alert/salla-alert.js +1 -1
- package/dist/collection/components/salla-booking-field/salla-booking-field.js +1 -1
- package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +2 -2
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +1 -1
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
- package/dist/collection/components/salla-comments/salla-comment-item.js +3 -3
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
- package/dist/collection/components/salla-count-down/salla-count-down.js +1 -1
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
- package/dist/collection/components/salla-filters/salla-filters.js +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
- package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
- package/dist/collection/components/salla-loading/salla-loading.js +1 -1
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-program.js +1 -1
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
- package/dist/collection/components/salla-map/salla-map.js +3 -3
- package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
- package/dist/collection/components/salla-order-details/interfaces.js +2 -0
- package/dist/collection/components/salla-order-details/interfaces.js.map +1 -0
- package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.css +0 -0
- package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +152 -0
- package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js.map +1 -0
- package/dist/collection/components/salla-order-details/salla-order-details-options.css +0 -0
- package/dist/collection/components/salla-order-details/salla-order-details-options.js +177 -0
- package/dist/collection/components/salla-order-details/salla-order-details-options.js.map +1 -0
- package/dist/collection/components/salla-order-details/salla-order-details.css +0 -0
- package/dist/collection/components/salla-order-details/salla-order-details.js +93 -0
- package/dist/collection/components/salla-order-details/salla-order-details.js.map +1 -0
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
- package/dist/collection/components/salla-payments/salla-payments.js +2 -2
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
- package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
- package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
- package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
- package/dist/collection/components/salla-search/salla-search.js +3 -3
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-slider/salla-slider.js +2 -2
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-accordion-body.js +1 -27
- package/dist/components/salla-accordion-body.js.map +1 -1
- package/dist/components/salla-accordion-body2.js +35 -0
- package/dist/components/salla-accordion-body2.js.map +1 -0
- package/dist/components/salla-accordion-head.js +1 -59
- package/dist/components/salla-accordion-head.js.map +1 -1
- package/dist/components/salla-accordion-head2.js +67 -0
- package/dist/components/salla-accordion-head2.js.map +1 -0
- package/dist/components/salla-accordion.js +1 -59
- package/dist/components/salla-accordion.js.map +1 -1
- package/dist/components/salla-accordion2.js +71 -0
- package/dist/components/salla-accordion2.js.map +1 -0
- package/dist/components/salla-alert.js +1 -1
- package/dist/components/salla-booking-field2.js +1 -1
- package/dist/components/salla-bottom-alert.js +2 -2
- package/dist/components/salla-cart-summary.js +1 -1
- package/dist/components/salla-color-picker2.js +1 -1
- package/dist/components/salla-comment-form2.js +1 -1
- package/dist/components/salla-comment-item2.js +3 -3
- package/dist/components/salla-conditional-fields2.js +1 -1
- package/dist/components/salla-count-down2.js +1 -1
- package/dist/components/salla-datetime-picker2.js +1 -1
- package/dist/components/salla-file-upload2.js +2 -2
- package/dist/components/salla-filters-widget2.js +2 -2
- package/dist/components/salla-filters.js +1 -1
- package/dist/components/salla-gifting.js +2 -2
- package/dist/components/salla-list-tile2.js +1 -1
- package/dist/components/salla-loading2.js +1 -1
- package/dist/components/salla-localization-modal.js +1 -1
- package/dist/components/salla-loyalty-prize-item.js +1 -1
- package/dist/components/salla-loyalty-program.js +1 -1
- package/dist/components/salla-maintenance-alert.js +1 -1
- package/dist/components/salla-map2.js +3 -3
- package/dist/components/salla-notification-item2.js +1 -1
- package/dist/components/salla-offer-modal.js +1 -1
- package/dist/components/salla-order-details-multiple-bundle-product.d.ts +11 -0
- package/dist/components/salla-order-details-multiple-bundle-product.js +12 -0
- package/dist/components/salla-order-details-multiple-bundle-product.js.map +1 -0
- package/dist/components/salla-order-details-multiple-bundle-product2.js +144 -0
- package/dist/components/salla-order-details-multiple-bundle-product2.js.map +1 -0
- package/dist/components/salla-order-details-options.d.ts +11 -0
- package/dist/components/salla-order-details-options.js +12 -0
- package/dist/components/salla-order-details-options.js.map +1 -0
- package/dist/components/salla-order-details-options2.js +145 -0
- package/dist/components/salla-order-details-options2.js.map +1 -0
- package/dist/components/salla-order-details.d.ts +11 -0
- package/dist/components/salla-order-details.js +127 -0
- package/dist/components/salla-order-details.js.map +1 -0
- package/dist/components/salla-order-summary.js +1 -1
- package/dist/components/salla-payments.js +2 -2
- package/dist/components/salla-placeholder2.js +1 -1
- package/dist/components/salla-price-range2.js +2 -2
- package/dist/components/salla-product-availability2.js +1 -1
- package/dist/components/salla-product-card2.js +5 -5
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-quantity-input.js +1 -1
- package/dist/components/salla-quick-buy2.js +1 -1
- package/dist/components/salla-review-card2.js +1 -1
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reviews.js +1 -1
- package/dist/components/salla-scopes.js +1 -1
- package/dist/components/salla-search.js +3 -3
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-slider2.js +2 -2
- package/dist/components/salla-social-share.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/esm/{app-globals-3b0DwjjK.js → app-globals-5yxEmkuB.js} +3 -3
- package/dist/esm/{app-globals-3b0DwjjK.js.map → app-globals-5yxEmkuB.js.map} +1 -1
- package/dist/esm/{index-D4D34Ujk.js → index-Hw2jlaNN.js} +16 -16
- package/dist/esm/index-Hw2jlaNN.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/salla-accordion.salla-accordion-body.salla-accordion-head.salla-order-details-options.entry.js.map +1 -0
- package/dist/esm/salla-accordion_4.entry.js +197 -0
- package/dist/esm/salla-accordion_4.entry.js.map +1 -0
- package/dist/esm/salla-add-product-button_51.entry.js +48 -48
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +3 -3
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
- package/dist/esm/salla-loyalty-program.entry.js +2 -2
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +2 -2
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +78 -0
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js.map +1 -0
- package/dist/esm/salla-order-details.entry.js +51 -0
- package/dist/esm/salla-order-details.entry.js.map +1 -0
- package/dist/esm/salla-order-summary.entry.js +2 -2
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +2 -2
- package/dist/esm/salla-reviews-page.entry.js +2 -2
- package/dist/esm/salla-reviews.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +4 -4
- package/dist/esm-es5/{app-globals-3b0DwjjK.js → app-globals-5yxEmkuB.js} +2 -2
- package/dist/esm-es5/{app-globals-3b0DwjjK.js.map → app-globals-5yxEmkuB.js.map} +1 -1
- package/dist/esm-es5/{index-D4D34Ujk.js → index-Hw2jlaNN.js} +3 -3
- package/dist/esm-es5/index-Hw2jlaNN.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion.salla-accordion-body.salla-accordion-head.salla-order-details-options.entry.js.map +1 -0
- package/dist/esm-es5/salla-accordion_4.entry.js +5 -0
- package/dist/esm-es5/salla-accordion_4.entry.js.map +1 -0
- package/dist/esm-es5/salla-add-product-button_51.entry.js +3 -3
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +2 -2
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +2 -2
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +2 -2
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-details-multiple-bundle-product.entry.js +5 -0
- package/dist/esm-es5/salla-order-details-multiple-bundle-product.entry.js.map +1 -0
- package/dist/esm-es5/salla-order-details.entry.js +5 -0
- package/dist/esm-es5/salla-order-details.entry.js.map +1 -0
- package/dist/esm-es5/salla-order-summary.entry.js +2 -2
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +2 -2
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-d513da6f.entry.js → p-0065a55b.entry.js} +2 -2
- package/dist/twilight/{p-c9678188.system.entry.js → p-05cf8f0f.system.entry.js} +2 -2
- package/dist/twilight/{p-8213a9ef.system.entry.js → p-066a5e95.system.entry.js} +2 -2
- package/dist/twilight/{p-81aeef6a.entry.js → p-0a58ecb2.entry.js} +2 -2
- package/dist/twilight/{p-5b882c52.system.entry.js → p-0ab8c50f.system.entry.js} +2 -2
- package/dist/twilight/{p-d84eb47c.entry.js → p-13efdbe3.entry.js} +2 -2
- package/dist/twilight/{p-4af5ffea.entry.js → p-13f1a287.entry.js} +2 -2
- package/dist/twilight/{p-6e24a5f0.system.entry.js → p-15c42251.system.entry.js} +2 -2
- package/dist/twilight/{p-8c0822f7.system.entry.js → p-17567b38.system.entry.js} +2 -2
- package/dist/twilight/p-184bc156.system.entry.js +5 -0
- package/dist/twilight/p-184bc156.system.entry.js.map +1 -0
- package/dist/twilight/{p-648fb6ca.entry.js → p-204e0ad2.entry.js} +2 -2
- package/dist/twilight/{p-63cba8e3.entry.js → p-210ccdae.entry.js} +2 -2
- package/dist/twilight/{p-d0004953.entry.js → p-240b86ef.entry.js} +2 -2
- package/dist/twilight/{p-dd83a408.entry.js → p-27206d63.entry.js} +2 -2
- package/dist/twilight/{p-c84819d5.entry.js → p-35dd7512.entry.js} +4 -4
- package/dist/twilight/{p-2af0da5a.system.entry.js → p-38675c42.system.entry.js} +2 -2
- package/dist/twilight/{p-7234c5f2.system.entry.js → p-3cdd4d44.system.entry.js} +2 -2
- package/dist/twilight/{p-8359eb2a.entry.js → p-3e9ceed0.entry.js} +2 -2
- package/dist/twilight/{p-a18f81a8.system.entry.js → p-447f03b5.system.entry.js} +2 -2
- package/dist/twilight/{p-2ecf868e.entry.js → p-4b7e613a.entry.js} +2 -2
- package/dist/twilight/{p-d5750810.entry.js → p-4d5387e9.entry.js} +2 -2
- package/dist/twilight/{p-ad0fedcd.system.entry.js → p-53fb14d0.system.entry.js} +2 -2
- package/dist/twilight/p-5db51240.system.entry.js +5 -0
- package/dist/twilight/{p-aad20f10.system.entry.js → p-61f590ca.system.entry.js} +2 -2
- package/dist/twilight/p-6a179bc3.system.entry.js +5 -0
- package/dist/twilight/p-6a179bc3.system.entry.js.map +1 -0
- package/dist/twilight/{p-407d19d8.system.entry.js → p-6a51cb91.system.entry.js} +2 -2
- package/dist/twilight/{p-95adf84e.entry.js → p-6abfa7ed.entry.js} +2 -2
- package/dist/twilight/{p-45b61475.entry.js → p-6f66faea.entry.js} +2 -2
- package/dist/twilight/{p-f57bcc51.entry.js → p-7187b729.entry.js} +2 -2
- package/dist/twilight/{p-c87d6aa6.system.entry.js → p-765562b8.system.entry.js} +4 -4
- package/dist/twilight/p-76d92026.entry.js +5 -0
- package/dist/twilight/p-76d92026.entry.js.map +1 -0
- package/dist/twilight/{p-6a0b5799.entry.js → p-78deca48.entry.js} +2 -2
- package/dist/twilight/{p-3483eb09.system.entry.js → p-7dce6627.system.entry.js} +2 -2
- package/dist/twilight/p-7f28b72e.entry.js +5 -0
- package/dist/twilight/p-7f28b72e.entry.js.map +1 -0
- package/dist/twilight/{p-396198a2.entry.js → p-83f6408a.entry.js} +2 -2
- package/dist/twilight/{p-d097a67d.system.entry.js → p-888de4b8.system.entry.js} +2 -2
- package/dist/twilight/{p-Ccj70VFr.system.js.map → p-8SAlNoQ7.system.js.map} +1 -1
- package/dist/twilight/{p-CZGaqTus.system.js.map → p-8cuU9AcW.system.js.map} +1 -1
- package/dist/twilight/{p-1b24ea99.system.entry.js → p-8e807035.system.entry.js} +2 -2
- package/dist/twilight/{p-6b716e82.system.entry.js → p-8fcff962.system.entry.js} +2 -2
- package/dist/twilight/p-9a8a57f0.entry.js +5 -0
- package/dist/twilight/{p-1a9eebb6.system.entry.js → p-9cb1a11d.system.entry.js} +2 -2
- package/dist/twilight/{p-CDmxJQ_1.system.js.map → p-B10yx9se.system.js.map} +1 -1
- package/dist/twilight/{p-BHI6mAw4.system.js.map → p-BKsOE9n5.system.js.map} +1 -1
- package/dist/twilight/{p-BRsVFuI-.system.js.map → p-BzHfWaAI.system.js.map} +1 -1
- package/dist/twilight/{p-ByNC3ygM.system.js.map → p-C0IcnmR-.system.js.map} +1 -1
- package/dist/twilight/{p-B_aBck2N.system.js.map → p-C0Tc4qY_.system.js.map} +1 -1
- package/dist/twilight/{p-e-FAhVeu.system.js.map → p-C72wuhae.system.js.map} +1 -1
- package/dist/twilight/{p-BrxIkK1y.system.js.map → p-CDuCVzYE.system.js.map} +1 -1
- package/dist/twilight/{p-CgDN9ZEV.system.js.map → p-CK7f65RE.system.js.map} +1 -1
- package/dist/twilight/{p-B0xoNOFR.system.js → p-CQDiSGcm.system.js} +3 -3
- package/dist/twilight/p-CQDiSGcm.system.js.map +1 -0
- package/dist/twilight/{p-CVW8a0jw.system.js.map → p-Crz5Om7F.system.js.map} +1 -1
- package/dist/twilight/p-D6vllM1-.system.js.map +1 -0
- package/dist/twilight/{p-O_6m6zp3.system.js.map → p-DHIqW0kb.system.js.map} +1 -1
- package/dist/twilight/{p-DxRZfb-O.system.js → p-DHVFvgH-.system.js} +2 -2
- package/dist/twilight/{p-DxRZfb-O.system.js.map → p-DHVFvgH-.system.js.map} +1 -1
- package/dist/twilight/{p-DvrwOwqK.system.js.map → p-DNXP15r0.system.js.map} +1 -1
- package/dist/twilight/{p-Bqv1miCk.system.js.map → p-DNsqaxY7.system.js.map} +1 -1
- package/dist/twilight/{p-BxORDCZ3.system.js.map → p-DTx9WCBY.system.js.map} +1 -1
- package/dist/twilight/{p-TrPvZWq-.system.js.map → p-DVKxP5is.system.js.map} +1 -1
- package/dist/twilight/p-DVpqfl3D.system.js.map +1 -0
- package/dist/twilight/{p-BXoB3JpD.system.js.map → p-DZTRKwds.system.js.map} +1 -1
- package/dist/twilight/{p-CaCB348j.system.js.map → p-DZajWqW2.system.js.map} +1 -1
- package/dist/twilight/{p-BbDuw4AO.system.js.map → p-Da2A-hsX.system.js.map} +1 -1
- package/dist/twilight/{p-CNqFfslE.system.js.map → p-DgVuWfs6.system.js.map} +1 -1
- package/dist/twilight/p-Dhlfiere.system.js +5 -0
- package/dist/twilight/{p-DMKkUrkS.system.js.map → p-Dhlfiere.system.js.map} +1 -1
- package/dist/twilight/{p-DVnmchft.system.js.map → p-DkCrulih.system.js.map} +1 -1
- package/dist/twilight/{p-CB3G0Z8y.system.js.map → p-Du8MMxWf.system.js.map} +1 -1
- package/dist/twilight/{p-u0que_SA.system.js.map → p-DvSX1guT.system.js.map} +1 -1
- package/dist/twilight/{p-D4D34Ujk.js → p-Hw2jlaNN.js} +3 -3
- package/dist/twilight/p-Hw2jlaNN.js.map +1 -0
- package/dist/twilight/{p-C-vbYsMC.system.js.map → p-N45BdAU8.system.js.map} +1 -1
- package/dist/twilight/{p-DNiQ_YXx.js → p-NSLkL4Dn.js} +2 -2
- package/dist/twilight/{p-DNiQ_YXx.js.map → p-NSLkL4Dn.js.map} +1 -1
- package/dist/twilight/{p-OzJ9XEsV.system.js.map → p-QNwQUqLM.system.js.map} +1 -1
- package/dist/twilight/{p-DlRNuq8n.system.js.map → p-XDYW48AK.system.js.map} +1 -1
- package/dist/twilight/{p-1055f2fb.entry.js → p-a8cf78c0.entry.js} +2 -2
- package/dist/twilight/p-a9c9a4ac.entry.js +5 -0
- package/dist/twilight/p-a9c9a4ac.entry.js.map +1 -0
- package/dist/twilight/{p-669db4df.entry.js → p-b13ef44c.entry.js} +2 -2
- package/dist/twilight/{p-d15630dd.entry.js → p-b492c336.entry.js} +2 -2
- package/dist/twilight/{p-f745fcad.entry.js → p-b51bb42b.entry.js} +2 -2
- package/dist/twilight/{p-3eaddcf1.entry.js → p-bb1a0f6b.entry.js} +2 -2
- package/dist/twilight/{p-5542a867.entry.js → p-bca6b6b2.entry.js} +2 -2
- package/dist/twilight/{p-fbe10567.entry.js → p-bdca9c9c.entry.js} +2 -2
- package/dist/twilight/p-be2938da.entry.js +5 -0
- package/dist/twilight/{p-58085711.entry.js → p-c5b5a947.entry.js} +2 -2
- package/dist/twilight/{p-BJUBMQeL.system.js.map → p-cK_8A-PC.system.js.map} +1 -1
- package/dist/twilight/{p-CiGTTlgd.system.js.map → p-cR7gWxFU.system.js.map} +1 -1
- package/dist/twilight/p-d314110a.system.entry.js +5 -0
- package/dist/twilight/p-d314110a.system.entry.js.map +1 -0
- package/dist/twilight/{p-13324cdd.system.entry.js → p-d33197dc.system.entry.js} +3 -3
- package/dist/twilight/{p-e9bc1fa4.system.entry.js → p-d3c9cfbb.system.entry.js} +2 -2
- package/dist/twilight/{p-e823d4e8.system.entry.js → p-d4017888.system.entry.js} +2 -2
- package/dist/twilight/{p-442340d3.system.entry.js → p-d43b5d6a.system.entry.js} +2 -2
- package/dist/twilight/{p-2ae75a1c.entry.js → p-d7604122.entry.js} +2 -2
- package/dist/twilight/{p-ebd4ac51.system.entry.js → p-d8039b97.system.entry.js} +2 -2
- package/dist/twilight/{p-423d91f5.system.entry.js → p-db9674c2.system.entry.js} +2 -2
- package/dist/twilight/{p-a1d102d3.system.entry.js → p-eb292930.system.entry.js} +2 -2
- package/dist/twilight/{p-60bf8746.system.entry.js → p-ec034bd2.system.entry.js} +2 -2
- package/dist/twilight/{p-ab7cc63a.system.entry.js → p-f07ad750.system.entry.js} +2 -2
- package/dist/twilight/{p-06b95a05.system.entry.js → p-f0b1ceef.system.entry.js} +2 -2
- package/dist/twilight/p-f5aefbca.system.entry.js +5 -0
- package/dist/twilight/{p-17c50686.entry.js → p-fb399776.entry.js} +2 -2
- package/dist/twilight/{p-e784d087.entry.js → p-fe81524d.entry.js} +2 -2
- package/dist/twilight/p-fed7a7a5.system.entry.js +5 -0
- package/dist/twilight/{p-C9DFiJHW.system.js.map → p-jx7CG3rj.system.js.map} +1 -1
- package/dist/twilight/{p-ofxyuLsh.system.js.map → p-lRCsnz7i.system.js.map} +1 -1
- package/dist/twilight/p-oqUqe5ch.system.js.map +1 -0
- package/dist/twilight/{p-Cs3Irr4v.system.js.map → p-xRJ6wvh1.system.js.map} +1 -1
- package/dist/twilight/salla-accordion.salla-accordion-body.salla-accordion-head.salla-order-details-options.entry.esm.js.map +1 -0
- package/dist/twilight/salla-order-details-multiple-bundle-product.entry.esm.js.map +1 -0
- package/dist/twilight/salla-order-details.entry.esm.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-accordion/salla-accordion.d.ts +2 -0
- package/dist/types/components/salla-order-details/interfaces.d.ts +55 -0
- package/dist/types/components/salla-order-details/salla-order-details-multiple-bundle-product.d.ts +22 -0
- package/dist/types/components/salla-order-details/salla-order-details-options.d.ts +23 -0
- package/dist/types/components/salla-order-details/salla-order-details.d.ts +14 -0
- package/dist/types/components.d.ts +173 -0
- package/package.json +5 -5
- package/dist/cjs/index-DtXwvL5X.js.map +0 -1
- package/dist/cjs/salla-accordion-body.cjs.entry.js +0 -23
- package/dist/cjs/salla-accordion-body.cjs.entry.js.map +0 -1
- package/dist/cjs/salla-accordion-body.entry.cjs.js.map +0 -1
- package/dist/cjs/salla-accordion-head.cjs.entry.js +0 -52
- package/dist/cjs/salla-accordion-head.cjs.entry.js.map +0 -1
- package/dist/cjs/salla-accordion-head.entry.cjs.js.map +0 -1
- package/dist/cjs/salla-accordion.cjs.entry.js +0 -51
- package/dist/cjs/salla-accordion.cjs.entry.js.map +0 -1
- package/dist/cjs/salla-accordion.entry.cjs.js.map +0 -1
- package/dist/esm/index-D4D34Ujk.js.map +0 -1
- package/dist/esm/salla-accordion-body.entry.js +0 -21
- package/dist/esm/salla-accordion-body.entry.js.map +0 -1
- package/dist/esm/salla-accordion-head.entry.js +0 -50
- package/dist/esm/salla-accordion-head.entry.js.map +0 -1
- package/dist/esm/salla-accordion.entry.js +0 -49
- package/dist/esm/salla-accordion.entry.js.map +0 -1
- package/dist/esm-es5/index-D4D34Ujk.js.map +0 -1
- package/dist/esm-es5/salla-accordion-body.entry.js +0 -5
- package/dist/esm-es5/salla-accordion-body.entry.js.map +0 -1
- package/dist/esm-es5/salla-accordion-head.entry.js +0 -5
- package/dist/esm-es5/salla-accordion-head.entry.js.map +0 -1
- package/dist/esm-es5/salla-accordion.entry.js +0 -5
- package/dist/esm-es5/salla-accordion.entry.js.map +0 -1
- package/dist/twilight/p-154fc672.entry.js +0 -5
- package/dist/twilight/p-154fc672.entry.js.map +0 -1
- package/dist/twilight/p-17ee3d18.entry.js +0 -5
- package/dist/twilight/p-40e20722.system.entry.js +0 -5
- package/dist/twilight/p-40e20722.system.entry.js.map +0 -1
- package/dist/twilight/p-4d6baea7.system.entry.js +0 -5
- package/dist/twilight/p-4d6baea7.system.entry.js.map +0 -1
- package/dist/twilight/p-553bc6b4.system.entry.js +0 -5
- package/dist/twilight/p-63a5bdc6.entry.js +0 -5
- package/dist/twilight/p-63a5bdc6.entry.js.map +0 -1
- package/dist/twilight/p-7eff7dc5.system.entry.js +0 -5
- package/dist/twilight/p-B0xoNOFR.system.js.map +0 -1
- package/dist/twilight/p-BN8tVPbo.system.js.map +0 -1
- package/dist/twilight/p-Cc6e2YrQ.system.js.map +0 -1
- package/dist/twilight/p-D4D34Ujk.js.map +0 -1
- package/dist/twilight/p-DMKkUrkS.system.js +0 -5
- package/dist/twilight/p-Daef3WlT.system.js.map +0 -1
- package/dist/twilight/p-c0363ba7.entry.js +0 -5
- package/dist/twilight/p-c0363ba7.entry.js.map +0 -1
- package/dist/twilight/p-e2ab2b64.system.entry.js +0 -5
- package/dist/twilight/p-e2ab2b64.system.entry.js.map +0 -1
- package/dist/twilight/p-ef38f4ac.system.entry.js +0 -5
- package/dist/twilight/p-fcc64f6d.entry.js +0 -5
- package/dist/twilight/salla-accordion-body.entry.esm.js.map +0 -1
- package/dist/twilight/salla-accordion-head.entry.esm.js.map +0 -1
- package/dist/twilight/salla-accordion.entry.esm.js.map +0 -1
- /package/dist/twilight/{p-d513da6f.entry.js.map → p-0065a55b.entry.js.map} +0 -0
- /package/dist/twilight/{p-c9678188.system.entry.js.map → p-05cf8f0f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8213a9ef.system.entry.js.map → p-066a5e95.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-81aeef6a.entry.js.map → p-0a58ecb2.entry.js.map} +0 -0
- /package/dist/twilight/{p-5b882c52.system.entry.js.map → p-0ab8c50f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d84eb47c.entry.js.map → p-13efdbe3.entry.js.map} +0 -0
- /package/dist/twilight/{p-4af5ffea.entry.js.map → p-13f1a287.entry.js.map} +0 -0
- /package/dist/twilight/{p-6e24a5f0.system.entry.js.map → p-15c42251.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8c0822f7.system.entry.js.map → p-17567b38.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-648fb6ca.entry.js.map → p-204e0ad2.entry.js.map} +0 -0
- /package/dist/twilight/{p-63cba8e3.entry.js.map → p-210ccdae.entry.js.map} +0 -0
- /package/dist/twilight/{p-d0004953.entry.js.map → p-240b86ef.entry.js.map} +0 -0
- /package/dist/twilight/{p-dd83a408.entry.js.map → p-27206d63.entry.js.map} +0 -0
- /package/dist/twilight/{p-c84819d5.entry.js.map → p-35dd7512.entry.js.map} +0 -0
- /package/dist/twilight/{p-2af0da5a.system.entry.js.map → p-38675c42.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7234c5f2.system.entry.js.map → p-3cdd4d44.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8359eb2a.entry.js.map → p-3e9ceed0.entry.js.map} +0 -0
- /package/dist/twilight/{p-a18f81a8.system.entry.js.map → p-447f03b5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2ecf868e.entry.js.map → p-4b7e613a.entry.js.map} +0 -0
- /package/dist/twilight/{p-d5750810.entry.js.map → p-4d5387e9.entry.js.map} +0 -0
- /package/dist/twilight/{p-ad0fedcd.system.entry.js.map → p-53fb14d0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-553bc6b4.system.entry.js.map → p-5db51240.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-aad20f10.system.entry.js.map → p-61f590ca.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-407d19d8.system.entry.js.map → p-6a51cb91.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-95adf84e.entry.js.map → p-6abfa7ed.entry.js.map} +0 -0
- /package/dist/twilight/{p-45b61475.entry.js.map → p-6f66faea.entry.js.map} +0 -0
- /package/dist/twilight/{p-f57bcc51.entry.js.map → p-7187b729.entry.js.map} +0 -0
- /package/dist/twilight/{p-c87d6aa6.system.entry.js.map → p-765562b8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6a0b5799.entry.js.map → p-78deca48.entry.js.map} +0 -0
- /package/dist/twilight/{p-3483eb09.system.entry.js.map → p-7dce6627.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-396198a2.entry.js.map → p-83f6408a.entry.js.map} +0 -0
- /package/dist/twilight/{p-d097a67d.system.entry.js.map → p-888de4b8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1b24ea99.system.entry.js.map → p-8e807035.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6b716e82.system.entry.js.map → p-8fcff962.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-17ee3d18.entry.js.map → p-9a8a57f0.entry.js.map} +0 -0
- /package/dist/twilight/{p-1a9eebb6.system.entry.js.map → p-9cb1a11d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1055f2fb.entry.js.map → p-a8cf78c0.entry.js.map} +0 -0
- /package/dist/twilight/{p-669db4df.entry.js.map → p-b13ef44c.entry.js.map} +0 -0
- /package/dist/twilight/{p-d15630dd.entry.js.map → p-b492c336.entry.js.map} +0 -0
- /package/dist/twilight/{p-f745fcad.entry.js.map → p-b51bb42b.entry.js.map} +0 -0
- /package/dist/twilight/{p-3eaddcf1.entry.js.map → p-bb1a0f6b.entry.js.map} +0 -0
- /package/dist/twilight/{p-5542a867.entry.js.map → p-bca6b6b2.entry.js.map} +0 -0
- /package/dist/twilight/{p-fbe10567.entry.js.map → p-bdca9c9c.entry.js.map} +0 -0
- /package/dist/twilight/{p-fcc64f6d.entry.js.map → p-be2938da.entry.js.map} +0 -0
- /package/dist/twilight/{p-58085711.entry.js.map → p-c5b5a947.entry.js.map} +0 -0
- /package/dist/twilight/{p-13324cdd.system.entry.js.map → p-d33197dc.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e9bc1fa4.system.entry.js.map → p-d3c9cfbb.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e823d4e8.system.entry.js.map → p-d4017888.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-442340d3.system.entry.js.map → p-d43b5d6a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2ae75a1c.entry.js.map → p-d7604122.entry.js.map} +0 -0
- /package/dist/twilight/{p-ebd4ac51.system.entry.js.map → p-d8039b97.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-423d91f5.system.entry.js.map → p-db9674c2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a1d102d3.system.entry.js.map → p-eb292930.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-60bf8746.system.entry.js.map → p-ec034bd2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ab7cc63a.system.entry.js.map → p-f07ad750.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-06b95a05.system.entry.js.map → p-f0b1ceef.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ef38f4ac.system.entry.js.map → p-f5aefbca.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-17c50686.entry.js.map → p-fb399776.entry.js.map} +0 -0
- /package/dist/twilight/{p-e784d087.entry.js.map → p-fe81524d.entry.js.map} +0 -0
- /package/dist/twilight/{p-7eff7dc5.system.entry.js.map → p-fed7a7a5.system.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-C-vbYsMC.system.js","sources":["src/components/salla-reviews/salla-reviews.scss?tag=salla-reviews","src/components/salla-reviews/salla-reviews.tsx"],"sourcesContent":["","import { Component, Prop, State, h } from '@stencil/core';\nimport IconArrowLeft from '../../assets/svg/arrow-left.svg'\nimport IconQuoteOpen from '../../assets/svg/quote-open.svg'\n\nimport {Source, Review, ReviewType, SortingOption} from \"./interfaces\"\nimport Helper from '../../Helpers/Helper';\n\n\n@Component({\n tag: 'salla-reviews',\n styleUrl: 'salla-reviews.scss',\n})\nexport class SallaReviews {\n constructor(){\n this.source = this.source;\n salla.onReady(() => {\n this.displayAllURL = salla.url.get('testimonials')\n this.isRTL = salla.config.get('theme.is_rtl', true)\n })\n\n salla.lang.onLoaded(() => { \n this.testimonialText = salla.lang.get('blocks.home.testimonials')\n this.displayAllLinkText = salla.lang.get('blocks.home.display_all')\n })\n }\n\n /**\n * Controls the visibility of a link to the reviews page.\n * \n * When set to `true`, a link will be displayed allowing users to navigate to the full reviews section.\n * \n * @type {boolean}\n */\n @Prop({ reflect: true }) displayAllLink: boolean\n\n /**\n * Specifies the data source for reviews.\n * \n * Valid options include:\n * - 'categories': Retrieves reviews for specific product categories.\n * - 'products': Retrieves reviews for individual products.\n * - 'json': Retrieves reviews from a custom JSON payload provided in `sourceValue`.\n * \n * When using 'json' as the source, a valid payload must be provided in `sourceValue`.\n * \n * @type {Source}\n * @default \"store\"\n */\n @Prop({ reflect: true }) source?: Source;\n\n /**\n * Provides data specific to the chosen source.\n * \n * Required when using 'categories', 'products', or 'json' as the source:\n * - 'categories': An array of category IDs.\n * - 'products': An array of product IDs.\n * - 'json': A custom JSON object containing review data.\n * \n * @type {string | object | Array<number>}\n */\n @Prop({ reflect: true }) sourceValue?: string | object | Array<number>;\n\n /**\n * Defines the maximum number of reviews to retrieve from the API.\n * \n * @type {number}\n * @default 5\n */\n @Prop({ reflect: true }) limit = 5\n\n\n /**\n * Specifies the type of reviews to fetch.\n * Available options:\n * - \"all\": Fetches reviews from all sources.\n * - \"store\": Fetches reviews specific to the store.\n * - \"products\": Fetches reviews specific to products.\n * \n * @type {ReviewType}\n * @default store\n */\n @Prop() type: ReviewType = \"store\";\n\n\n /**\n * Specifies the sorting criteria for the fetched reviews.\n * Available options:\n * - \"top_rating\": Sorts reviews based on top ratings.\n * - \"random\": Sorts reviews randomly.\n * - \"latest\": Sorts reviews based on the latest ones (default).\n * \n * @type {SortingOption}\n * @default latest\n */\n @Prop() sort: SortingOption = \"latest\";\n\n\n /**\n * Specifies whether to hide customer information in the component.\n * When set to true, customer information will be hidden.\n * Defaults to false, meaning customer information will be displayed.\n */\n @Prop() hideCustomerInfo: boolean = false;\n\n\n @State() reviews: Array<Review> = [];\n @State() isRTL: boolean\n @State() showReviews: boolean = false;\n @State() testimonialText: string = salla.lang.get('blocks.home.testimonials');\n @State() displayAllLinkText: string = salla.lang.get('blocks.home.display_all');\n\n private displayAllURL = null\n\n fetchReviews() {\n if (this.source === 'json') {\n return Promise.resolve(JSON.parse(this.sourceValue as string));\n }\n const isJsonEncoded = ['products', 'categories'].includes(this.source);\n const params = {\n limit: this.limit,\n source: this.source,\n items: isJsonEncoded ? JSON.parse(this.sourceValue as string) : this.sourceValue,\n sort: this.sort,\n type: this.type,\n hide_customer_info: this.hideCustomerInfo?1:0\n };\n return salla.api.request('reviews', { params }, 'get');\n }\n\n\n componentWillLoad() {\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => this.fetchReviews())\n .then((resp) => resp.data || [])\n .then(reviews => {\n if (reviews.length) {\n this.reviews = reviews;\n this.showReviews = true;\n Helper.generateReviewSchema(this.reviews);\n }\n });\n }\n\n render() {\n return (\n <div class=\"s-reviews-container\">\n <div class=\"s-reviews-header-wrapper\">\n <h1 class=\"s-reviews-header\">\n {this.testimonialText}\n </h1>\n {!!this.displayAllLink ? (\n <a href={this.displayAllURL} class=\"s-reviews-display-all\">\n {this.displayAllLinkText}\n <span class=\"s-reviews-display-all-icon\" innerHTML={IconArrowLeft} />\n </a>\n ) : null}\n </div>\n <salla-slider\n centered\n slides-per-view={1}\n type=\"testimonials\"\n class=\"s-reviews-testimonials-slider\"\n controls-outer\n auto-play\n id={`testimonials-${this.source}-slider`}\n >\n <div slot=\"items\">\n {this.reviews.map((item: Review, index) => (\n <div key={index} class=\"s-reviews-swiper-slide\">\n <div class=\"s-reviews-testimonial\">\n <div class=\"s-reviews-testimonial__inner\">\n <div class=\"s-reviews-testimonial__avatar\">\n <img\n src={'images/s-empty.png'}\n data-src={item.avatar}\n alt={item.name ? item.name : 'testimonial-' + index}\n class=\"lazy\"\n />\n </div>\n <div class=\"s-reviews-testimonial__text\">\n <p innerHTML={item.content}></p>\n <div class=\"s-reviews-testimonial__name_wrapper\">\n <div class=\"s-reviews-testimonial__info\">\n {item.name && <h2>{`${item.name}`}</h2>}\n </div>\n <div class=\"s-reviews-testimonial__rating\">\n {/* TODO stars is missing */}\n <salla-rating-stars size=\"small\" value={item.stars}></salla-rating-stars>\n </div>\n </div>\n </div>\n\n <span class=\"s-reviews-testimonial__icon\" innerHTML={IconQuoteOpen} />\n </div>\n </div>\n </div>\n ))}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n}\n\n"],"names":["IconArrowLeft"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;YAAA,MAAM,eAAe,GAAG,EAAE;;kBCYb,YAAY,4BAAA,MAAA;YACvB,IAAA,WAAA,CAAA,OAAA,EAAA;;YAiDA;;;;;YAKG;YACsB,QAAA,IAAK,CAAA,KAAA,GAAG,CAAC;YAGlC;;;;;;;;;YASG;YACK,QAAA,IAAI,CAAA,IAAA,GAAe,OAAO;YAGlC;;;;;;;;;YASG;YACK,QAAA,IAAI,CAAA,IAAA,GAAkB,QAAQ;YAGtC;;;;YAIG;YACK,QAAA,IAAgB,CAAA,gBAAA,GAAY,KAAK;YAGhC,QAAA,IAAO,CAAA,OAAA,GAAkB,EAAE;YAE3B,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;oBAC5B,IAAe,CAAA,eAAA,GAAW,KAAK,CAAC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AAA,EAAK,CAAA,EAAG,IAAI,CAAC,IAAI,EAAE,CAAM,CACnC,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,+BAA+B,EAAA,EAExC,CAAA,CAAA,oBAAA,EAAA,EAAoB,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,CAAuB,CACrE,CACF,CACF,EAEN,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,6BAA6B,EAAC,SAAS,EAAE,aAAa,EAAA,CAAI,CAClE,CACF,CACF,CACP,CAAC,CACE,CACO,CACX;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-N45BdAU8.system.js","sources":["src/components/salla-reviews/salla-reviews.scss?tag=salla-reviews","src/components/salla-reviews/salla-reviews.tsx"],"sourcesContent":["","import { Component, Prop, State, h } from '@stencil/core';\nimport IconArrowLeft from '../../assets/svg/arrow-left.svg'\nimport IconQuoteOpen from '../../assets/svg/quote-open.svg'\n\nimport {Source, Review, ReviewType, SortingOption} from \"./interfaces\"\nimport Helper from '../../Helpers/Helper';\n\n\n@Component({\n tag: 'salla-reviews',\n styleUrl: 'salla-reviews.scss',\n})\nexport class SallaReviews {\n constructor(){\n this.source = this.source;\n salla.onReady(() => {\n this.displayAllURL = salla.url.get('testimonials')\n this.isRTL = salla.config.get('theme.is_rtl', true)\n })\n\n salla.lang.onLoaded(() => { \n this.testimonialText = salla.lang.get('blocks.home.testimonials')\n this.displayAllLinkText = salla.lang.get('blocks.home.display_all')\n })\n }\n\n /**\n * Controls the visibility of a link to the reviews page.\n * \n * When set to `true`, a link will be displayed allowing users to navigate to the full reviews section.\n * \n * @type {boolean}\n */\n @Prop({ reflect: true }) displayAllLink: boolean\n\n /**\n * Specifies the data source for reviews.\n * \n * Valid options include:\n * - 'categories': Retrieves reviews for specific product categories.\n * - 'products': Retrieves reviews for individual products.\n * - 'json': Retrieves reviews from a custom JSON payload provided in `sourceValue`.\n * \n * When using 'json' as the source, a valid payload must be provided in `sourceValue`.\n * \n * @type {Source}\n * @default \"store\"\n */\n @Prop({ reflect: true }) source?: Source;\n\n /**\n * Provides data specific to the chosen source.\n * \n * Required when using 'categories', 'products', or 'json' as the source:\n * - 'categories': An array of category IDs.\n * - 'products': An array of product IDs.\n * - 'json': A custom JSON object containing review data.\n * \n * @type {string | object | Array<number>}\n */\n @Prop({ reflect: true }) sourceValue?: string | object | Array<number>;\n\n /**\n * Defines the maximum number of reviews to retrieve from the API.\n * \n * @type {number}\n * @default 5\n */\n @Prop({ reflect: true }) limit = 5\n\n\n /**\n * Specifies the type of reviews to fetch.\n * Available options:\n * - \"all\": Fetches reviews from all sources.\n * - \"store\": Fetches reviews specific to the store.\n * - \"products\": Fetches reviews specific to products.\n * \n * @type {ReviewType}\n * @default store\n */\n @Prop() type: ReviewType = \"store\";\n\n\n /**\n * Specifies the sorting criteria for the fetched reviews.\n * Available options:\n * - \"top_rating\": Sorts reviews based on top ratings.\n * - \"random\": Sorts reviews randomly.\n * - \"latest\": Sorts reviews based on the latest ones (default).\n * \n * @type {SortingOption}\n * @default latest\n */\n @Prop() sort: SortingOption = \"latest\";\n\n\n /**\n * Specifies whether to hide customer information in the component.\n * When set to true, customer information will be hidden.\n * Defaults to false, meaning customer information will be displayed.\n */\n @Prop() hideCustomerInfo: boolean = false;\n\n\n @State() reviews: Array<Review> = [];\n @State() isRTL: boolean\n @State() showReviews: boolean = false;\n @State() testimonialText: string = salla.lang.get('blocks.home.testimonials');\n @State() displayAllLinkText: string = salla.lang.get('blocks.home.display_all');\n\n private displayAllURL = null\n\n fetchReviews() {\n if (this.source === 'json') {\n return Promise.resolve(JSON.parse(this.sourceValue as string));\n }\n const isJsonEncoded = ['products', 'categories'].includes(this.source);\n const params = {\n limit: this.limit,\n source: this.source,\n items: isJsonEncoded ? JSON.parse(this.sourceValue as string) : this.sourceValue,\n sort: this.sort,\n type: this.type,\n hide_customer_info: this.hideCustomerInfo?1:0\n };\n return salla.api.request('reviews', { params }, 'get');\n }\n\n\n componentWillLoad() {\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => this.fetchReviews())\n .then((resp) => resp.data || [])\n .then(reviews => {\n if (reviews.length) {\n this.reviews = reviews;\n this.showReviews = true;\n Helper.generateReviewSchema(this.reviews);\n }\n });\n }\n\n render() {\n return (\n <div class=\"s-reviews-container\">\n <div class=\"s-reviews-header-wrapper\">\n <h1 class=\"s-reviews-header\">\n {this.testimonialText}\n </h1>\n {!!this.displayAllLink ? (\n <a href={this.displayAllURL} class=\"s-reviews-display-all\">\n {this.displayAllLinkText}\n <span class=\"s-reviews-display-all-icon\" innerHTML={IconArrowLeft} />\n </a>\n ) : null}\n </div>\n <salla-slider\n centered\n slides-per-view={1}\n type=\"testimonials\"\n class=\"s-reviews-testimonials-slider\"\n controls-outer\n auto-play\n id={`testimonials-${this.source}-slider`}\n >\n <div slot=\"items\">\n {this.reviews.map((item: Review, index) => (\n <div key={index} class=\"s-reviews-swiper-slide\">\n <div class=\"s-reviews-testimonial\">\n <div class=\"s-reviews-testimonial__inner\">\n <div class=\"s-reviews-testimonial__avatar\">\n <img\n src={'images/s-empty.png'}\n data-src={item.avatar}\n alt={item.name ? item.name : 'testimonial-' + index}\n class=\"lazy\"\n />\n </div>\n <div class=\"s-reviews-testimonial__text\">\n <p innerHTML={item.content}></p>\n <div class=\"s-reviews-testimonial__name_wrapper\">\n <div class=\"s-reviews-testimonial__info\">\n {item.name && <h2>{`${item.name}`}</h2>}\n </div>\n <div class=\"s-reviews-testimonial__rating\">\n {/* TODO stars is missing */}\n <salla-rating-stars size=\"small\" value={item.stars}></salla-rating-stars>\n </div>\n </div>\n </div>\n\n <span class=\"s-reviews-testimonial__icon\" innerHTML={IconQuoteOpen} />\n </div>\n </div>\n </div>\n ))}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n}\n\n"],"names":["IconArrowLeft"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;YAAA,MAAM,eAAe,GAAG,EAAE;;kB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EACrB,GAAG,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,cAAc,GAAG,KAAK,EACnD,KAAK,EAAC,MAAM,GACZ,CACE,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,6BAA6B,EAAA,EACtC,CAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,IAAI,CAAC,OAAO,EAAM,CAAA,EAChC,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,qCAAqC,EAAA,EAC9C,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,6BAA6B,EAAA,EACrC,IAAI,CAAC,IAAI,IAAI,CAAA,CAAA,IAAA,EAAA,IAAA,EAAK,CAAA,EAAG,IAAI,CAAC,IAAI,EAAE,CAAM,CACnC,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,+BAA+B,EAAA,EAExC,CAAA,CAAA,oBAAA,EAAA,EAAoB,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,CAAuB,CACrE,CACF,CACF,EAEN,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,6BAA6B,EAAC,SAAS,EAAE,aAAa,EAAA,CAAI,CAClE,CACF,CACF,CACP,CAAC,CACE,CACO,CACX;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{L as e}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{L as e}from"./p-Hw2jlaNN.js";function t(){if(!document.lazyLoadInstance){document.lazyLoadInstance=new e({use_native:true});document.lazyLoadBackgrounds=new e({elements_selector:".lazy[data-bg]:not(.loaded)"})}if(document.readyState!=="complete"){document.addEventListener("DOMContentLoaded",(()=>document.lazyLoadInstance.update()));document.addEventListener("DOMContentLoaded",(()=>document.lazyLoadBackgrounds.update()))}salla.infiniteScroll.event.onAppend((()=>{document.lazyLoadInstance.update();document.lazyLoadBackgrounds.update()}))}const o=t;export{o as g};
|
|
5
|
+
//# sourceMappingURL=p-NSLkL4Dn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-NSLkL4Dn.js","sources":["src/global/app.ts","@stencil/core/internal/app-globals"],"sourcesContent":["import '@salla.sa/twilight'\nimport LazyLoad from \"vanilla-lazyload\";\n\nexport default function () {\n // Only initialize it one time for the entire application\n if (!document.lazyLoadInstance) {\n document.lazyLoadInstance = new LazyLoad({\n use_native: true,//native not support lazyLoad backgrounds\n // restore_on_error: true,\n // Your custom settings go here\n // callback_finish: () => document.lazyLoadBackgrounds.update(document.querySelectorAll('.lazy[data-bg]:not(.loaded)'))\n });\n document.lazyLoadBackgrounds = new LazyLoad({\n elements_selector: '.lazy[data-bg]:not(.loaded)',\n });\n //native way doesn't load backgrounds\n // document.lazyLoadBackgrounds = new LazyLoad();\n }\n //make sure that lazyLoad will be fired after loading the page too.\n if (document.readyState !== 'complete') {\n document.addEventListener(\"DOMContentLoaded\", () => document.lazyLoadInstance.update());\n document.addEventListener(\"DOMContentLoaded\", () => document.lazyLoadBackgrounds.update());\n }\n\n // fire it after each load more request;\n // @ts-ignore\n salla.infiniteScroll.event.onAppend(() => {\n document.lazyLoadInstance.update();\n document.lazyLoadBackgrounds.update();\n }\n );\n}\n","import appGlobalScript from '/home/runner/work/twilight/twilight/packages/twilight-components/src/global/app.ts';\nexport const globalScripts = appGlobalScript;\nexport const globalStyles = \"\";\n"],"names":[],"mappings":";;;;;AAGc,wBAAA,IAAA;;AAEZ,IAAA,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE;AAC9B,QAAA,QAAQ,CAAC,gBAAgB,GAAG,IAAI,QAAQ,CAAC;YACvC,UAAU,EAAE,IAAI;;;;AAIjB,SAAA,CAAC;AACF,QAAA,QAAQ,CAAC,mBAAmB,GAAG,IAAI,QAAQ,CAAC;AACxC,YAAA,iBAAiB,EAAE,6BAA6B;AACnD,SAAA,CAAC;;;;;AAKJ,IAAA,IAAI,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE;AACtC,QAAA,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;AACvF,QAAA,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,QAAQ,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;;;;IAK5F,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAK;AAC/B,QAAA,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE;AAClC,QAAA,QAAQ,CAAC,mBAAmB,CAAC,MAAM,EAAE;AACzC,KAAC,CACJ;AACL;;AC9BY,MAAC,aAAa,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-OzJ9XEsV.system.js","sources":["src/components/salla-price-range/salla-price-range.scss?tag=salla-price-range","src/components/salla-price-range/salla-price-range.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n\n.rtl, [dir=\"rtl\"] {\n .rtl-range-slider {\n transform: rotateY(180deg);\n }\n\n .rtl-range-numbers{\n flex-direction: row-reverse;\n }\n\n .form-select, select{\n background-position: left 0.5rem center;\n padding-right: 12px;\n } \n\n // divide\n.menu-divide {\n li {\n &:not(:last-child) {\n &:after {\n left: 0;\n right: auto;\n }\n }\n }\n}\n}\n\ninput[type=range]::-webkit-slider-thumb {\n pointer-events: all;\n width: 24px;\n height: 24px;\n -webkit-appearance: none;\n}\n\n[type='checkbox']:checked{\n background-size: 80%;\n}","import { Component, Host, h, State, Prop, Event, Method } from '@stencil/core';\nimport { Filter, FilterValue } from \"../salla-filters/interfaces\";\nimport arrowLeft from '../../assets/svg/arrow-left.svg'\nimport arrowRight from '../../assets/svg/arrow-right.svg'\n\n\n@Component({\n tag: 'salla-price-range',\n styleUrl: 'salla-price-range.scss',\n})\nexport class SallaPriceRange {\n /**\n * Minimum price threshold value\n */\n @Prop({ mutable: true }) minPrice;\n\n /**\n * Maximum price threshold value\n */\n @Prop({ mutable: true }) maxPrice;\n\n /**\n * Product price range filter option object instance\n */\n @Prop({ reflect: true }) option: Filter;\n\n /**\n * Currently selected price filter data\n */\n @Prop({ reflect: true }) filtersData: any;\n\n\n @State() min = 0;\n @State() max = 10000;\n @State() priceOptions: any;\n @State() moreThanLabel: string = \"أكثر من\";\n @State() lessThanLabel: string = \"أقل من\";\n @State() toLabel: string = \"الى\";\n @State() fromLabel: string = \"من\";\n @State() typing: boolean = false;\n @State() isMin: boolean = false;\n @State() isRTL: Boolean = salla.config.get('theme.is_rtl', true);\n\n\n /**\n * Custome event emitted when there is a change in price input.\n */\n @Event() changed: any;\n\n isReady: Boolean;\n minInput: HTMLInputElement;\n maxInput: HTMLInputElement;\n filterValues: Array<FilterValue> = [];\n\n\n connectedCallback() {\n if (this.filtersData && this.filtersData?.price) {\n this.minPrice = this.filtersData.price.min;\n this.maxPrice = this.filtersData.price.max;\n }\n salla.lang.onLoaded(() => {\n this.moreThanLabel = salla.lang.getWithDefault('common.elements.more_than', this.moreThanLabel)\n this.lessThanLabel = salla.lang.getWithDefault('common.elements.less_than', this.lessThanLabel)\n this.toLabel = salla.lang.getWithDefault('common.elements.to', this.toLabel)\n this.fromLabel = salla.lang.getWithDefault('common.elements.from', this.fromLabel)\n })\n\n //no need to show one option only\n if (this.option.values.length == 1) {\n return;\n }\n //here we may receive too many prices, we will group all inputs to\n if (this.option.values.length <= 5) {\n this.filterValues = this.option.values;\n return;\n }\n const chunkSize = Math.ceil(this.option.values.length / 5);\n for (let i = 0; i < this.option.values.length; i += chunkSize) {\n this.filterValues.push(\n this.option.values\n .slice(i, i + chunkSize)\n .reduce((final: FilterValue, currentValue: FilterValue) => {\n final.to = currentValue.to;\n final.count += currentValue.count;\n return final;\n })\n );\n // do whatever\n }\n }\n\n /**\n * reset the price range inputs\n */\n @Method()\n async reset() {\n //@ts-ignore\n this.minInput.value = null;\n this.maxInput.value = null;\n this.minPrice=null\n this.maxPrice=null\n }\n\n private getPriceLabel(filterValue: FilterValue) {\n // @ts-ignore\n if (isNaN(filterValue.from) || filterValue.from < 1) {\n return `${this.lessThanLabel} ${salla.money(filterValue.to)}`;\n }\n // @ts-ignore\n if (isNaN(filterValue.to) || filterValue.to < 1) {\n return `${this.moreThanLabel} ${salla.money(filterValue.from)}`;\n }\n\n return `${salla.money(filterValue.from)} ${this.toLabel} ${salla.money(filterValue.to)}`;\n }\n\n minInputValidation(value: number) {\n if (value && (value > this.max || (this.maxPrice && value > this.maxPrice))) {\n // this.minPrice = this.maxPrice;\n return;\n }\n\n if (value < this.min) {\n this.minPrice = this.min;\n return;\n }\n\n if (value) {\n this.minPrice = value;\n }\n }\n\n maxInputValidation(value) {\n if (value && (value < this.min || (this.minPrice && value < this.minPrice))) {\n // this.maxPrice = this.minPrice;\n return;\n }\n if (value > this.max) {\n this.maxPrice = this.max;\n return;\n }\n }\n\n private async changedEventHandler(event) {\n salla.helpers.inputDigitsOnly(this.minInput)\n salla.helpers.inputDigitsOnly(this.maxInput)\n\n const minInputValue = this.minPrice ? +this.minPrice * 1 : null\n const maxInputValue = this.maxPrice ? +this.maxPrice * 1 : null\n \n if (!this.maxPrice) {\n this.maxPrice = '';\n }\n if (this.isMin) {\n this.minInputValidation(minInputValue);\n } else {\n if (!this.minPrice) {\n this.minPrice = 0;\n }\n this.maxInputValidation(maxInputValue)\n }\n\n this.isReady && this.changed.emit({\n event: event,\n option: this.option,\n value: { max: this.maxPrice, min: this.minPrice }\n })\n }\n private handleMinMaxPrice(event: Event, value: FilterValue): void {\n //todo:: cover when from is star\n this.minPrice = value.from;\n this.maxPrice = value.to !== '*' ? value.to : \"\";\n\n this.changedEventHandler(event);\n }\n\n\n\n private isChecked(filterValue: FilterValue) {\n if (!this.minPrice && !this.maxPrice) {\n return false;\n }\n\n //1 filterValue.from zero or * and this.minPrice not set or zero\n //2 filterValue.from == this.minPrice\n //@ts-ignore\n let isMinEqual = ((filterValue.from < 1 || filterValue.from == '*') && this.minPrice == 0) || filterValue.from == this.minPrice;\n\n //1 filterValue.to == \"*\" or null\n //2 filterValue.to == this.max\n let isMaxEqual = filterValue.to == '*' || !filterValue.to || filterValue.to == this.maxPrice;\n return isMinEqual && isMaxEqual;\n }\n\n private handleMinPrice(event: Event) {\n this.isMin = true\n const value = (event.target as HTMLInputElement).value\n this.minPrice = value ==='' ? 0 : value\n }\n private handleMaxPrice(event: Event) {\n this.isMin = false\n const value = (event.target as HTMLInputElement).value\n this.maxPrice = value === undefined ? '' : value\n }\n\n\n render() {\n return (\n <Host>\n {\n this.filterValues.map((filterValue, index) => {\n\n return <label class=\"s-filters-label\" htmlFor={`${this.option.key}-${index}`} key={index}>\n <input\n id={`${this.option.key}-${index}`}\n name=\"price\"\n type=\"radio\"\n checked={this.isChecked(filterValue)}\n class=\"s-filters-radio\"\n onChange={e => this.handleMinMaxPrice(e, filterValue)}\n />\n <span innerHTML={this.getPriceLabel(filterValue)}></span>\n </label>\n })\n }\n\n\n <div class=\"flex justify-center items-center\">\n <div class=\"relative max-w-xl w-full\">\n <div class=\"s-price-range-inputs\">\n <div class=\"s-price-range-relative\">\n <div class=\"s-price-range-currency\"> {salla.config.currency().symbol}</div>\n <input\n type=\"number\"\n maxlength=\"5\"\n ref={el => this.minInput = el}\n onBlur={(e) => this.handleMinPrice(e)}\n value={this.minPrice}\n placeholder={this.fromLabel}\n class=\"s-price-range-number-input\"\n\n />\n </div>\n\n <div class=\"s-price-range-gray-text\"> -</div>\n <div class=\"s-price-range-relative\">\n <div class=\"s-price-range-currency\"> {salla.config.currency().symbol}</div>\n <input\n type=\"number\"\n maxlength=\"5\"\n ref={el => this.maxInput = el}\n onBlur={(e) => this.handleMaxPrice(e)}\n value={this.maxPrice}\n placeholder={this.toLabel}\n class=\"s-price-range-number-input\" aria-describedby=\"price-currency\" />\n </div>\n <salla-button color='gray' shape='icon' size='small' fill='outline' onClick={(event) => this.changedEventHandler(event)}>\n <span innerHTML={this.isRTL ? arrowLeft : arrowRight} />\n </salla-button>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAAA,MAAM,kBAAkB,GAAG,ynBAAynB;;YCUvoB,eAAe,gCAAA,MAAA;MAJ5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;MA0BW,QAAA,IAAG,CAAA,GAAA,GAAG,CAAC;MACP,QAAA,IAAG,CAAA,GAAA,GAAG,KAAK;MAEX,QAAA,IAAa,CAAA,aAAA,GAAW,SAAS;MACjC,QAAA,IAAa,CAAA,aAAA,GAAW,QAAQ;MAChC,QAAA,IAAO,CAAA,OAAA,GAAW,KAAK;MACvB,QAAA,IAAS,CAAA,SAAA,GAAW,IAAI;MACxB,QAAA,IAAM,CAAA,MAAA,GAAY,KAAK;MACvB,QAAA,IAAK,CAAA,KAAA,GAAY,KAAK;MACtB,QAAA,IAAK,CAAA,KAAA,GAAY,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC;MAWhE,QAAA,IAAY,CAAA,YAAA,GAAuB,EAAE;MAyNtC;UAtNC,iBAAiB,GAAA;;MACf,QAAA,IAAI,IAAI,CAAC,WAAW,KAAI,CAAA,EAAA,GAAA,IAAI,CAAC,WAAW,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,KAAK,CAAA,EAAE;kBAC/C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG;kBAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG;;MAE5C,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;MACvB,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N,CAAA,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAc,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAA,EACrH,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,SAAS,EAAE,IAAI,CAAC,KAAK,GAAG,SAAS,GAAG,UAAU,GAAI,CAC3C,CACX,CACF,CACF,CACD;;UAIX,gBAAgB,GAAA;MACd,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-QNwQUqLM.system.js","sources":["src/components/salla-price-range/salla-price-range.scss?tag=salla-price-range","src/components/salla-price-range/salla-price-range.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n\n.rtl, [dir=\"rtl\"] {\n .rtl-range-slider {\n transform: rotateY(180deg);\n }\n\n .rtl-range-numbers{\n flex-direction: row-reverse;\n }\n\n .form-select, select{\n background-position: left 0.5rem center;\n padding-right: 12px;\n } \n\n // divide\n.menu-divide {\n li {\n &:not(:last-child) {\n &:after {\n left: 0;\n right: auto;\n }\n }\n }\n}\n}\n\ninput[type=range]::-webkit-slider-thumb {\n pointer-events: all;\n width: 24px;\n height: 24px;\n -webkit-appearance: none;\n}\n\n[type='checkbox']:checked{\n background-size: 80%;\n}","import { Component, Host, h, State, Prop, Event, Method } from '@stencil/core';\nimport { Filter, FilterValue } from \"../salla-filters/interfaces\";\nimport arrowLeft from '../../assets/svg/arrow-left.svg'\nimport arrowRight from '../../assets/svg/arrow-right.svg'\n\n\n@Component({\n tag: 'salla-price-range',\n styleUrl: 'salla-price-range.scss',\n})\nexport class SallaPriceRange {\n /**\n * Minimum price threshold value\n */\n @Prop({ mutable: true }) minPrice;\n\n /**\n * Maximum price threshold value\n */\n @Prop({ mutable: true }) maxPrice;\n\n /**\n * Product price range filter option object instance\n */\n @Prop({ reflect: true }) option: Filter;\n\n /**\n * Currently selected price filter data\n */\n @Prop({ reflect: true }) filtersData: any;\n\n\n @State() min = 0;\n @State() max = 10000;\n @State() priceOptions: any;\n @State() moreThanLabel: string = \"أكثر من\";\n @State() lessThanLabel: string = \"أقل من\";\n @State() toLabel: string = \"الى\";\n @State() fromLabel: string = \"من\";\n @State() typing: boolean = false;\n @State() isMin: boolean = false;\n @State() isRTL: Boolean = salla.config.get('theme.is_rtl', true);\n\n\n /**\n * Custome event emitted when there is a change in price input.\n */\n @Event() changed: any;\n\n isReady: Boolean;\n minInput: HTMLInputElement;\n maxInput: HTMLInputElement;\n filterValues: Array<FilterValue> = [];\n\n\n connectedCallback() {\n if (this.filtersData && this.filtersData?.price) {\n this.minPrice = this.filtersData.price.min;\n this.maxPrice = this.filtersData.price.max;\n }\n salla.lang.onLoaded(() => {\n this.moreThanLabel = salla.lang.getWithDefault('common.elements.more_than', this.moreThanLabel)\n this.lessThanLabel = salla.lang.getWithDefault('common.elements.less_than', this.lessThanLabel)\n this.toLabel = salla.lang.getWithDefault('common.elements.to', this.toLabel)\n this.fromLabel = salla.lang.getWithDefault('common.elements.from', this.fromLabel)\n })\n\n //no need to show one option only\n if (this.option.values.length == 1) {\n return;\n }\n //here we may receive too many prices, we will group all inputs to\n if (this.option.values.length <= 5) {\n this.filterValues = this.option.values;\n return;\n }\n const chunkSize = Math.ceil(this.option.values.length / 5);\n for (let i = 0; i < this.option.values.length; i += chunkSize) {\n this.filterValues.push(\n this.option.values\n .slice(i, i + chunkSize)\n .reduce((final: FilterValue, currentValue: FilterValue) => {\n final.to = currentValue.to;\n final.count += currentValue.count;\n return final;\n })\n );\n // do whatever\n }\n }\n\n /**\n * reset the price range inputs\n */\n @Method()\n async reset() {\n //@ts-ignore\n this.minInput.value = null;\n this.maxInput.value = null;\n this.minPrice=null\n this.maxPrice=null\n }\n\n private getPriceLabel(filterValue: FilterValue) {\n // @ts-ignore\n if (isNaN(filterValue.from) || filterValue.from < 1) {\n return `${this.lessThanLabel} ${salla.money(filterValue.to)}`;\n }\n // @ts-ignore\n if (isNaN(filterValue.to) || filterValue.to < 1) {\n return `${this.moreThanLabel} ${salla.money(filterValue.from)}`;\n }\n\n return `${salla.money(filterValue.from)} ${this.toLabel} ${salla.money(filterValue.to)}`;\n }\n\n minInputValidation(value: number) {\n if (value && (value > this.max || (this.maxPrice && value > this.maxPrice))) {\n // this.minPrice = this.maxPrice;\n return;\n }\n\n if (value < this.min) {\n this.minPrice = this.min;\n return;\n }\n\n if (value) {\n this.minPrice = value;\n }\n }\n\n maxInputValidation(value) {\n if (value && (value < this.min || (this.minPrice && value < this.minPrice))) {\n // this.maxPrice = this.minPrice;\n return;\n }\n if (value > this.max) {\n this.maxPrice = this.max;\n return;\n }\n }\n\n private async changedEventHandler(event) {\n salla.helpers.inputDigitsOnly(this.minInput)\n salla.helpers.inputDigitsOnly(this.maxInput)\n\n const minInputValue = this.minPrice ? +this.minPrice * 1 : null\n const maxInputValue = this.maxPrice ? +this.maxPrice * 1 : null\n \n if (!this.maxPrice) {\n this.maxPrice = '';\n }\n if (this.isMin) {\n this.minInputValidation(minInputValue);\n } else {\n if (!this.minPrice) {\n this.minPrice = 0;\n }\n this.maxInputValidation(maxInputValue)\n }\n\n this.isReady && this.changed.emit({\n event: event,\n option: this.option,\n value: { max: this.maxPrice, min: this.minPrice }\n })\n }\n private handleMinMaxPrice(event: Event, value: FilterValue): void {\n //todo:: cover when from is star\n this.minPrice = value.from;\n this.maxPrice = value.to !== '*' ? value.to : \"\";\n\n this.changedEventHandler(event);\n }\n\n\n\n private isChecked(filterValue: FilterValue) {\n if (!this.minPrice && !this.maxPrice) {\n return false;\n }\n\n //1 filterValue.from zero or * and this.minPrice not set or zero\n //2 filterValue.from == this.minPrice\n //@ts-ignore\n let isMinEqual = ((filterValue.from < 1 || filterValue.from == '*') && this.minPrice == 0) || filterValue.from == this.minPrice;\n\n //1 filterValue.to == \"*\" or null\n //2 filterValue.to == this.max\n let isMaxEqual = filterValue.to == '*' || !filterValue.to || filterValue.to == this.maxPrice;\n return isMinEqual && isMaxEqual;\n }\n\n private handleMinPrice(event: Event) {\n this.isMin = true\n const value = (event.target as HTMLInputElement).value\n this.minPrice = value ==='' ? 0 : value\n }\n private handleMaxPrice(event: Event) {\n this.isMin = false\n const value = (event.target as HTMLInputElement).value\n this.maxPrice = value === undefined ? '' : value\n }\n\n\n render() {\n return (\n <Host>\n {\n this.filterValues.map((filterValue, index) => {\n\n return <label class=\"s-filters-label\" htmlFor={`${this.option.key}-${index}`} key={index}>\n <input\n id={`${this.option.key}-${index}`}\n name=\"price\"\n type=\"radio\"\n checked={this.isChecked(filterValue)}\n class=\"s-filters-radio\"\n onChange={e => this.handleMinMaxPrice(e, filterValue)}\n />\n <span innerHTML={this.getPriceLabel(filterValue)}></span>\n </label>\n })\n }\n\n\n <div class=\"flex justify-center items-center\">\n <div class=\"relative max-w-xl w-full\">\n <div class=\"s-price-range-inputs\">\n <div class=\"s-price-range-relative\">\n <div class=\"s-price-range-currency\"> {salla.config.currency().symbol}</div>\n <input\n type=\"number\"\n maxlength=\"5\"\n ref={el => this.minInput = el}\n onBlur={(e) => this.handleMinPrice(e)}\n value={this.minPrice}\n placeholder={this.fromLabel}\n class=\"s-price-range-number-input\"\n\n />\n </div>\n\n <div class=\"s-price-range-gray-text\"> -</div>\n <div class=\"s-price-range-relative\">\n <div class=\"s-price-range-currency\"> {salla.config.currency().symbol}</div>\n <input\n type=\"number\"\n maxlength=\"5\"\n ref={el => this.maxInput = el}\n onBlur={(e) => this.handleMaxPrice(e)}\n value={this.maxPrice}\n placeholder={this.toLabel}\n class=\"s-price-range-number-input\" aria-describedby=\"price-currency\" />\n </div>\n <salla-button color='gray' shape='icon' size='small' fill='outline' onClick={(event) => this.changedEventHandler(event)}>\n <span innerHTML={this.isRTL ? arrowLeft : arrowRight} />\n </salla-button>\n </div>\n </div>\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C,SAAS,EAAC,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAA,EACrH,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,SAAS,EAAE,IAAI,CAAC,KAAK,GAAG,SAAS,GAAG,UAAU,GAAI,CAC3C,CACX,CACF,CACF,CACD;;UAIX,gBAAgB,GAAA;MACd,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-XDYW48AK.system.js","sources":["src/components/salla-app-install-alert/salla-app-install-alert.scss?tag=salla-app-install-alert","src/components/salla-app-install-alert/salla-app-install-alert.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, h, State, Element, Host } from '@stencil/core';\nimport { AppInstallAlertData } from './interfaces';\n\n@Component({\n tag: 'salla-app-install-alert',\n styleUrl: 'salla-app-install-alert.scss',\n})\nexport class SallaAppInstallAlert {\n\n alertDelay: NodeJS.Timeout = null\n\n connectedCallback() {\n salla.onReady(() => {\n this.data = salla.config.get('store.app_install_prompt')\n\n if (!this.isMobileOrTabletDevice()) return;\n\n if (!this.data) return salla.logger.error('Failed to retrieve salla-app-install-alert config')\n\n this.ctaLink = salla.url.get('app');\n this.alertDelay = setTimeout(() => (this.open = true), 3000);\n });\n }\n\n disconnectedCallback() {\n clearTimeout(this.alertDelay)\n }\n\n\n\n\n @State() data: AppInstallAlertData | null = salla.config.get('store.app_install_prompt');\n @State() ctaLink: string;\n @State() open: boolean = false;\n @State() closing: boolean = false;\n @Element() private host: HTMLElement;\n\n\n /**\n * Check if the website opens from mobile or tablet devices only (android/ios).\n *\n * @param {number} screen the width of the biggest screen to be checked\n * @returns {boolean} true if it is mobile or tablet else false\n */\n private isMobileOrTabletDevice(screen = 1024): boolean {\n const screenWidth = window.innerWidth <= screen;\n const userAgentCheck = /Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);\n const hasTouch =\n 'ontouchstart' in window ||\n 'ontouchend' in document ||\n navigator.maxTouchPoints > 0;\n\n return userAgentCheck && screenWidth && hasTouch;\n }\n\n closeAlert() {\n salla.storage.set('app_install_prompt_disabled', true);\n // handle closing animation first, then close the banner\n this.closing = true;\n this.host.addEventListener(\n 'animationend',\n () => {\n this.closing = false\n this.open = false;\n },\n { once: true }\n );\n }\n\n\n render() {\n return this.data ? (\n <Host class={`s-app-install-alert-wrapper ${this.open ? 'open' : ''} ${this.closing ? 'closing' : ''}`} position={this.data.position}>\n <div>\n <img src={this.data.icon} width=\"58\" height=\"58\" alt={`${salla.config.get('store.name')}`} />\n </div>\n <div class=\"s-app-install-alert-content\">\n <h2 class=\"s-app-install-alert-title\">{this.data.title}</h2>\n <p class=\"s-app-install-alert-sub-title\">\n {this.data.sub_title} {\" \"}\n <a href={this.ctaLink} target=\"_blank\" aria-label=\"download app\" class=\"s-app-install-alert-cta\">\n {salla.lang.getWithDefault('blocks.footer.download_app_now', 'حمله الآن')}\n </a>\n </p>\n </div>\n <button class=\"s-app-install-alert-cancel-button\" aria-label=\"close alert\" onClick={() => this.closeAlert()}>\n <i class=\"sicon-cancel\"></i>\n </button>\n </Host>\n ) : null\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAAA,MAAM,uBAAuB,GAAG,sBAAsB;;YCOzC,oBAAoB,sCAAA,MAAA;MAJjC,IAAA,WAAA,CAAA,OAAA,EAAA;;MAME,QAAA,IAAU,CAAA,UAAA,GAAmB,IAAI;cAsBxB,IAAI,CAAA,IAAA,GAA+B,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;MAE/E,QAAA,IAAI,CAAA,IAAA,GAAY,KAAK;MACrB,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK;MAyDlC;UAhFC,iBAAiB,GAAA;MACf,QAAA,KAAK,CAAC,OAAO,CAAC,MAAK;kBACjB,IAAI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AAA,CACrB,CACJ,IACL,IAAI;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,c as i,h as t,H as e,g as l}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,c as i,h as t,H as e,g as l}from"./p-Hw2jlaNN.js";import{M as r}from"./p-DmgxDvXL.js";var h=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n`;const o="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";const a=class{constructor(t){s(this,t);this.verified=i(this,"verified");this.translationLoaded=false;this.display="modal";this.type="mobile";this.autoReload=true;this.supportWebAuth=true;this.resendAfter=30;this.isProfileVerify=false;salla.lang.onLoaded((()=>{var s;this.translationLoaded=true;this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type);(s=this.modal)===null||s===void 0?void 0:s.setTitle(this.title)}));if(this.display=="inline"){this.modal={open:()=>"",close:()=>"",setTitle:()=>""};return}salla.event.on("profile::verification",(s=>{var i;let t=Array.isArray(s)?s[0]:s;this.isProfileVerify=true;this.open(t);this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type);(i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title)}));salla.event.on("modalClosed",(()=>{this.resendAfter=0;this.timer.innerHTML="30 : 00"}))}splitNumber(s){this.resetError();let i=s.data||s.target.value;if(!i)return;if(i.length===1)return;this.modifyNext(s.target,i)}modifyNext(s,i){s.value=i[0];i=i.substring(1);if(s.nextElementSibling&&i.length){this.modifyNext(s.nextElementSibling,i)}else if(!s.nextElementSibling&&i.length===0){s.focus()}else if(s.nextElementSibling&&i.length===0){s.nextElementSibling.focus()}}checkAllInputs(){let s=true;for(let i=0;i<this.otpInputs.length;i++){if(this.otpInputs[i].value===""){s=false}}return s}handleKeyUp(s){var i,t,e,l;this.resetError();if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(s.key)){return}let r=s.keyCode||s.charCode;if(s.target.value){(i=s.target.nextElementSibling)===null||i===void 0?void 0:i.focus();(t=s.target.nextElementSibling)===null||t===void 0?void 0:t.select()}else if([8,46].includes(r)){(e=s.target.previousElementSibling)===null||e===void 0?void 0:e.focus();(l=s.target.previousElementSibling)===null||l===void 0?void 0:l.select()}if(s.target.value.length>1){this.splitNumber(s)}}handlePaste(s){this.resetError();const i=salla.helpers.number(s.clipboardData.getData("text"))||"";let t=i.replace(/[^0-9]/g,"");t=t.substring(0,this.otpInputs.length);this.otpInputs.forEach((s=>s.value=""));this.modifyNext(this.otpInputs[0],t)}handleInput(s){this.resetError();salla.helpers.inputDigitsOnly(s.target);if(this.checkAllInputs()){setTimeout((()=>{this.toggleOTPSubmit()}),100)}}resetError(){this.hasError=false;this.errorMessage=""}handleFocus(s){var i;if(s.target===this.firstOtpInput)return;if(((i=this.firstOtpInput)===null||i===void 0?void 0:i.value)==""){this.firstOtpInput.focus()}if(s.target.previousElementSibling.value==""){s.target.previousElementSibling.focus()}}async getCode(){return this.code.value}async open(s){var i,t;this.data=s;this.data.type=this.data.type||this.type;this.type=this.data.type;this.resendTimer();this.otpInputs=this.body.querySelectorAll(".s-verify-input");this.firstOtpInput=this.body.querySelector("#otp-1");this.reset();this.resetError();this.display=="modal"&&((i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title));this.modal.open();(t=this.firstOtpInput)===null||t===void 0?void 0:t.addEventListener("input",(s=>this.splitNumber(s)));setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let s=[];this.otpInputs.forEach((i=>i.value&&s.push(i.value)));this.code.value=s.join("");if(s.length===4){this.btn.disable();this.btn.click();return}this.btn.enable()}reset(){this.otpInputs.forEach((s=>s.value=""));this.code.value="";this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block";this.resend.style.display="none";this.resendAfter=30;let s=setInterval((()=>{if(this.resendAfter<=0){clearInterval(s);this.resend.style.display="block";this.resendMessage.style.display="none"}else{this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`;this.resendAfter--}}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value=""));this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4){this.otpInputs[this.code.value.length].focus();salla.log("Trying to submit without 4 digits!");return}let s=Object.assign({code:this.code.value},this.data);return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,this.supportWebAuth))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((s=>{var i,t,e;this.hasError=true;this.errorMessage=((e=(t=(i=s.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||e===void 0?void 0:e.message)||salla.lang.get("common.errors.error_occurred");if(!s.response){console.log("Unexpected error",s)}else{salla.logger.error(s)}this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return this.display=="inline"?t(e,null,this.myBody()):t("salla-modal",{width:"xs",class:"s-verify",ref:s=>this.modal=s,"modal-title":this.title},t("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:this.type=="mobile"?h:r}),this.myBody())}myBody(){return t("div",{class:"s-verify-body",ref:s=>this.body=s},t("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),t("slot",{name:"mobile"}),t("slot",{name:"email"}),t("input",{type:"hidden",name:"code",maxlength:"4",required:true,ref:s=>this.code=s}),t("div",{class:{"s-verify-codes":true,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((s=>t("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:`otp-${s}`,class:{"s-verify-input":true,"s-has-error":this.hasError},onInput:s=>this.handleInput(s),onPaste:s=>this.handlePaste(s),onKeyUp:s=>this.handleKeyUp(s),onFocus:s=>this.handleFocus(s),required:true})))),this.hasError&&this.errorMessage?t("span",{class:"s-verify-error-message"},this.errorMessage):"",t("div",{slot:"footer",class:"s-verify-footer"},t("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:true,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),t("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),t("b",{class:"s-verify-timer",ref:s=>this.timer=s})),t("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),t("slot",{name:"after-footer"}))}get host(){return l(this)}};a.style=o;export{a as salla_verify};
|
|
5
|
+
//# sourceMappingURL=p-a8cf78c0.entry.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as s,h as t,F as e,H as a}from"./p-Hw2jlaNN.js";const r="";const l=class{constructor(t){s(this,t)}parseOrderDetailsData(s){this.parsedOrderDetailsData=s;if(typeof this.orderDetails==="string"){this.parsedOrderDetailsData=JSON.parse(s)}else{this.parsedOrderDetailsData=s}}componentWillLoad(){this.parseOrderDetailsData(this.orderDetails);console.log("Parent componentWillLoad - parsedOrderDetailsData:",this.parsedOrderDetailsData)}renderOrderDetailsContent(){if(!this.parsedOrderDetailsData){console.warn("No parsedOrderDetailsData available");return null}return[this.parsedOrderDetailsData.options&&this.parsedOrderDetailsData.options.length>0&&t("salla-order-details-options",{options:this.parsedOrderDetailsData.options}),this.parsedOrderDetailsData.sub_products&&this.parsedOrderDetailsData.sub_products.length>0&&t(e,null,t("h2",{class:"s-order-details-bundle-title"},salla.lang.get("pages.orders.sub_products")),t("div",{class:"s-order-details-bundle-content"},this.parsedOrderDetailsData.sub_products.map((s=>t("salla-order-details-multiple-bundle-product",{key:s===null||s===void 0?void 0:s.id,productDetails:s})))))]}render(){return t(a,{key:"d76fce6a442aca11f3544a9f101ea4245a9317db",class:"s-order-details-wrapper"},this.renderOrderDetailsContent())}static get watchers(){return{orderDetails:["parseOrderDetailsData"]}}};l.style=r;export{l as salla_order_details};
|
|
5
|
+
//# sourceMappingURL=p-a9c9a4ac.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sallaOrderDetailsCss","SallaOrderDetails","parseOrderDetailsData","newValue","this","parsedOrderDetailsData","orderDetails","JSON","parse","componentWillLoad","console","log","renderOrderDetailsContent","warn","options","length","h","sub_products","Fragment","class","salla","lang","get","map","product","key","id","productDetails","render","Host"],"sources":["src/components/salla-order-details/salla-order-details.scss?tag=salla-order-details","src/components/salla-order-details/salla-order-details.tsx"],"sourcesContent":[null,"import { Component, Host, h, Prop, State, Watch, Fragment } from '@stencil/core';\nimport { OrderProduct } from './interfaces';\n\n/**\n * @salla/ui-components\n * The `salla-order-details` component renders a collapsible summary for an order product with optional options list.\n * It uses the salla-accordion component to provide collapsible functionality.\n */\n@Component({\n tag: 'salla-order-details',\n styleUrl: 'salla-order-details.scss',\n})\nexport class SallaOrderDetails {\n @Prop() orderDetails: string | OrderProduct;\n\n @State() parsedOrderDetailsData: OrderProduct;\n\n @Watch('orderDetails')\n private parseOrderDetailsData(newValue: string | OrderProduct) {\n this.parsedOrderDetailsData = newValue as OrderProduct;\n if (typeof this.orderDetails === 'string') {\n this.parsedOrderDetailsData = JSON.parse(newValue as string);\n } else {\n this.parsedOrderDetailsData = newValue as OrderProduct;\n }\n }\n\n componentWillLoad() {\n this.parseOrderDetailsData(this.orderDetails);\n console.log('Parent componentWillLoad - parsedOrderDetailsData:', this.parsedOrderDetailsData);\n }\n\n private renderOrderDetailsContent() {\n // Check if we have parsed data\n if (!this.parsedOrderDetailsData) {\n console.warn('No parsedOrderDetailsData available');\n return null;\n }\n\n return [\n /* Product Options */\n this.parsedOrderDetailsData.options && this.parsedOrderDetailsData.options.length > 0 && (\n <salla-order-details-options options={this.parsedOrderDetailsData.options} />\n ),\n\n /* Bundle Subproducts */\n this.parsedOrderDetailsData.sub_products &&\n this.parsedOrderDetailsData.sub_products.length > 0 && (\n <Fragment>\n <h2 class=\"s-order-details-bundle-title\">\n {salla.lang.get('pages.orders.sub_products')}\n </h2>\n <div class=\"s-order-details-bundle-content\">\n {this.parsedOrderDetailsData.sub_products.map(product => (\n <salla-order-details-multiple-bundle-product\n key={product?.id}\n productDetails={product}\n />\n ))}\n </div>\n </Fragment>\n ),\n ];\n }\n\n render() {\n return <Host class=\"s-order-details-wrapper\">{this.renderOrderDetailsContent()}</Host>;\n }\n}\n"],"mappings":";;;yDAAA,MAAMA,EAAuB,G,MCYhBC,EAAiB,M,yBAMpB,qBAAAC,CAAsBC,GAC5BC,KAAKC,uBAAyBF,EAC9B,UAAWC,KAAKE,eAAiB,SAAU,CACzCF,KAAKC,uBAAyBE,KAAKC,MAAML,E,KACpC,CACLC,KAAKC,uBAAyBF,C,EAIlC,iBAAAM,GACEL,KAAKF,sBAAsBE,KAAKE,cAChCI,QAAQC,IAAI,qDAAsDP,KAAKC,uB,CAGjE,yBAAAO,GAEN,IAAKR,KAAKC,uBAAwB,CAChCK,QAAQG,KAAK,uCACb,OAAO,I,CAGT,MAAO,CAELT,KAAKC,uBAAuBS,SAAWV,KAAKC,uBAAuBS,QAAQC,OAAS,GAClFC,EAAA,+BAA6BF,QAASV,KAAKC,uBAAuBS,UAIpEV,KAAKC,uBAAuBY,cAC1Bb,KAAKC,uBAAuBY,aAAaF,OAAS,GAChDC,EAACE,EAAQ,KACPF,EAAA,MAAIG,MAAM,gCACPC,MAAMC,KAAKC,IAAI,8BAElBN,EAAA,OAAKG,MAAM,kCACRf,KAAKC,uBAAuBY,aAAaM,KAAIC,GAC5CR,EAAA,+CACES,IAAKD,IAAA,MAAAA,SAAA,SAAAA,EAASE,GACdC,eAAgBH,Q,CAShC,MAAAI,GACE,OAAOZ,EAACa,EAAK,CAAAJ,IAAA,2CAAAN,MAAM,2BAA2Bf,KAAKQ,4B","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,H as a,g as i}from"./p-Hw2jlaNN.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{var s,t,a;if(typeof this.exclude==="string"){try{this.exclude=JSON.parse(this.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude);this.exclude=[]}}this.placeholderImage=salla.url.cdn(`images/s-empty.png`);this.paymentSlot=((s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||`<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="${this.placeholderImage}" data-src="{image}" alt={payment} /><li>`;this.sbcSlot=((t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.innerHTML)||`<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="${this.placeholderImage}" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>`;this.codSlot=((a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.innerHTML)||`<li class="s-payments-list-item"> <img width="100%" height="100%" src="${this.placeholderImage}" data-src={image} class="lazy" alt="COD"/><li>`;this.payments=salla.config.get("store.settings.payments")}))}render(){const s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");const i=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return t(a,{key:"a1a26ba03aa60491071f0e63bac40de3ad91bce6",class:"s-payments-list-wrap"},t("ul",{key:"d31ca162e83aade956f45d8f517029942a748646",class:"s-payments-list"},s&&t("li",{key:"552e3e57345d01ab33bfd20094cbcf8f702c6efa",class:"s-payments-list-item"},t("img",{key:"04eb9c9a1950edc9ea3c2e218fbe6c5c21d65f6a",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn(`images/made-in-ksa.svg`,58,58),alt:"made in KSA certified"})),this.payments.map((s=>s=="cod"?t("div",{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/cod_mini.png`,58,58))}):t("div",{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/${s}_mini.png`,58,58)).replace(/\{payment\}/g,s)}))),i&&t("div",{key:"5f69b3c936edf8039006d6ecd73e3c44b74b9167",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn(`images/sbc.png`,58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${i}`)})))}componentDidLoad(){var s;(s=document.lazyLoadInstance)===null||s===void 0?void 0:s.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((s=>{s.addEventListener("load",(()=>{s.setAttribute("width","100%");s.setAttribute("height","100%")}))}))}componentDidRender(){var s,t,a;this.host.querySelectorAll("#payment-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#sbc-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#cod-slot").forEach((s=>s.replaceWith(s.firstChild)));(s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.remove();(t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.remove();(a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.remove()}get host(){return i(this)}};l.style=e;export{l as salla_payments};
|
|
5
|
+
//# sourceMappingURL=p-b13ef44c.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,g as o}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as e,g as o}from"./p-Hw2jlaNN.js";const i='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;-webkit-transform:translateX(-39%);transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;-webkit-transition:opacity 0.3s;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:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){-webkit-transform:translateX(-72%);transform:translateX(-72%)}';const s=class{constructor(e){t(this,e);this.show=false;this.targetElement=null}handleMouseOver(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=true}}handleMouseOut(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=false}}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){return e("div",{key:"e2454dd8d3533e19b93b796ca427d825c6576ff0",class:"s-tooltip-container"},e("slot",{key:"08ae103831491e760b47c848c161f909341c68ee"}),this.show&&e("div",{key:"bab2b3214ff45377b5d971f13f32c691ec090324",class:"s-tooltip-item"},this.text))}get el(){return o(this)}};s.style=i;export{s as salla_tooltip};
|
|
5
|
+
//# sourceMappingURL=p-b492c336.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t}from"./p-Hw2jlaNN.js";import{I as a}from"./p-uTyAzPSy.js";var e=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-archive</title>\n<path d="M17.333 16h-5.333c-0.737 0-1.333 0.597-1.333 1.333v2.667c0 2.205 1.795 4 4 4s4-1.795 4-4v-2.667c0-0.736-0.596-1.333-1.333-1.333zM16 20c0 0.735-0.597 1.333-1.333 1.333s-1.333-0.599-1.333-1.333v-1.333h2.667zM17.333 12h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28.943 8.391l-8-8c-0.249-0.251-0.588-0.391-0.943-0.391h-13.333c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-18.667c0-0.353-0.14-0.693-0.391-0.943zM26.667 28c0 0.735-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h12.781l7.219 7.219zM17.333 8h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM17.333 4h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333z"></path>\n</svg>\n`;var c=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>download</title>\n<path d="M15.056 20.941c0.123 0.124 0.271 0.221 0.435 0.289 0.163 0.067 0.336 0.103 0.509 0.103s0.347-0.036 0.509-0.103c0.164-0.068 0.311-0.165 0.435-0.289l5.332-5.332c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-3.057 3.057v-12.781c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v12.781l-3.057-3.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885zM25.333 26.667h-18.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h18.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n`;var i=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-stroke</title>\n<path d="M6.667 18.667h-2.667c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333v2.667c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-2.667c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h2.667c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM28 10.667h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.597 1.333-1.333 1.333h-13.333c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333z"></path>\n</svg>\n`;var l=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>debit-card-back</title>\n<path d="M30 28h-28c-1.105 0-2-0.895-2-2v0-18c0-1.105 0.895-2 2-2v0h28c1.105 0 2 0.895 2 2v0 18c0 1.105-0.895 2-2 2v0zM30 26v0zM2 8v18h28v-18zM31 14h-30c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h30c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM11 22h-6c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM24 24c-2.209 0-4-1.791-4-4s1.791-4 4-4c2.209 0 4 1.791 4 4v0c0 2.209-1.791 4-4 4v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2v0c0-1.105-0.895-2-2-2v0zM20 24c-2.209 0-4-1.791-4-4s1.791-4 4-4v0c0.002 0 0.005 0 0.007 0 1.032 0 1.972 0.398 2.673 1.048l-0.003-0.002c0.191 0.183 0.311 0.439 0.311 0.724 0 0.552-0.448 1-1 1-0.257 0-0.492-0.097-0.669-0.257l0.001 0.001c-0.345-0.319-0.807-0.514-1.315-0.514-0.002 0-0.003 0-0.005 0h0c-1.105 0-2 0.895-2 2s0.895 2 2 2v0c0.002 0 0.004 0 0.007 0 0.508 0 0.971-0.195 1.317-0.515l-0.001 0.001c0.179-0.171 0.422-0.276 0.689-0.276 0.552 0 1 0.448 1 1 0 0.295-0.128 0.56-0.331 0.743l-0.001 0.001c-0.699 0.648-1.638 1.046-2.671 1.046-0.003 0-0.007 0-0.010 0h0.001z"></path>\n</svg>\n`;const n=":host{display:block}";const h=class{constructor(t){s(this,t);this.codeCopied=null;this.noItemFound=true;this.order_items=[];this.isDigitalCard=s=>s.product.type==="codes";this.isDigitalProduct=s=>s.product.type==="digital"}async componentWillLoad(){salla.lang.onLoaded((()=>{this.codes_text=salla.lang.get("pages.thank_you.codes");this.copy_text=salla.lang.get("common.elements.copy");this.files_text=salla.lang.get("pages.thank_you.files");this.download_text=salla.lang.get("pages.thank_you.download")}));return await this.getOrderItems()}copyToClipboardHandler(s){if(navigator&&"clipboard"in navigator){try{navigator.clipboard.writeText(s).then((()=>{this.codeCopied=s;this.copyCodeButtonTimeout=setTimeout((()=>{this.codeCopied=null}),3e3)}))}catch(s){salla.loggers.error("copy functionality is not supported by the browser")}}}async getOrderItems(){const s=this.orderId||salla.config.get("page.id");const t="Failed to fetch order items";if(!s){salla.logger.error(t);throw new Error(t)}try{const{data:{items:t=[]}}=await salla.api.request(`orders/${s}`);const a=t.some((s=>this.isDigitalCard(s)||this.isDigitalProduct(s)));if(a){this.order_items=t;this.noItemFound=false}}catch(s){salla.logger.error(t)}}disconnectedCallback(){this.copyCodeButtonTimeout&&clearTimeout(this.copyCodeButtonTimeout)}render(){return t("ul",{key:"14eed8e219bcde5b32d5fddb95bb8727e980c56c",class:"s-order-summary-wrapper"},this.noItemFound?t("salla-placeholder",{alignment:"center"},t("span",{slot:"title"})):this.order_items.map((s=>this.isDigitalCard(s)?t("li",{key:s.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.codes_text," (",s.name,")"),s.codes.map((s=>t("div",{key:s.code,class:"s-order-summary-code-item-wrapper"},t("p",null,t("span",{innerHTML:l}),t("span",null,s.code)),t("salla-button",{class:`s-order-summary-item-copy-button ${this.codeCopied===s.code?"copied":""}`,onClick:()=>this.copyToClipboardHandler(s.code),shape:"link"},t("span",{innerHTML:this.codeCopied===s.code?a:i}),t("span",null,this.copy_text)))))):this.isDigitalProduct(s)?t("li",{key:s.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.files_text," (",s.name,")"),t("ul",null,s.files.map((s=>t("li",{class:"s-order-summary-digital-item-wrapper"},t("div",null,t("span",{innerHTML:e}),t("span",null,s.name)),t("a",{href:s.url,target:"_blank",class:"s-order-summary-item-download"},t("span",{innerHTML:c}),t("span",null,this.download_text))))))):null)))}};h.style=n;export{h as salla_order_summary};
|
|
5
|
+
//# sourceMappingURL=p-b51bb42b.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as s,h as e,H as i,g as l}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,c as s,h as e,H as i,g as l}from"./p-Hw2jlaNN.js";import{F as a}from"./p-DL4h2bc3.js";import{H as r}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const o=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";const n=class{constructor(e){t(this,e);this.changed=s(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(()=>this.host.style.display="none"));salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply");this.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=a.VALUES;let{max:s,min:e}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=e||t<=s))}if(this.filtersData.variants&&t.type==a.VARIANTS){s.variants=this.filtersData.variants}if(this.filtersData[t.key]&&t.type!==a.VARIANTS){s[t.key]=this.filtersData[t.key]}let e=new URLSearchParams(window.location.search);let i=false;for(let t of e.keys()){if(t.includes("filters")){i=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(s).length==0&&!i){let t=window.location.href;let e=salla.config.get("page.id");let i=t.indexOf("?")!==-1?"&":"?";let l=t+i+"filters[category_id]="+e;s.category_id=e;window.history.pushState({path:l},"",l)}return t}));this.filtersData=s;this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady){return}let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{var s;if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries()){if(s.startsWith("filters")){t.searchParams.delete(s)}}let s=this.encodeFilters(this.filtersData);let e=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");if(e){t.search=t.search.split("&filters")[0]+"&"+s}else{t.search=`?${s}`}window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);(s=t.searchParams)===null||s===void 0?void 0:s.delete("filters");window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData);this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const e=[];for(const i in t){if(Object.prototype.hasOwnProperty.call(t,i)){const l=t[i];const a=s?`${s}[${i}]`:i;if(Array.isArray(l)){for(let t=0;t<l.length;t++){e.push(`${a}[${t}]=${l[t]}`)}}else if(typeof l==="object"&&l!==null){e.push(this.encodeFilters(l,a))}else{let t=`${a}=${l}`;e.push(t)}}}return e.join("&")}async resetFilters(){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((t=>t.reset&&t.reset()));salla.event.emit("salla-filters::reset");return this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search);const s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&");const e=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",e)}handleOptionChange(t,s,e){if(s.type===a.RANGE){this.filtersData[s.key]=e}let i=t.target.checked;if(s.type===a.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[s.key]=e);i||delete this.filtersData.variants[s.key]}else if(t.target.type=="radio"){i&&(this.filtersData[s.key]=e);i||delete this.filtersData[s.key]}else if(t.target.type=="checkbox"){this.filtersData[s.key]=this.filtersData[s.key]||[];if(i){this.filtersData[s.key].push(e)}this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=e))}this.applyFilters()}render(){var t,s;return e(i,{key:"54a625522588215230f1eb5a3ca94b8280b18040"},(t=this.filters)===null||t===void 0?void 0:t.map((t=>e("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:e}})=>{this.handleOptionChange(t,s,e)}}))),((s=this.filters)===null||s===void 0?void 0:s.length)?e("div",{class:"s-filters-footer"},e("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=true}get host(){return l(this)}};n.style=o;export{n as salla_filters};
|
|
5
|
+
//# sourceMappingURL=p-bb1a0f6b.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as t,H as s,g as e}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as a,h as t,H as s,g as e}from"./p-Hw2jlaNN.js";const i="";const l=class{constructor(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(a){salla.log("Bad json passed via entityId prop")}}}getValue(a){if(a.type==="file"){return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`}if(a.type==="url"){return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`}if(a.type==="date"){const t=new Date(a.value);const s=String(t.getDate()).padStart(2,"0");const e=String(t.getMonth()+1).padStart(2,"0");const i=t.getFullYear();const l=`${s}/${e}/${i}`;return l}return a.value}async componentWillLoad(){var a,t;await salla.onReady();if(!((a=salla.config.get("store.features"))===null||a===void 0?void 0:a.includes("custom-fields"))){return salla.logger.error("feature custom-fields is not activated")}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return salla.logger.error("can't render salla-metadata without enity-id prop!")}await salla.lang.onLoaded();this.download=salla.lang.get("pages.thank_you.download");const s=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=(t=s.data[0])===null||t===void 0?void 0:t.sections}render(){if(!this.specs.length){return}return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};l.style=i;export{l as salla_metadata};
|
|
5
|
+
//# sourceMappingURL=p-bca6b6b2.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as i,h as o,H as s,g as n}from"./p-D4D34Ujk.js";import{I as e}from"./p-uTyAzPSy.js";import{C as a}from"./p-C6jIkM-X.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));var d=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const p="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=(t,i,o)=>{if(i==="custom"&&o==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i==="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}const i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}async setOptionsData(t){var i,o;this.optionsData=t;const s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={};const i=this.host.getElementSallaData();i.forEach(((i,o)=>{if(o.startsWith("options[")){t[o.replace("options[","").replace("]","")]=i}}));return t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!o.classList.contains("s-product-options-option-error")){o.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){const t=this.host.querySelector(".s-product-options-option-error");if(t===o){this.scrollToElement(o)}}}scrollToElement(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}}changedHandler(t,i,o=true){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const o=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=o}if(i.type==="country"){this.handleCountryOptionChange(t,s.detail)}const n=t.target.closest(".s-product-options-option");if(t.target.value||(i.type===l.FILE||i.type===l.IMAGE)&&t.type==="added"||i.type===l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{n.classList.remove("s-product-options-option-error")}),200)}if(i.type===l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);const e=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===l.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>{var i;return t.option_id===s.option.id&&(t===null||t===void 0?void 0:t.id)===((i=s.detail)===null||i===void 0?void 0:i.id)}));if(t>-1){this.selectedOptions.splice(t,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}else{if(!s.detail||Object.keys(s.detail).length===0){if(e>-1){this.selectedOptions.splice(e,1)}}else{if(e>-1){this.selectedOptions[e]=Object.assign(Object.assign({},s.detail),{option_id:s.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}}this.optionsData=this.optionsData.map((t=>{if(t.id===s.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((t=>{var i,o;return Object.assign(Object.assign({},t),{is_selected:s.option.type===l.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number((i=s.detail)===null||i===void 0?void 0:i.id),value:(o=s.detail)===null||o===void 0?void 0:o.value})}))})}return t}));if(o){this.changed.emit(s);salla.event.emit("product-options::change",s)}}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i==="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===l.COUNTRY){return this.countryOption(t)}if(t.type===l.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!i)throw new Error("product-options:: No digital card options found");const o=Object.keys(t.skus_availability).filter((i=>t.skus_availability[i]===false));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>o.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;const o=this.host.querySelector("input[data-code-value]:checked");if(o)o.checked=false;const s=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!s)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected));const o=t.details.find((t=>!!t.is_default))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return i||o}async componentWillLoad(){if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}const t=this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart");if(t){const t=this.optionsData.find((t=>t.type==="country"));const i=t&&this.getSelectedDigitalCardOptions(t);if(i){this.getAvailableDigitalCardSKUs(i)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");await salla.onReady();document.addEventListener("paste",this.handlePaste.bind(this));const i=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return i?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}handlePaste(t){var i;const o=t.target;if(!Salla.config.get("store.settings.content_copyright")||!Salla.helpers.hasApplePay()||!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)||!o.classList.contains("s-form-control")||!o.name.startsWith("options[")){return}t.preventDefault();const s=((i=t.clipboardData)===null||i===void 0?void 0:i.getData("text"))||"";const n=o.selectionStart;const e=o.selectionEnd;const a=o.value.slice(0,n)+s+o.value.slice(e);o.value=a;o.setSelectionRange(n+s.length,n+s.length)}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===l.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({key:t.id,class:`s-product-options-option-container${t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name==="splitter"?this.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":t.type===l.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:`options[${t.id}]`,class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)||t.type===l.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}generateUniqueKey(t){return this.uniqueKey?`${t}-${this.uniqueKey}`:t}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const o=i.details.filter((t=>t.is_selected));const s=o.map((t=>Object.assign(Object.assign({},t),{option_id:i.id})));return t.concat(s)}),[])}triggerProductFormSelectionEvents(){const t=t=>["change","input"].forEach((i=>t.dispatchEvent(new window.Event(i,{bubbles:true}))));const i=this.host.closest("form");if(i){t(i)}else{const i=new MutationObserver((()=>{const o=this.host.closest("form");if(o){t(o);i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true})}}componentDidLoad(){var t,i;if(salla.url.is_page("product.single")){this.triggerProductFormSelectionEvents()}if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0&&!this.optionsData.some((t=>t.type===l.DONATION))){return}const o=(i=this.optionsData.find((t=>t.type===l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:t=>this.handleDonationOptions(t,i,"option")}),o("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},o("span",{innerHTML:salla.money(i.name)}))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){var s;return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((s=i.accept)===null||s===void 0?void 0:s.split(",").every((t=>t.includes("image"))))?a:d}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){var s;let n;if(o&&o===l.COLOR){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,false)}) </p>`:"")}if(!n){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,false)})`:"")}return n.replace("<i class=sicon-sar></i>",((s=salla.config.currency())===null||s===void 0?void 0:s.symbol)||"ر.س")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}const o=this.selectedOptions.filter((i=>i.id===t.id)).length;if(o&&this.selectedOptions.length===1){return false}if(o){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,i,s,n,e,a){const l=this.generateUniqueKey(`${t}-${s.id}-${i.id}`);const r=this.isOptionDetailOut(i);return o("label",{class:{"s-product-options-disabled":r}},o("input",{id:l,type:t,name:e,value:i.id,disabled:r,required:n,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,i,o,s=false){const n=t==="radio"?`options[${i.id}]`:`options[${i.id}][]`;return i===null||i===void 0?void 0:i.details.map((e=>this.renderInput(t,e,i,o,n,s)))}renderSelect(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,s,true))}singleOption(t){var i,o;const s=((o=(i=this.optionConfig)===null||i===void 0?void 0:i["single-option"])===null||o===void 0?void 0:o.type)==="button";const n=!t.visibility_condition&&t.required;return s?this.renderButtonStyle("radio",t,n):this.renderSelect(t)}multipleOptions(t){var i,s;const n=((s=(i=this.optionConfig)===null||i===void 0?void 0:i["multiple-option"])===null||s===void 0?void 0:s.type)==="button";const e=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return n?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}digitalCardValuesOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{var s,n,e;const a=String(i.id);return o("label",{htmlFor:this.generateUniqueKey(a.toString()),key:a,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,id:this.generateUniqueKey(a.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t)},!this.ignoreDefaultCardValue?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("span",null,i.name," ",(e=(n=salla.config)===null||n===void 0?void 0:n.currency())===null||e===void 0?void 0:e.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>{var s;return o("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`}),o("span",null,i.name))})))}get host(){return n(this)}};c.style=p;export{c as salla_product_options};
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,c as i,h as o,H as s,g as n}from"./p-Hw2jlaNN.js";import{I as e}from"./p-uTyAzPSy.js";import{C as a}from"./p-C6jIkM-X.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));var d=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const p="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=(t,i,o)=>{if(i==="custom"&&o==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i==="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}const i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}async setOptionsData(t){var i,o;this.optionsData=t;const s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={};const i=this.host.getElementSallaData();i.forEach(((i,o)=>{if(o.startsWith("options[")){t[o.replace("options[","").replace("]","")]=i}}));return t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!o.classList.contains("s-product-options-option-error")){o.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){const t=this.host.querySelector(".s-product-options-option-error");if(t===o){this.scrollToElement(o)}}}scrollToElement(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}}changedHandler(t,i,o=true){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const o=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=o}if(i.type==="country"){this.handleCountryOptionChange(t,s.detail)}const n=t.target.closest(".s-product-options-option");if(t.target.value||(i.type===l.FILE||i.type===l.IMAGE)&&t.type==="added"||i.type===l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{n.classList.remove("s-product-options-option-error")}),200)}if(i.type===l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);const e=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===l.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>{var i;return t.option_id===s.option.id&&(t===null||t===void 0?void 0:t.id)===((i=s.detail)===null||i===void 0?void 0:i.id)}));if(t>-1){this.selectedOptions.splice(t,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}else{if(!s.detail||Object.keys(s.detail).length===0){if(e>-1){this.selectedOptions.splice(e,1)}}else{if(e>-1){this.selectedOptions[e]=Object.assign(Object.assign({},s.detail),{option_id:s.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}}this.optionsData=this.optionsData.map((t=>{if(t.id===s.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((t=>{var i,o;return Object.assign(Object.assign({},t),{is_selected:s.option.type===l.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number((i=s.detail)===null||i===void 0?void 0:i.id),value:(o=s.detail)===null||o===void 0?void 0:o.value})}))})}return t}));if(o){this.changed.emit(s);salla.event.emit("product-options::change",s)}}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i==="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===l.COUNTRY){return this.countryOption(t)}if(t.type===l.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!i)throw new Error("product-options:: No digital card options found");const o=Object.keys(t.skus_availability).filter((i=>t.skus_availability[i]===false));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>o.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;const o=this.host.querySelector("input[data-code-value]:checked");if(o)o.checked=false;const s=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!s)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected));const o=t.details.find((t=>!!t.is_default))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return i||o}async componentWillLoad(){if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}const t=this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart");if(t){const t=this.optionsData.find((t=>t.type==="country"));const i=t&&this.getSelectedDigitalCardOptions(t);if(i){this.getAvailableDigitalCardSKUs(i)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");await salla.onReady();document.addEventListener("paste",this.handlePaste.bind(this));const i=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return i?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}handlePaste(t){var i;const o=t.target;if(!Salla.config.get("store.settings.content_copyright")||!Salla.helpers.hasApplePay()||!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)||!o.classList.contains("s-form-control")||!o.name.startsWith("options[")){return}t.preventDefault();const s=((i=t.clipboardData)===null||i===void 0?void 0:i.getData("text"))||"";const n=o.selectionStart;const e=o.selectionEnd;const a=o.value.slice(0,n)+s+o.value.slice(e);o.value=a;o.setSelectionRange(n+s.length,n+s.length)}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===l.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({key:t.id,class:`s-product-options-option-container${t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name==="splitter"?this.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":t.type===l.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:`options[${t.id}]`,class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)||t.type===l.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}generateUniqueKey(t){return this.uniqueKey?`${t}-${this.uniqueKey}`:t}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const o=i.details.filter((t=>t.is_selected));const s=o.map((t=>Object.assign(Object.assign({},t),{option_id:i.id})));return t.concat(s)}),[])}triggerProductFormSelectionEvents(){const t=t=>["change","input"].forEach((i=>t.dispatchEvent(new window.Event(i,{bubbles:true}))));const i=this.host.closest("form");if(i){t(i)}else{const i=new MutationObserver((()=>{const o=this.host.closest("form");if(o){t(o);i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true})}}componentDidLoad(){var t,i;if(salla.url.is_page("product.single")){this.triggerProductFormSelectionEvents()}if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0&&!this.optionsData.some((t=>t.type===l.DONATION))){return}const o=(i=this.optionsData.find((t=>t.type===l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:t=>this.handleDonationOptions(t,i,"option")}),o("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},o("span",{innerHTML:salla.money(i.name)}))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){var s;return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((s=i.accept)===null||s===void 0?void 0:s.split(",").every((t=>t.includes("image"))))?a:d}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){var s;let n;if(o&&o===l.COLOR){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,false)}) </p>`:"")}if(!n){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,false)})`:"")}return n.replace("<i class=sicon-sar></i>",((s=salla.config.currency())===null||s===void 0?void 0:s.symbol)||"ر.س")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}const o=this.selectedOptions.filter((i=>i.id===t.id)).length;if(o&&this.selectedOptions.length===1){return false}if(o){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,i,s,n,e,a){const l=this.generateUniqueKey(`${t}-${s.id}-${i.id}`);const r=this.isOptionDetailOut(i);return o("label",{class:{"s-product-options-disabled":r}},o("input",{id:l,type:t,name:e,value:i.id,disabled:r,required:n,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,i,o,s=false){const n=t==="radio"?`options[${i.id}]`:`options[${i.id}][]`;return i===null||i===void 0?void 0:i.details.map((e=>this.renderInput(t,e,i,o,n,s)))}renderSelect(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,s,true))}singleOption(t){var i,o;const s=((o=(i=this.optionConfig)===null||i===void 0?void 0:i["single-option"])===null||o===void 0?void 0:o.type)==="button";const n=!t.visibility_condition&&t.required;return s?this.renderButtonStyle("radio",t,n):this.renderSelect(t)}multipleOptions(t){var i,s;const n=((s=(i=this.optionConfig)===null||i===void 0?void 0:i["multiple-option"])===null||s===void 0?void 0:s.type)==="button";const e=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return n?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}digitalCardValuesOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{var s,n,e;const a=String(i.id);return o("label",{htmlFor:this.generateUniqueKey(a.toString()),key:a,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,id:this.generateUniqueKey(a.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t)},!this.ignoreDefaultCardValue?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("span",null,i.name," ",(e=(n=salla.config)===null||n===void 0?void 0:n.currency())===null||e===void 0?void 0:e.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>{var s;return o("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`}),o("span",null,i.name))})))}get host(){return n(this)}};c.style=p;export{c as salla_product_options};
|
|
5
|
+
//# sourceMappingURL=p-bdca9c9c.entry.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as i,h as e}from"./p-Hw2jlaNN.js";const a="";const c=class{constructor(e){i(this,e)}render(){return e("a",{key:"15701825f2d0bb5b4bc21cf20114eae79af6b9aa",href:this.notification.url,class:{"s-notifications-item":true,"s-notifications-item-shadow":true,"s-notifications-item-read":!this.notification.is_new}},e("span",{key:"f87fba9d640a5c6cab81abe2d7537c2c89ee8857",class:"s-notifications-item-icon"},e("i",{key:"52590f17aacb20f87768a0dcc699e15303ca0e81",class:{"s-notifications-item-icon sicon-bell-ring":true,"s-notifications-item-icon-new":this.notification.is_new}})),e("div",{key:"489bdb71b1caaa202604facffe47ce6a6825355b",class:"s-notifications-item-content"},e("div",{key:"53a0e1e2f2f1be650567c0b1b9cc779779bc2cdc",class:"s-notifications-item-content-leading"},e("h4",{key:"b7f6fd64ad3212d0810a4eb7ab0a33d4294498c7"},this.notification.title),e("p",{key:"3774bc0d5c619d73f97466283d28ed5204e9abe4"},this.notification.sub_title)),e("span",{key:"25c70649e341c3e7c659dec48e986945088b4dfa",class:"s-notifications-item-content-trailing"},e("i",{key:"eaca7d3e4b8254b5eb8ea7e864c5afac8529f019",class:"sicon-time s-notifications-item-content-trailing-icon"}),e("span",{key:"de695990f5d2b6e5a131373d863f1d2e1e002613"},this.notification.date))))}};c.style=a;export{c as salla_notification_item};
|
|
5
|
+
//# sourceMappingURL=p-be2938da.entry.js.map
|