@salla.sa/twilight-components 2.14.220 → 2.14.222
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-2vTvVXxF.js → app-globals-DPedpk8u.js} +3 -3
- package/dist/cjs/{app-globals-2vTvVXxF.js.map → app-globals-DPedpk8u.js.map} +1 -1
- package/dist/cjs/{index-B04Y8RyW.js → index-BDn6fH9S.js} +8 -4
- package/dist/cjs/index-BDn6fH9S.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +16 -5
- package/dist/cjs/salla-conditional-offer.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-conditional-offer.entry.cjs.js.map +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- 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-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +338 -0
- package/dist/cjs/salla-tiered-offer.cjs.entry.js.map +1 -0
- package/dist/cjs/salla-tiered-offer.entry.cjs.js.map +1 -0
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +3 -3
- package/dist/collection/assets/svg/diamond-02.svg +4 -0
- package/dist/collection/assets/svg/gold.svg +6 -0
- package/dist/collection/assets/svg/star-rounded.svg +3 -0
- package/dist/collection/assets/svg/stars.svg +5 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-conditional-offer/salla-conditional-offer.js +15 -4
- package/dist/collection/components/salla-conditional-offer/salla-conditional-offer.js.map +1 -1
- package/dist/collection/components/salla-tiered-offer/constants.js +12 -0
- package/dist/collection/components/salla-tiered-offer/constants.js.map +1 -0
- package/dist/collection/components/salla-tiered-offer/interfaces.js +9 -0
- package/dist/collection/components/salla-tiered-offer/interfaces.js.map +1 -0
- package/dist/collection/components/salla-tiered-offer/salla-tiered-offer.css +26 -0
- package/dist/collection/components/salla-tiered-offer/salla-tiered-offer.js +288 -0
- package/dist/collection/components/salla-tiered-offer/salla-tiered-offer.js.map +1 -0
- package/dist/collection/components/salla-tiered-offer/utils.js +38 -0
- package/dist/collection/components/salla-tiered-offer/utils.js.map +1 -0
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-conditional-offer.js +15 -4
- package/dist/components/salla-conditional-offer.js.map +1 -1
- package/dist/components/salla-tiered-offer.d.ts +11 -0
- package/dist/components/salla-tiered-offer.js +371 -0
- package/dist/components/salla-tiered-offer.js.map +1 -0
- package/dist/esm/{app-globals-DRz9_J1y.js → app-globals-wLakfxcp.js} +3 -3
- package/dist/esm/{app-globals-DRz9_J1y.js.map → app-globals-wLakfxcp.js.map} +1 -1
- package/dist/esm/{index-L1Wml9tS.js → index-Dj2SrCy0.js} +8 -4
- package/dist/esm/index-Dj2SrCy0.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/salla-accordion-body.entry.js +1 -1
- package/dist/esm/salla-accordion-head.entry.js +1 -1
- package/dist/esm/salla-accordion.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +16 -5
- package/dist/esm/salla-conditional-offer.entry.js.map +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +336 -0
- package/dist/esm/salla-tiered-offer.entry.js.map +1 -0
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +4 -4
- package/dist/esm-es5/{app-globals-DRz9_J1y.js → app-globals-wLakfxcp.js} +2 -2
- package/dist/esm-es5/{app-globals-DRz9_J1y.js.map → app-globals-wLakfxcp.js.map} +1 -1
- package/dist/esm-es5/{index-L1Wml9tS.js → index-Dj2SrCy0.js} +3 -3
- package/dist/esm-es5/index-Dj2SrCy0.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
- package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
- package/dist/esm-es5/salla-accordion.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
- 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-conditional-offer.entry.js.map +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-summary.entry.js +2 -2
- package/dist/esm-es5/salla-orders.entry.js +2 -2
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- 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 +5 -0
- package/dist/esm-es5/salla-tiered-offer.entry.js.map +1 -0
- 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-2ac20d02.entry.js → p-00ce3e65.entry.js} +2 -2
- package/dist/twilight/{p-e00746e9.system.entry.js → p-02cc2225.system.entry.js} +2 -2
- package/dist/twilight/{p-0a469ba7.system.entry.js → p-0b16f452.system.entry.js} +3 -3
- package/dist/twilight/{p-3bdebf0d.entry.js → p-109136fc.entry.js} +2 -2
- package/dist/twilight/{p-fe959c9a.system.entry.js → p-12adb702.system.entry.js} +2 -2
- package/dist/twilight/{p-12a13525.entry.js → p-16dfee33.entry.js} +2 -2
- package/dist/twilight/{p-1ccd8b8e.entry.js → p-18537486.entry.js} +2 -2
- package/dist/twilight/{p-2cd40336.system.entry.js → p-1cbc4329.system.entry.js} +2 -2
- package/dist/twilight/{p-fbaa093c.entry.js → p-1cf1344e.entry.js} +2 -2
- package/dist/twilight/{p-a477ee76.system.entry.js → p-1d6100c4.system.entry.js} +2 -2
- package/dist/twilight/{p-75ec194e.system.entry.js → p-29567106.system.entry.js} +2 -2
- package/dist/twilight/{p-962cd525.entry.js → p-315c5fd3.entry.js} +2 -2
- package/dist/twilight/{p-184f98b1.entry.js → p-337fca82.entry.js} +2 -2
- package/dist/twilight/{p-5b8bf0e6.system.entry.js → p-3b02f780.system.entry.js} +2 -2
- package/dist/twilight/{p-Burnn1Qt.js → p-4drPVtGP.js} +2 -2
- package/dist/twilight/{p-Burnn1Qt.js.map → p-4drPVtGP.js.map} +1 -1
- package/dist/twilight/{p-7b7618d5.entry.js → p-5394cdeb.entry.js} +2 -2
- package/dist/twilight/{p-38526ba5.system.entry.js → p-55306475.system.entry.js} +2 -2
- package/dist/twilight/{p-b1ad7c75.entry.js → p-59763129.entry.js} +2 -2
- package/dist/twilight/{p-52156f6d.system.entry.js → p-5cd7ff6d.system.entry.js} +2 -2
- package/dist/twilight/{p-5c918974.entry.js → p-5e1f0ddf.entry.js} +2 -2
- package/dist/twilight/p-618eb3f2.system.entry.js +5 -0
- package/dist/twilight/p-618eb3f2.system.entry.js.map +1 -0
- package/dist/twilight/{p-f6c410c6.entry.js → p-67b54ac4.entry.js} +2 -2
- package/dist/twilight/p-67ebf87e.system.entry.js +5 -0
- package/dist/twilight/{p-76137ff1.entry.js → p-688dd765.entry.js} +2 -2
- package/dist/twilight/{p-284dae41.system.entry.js → p-6ec767ac.system.entry.js} +2 -2
- package/dist/twilight/{p-1af18eb4.entry.js → p-70e74f3c.entry.js} +2 -2
- package/dist/twilight/{p-d9c2f2b0.system.entry.js → p-7236a037.system.entry.js} +2 -2
- package/dist/twilight/{p-30c8b458.system.entry.js → p-7436f972.system.entry.js} +2 -2
- package/dist/twilight/{p-8d9a5dc0.entry.js → p-74647582.entry.js} +2 -2
- package/dist/twilight/{p-Cl_CHxGj.system.js.map → p-78vq_YNh.system.js.map} +1 -1
- package/dist/twilight/{p-c781f7a7.entry.js → p-8162a820.entry.js} +2 -2
- package/dist/twilight/p-864f1430.system.entry.js +5 -0
- package/dist/twilight/{p-47b6e06b.system.entry.js → p-865fc401.system.entry.js} +2 -2
- package/dist/twilight/{p-bfb9457b.system.entry.js → p-87206bd7.system.entry.js} +2 -2
- package/dist/twilight/p-8c08dafb.entry.js +5 -0
- package/dist/twilight/{p-0e4f26bb.system.entry.js → p-8ce2a142.system.entry.js} +2 -2
- package/dist/twilight/{p-60e6d7e6.system.entry.js → p-8d28bf6e.system.entry.js} +2 -2
- package/dist/twilight/{p-d07e552b.system.entry.js → p-97337c52.system.entry.js} +2 -2
- package/dist/twilight/{p-08258532.entry.js → p-9e54e404.entry.js} +2 -2
- package/dist/twilight/{p-C9IwdXDn.system.js.map → p-B-EmhPha.system.js.map} +1 -1
- package/dist/twilight/{p-B0ThVjj_.system.js.map → p-B6apPCKk.system.js.map} +1 -1
- package/dist/twilight/{p-D_Of4cjl.system.js.map → p-BC5TR2o4.system.js.map} +1 -1
- package/dist/twilight/{p-Bvg9GRmu.system.js.map → p-BFLzwSRe.system.js.map} +1 -1
- package/dist/twilight/{p-DFlc0grl.system.js.map → p-BIlNLy1w.system.js.map} +1 -1
- package/dist/twilight/{p-j7nJelMY.system.js.map → p-B_H7JnAQ.system.js.map} +1 -1
- package/dist/twilight/{p-BWD1Mdmj.system.js.map → p-BfizdcIv.system.js.map} +1 -1
- package/dist/twilight/{p-BfxbBmpF.system.js.map → p-BgVK0PPB.system.js.map} +1 -1
- package/dist/twilight/{p-BUNm7oxn.system.js → p-BtfcvLWi.system.js} +2 -2
- package/dist/twilight/{p-BUNm7oxn.system.js.map → p-BtfcvLWi.system.js.map} +1 -1
- package/dist/twilight/{p-BP344v_q.system.js.map → p-BxPxFmIf.system.js.map} +1 -1
- package/dist/twilight/{p-9jT7Wo1H.system.js.map → p-C6Mc-nga.system.js.map} +1 -1
- package/dist/twilight/{p-nuRa4ECK.system.js.map → p-CAhB5SXO.system.js.map} +1 -1
- package/dist/twilight/{p-cWZujtjd.system.js.map → p-CD5EBKFr.system.js.map} +1 -1
- package/dist/twilight/{p-egmUBeji.system.js.map → p-CDPN9ikP.system.js.map} +1 -1
- package/dist/twilight/{p-YvHIMjOJ.system.js.map → p-CE_xhQMS.system.js.map} +1 -1
- package/dist/twilight/{p-Cee0DssD.system.js.map → p-CIzZIur3.system.js.map} +1 -1
- package/dist/twilight/p-CaVNqQXu.system.js +5 -0
- package/dist/twilight/{p-ByGP8fWO.system.js.map → p-CaVNqQXu.system.js.map} +1 -1
- package/dist/twilight/{p-DPreD4Hr.system.js.map → p-CfNLozg0.system.js.map} +1 -1
- package/dist/twilight/p-ClaSC-3N.system.js.map +1 -0
- package/dist/twilight/{p-CIghWdV5.system.js.map → p-Cm8GjH45.system.js.map} +1 -1
- package/dist/twilight/{p-BftU992I.system.js.map → p-CpJOChwF.system.js.map} +1 -1
- package/dist/twilight/{p-BWnEoSJY.system.js.map → p-CsweHiBJ.system.js.map} +1 -1
- package/dist/twilight/{p-CpzD5fce.system.js.map → p-CtiUKful.system.js.map} +1 -1
- package/dist/twilight/{p-nvgYekhd.system.js.map → p-D0vXKNzE.system.js.map} +1 -1
- package/dist/twilight/{p-BCvHzhOW.system.js.map → p-D6fGvShW.system.js.map} +1 -1
- package/dist/twilight/{p-BlpV9vce.system.js.map → p-DInbMpRZ.system.js.map} +1 -1
- package/dist/twilight/{p-DVqtOGyR.system.js.map → p-DRUO4ntA.system.js.map} +1 -1
- package/dist/twilight/{p-L1Wml9tS.js → p-Dj2SrCy0.js} +3 -3
- package/dist/twilight/p-Dj2SrCy0.js.map +1 -0
- package/dist/twilight/{p-DuTXkmaO.system.js → p-DvJ_tnSw.system.js} +6 -6
- package/dist/twilight/p-DvJ_tnSw.system.js.map +1 -0
- package/dist/twilight/{p-DUDOY-ZS.system.js.map → p-DvQIv_6Y.system.js.map} +1 -1
- package/dist/twilight/{p-DwLeLHva.system.js.map → p-Dx2JzDoP.system.js.map} +1 -1
- package/dist/twilight/{p-DmQdqVWv.system.js.map → p-Dzal8dOY.system.js.map} +1 -1
- package/dist/twilight/p-FGWU4ai_.system.js.map +1 -0
- package/dist/twilight/{p-DvZ3uG1Y.system.js.map → p-LondrlGD.system.js.map} +1 -1
- package/dist/twilight/{p-tI_9cOVN.system.js.map → p-Q2yReOd3.system.js.map} +1 -1
- package/dist/twilight/{p-ByVXW9BA.system.js.map → p-WlDhq-4G.system.js.map} +1 -1
- package/dist/twilight/{p-cbadf894.system.entry.js → p-a20b6984.system.entry.js} +2 -2
- package/dist/twilight/{p-b4b5a600.system.entry.js → p-a439d5c1.system.entry.js} +2 -2
- package/dist/twilight/{p-62ba5382.entry.js → p-a531e0e4.entry.js} +2 -2
- package/dist/twilight/{p-342e13e4.system.entry.js → p-acaa2f80.system.entry.js} +2 -2
- package/dist/twilight/{p-154d97db.system.entry.js → p-ae7962ba.system.entry.js} +2 -2
- package/dist/twilight/{p-039b45e6.system.entry.js → p-b167e712.system.entry.js} +2 -2
- package/dist/twilight/{p-9a3f6331.entry.js → p-b42c8720.entry.js} +2 -2
- package/dist/twilight/{p-4291c03c.system.entry.js → p-b477f55b.system.entry.js} +2 -2
- package/dist/twilight/{p-50f789e5.entry.js → p-bc918d89.entry.js} +2 -2
- package/dist/twilight/{p-96d501d2.entry.js → p-c3adc5d9.entry.js} +2 -2
- package/dist/twilight/{p-5a577bf3.system.entry.js → p-c842f73f.system.entry.js} +2 -2
- package/dist/twilight/{p-f72dd4b6.system.entry.js → p-c8cea269.system.entry.js} +2 -2
- package/dist/twilight/{p-90fc2489.entry.js → p-d37bad6f.entry.js} +2 -2
- package/dist/twilight/{p-af1f9cd6.entry.js → p-d85581c6.entry.js} +2 -2
- package/dist/twilight/{p-666189da.system.entry.js → p-d8d9cdcd.system.entry.js} +2 -2
- package/dist/twilight/{p-be1034af.system.entry.js → p-de891990.system.entry.js} +2 -2
- package/dist/twilight/{p-6c83517d.entry.js → p-def552bd.entry.js} +2 -2
- package/dist/twilight/{p-228d58df.system.entry.js → p-e4f73083.system.entry.js} +2 -2
- package/dist/twilight/{p-a3ab451d.entry.js → p-e5872e75.entry.js} +2 -2
- package/dist/twilight/{p-d0a760cc.entry.js → p-ed4c7158.entry.js} +2 -2
- package/dist/twilight/p-ee443b00.entry.js +5 -0
- package/dist/twilight/p-ee443b00.entry.js.map +1 -0
- package/dist/twilight/{p-789f0166.system.entry.js → p-f1f3d74e.system.entry.js} +2 -2
- package/dist/twilight/{p-ca88566e.entry.js → p-f3b8551c.entry.js} +2 -2
- package/dist/twilight/{p-c63ddf33.entry.js → p-f41e7eed.entry.js} +2 -2
- package/dist/twilight/{p-6fcc8ed3.entry.js → p-f4918259.entry.js} +2 -2
- package/dist/twilight/p-f594b721.entry.js +5 -0
- package/dist/twilight/p-f594b721.entry.js.map +1 -0
- package/dist/twilight/{p-5b4f648e.entry.js → p-f9d8f20d.entry.js} +2 -2
- package/dist/twilight/p-fb59e3b5.entry.js +5 -0
- package/dist/twilight/p-ffb9ab7b.system.entry.js +5 -0
- package/dist/twilight/p-ffb9ab7b.system.entry.js.map +1 -0
- package/dist/twilight/{p-DKke2twA.system.js.map → p-jlCh1xBh.system.js.map} +1 -1
- package/dist/twilight/salla-conditional-offer.entry.esm.js.map +1 -1
- package/dist/twilight/salla-tiered-offer.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-tiered-offer/constants.d.ts +2 -0
- package/dist/types/components/salla-tiered-offer/interfaces.d.ts +44 -0
- package/dist/types/components/salla-tiered-offer/salla-tiered-offer.d.ts +39 -0
- package/dist/types/components/salla-tiered-offer/utils.d.ts +19 -0
- package/dist/types/components.d.ts +13 -0
- package/package.json +5 -5
- package/dist/cjs/index-B04Y8RyW.js.map +0 -1
- package/dist/esm/index-L1Wml9tS.js.map +0 -1
- package/dist/esm-es5/index-L1Wml9tS.js.map +0 -1
- package/dist/twilight/p-0225792d.system.entry.js +0 -5
- package/dist/twilight/p-0225792d.system.entry.js.map +0 -1
- package/dist/twilight/p-2c11821b.entry.js +0 -5
- package/dist/twilight/p-4fd3a01d.entry.js +0 -5
- package/dist/twilight/p-4fd3a01d.entry.js.map +0 -1
- package/dist/twilight/p-57bbd96b.system.entry.js +0 -5
- package/dist/twilight/p-BIOQiBj0.system.js.map +0 -1
- package/dist/twilight/p-ByGP8fWO.system.js +0 -5
- package/dist/twilight/p-DuTXkmaO.system.js.map +0 -1
- package/dist/twilight/p-L1Wml9tS.js.map +0 -1
- package/dist/twilight/p-a198f405.entry.js +0 -5
- package/dist/twilight/p-e58e21db.system.entry.js +0 -5
- /package/dist/twilight/{p-2ac20d02.entry.js.map → p-00ce3e65.entry.js.map} +0 -0
- /package/dist/twilight/{p-e00746e9.system.entry.js.map → p-02cc2225.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0a469ba7.system.entry.js.map → p-0b16f452.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3bdebf0d.entry.js.map → p-109136fc.entry.js.map} +0 -0
- /package/dist/twilight/{p-fe959c9a.system.entry.js.map → p-12adb702.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-12a13525.entry.js.map → p-16dfee33.entry.js.map} +0 -0
- /package/dist/twilight/{p-1ccd8b8e.entry.js.map → p-18537486.entry.js.map} +0 -0
- /package/dist/twilight/{p-2cd40336.system.entry.js.map → p-1cbc4329.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fbaa093c.entry.js.map → p-1cf1344e.entry.js.map} +0 -0
- /package/dist/twilight/{p-a477ee76.system.entry.js.map → p-1d6100c4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-75ec194e.system.entry.js.map → p-29567106.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-962cd525.entry.js.map → p-315c5fd3.entry.js.map} +0 -0
- /package/dist/twilight/{p-184f98b1.entry.js.map → p-337fca82.entry.js.map} +0 -0
- /package/dist/twilight/{p-5b8bf0e6.system.entry.js.map → p-3b02f780.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7b7618d5.entry.js.map → p-5394cdeb.entry.js.map} +0 -0
- /package/dist/twilight/{p-38526ba5.system.entry.js.map → p-55306475.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b1ad7c75.entry.js.map → p-59763129.entry.js.map} +0 -0
- /package/dist/twilight/{p-52156f6d.system.entry.js.map → p-5cd7ff6d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5c918974.entry.js.map → p-5e1f0ddf.entry.js.map} +0 -0
- /package/dist/twilight/{p-f6c410c6.entry.js.map → p-67b54ac4.entry.js.map} +0 -0
- /package/dist/twilight/{p-57bbd96b.system.entry.js.map → p-67ebf87e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-76137ff1.entry.js.map → p-688dd765.entry.js.map} +0 -0
- /package/dist/twilight/{p-284dae41.system.entry.js.map → p-6ec767ac.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1af18eb4.entry.js.map → p-70e74f3c.entry.js.map} +0 -0
- /package/dist/twilight/{p-d9c2f2b0.system.entry.js.map → p-7236a037.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-30c8b458.system.entry.js.map → p-7436f972.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8d9a5dc0.entry.js.map → p-74647582.entry.js.map} +0 -0
- /package/dist/twilight/{p-c781f7a7.entry.js.map → p-8162a820.entry.js.map} +0 -0
- /package/dist/twilight/{p-e58e21db.system.entry.js.map → p-864f1430.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-47b6e06b.system.entry.js.map → p-865fc401.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-bfb9457b.system.entry.js.map → p-87206bd7.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a198f405.entry.js.map → p-8c08dafb.entry.js.map} +0 -0
- /package/dist/twilight/{p-0e4f26bb.system.entry.js.map → p-8ce2a142.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-60e6d7e6.system.entry.js.map → p-8d28bf6e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d07e552b.system.entry.js.map → p-97337c52.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-08258532.entry.js.map → p-9e54e404.entry.js.map} +0 -0
- /package/dist/twilight/{p-cbadf894.system.entry.js.map → p-a20b6984.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b4b5a600.system.entry.js.map → p-a439d5c1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-62ba5382.entry.js.map → p-a531e0e4.entry.js.map} +0 -0
- /package/dist/twilight/{p-342e13e4.system.entry.js.map → p-acaa2f80.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-154d97db.system.entry.js.map → p-ae7962ba.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-039b45e6.system.entry.js.map → p-b167e712.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9a3f6331.entry.js.map → p-b42c8720.entry.js.map} +0 -0
- /package/dist/twilight/{p-4291c03c.system.entry.js.map → p-b477f55b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-50f789e5.entry.js.map → p-bc918d89.entry.js.map} +0 -0
- /package/dist/twilight/{p-96d501d2.entry.js.map → p-c3adc5d9.entry.js.map} +0 -0
- /package/dist/twilight/{p-5a577bf3.system.entry.js.map → p-c842f73f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f72dd4b6.system.entry.js.map → p-c8cea269.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-90fc2489.entry.js.map → p-d37bad6f.entry.js.map} +0 -0
- /package/dist/twilight/{p-af1f9cd6.entry.js.map → p-d85581c6.entry.js.map} +0 -0
- /package/dist/twilight/{p-666189da.system.entry.js.map → p-d8d9cdcd.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-be1034af.system.entry.js.map → p-de891990.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6c83517d.entry.js.map → p-def552bd.entry.js.map} +0 -0
- /package/dist/twilight/{p-228d58df.system.entry.js.map → p-e4f73083.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a3ab451d.entry.js.map → p-e5872e75.entry.js.map} +0 -0
- /package/dist/twilight/{p-d0a760cc.entry.js.map → p-ed4c7158.entry.js.map} +0 -0
- /package/dist/twilight/{p-789f0166.system.entry.js.map → p-f1f3d74e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ca88566e.entry.js.map → p-f3b8551c.entry.js.map} +0 -0
- /package/dist/twilight/{p-c63ddf33.entry.js.map → p-f41e7eed.entry.js.map} +0 -0
- /package/dist/twilight/{p-6fcc8ed3.entry.js.map → p-f4918259.entry.js.map} +0 -0
- /package/dist/twilight/{p-5b4f648e.entry.js.map → p-f9d8f20d.entry.js.map} +0 -0
- /package/dist/twilight/{p-2c11821b.entry.js.map → p-fb59e3b5.entry.js.map} +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
System.register(["./p-DuTXkmaO.system.js"],(function(n){"use strict";var i,t,e;return{setters:[function(n){i=n.r;t=n.h;e=n.H}],execute:function(){var o;(function(n){n["PERCENTAGE"]="percentage";n["FIXED"]="fixed";n["FREE_PRODUCT"]="free_product"})(o||(o={}));var r;(function(n){n["PRODUCT_COUNT"]="products_count";n["PRODUCT_PURCHASE"]="order_amount"})(r||(r={}));var a=":host{display:block}";var s=n("salla_conditional_offer",function(){function n(n){i(this,n);this.offer=null;this.products={};this.isLoading=true;this.canRender=true}n.prototype.componentWillLoad=function(){var n=this;salla.onReady().then((function(){var n,i,t;if(!((n=salla.config.get("store.features"))===null||n===void 0?void 0:n.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((t=(i=salla.storage.get("cart"))===null||i===void 0?void 0:i.summary)===null||t===void 0?void 0:t.count)){throw new Error("feature or cart object does not existed")}})).then((function(){return salla.api.cart.offers()})).then((function(i){var t=i.data;n.offer=t.find((function(n){return n.type==="conditional"}));if(!n.offer){throw new Error("No conditional offer has been activated in the merchant dashboard")}n.offer.details.discounts.unshift({value:0,min_spend:0});return n.updateInitialOfferValue()})).then((function(){return n.getProducts()})).then((function(){return salla.event.on("cart::updated",(function(i){return n.updateOfferValues(i)}))})).catch((function(i){n.canRender=false;salla.logger.warn("salla-conditional-offer:: ",i)})).finally((function(){n.isLoading=false}))};n.prototype.getProducts=function(){var n=this;var i=this.offer.details.discounts.filter((function(n){var i=n.type;return i===o.FREE_PRODUCT})).map((function(n){var i=n.value;return i}));if(i.length>0){return salla.product.fetch({source:"selected",source_value:i}).then((function(i){var t=i.data;t.forEach((function(i){var t=i.id,e=i.url,o=i.image;n.products[t]={url:e,image:o}}))}))}};n.prototype.updateInitialOfferValue=function(){var n=this;return salla.api.cart.details().then((function(i){var t=i.data.cart;return n.updateOfferValues(t)}))};n.prototype.updateOfferValues=function(n){var i=n.items,t=n.sub_total;var e;var o=this.offer.details.based_on===r.PRODUCT_COUNT?i.reduce((function(n,i){var t=i.quantity;return n+t}),0):t;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(e=this.offer)===null||e===void 0?void 0:e.details),{current_value:o})});return this.offer};n.prototype.getCheckpointContent=function(n){var i,e;if(n.type===o.PERCENTAGE)return"".concat(n.value,"%");if(n.type===o.FIXED)return salla.money(n.value);if(n.type!==o.FREE_PRODUCT){salla.logger.error("salla-conditional-offer:: unexpected type (".concat(n.type,")!"));return""}var r=this.products[n.value];if(!r){salla.logger.error("salla-conditional-offer:: there is no product with id (".concat(n.value,")!"));return""}return t("a",{class:"s-conditional-offer-product-link",href:r.url},t("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((i=r===null||r===void 0?void 0:r.image)===null||i===void 0?void 0:i.alt)||"",src:(e=r===null||r===void 0?void 0:r.image)===null||e===void 0?void 0:e.url}))};n.prototype.getOfferType=function(n){var i;var t=(i=this.offer.details)===null||i===void 0?void 0:i.based_on;if(t===r.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",n.min_spend);if(t===r.PRODUCT_PURCHASE)return salla.money(n.min_spend);salla.logger.warn("salla-conditional-offer:: Unexpected offer detail's based_on value: ".concat(t));return"".concat(n.min_spend)};n.prototype.clamp=function(n,i,t){return Math.max(i,Math.min(n,t))};n.prototype.mapValueRanges=function(n,i,t,e,o){var r=(n-i)*(o-e)/(t-i)+e;if(r===Number.POSITIVE_INFINITY)return 100;if(r===Number.NEGATIVE_INFINITY)return 0;return this.clamp(r,0,100)};n.prototype.getCheckPointView=function(n,i){var e,o;var r=this.offer.details.discounts.findIndex((function(i){var t=i.min_spend;return t===n.min_spend}));var a=(o=(e=this.offer.details.discounts[r-1])===null||e===void 0?void 0:e.min_spend)!==null&&o!==void 0?o:0;var s=this.mapValueRanges(this.offer.details.current_value,a,n.min_spend,0,100);var l=n.min_spend<=this.offer.details.current_value;return t("div",{class:"s-conditional-offer-checkpoint-container"},i>0?[t("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},t("div",{class:"s-conditional-offer-progress-line-inactive"}),t("div",{class:"s-conditional-offer-progress-line-active",style:{width:"".concat(s,"%")}})),t("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint ".concat(l?"s-conditional-offer-active-checkpoint":"")},t("div",{class:"s-conditional-offer-item-avatar-content ".concat(l?"active":""),innerHTML:this.products&&this.getCheckpointContent(n)}),t("div",{class:"s-conditional-offer-checkpoint-label ".concat(l?"active":""),innerHTML:this.getOfferType(n)}))]:t("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":i===0,active:l},innerHTML:this.getOfferType(n)}))};n.prototype.getLoadingSkeletonView=function(){return t(e,{class:"s-conditional-offer-container"},t("div",{class:"s-conditional-offer-skeleton-inner-container"},t("div",{class:"s-conditional-offer-skeleton-subtitle"},t("salla-skeleton",{height:"16px",width:"30%"})),t("div",{class:"s-conditional-offer-skeleton-subtitle"},t("salla-skeleton",{height:"16px",width:"35%"})),t("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((function(){return[t("salla-skeleton",{key:"checkpoint-line",height:"8px"}),t("div",{key:"checkpoint"},t("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))]})))))};n.prototype.render=function(){var n=this;if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();return t(e,{class:"s-conditional-offer-container"},t("div",{class:"s-conditional-offer-title-wrapper"},t("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?t("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",t("i",{class:"sicon-information"})):null),t("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map((function(i,e){return t("div",{class:{"flex-1":e>0},key:i.min_spend},n.getCheckPointView(i,e))}))))};return n}());s.style=a}}}));
|
|
5
|
-
//# sourceMappingURL=p-0225792d.system.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DiscountType","OfferType","sallaConditionalOfferCss","SallaConditionalOffer","exports","class_1","hostRef","this","offer","products","isLoading","canRender","prototype","componentWillLoad","_this","salla","onReady","then","_a","config","get","includes","storage","_c","_b","summary","count","Error","api","cart","offers","_d","data","find","type","details","discounts","unshift","value","min_spend","updateInitialOfferValue","getProducts","event","on","updatedCart","updateOfferValues","catch","error","logger","warn","finally","freeProductIDs","filter","FREE_PRODUCT","map","length","product","fetch","source","source_value","forEach","id","url","image","items","sub_total","current_value","based_on","PRODUCT_COUNT","reduce","quantity","Object","assign","getCheckpointContent","discount","PERCENTAGE","concat","FIXED","money","productItem","h","class","href","loading","decoding","alt","src","getOfferType","basedOn","lang","choice","PRODUCT_PURCHASE","clamp","min","max","Math","mapValueRanges","initialMinRange","initialMaxRange","newMinRange","newMaxRange","newRange","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","getCheckPointView","index","checkpointIndex","findIndex","previousCheckpointValue","progressPercentage","isActive","key","style","width","innerHTML","active","getLoadingSkeletonView","Host","height","Array","fill","render","title","description"],"sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = true\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n //it's okay if there is an exception here, all thens will be skipped, and will catch the error,\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n throw new Error('No conditional offer has been activated in the merchant dashboard');\n }\n\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => this.getProducts()).then(() => salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart)))\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"mappings":";;;kJAEA,IAAYA,GAAZ,SAAYA,GACRA,EAAA,2BACAA,EAAA,iBACAA,EAAA,8BACH,EAJD,CAAYA,MAIX,KAED,IAAYC,GAAZ,SAAYA,GACRA,EAAA,kCACAA,EAAA,kCACH,EAHD,CAAYA,MAGX,KCXD,IAAMC,EAA2B,uB,ICcpBC,EAAqBC,EAAA,qCAJlC,SAAAC,EAAAC,G,UAMaC,KAAKC,MAAU,KACfD,KAAQE,SAAmD,GAC3DF,KAASG,UAAG,KACZH,KAASI,UAAG,IAgLxB,CA9KGN,EAAAO,UAAAC,kBAAA,eAAAC,EAAAP,KACIQ,MAAMC,UAAUC,MAAK,W,UACjB,MAAKC,EAAAH,MAAMI,OAAOC,IAAI,qBAAiB,MAAAF,SAAA,SAAAA,EAAEG,SAAS,uBAAyBN,MAAMO,QAAQF,IAAI,UAAY,OAAOG,GAAAC,EAAAT,MAAMO,QAAQF,IAAI,WAAS,MAAAI,SAAA,SAAAA,EAAAC,WAAO,MAAAF,SAAA,SAAAA,EAAEG,OAAQ,CACxJ,MAAM,IAAIC,MAAM,0C,CAExB,IACKV,MAAK,WAAM,OAAAF,MAAMa,IAAIC,KAAKC,QAAf,IACXb,MAAK,SAACc,G,IAAEC,EAAID,EAAAC,KAETlB,EAAKN,MAAQwB,EAAKC,MAAK,SAAAzB,GAAS,OAAAA,EAAM0B,OAAS,aAAf,IAEhC,IAAKpB,EAAKN,MAAO,CACb,MAAM,IAAImB,MAAM,oE,CAGpBb,EAAKN,MAAM2B,QAAQC,UAAUC,QAAO,CAAIC,MAAO,EAAGC,UAAW,IAC7D,OAAOzB,EAAK0B,yBAChB,IAAGvB,MAAK,WAAM,OAAAH,EAAK2B,aAAL,IAAoBxB,MAAK,WAAM,OAAAF,MAAM2B,MAAMC,GAAG,iBAA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SAACoB,EAAUgC,GAAK,OAC9C1B,EAAK,OAAAC,MAAO,CAAE,SAAUyB,EAAQ,GAAKM,IAAKtC,EAASnC,WAC9CzB,EAAK2F,kBAAkB/B,EAAUgC,GAFQ,K,WA7KhC,I","ignoreList":[]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,h as s,g as i}from"./p-L1Wml9tS.js";import{a}from"./p-CgtvEd63.js";const e=":host{display:block}";const l=class{constructor(s){t(this,s);var i;this.currentSlug=salla.config.get("page.slug");salla.onReady((()=>{this.currentSlug=salla.config.get("page.slug")}));this.advSlot=((i=this.host.querySelector('[slot="adv"]'))===null||i===void 0?void 0:i.innerHTML)||`<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n `}isNotVisible(t){return!!salla.storage.get(`statusAd-${t.id}`)}setCanDisplayFlag(t,s){if(!s){salla.storage.set(`statusAd-${t.id}`,"dismissed");a({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}}render(){if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((t=>s("div",{class:{"s-hidden":this.isNotVisible(t),"s-advertisement":true},"data-id":t.id,style:{"background-color":t.colors.bg,color:t.colors.text}},s("div",{id:"adv-slot",innerHTML:this.advSlot.replace("{iconElem}",`<i class="s-advertisement-content-icon ${t.icon}"></i>`).replace("{urlElem}",t.url?`<a href="${t.url}" target="${t.target}">${t.description}</a>`:t.description).replace("{closeElem}",`<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>`).replace("{icon}",t.icon).replace("{url}",t.url).replace("{target}",t.target).replace("{description}",t.description).replace("{bg_color}",t.colors.bg).replace("{text_color}",t.colors.text)}))))}componentWillLoad(){return new Promise((t=>salla.onReady(t))).then((()=>salla.api.advertisement.fetch(this.currentSlug))).then((t=>Array.isArray(t.data)?t.data.find((t=>!salla.storage.get(`statusAd-${t.id}`))):null)).then((t=>this.advertisements=t?[t]:[]))}componentDidRender(){var t;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((()=>{let t=this.host.querySelector(".s-advertisement-action");if(t){t.addEventListener("click",(()=>this.setCanDisplayFlag(this.advertisements[0],false)))}}));this.host.querySelectorAll("#adv-slot").forEach((t=>t===null||t===void 0?void 0:t.replaceWith(t===null||t===void 0?void 0:t.firstChild)));(t=this.host.querySelector('[slot="adv"]'))===null||t===void 0?void 0:t.remove();a({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})}get host(){return i(this)}};l.style=e;export{l as salla_advertisement};
|
|
5
|
-
//# sourceMappingURL=p-2c11821b.entry.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,h as i,H as e}from"./p-L1Wml9tS.js";var s;(function(t){t["PERCENTAGE"]="percentage";t["FIXED"]="fixed";t["FREE_PRODUCT"]="free_product"})(s||(s={}));var o;(function(t){t["PRODUCT_COUNT"]="products_count";t["PRODUCT_PURCHASE"]="order_amount"})(o||(o={}));const n=":host{display:block}";const a=class{constructor(i){t(this,i);this.offer=null;this.products={};this.isLoading=true;this.canRender=true}componentWillLoad(){salla.onReady().then((()=>{var t,i,e;if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((e=(i=salla.storage.get("cart"))===null||i===void 0?void 0:i.summary)===null||e===void 0?void 0:e.count)){throw new Error("feature or cart object does not existed")}})).then((()=>salla.api.cart.offers())).then((({data:t})=>{this.offer=t.find((t=>t.type==="conditional"));if(!this.offer){throw new Error("No conditional offer has been activated in the merchant dashboard")}this.offer.details.discounts.unshift({value:0,min_spend:0});return this.updateInitialOfferValue()})).then((()=>this.getProducts())).then((()=>salla.event.on("cart::updated",(t=>this.updateOfferValues(t))))).catch((t=>{this.canRender=false;salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=false}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t));if(t.length>0){return salla.product.fetch({source:"selected",source_value:t}).then((({data:t})=>{t.forEach((({id:t,url:i,image:e})=>{this.products[t]={url:i,image:e}}))}))}}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){var e;const s=this.offer.details.based_on===o.PRODUCT_COUNT?t.reduce(((t,{quantity:i})=>t+i),0):i;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(e=this.offer)===null||e===void 0?void 0:e.details),{current_value:s})});return this.offer}getCheckpointContent(t){var e,o;if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return salla.money(t.value);if(t.type!==s.FREE_PRODUCT){salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`);return""}const n=this.products[t.value];if(!n){salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`);return""}return i("a",{class:"s-conditional-offer-product-link",href:n.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((e=n===null||n===void 0?void 0:n.image)===null||e===void 0?void 0:e.alt)||"",src:(o=n===null||n===void 0?void 0:n.image)===null||o===void 0?void 0:o.url}))}getOfferType(t){var i;const e=(i=this.offer.details)===null||i===void 0?void 0:i.based_on;if(e===o.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",t.min_spend);if(e===o.PRODUCT_PURCHASE)return salla.money(t.min_spend);salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${e}`);return`${t.min_spend}`}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,o){const n=(t-i)*(o-s)/(e-i)+s;if(n===Number.POSITIVE_INFINITY)return 100;if(n===Number.NEGATIVE_INFINITY)return 0;return this.clamp(n,0,100)}getCheckPointView(t,e){var s,o;const n=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend));const a=(o=(s=this.offer.details.discounts[n-1])===null||s===void 0?void 0:s.min_spend)!==null&&o!==void 0?o:0;const l=this.mapValueRanges(this.offer.details.current_value,a,t.min_spend,0,100);const r=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${l}%`}})),i("div",{key:"checkpoint",class:`s-conditional-offer-checkpoint ${r?"s-conditional-offer-active-checkpoint":""}`},i("div",{class:`s-conditional-offer-item-avatar-content ${r?"active":""}`,innerHTML:this.products&&this.getCheckpointContent(t)}),i("div",{class:`s-conditional-offer-checkpoint-label ${r?"active":""}`,innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":e===0,active:r},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e))))))}};a.style=n;export{a as salla_conditional_offer};
|
|
5
|
-
//# sourceMappingURL=p-4fd3a01d.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DiscountType","OfferType","sallaConditionalOfferCss","SallaConditionalOffer","constructor","hostRef","this","offer","products","isLoading","canRender","componentWillLoad","salla","onReady","then","_a","config","get","includes","storage","_c","_b","summary","count","Error","api","cart","offers","data","find","type","details","discounts","unshift","value","min_spend","updateInitialOfferValue","getProducts","event","on","updatedCart","updateOfferValues","catch","error","logger","warn","finally","freeProductIDs","filter","FREE_PRODUCT","map","length","product","fetch","source","source_value","forEach","id","url","image","items","sub_total","current_value","based_on","PRODUCT_COUNT","reduce","quantity","Object","assign","getCheckpointContent","discount","PERCENTAGE","FIXED","money","productItem","h","class","href","loading","decoding","alt","src","getOfferType","basedOn","lang","choice","PRODUCT_PURCHASE","clamp","min","max","Math","mapValueRanges","initialMinRange","initialMaxRange","newMinRange","newMaxRange","newRange","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","getCheckPointView","index","checkpointIndex","findIndex","previousCheckpointValue","progressPercentage","isActive","key","style","width","innerHTML","active","getLoadingSkeletonView","Host","height","Array","fill","render","title","description"],"sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = true\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n //it's okay if there is an exception here, all thens will be skipped, and will catch the error,\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n throw new Error('No conditional offer has been activated in the merchant dashboard');\n }\n\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => this.getProducts()).then(() => salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart)))\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"mappings":";;;kDAEA,IAAYA,GAAZ,SAAYA,GACRA,EAAA,2BACAA,EAAA,iBACAA,EAAA,8BACH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C,MAAM,iCACfD,EAAK,OAAAC,MAAM,qCACPD,EAAK,OAAAC,MAAM,6BAA6BtE,KAAKC,MAAM+G,OAClDhH,KAAKC,MAAMgH,YAAc5C,EAAA,OAAKC,MAAM,gCAChCtE,KAAKC,MAAMgH,YAAW,IAAE5C,EAAG,KAAAC,MAAM,uBAC7B,MAEbD,EAAK,OAAAC,MAAM,0CACNtE,KAAKC,MAAMwB,QAAQC,UAAUkB,KAAI,CAACoB,EAAU+B,IACzC1B,EAAK,OAAAC,MAAO,CAAE,SAAUyB,EAAQ,GAAKM,IAAKrC,EAASnC,WAC9C7B,KAAK8F,kBAAkB9B,EAAU+B,O","ignoreList":[]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,r,n,i){function e(t){return t instanceof n?t:new n((function(r){r(t)}))}return new(n||(n=Promise))((function(n,a){function s(t){try{u(i.next(t))}catch(t){a(t)}}function o(t){try{u(i["throw"](t))}catch(t){a(t)}}function u(t){t.done?n(t.value):e(t.value).then(s,o)}u((i=i.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,e,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(r){return u([t,r])}}function u(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(n=0)),n)try{if(i=1,e&&(a=o[0]&2?e["return"]:o[0]?e["throw"]||((a=e["return"])&&a.call(e),0):e.next)&&!(a=a.call(e,o[1])).done)return a;if(e=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;e=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=r.call(t,n)}catch(t){o=[6,t];e=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-DuTXkmaO.system.js","./p-Bnro4LR3.system.js","./p-C-c0Msup.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var r,n,i,e,a,s,o;return{setters:[function(t){r=t.r;n=t.c;i=t.h;e=t.H;a=t.g},function(t){s=t.F},function(t){o=t.H},null],execute:function(){var u=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";var f=t("salla_filters",function(){function t(t){var i=this;r(this,t);this.changed=n(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(function(){return i.host.style.display="none"}));salla.lang.onLoaded((function(){i.apply=salla.lang.get("pages.checkout.apply");i.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(function(t){var r=t.filters;i.host.style.display="";var n={};i.filters=r.map((function(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=s.VALUES;var r=t.values,e=r.max,a=r.min;t.values=[5,4,3,2,1].filter((function(t){return t>=a||t<=e}))}if(i.filtersData.variants&&t.type==s.VARIANTS){n.variants=i.filtersData.variants}if(i.filtersData[t.key]&&t.type!==s.VARIANTS){n[t.key]=i.filtersData[t.key]}var o=new URLSearchParams(window.location.search);var u=false;for(var f=0,c=o.keys();f<c.length;f++){var l=c[f];if(l.includes("filters")){u=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(n).length==0&&!u){var h=window.location.href;var d=salla.config.get("page.id");var v=h.indexOf("?")!==-1?"&":"?";var w=h+v+"filters[category_id]="+d;n.category_id=d;window.history.pushState({path:w},"",w)}return t}));i.filtersData=n;i.host.childNodes.forEach((function(t){return __awaiter(i,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:r=t.setWidgetHeight;if(!r)return[3,2];return[4,t.setWidgetHeight()];case 1:r=n.sent();n.label=2;case 2:return[2,r]}}))}))}))}))}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);t=new URLSearchParams(window.location.search);r=this;return[4,o.extractFiltersFromUrl(t)];case 1:r.filtersData=i.sent();return[3,3];case 2:n=i.sent();console.warn("failed to get filters from URL",n.message);return[3,3];case 3:return[2]}}))}))};t.prototype.getFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.filtersData]}))}))};t.prototype.applyFilters=function(){return __awaiter(this,void 0,void 0,(function(){var t;var r=this;return __generator(this,(function(n){if(!this.isReady){return[2]}t=Object.keys(this.filtersData).length>0;setTimeout((function(){var n;if(t){var i=new URL(window.location.href);for(var e=0,a=i.searchParams.entries();e<a.length;e++){var s=a[e][0];if(s.startsWith("filters")){i.searchParams.delete(s)}}var o=r.encodeFilters(r.filtersData);var u=i.search.split("&").filter((function(t){return!t.includes("filters")})).join("&");if(u){i.search=i.search.split("&filters")[0]+"&"+o}else{i.search="?".concat(o)}window.history.pushState({},"",i.href)}else{var i=new URL(window.location.href);(n=i.searchParams)===null||n===void 0?void 0:n.delete("filters");window.history.pushState({},"",i.toString())}salla.event.emit("salla-filters::changed",r.filtersData);r.changed.emit(r.filtersData)}),300);return[2]}))}))};t.prototype.encodeFilters=function(t,r){if(r===void 0){r="filters"}var n=[];for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){var e=t[i];var a=r?"".concat(r,"[").concat(i,"]"):i;if(Array.isArray(e)){for(var s=0;s<e.length;s++){n.push("".concat(a,"[").concat(s,"]=").concat(e[s]))}}else if(typeof e==="object"&&e!==null){n.push(this.encodeFilters(e,a))}else{var o="".concat(a,"=").concat(e);n.push(o)}}}return n.join("&")};t.prototype.resetFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((function(t){return t.reset&&t.reset()}));salla.event.emit("salla-filters::reset");return[2,this.applyFilters()]}))}))};t.prototype.removeFiltersQueryParams=function(){var t=new URLSearchParams(window.location.search);var r=Array.from(t.keys()).filter((function(t){return!t.startsWith("filters[")})).map((function(r){return"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(t.get(r)))})).join("&");var n=r?"".concat(window.location.pathname,"?").concat(r):window.location.pathname;window.history.pushState({},"",n)};t.prototype.handleOptionChange=function(t,r,n){if(r.type===s.RANGE){this.filtersData[r.key]=n}var i=t.target.checked;if(r.type===s.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[r.key]=n);i||delete this.filtersData.variants[r.key]}else if(t.target.type=="radio"){i&&(this.filtersData[r.key]=n);i||delete this.filtersData[r.key]}else if(t.target.type=="checkbox"){this.filtersData[r.key]=this.filtersData[r.key]||[];if(i){this.filtersData[r.key].push(n)}this.filtersData[r.key]=this.filtersData[r.key].filter((function(t){return t!=n}))}this.applyFilters()};t.prototype.render=function(){var t=this;var r,n;return i(e,{key:"d62d9a867f140a911cb5da11a1034511fd230745"},(r=this.filters)===null||r===void 0?void 0:r.map((function(r){return i("salla-filters-widget",{option:r,filtersData:t.filtersData,onChanged:function(r){var n=r.detail,i=n.event,e=n.option,a=n.value;t.handleOptionChange(i,e,a)}})})),((n=this.filters)===null||n===void 0?void 0:n.length)?i("div",{class:"s-filters-footer"},i("salla-button",{color:"gray",fill:"outline",onClick:function(){return t.resetFilters()}},this.reset)):"")};t.prototype.componentDidLoad=function(){this.isReady=true};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());f.style=u}}}));
|
|
5
|
-
//# sourceMappingURL=p-57bbd96b.system.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"p-BIOQiBj0.system.js","sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = true\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n //it's okay if there is an exception here, all thens will be skipped, and will catch the error,\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n throw new Error('No conditional offer has been activated in the merchant dashboard');\n }\n\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => this.getProducts()).then(() => salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart)))\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items.reduce((count: number, { quantity }) => count + quantity, 0,) : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAEA,IAAY,YAIX;YAJD,CAAA,UAAY,YAAY,EAAA;YACpB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;YACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;YACf,IAAA,YAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;YACjC,CAAC,EAJW,YAAY,KAAZ,YAAY,GAIvB,EAAA,CAAA,CAAA;YAED,IAAY,SAGX;YAHD,CAAA,UAAY,SAAS,EAAA;YACjB,IAAA,SAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,SAAA,CAAA,kBAAA,CAAA,GAAA,cAAiC;YACrC,CAAC,EAHW,SAAS,KAAT,SAAS,GAGpB,EAAA,CAAA,CAAA;;YCXD,MAAM,wBAAwB,GAAG,sBAAsB;;kBCc1C,qBAAqB,sCAAA,MAAA;YAJlC,IAAA,WAAA,CAAA,OAAA,EAAA;;YAMa,QAAA,IAAK,CAAA,KAAA,GAAU,IAAI;YACnB,QAAA,IAAQ,CAAA,QAAA,GAAmD,EAAE;YAC7D,QAAA,IAAS,CAAA,SAAA,GAAG,IAAI;YAChB,QAAA,IAAS,CAAA,SAAA,GAAG,IAAI;YAgL5B;gBA9KG,iBAAiB,GAAA;YACb,QAAA,KAAK,CA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AK,CAAC,WAAW,GAAG,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAA,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,OAAE,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EAAA,CAAG,CACtD,GAAG,IAAI,CACX,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,wCAAwC,EAC9C,EAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,MAC9C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EACvD,EAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CACtC,CACT,CAAC,CACA,CACH;;;;;;;;;;;"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,a,l){function o(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,i){function s(e){try{n(l.next(e))}catch(e){i(e)}}function r(e){try{n(l["throw"](e))}catch(e){i(e)}}function n(e){e.done?a(e.value):o(e.value).then(s,r)}n((l=l.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},l,o,i,s;return s={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function r(e){return function(t){return n([e,t])}}function n(r){if(l)throw new TypeError("Generator is already executing.");while(s&&(s=0,r[0]&&(a=0)),a)try{if(l=1,o&&(i=r[0]&2?o["return"]:r[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;if(o=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:a.label++;return{value:r[1],done:false};case 5:a.label++;o=r[1];r=[0];continue;case 7:r=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){a=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(r[0]===6&&a.label<i[1]){a.label=i[1];i=r;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(r);break}if(i[2])a.ops.pop();a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e];o=0}finally{l=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-DuTXkmaO.system.js","./p-BUNm7oxn.system.js"],(function(e,t){"use strict";var a,l,o;return{setters:[function(t){a=t.p;l=t.b;e("setNonce",t.s)},function(e){o=e.g}],execute:function(){var e=this;var i=function(){var e=t.meta.url;var l={};if(e!==""){l.resourcesUrl=new URL(".",e).href}return a(l)};i().then((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,o()];case 1:e.sent();return[2,l(JSON.parse('[["p-38526ba5.system",[[0,"salla-offer",{"productCardComponent":[1,"product-card-component"],"offersList":[32],"userCurrency":[32],"isMultipleBank":[32],"title":[32],"currentPage":[32],"hasCustomComponent":[32],"isBankOffer":[32],"canRender":[32],"showOffer":[32],"offer_with_price_text":[32],"with_discount_text":[32],"product_discount_text":[32],"special_offer_text":[32],"multipleBankOfferTitleText":[32],"multipleBankOfferTitleDescription":[32],"buy_quantity_text":[32]}]]],["p-cbadf894.system",[[0,"salla-product-options",{"productId":[2,"product-id"],"options":[1],"hideOutLabel":[1,"hide-out-label"],"uniqueKey":[1,"unique-key"],"config":[1],"optionsData":[32],"outOfStockText":[32],"donationAmount":[32],"selectDonationAmount":[32],"selectAmount":[32],"isCustomDonation":[32],"selectedOptions":[32],"canDisabled":[32],"selectedSkus":[32],"selectedOutSkus":[32],"disableCardValue":[32],"availableDigitalCardValues":[32],"setOptionsData":[64],"getSelectedOptionsData":[64],"reportValidity":[64],"hasOutOfStockOption":[64],"getSelectedOptions":[64],"getOption":[64]}]]],["p-57bbd96b.system",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["p-52156f6d.system",[[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"supportWebAuth":[4,"support-web-auth"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"hasError":[32],"errorMessage":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}]]],["p-342e13e4.system",[[0,"salla-loyalty-program",{"loyaltyPointsArray":[32],"isLoadingLoyalty":[32],"nextPageUrlLoyalty":[32]}]]],["p-5b8bf0e6.system",[[0,"salla-notifications",{"loadMoreText":[1,"load-more-text"],"itemPerPage":[2,"item-per-page"],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"no_notifications_trans":[32],"load_more_text_trans":[32]}]]],["p-fe959c9a.system",[[0,"salla-order-summary",{"orderId":[514,"order-id"],"codeCopied":[32],"noItemFound":[32],"order_items":[32]}]]],["p-b4b5a600.system",[[0,"salla-reviews",{"displayAllLink":[516,"display-all-link"],"source":[513],"sourceValue":[513,"source-value"],"limit":[514],"type":[1],"sort":[1],"hideCustomerInfo":[4,"hide-customer-info"],"reviews":[32],"isRTL":[32],"showReviews":[32],"testimonialText":[32],"displayAllLinkText":[32]}]]],["p-30c8b458.system",[[0,"salla-reviews-page",{"reviews":[32],"isLoading":[32],"pagination":[32],"sort":[32]}]]],["p-75ec194e.system",[[0,"salla-wallet",{"transactionsArray":[32],"balance":[32],"isLoading":[32],"nextPageUrl":[32]}]]],["p-0225792d.system",[[0,"salla-conditional-offer",{"offer":[32],"products":[32],"isLoading":[32],"canRender":[32]}]]],["p-789f0166.system",[[0,"salla-orders",{"params":[16],"loadMoreText":[1,"load-more-text"],"orderNumberText":[32],"totalOrderText":[32],"orderDateText":[32],"orderStatusText":[32],"noOrderText":[32],"load_more_text_trans":[32],"languageCode":[32],"orders":[32],"pagination":[32],"hasInfiniteScroll":[32],"total":[32],"nextPage":[32],"showPlaceholder":[32]}]]],["p-bfb9457b.system",[[4,"salla-accordion",{"collapsible":[4],"collapsed":[1540],"dir":[32]},[[4,"salla::language.change","directionChangedHandler"],[0,"accordionToggle","handleCollapse"]]]]],["p-e58e21db.system",[[4,"salla-accordion-body"]]],["p-f72dd4b6.system",[[4,"salla-accordion-head",{"collapsible":[4],"collapsed":[1540]}]]],["p-154d97db.system",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["p-228d58df.system",[[0,"salla-app-install-alert",{"data":[32],"ctaLink":[32],"open":[32],"closing":[32]}]]],["p-47b6e06b.system",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["p-0a469ba7.system",[[0,"salla-cart-item-offers",{"quantity":[2],"offers":[1],"itemId":[2,"item-id"],"productPrice":[2,"product-price"],"internalQuantity":[32],"internalOffers":[32],"internalProductPrice":[32],"showAll":[32],"freeLabel":[32],"receivedOffer":[32],"discountAmountLabel":[32],"showMoreOffers":[32]}]]],["p-be1034af.system",[[0,"salla-contacts",{"contactsTitle":[1025,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["p-5a577bf3.system",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"country":[1],"tabbyIsActive":[32],"spotiiIsActive":[32],"tamaraIsActive":[32],"mispayActive":[32],"emkanIsActive":[32],"madfuActive":[32],"rajehiIsActive":[32],"installment_sheria_text":[32]}]]],["p-a477ee76.system",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["p-e00746e9.system",[[0,"salla-metadata",{"entity":[1],"entityId":[8,"entity-id"],"specs":[32],"download":[32]}]]],["p-666189da.system",[[0,"salla-payments",{"exclude":[1040]}]]],["p-4291c03c.system",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["p-039b45e6.system",[[4,"salla-filters-widget",{"withLoadMore":[1028,"with-load-more"],"filtersData":[16,"filters-data"],"option":[16],"isOpen":[32],"isShowMore":[32],"showMoreLabel":[32],"showLessLabel":[32],"page":[32],"setWidgetHeight":[64],"reset":[64],"showMore":[64],"toggleWidget":[64]}]]],["p-0e4f26bb.system",[[0,"salla-notification-item",{"notification":[16]}]]],["p-d9c2f2b0.system",[[0,"salla-review-card",{"review":[16],"currentSlide":[32],"purchasedCount":[32],"showPurchaseCount":[32]}]]],["p-2cd40336.system",[[4,"salla-tooltip",{"text":[1],"targetId":[1,"target-id"],"show":[32]},[[9,"mouseover","handleMouseOver"],[9,"mouseout","handleMouseOut"]]]]],["p-d07e552b.system",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"hasError":[32],"errorMessage":[32],"productID":[32],"offer_type":[32],"translationLoaded":[32],"addToCartLabel":[32],"open":[64],"showOffer":[64]}],[4,"salla-gifting",{"productId":[2,"product-id"],"widgetTitle":[1,"widget-title"],"widgetSubtitle":[1,"widget-subtitle"],"physicalProducts":[4,"physical-products"],"vertical":[4],"formSelector":[1025,"form-selector"],"sectionTitle":[32],"sectionSubtitle":[32],"sectionBtnText":[32],"giftDetails":[32],"selectImageForYourGift":[32],"selectImageOrUpload":[32],"selectGiftMessage":[32],"giftCustomText":[32],"textId":[32],"incorrectGiftText":[32],"nextStep":[32],"senderNameLabel":[32],"receiverNameFieldLabel":[32],"receiverMobileFieldLabel":[32],"receiverCountryFieldLabel":[32],"ksa":[32],"selectCity":[32],"selectCityInfo":[32],"receiverCityFieldLabel":[32],"receiverEmailFieldLabel":[32],"emailPlaceholder":[32],"sendLater":[32],"selectSendDateAndTime":[32],"canNotEditOrderAfterSelectDate":[32],"sendGift":[32],"donationRequired":[32],"currentStep":[32],"showCalendar":[32],"showGiftText":[32],"currentLang":[32],"parentClass":[32],"errors":[32],"gift":[32],"selectedGiftTextOption":[32],"parsedFormData":[32],"showTextArea":[32],"selectedImage":[32],"uploadedImage":[32],"selectedText":[32],"senderName":[32],"errorMessage":[32],"hasError":[32],"quantity":[32],"deliveryDate":[32],"timeZone":[32],"receiverName":[32],"receiverMobile":[32],"receiverCountryCode":[32],"receiverEmail":[32],"hostId":[32],"receiverCity":[32],"open":[64],"close":[64],"goToStep2":[64]}],[4,"salla-loyalty",{"prizePoints":[1544,"prize-points"],"customerPoints":[1538,"customer-points"],"prizeTitle":[1537,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1025,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[0,"salla-comments",{"itemId":[2,"item-id"],"loadMoreText":[1,"load-more-text"],"hideForm":[4,"hide-form"],"blockTitle":[1,"block-title"],"hideTitle":[4,"hide-title"],"type":[1],"showFormAvatar":[4,"show-form-avatar"],"hideBought":[4,"hide-bought"],"sort":[1],"testimonials":[4],"comments":[32],"pagination":[32],"total":[32],"showPlaceholder":[32],"nextPage":[32],"mostHelpfulLabel":[32],"noComments":[32],"comment_title":[32],"comment_name":[32],"placeholder_text":[32],"showRatingSummary":[32],"allowLikes":[32],"reload":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"placeholder_title":[32],"placeholder_description":[32],"modal_title":[32],"hasError":[32],"open":[64],"close":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"hasError":[32],"showContactWidget":[32],"errorMessage":[32],"dragAndDropFilesLabel":[32],"contactSubjectLabel":[32],"editReviewLabel":[32],"allowedImagesTypesLabel":[32],"addImagesLabel":[32],"editImagesLabel":[32],"threeImagesMax":[32],"areYouSureLabel":[32],"confirmDeletionLabel":[32],"cancelLabel":[32],"confirmDeleteBtn":[32],"updatedSuccessfullyLabel":[32],"deletedSuccessfullyLabel":[32],"allowAttachImages":[32],"allowContactSupport":[32],"contactUsLabel":[32],"images":[32],"productImages":[32],"editItemImages":[32],"contact_body":[32],"editMode":[32],"defaultMode":[32],"deleteMode":[32],"shouldOpenDeleteModal":[32],"editType":[32],"editFeedbackId":[32],"deleteFeedbackId":[32],"editItem":[32],"open":[64],"close":[64]}],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"hasError":[32],"loading":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"hasError":[32],"errorMessage":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-user-profile",{"customFields":[1,"custom-fields"],"minAge":[2,"min-age"],"userData":[32],"isEditable":[32],"userDefinedFields":[32],"disableAction":[32],"isLoading":[32],"first_name_trans":[32],"last_name_trans":[32],"birthday_trans":[32],"birthday_placeholder_trans":[32],"gender_trans":[32],"gender_placeholder_trans":[32],"male_trans":[32],"female_trans":[32],"email_trans":[32],"mobile_trans":[32],"save_btn_trans":[32],"drag_and_drop_trans":[32],"browse_trans":[32],"email_required_trans":[32],"invalid_email_trans":[32],"setCustomFields":[64]}],[0,"salla-quick-order",{"quickOrderTitle":[1025,"quick-order-title"],"subTitle":[1025,"sub-title"],"payButtonTitle":[1025,"pay-button-title"],"confirmPayButtonTitle":[1025,"confirm-pay-button-title"],"agreementText":[1025,"agreement-text"],"isEmailRequired":[1028,"is-email-required"],"productId":[1025,"product-id"],"thanksMessage":[1025,"thanks-message"],"quickOrderStyle":[1025,"quick-order-style"],"user":[32],"isAvailable":[32],"oneClick":[32],"expanded":[32],"isTermsRequired":[32],"countryCode":[32],"submitSucess":[32],"placeHolderEmail":[32],"emailOptional":[32],"agreementShowText":[32],"agreementModalHead":[32],"userNameLabel":[32],"termsChecked":[32]}],[0,"salla-user-settings",{"deactivateAccount":[32],"promotionalMsgs":[32],"hideMyName":[32],"hideMyNameDesc":[32],"deactivateDesc":[32],"promotionalMsgsDesc":[32],"sorryForLeavingText":[32],"warningText":[32],"keepAccount":[32],"buttonLoading":[32],"canHideName":[32],"isHiddenName":[32],"isNotifiable":[32]}],[0,"salla-bottom-alert",{"type":[513],"icon":[513],"message":[513],"actionUrl":[513,"action-url"],"actionLabel":[513,"action-label"],"storeId":[32],"template":[32],"loading":[32],"templateData":[32],"defaultMessage":[32],"defaultActionLabel":[32],"storeFeatures":[32],"storeDetails":[32],"storePrice":[32],"storePriceDetails":[32],"theDeveloper":[32],"templateInformation":[32],"buyTheTemplate":[32],"isRtl":[32],"storeName":[32]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"maxWords":[2,"max-words"],"showAction":[4,"show-action"],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]],{"search_term":["handleSearch"]}],[0,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"supportWebAuth":[516,"support-web-auth"],"inline":[516],"storeId":[1032,"store-id"],"api":[1],"headers":[1025],"withoutReload":[1028,"without-reload"],"messages":[32],"isClosable":[32],"iframeLoaded":[32],"scrolling":[32],"direction":[32],"canRenderIframe":[32],"open":[64]}],[0,"salla-menu",{"source":[1],"sourceValue":[1,"source-value"],"topnav":[4],"useReactLink":[4,"use-react-link"],"limit":[2],"menus":[32]}],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[513],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"convertedPlatforms":[32],"open":[64],"refresh":[64]}],[4,"salla-alert",{"message":[1],"variant":[1],"icon":[1]}],[0,"salla-breadcrumb",{"breadcrumbs":[32]}],[4,"salla-cart-summary",{"showCartLabel":[4,"show-cart-label"],"cartSummaryCount":[32],"cartSummaryTotal":[32],"cartLabel":[32],"animateToCart":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"loadMoreText":[1,"load-more-text"],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[0,"salla-maintenance-alert",{"title":[32],"message":[32],"buttonTitle":[32]}],[4,"salla-quantity-input",{"cartItemId":[8,"cart-item-id"],"quantity":[32],"fireChangeEvent":[32],"decrease":[64],"increase":[64],"setValue":[64]},null,{"quantity":["watchPropHandler"]}],[4,"salla-user-menu",{"inline":[516],"avatarOnly":[516,"avatar-only"],"showHeader":[516,"show-header"],"relativeDropdown":[516,"relative-dropdown"],"accountLoading":[32],"opened":[32],"notifications":[32],"orders":[32],"pending_orders":[32],"wishlist":[32],"profile":[32],"rating":[32],"wallet":[32],"loyalty_program":[32],"logout":[32],"hello":[32],"first_name":[32],"last_name":[32],"avatar":[32],"is_loggedIn":[32],"badges":[32],"hasBadges":[32],"OrderUpdate":[32]}],[0,"salla-products-slider",{"blockTitle":[1,"block-title"],"subTitle":[1,"sub-title"],"sliderId":[1,"slider-id"],"displayAllUrl":[1,"display-all-url"],"autoplay":[1028],"source":[1537],"sourceValue":[1,"source-value"],"limit":[1026],"sliderConfig":[520,"slider-config"],"productCardComponent":[1,"product-card-component"],"includes":[1040],"productsData":[32],"isReady":[32],"sourceValueIsValid":[32],"hasCustomComponent":[32],"apiUrl":[32],"parsedSourceValue":[32]}],[4,"salla-map",{"name":[1],"required":[4],"readonly":[4],"searchable":[1028],"lat":[1026],"lng":[1026],"apiKey":[1025,"api-key"],"modalTitle":[1,"modal-title"],"zoom":[1026],"theme":[1025],"modalActivityTitle":[32],"confirmButtonTitle":[32],"locateButtonTitle":[32],"locateButtonEdit":[32],"searchPlaceholder":[32],"searchInputValue":[32],"formattedAddress":[32],"geolocationError":[32],"searchInput":[32],"mapInput":[32],"mapElement":[32],"selectedLat":[32],"selectedLng":[32],"open":[64]}],[0,"salla-reviews-summary",{"itemId":[2,"item-id"],"data":[32],"canRender":[32],"basedOnLabel":[32],"recommendedLabel":[32],"showRatingSummary":[32],"recommendationOnly":[32],"showRecommendation":[32]}],[0,"salla-comment-form",{"type":[1537],"showAvatar":[4,"show-avatar"],"itemId":[1544,"item-id"],"placeholder":[32],"submitText":[32],"canComment":[32]}],[4,"salla-drawer",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"drawerTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]],{"visible":["handleVisible"]}],[4,"salla-color-picker",{"name":[1],"required":[4],"color":[1537],"format":[1],"showCancelButton":[4,"show-cancel-button"],"showTextField":[4,"show-text-field"],"enableAlpha":[4,"enable-alpha"],"widgetColor":[32],"setPickerOption":[64],"movePopUp":[64],"setColorValue":[64],"openPicker":[64],"closePicker":[64],"destroyPicker":[64]}],[0,"salla-products-list",{"source":[1537],"sourceValue":[1032,"source-value"],"limit":[1026],"sortBy":[1025,"sort-by"],"filtersResults":[1540,"filters-results"],"horizontalCards":[516,"horizontal-cards"],"rowCards":[516,"row-cards"],"autoload":[1028],"loadMoreText":[1,"load-more-text"],"productCardComponent":[1,"product-card-component"],"includes":[1040],"page":[32],"nextPage":[32],"hasInfiniteScroll":[32],"hasCustomComponent":[32],"sourceValueIsValid":[32],"placeholderText":[32],"endOfText":[32],"failedLoadMore":[32],"currentPage":[32],"currentCategoryIdFilter":[32],"isReady":[32],"showPlaceholder":[32],"switchToNormalBehavior":[32],"parsedFilters":[32],"filtersSnapshot":[32],"setFilters":[64],"reload":[64]}],[0,"salla-comment-item",{"comment":[16],"hideBought":[16,"hide-bought"],"has_bought_trans":[32],"rated_trans":[32],"waiting_approval_trans":[32],"has_order_trans":[32],"allowLikes":[32],"allowAttachImages":[32],"helpfulLabel":[32],"likesCount":[32],"likedComments":[32]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-product-card",{"product":[1],"horizontal":[4],"shadowOnHover":[4,"shadow-on-hover"],"hideAddBtn":[4,"hide-add-btn"],"fullImage":[4,"full-image"],"minimal":[4],"isSpecial":[4,"is-special"],"showQuantity":[4,"show-quantity"],"productData":[32],"fitImageHeight":[32],"remained":[32],"outOfStock":[32],"donationAmount":[32],"startingPrice":[32],"addToCart":[32],"placeholder":[32]}],[0,"salla-datetime-picker",{"value":[1537],"required":[4],"name":[513],"placeholder":[1],"allowInput":[4,"allow-input"],"allowInvalidPreload":[4,"allow-invalid-preload"],"altFormat":[1,"alt-format"],"altInput":[4,"alt-input"],"altInputClass":[1,"alt-input-class"],"appendTo":[16,"append-to"],"ariaDateFormat":[1,"aria-date-format"],"autoFillDefaultTime":[4,"auto-fill-default-time"],"clickOpens":[4,"click-opens"],"closeOnSelect":[4,"close-on-select"],"conjunction":[1],"dateFormat":[1,"date-format"],"defaultDate":[8,"default-date"],"defaultHour":[2,"default-hour"],"defaultMinute":[2,"default-minute"],"defaultSeconds":[2,"default-seconds"],"disable":[16],"disableMobile":[4,"disable-mobile"],"enable":[16],"enableSeconds":[4,"enable-seconds"],"enableTime":[4,"enable-time"],"formatDate":[16,"format-date"],"hourIncrement":[2,"hour-increment"],"inline":[4],"locale":[1],"maxDate":[8,"max-date"],"maxTime":[8,"max-time"],"minDate":[8,"min-date"],"minTime":[8,"min-time"],"minuteIncrement":[2,"minute-increment"],"mode":[1],"monthSelectorType":[1,"month-selector-type"],"nextArrow":[1,"next-arrow"],"noCalendar":[4,"no-calendar"],"dateParser":[16,"date-parser"],"position":[1],"positionElement":[16,"position-element"],"prevArrow":[1,"prev-arrow"],"shorthandCurrentMonth":[4,"shorthand-current-month"],"static":[4],"showMonths":[2,"show-months"],"time_24hr":[4,"time_-2-4hr"],"weekNumbers":[4,"week-numbers"],"wrap":[4],"disabled":[4]}],[4,"salla-add-product-button",{"channels":[513],"subscribedOptions":[1,"subscribed-options"],"quickBuy":[1540,"quick-buy"],"quantity":[514],"donatingAmount":[514,"donating-amount"],"notifyOptionsAvailability":[516,"notify-options-availability"],"productId":[520,"product-id"],"supportStickyBar":[516,"support-sticky-bar"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"hasOutOfStockOption":[32],"hasSubscribedOptions":[32],"selectedOptions":[32],"showQuickBuy":[32],"isApplePayActive":[32],"buyNowText":[32]}],[0,"salla-count-down",{"date":[1],"preOrder":[1,"pre-order"],"boxed":[4],"size":[1],"color":[1],"labeled":[4],"endText":[1,"end-text"],"digits":[1],"endOfDay":[4,"end-of-day"],"daysLabel":[32],"hoursLabel":[32],"minutesLabel":[32],"secondsLabel":[32],"endLabel":[32],"invalidDate":[32],"offerEnded":[32],"countInterval":[32],"days":[32],"hours":[32],"minutes":[32],"seconds":[32],"endCountDown":[64]}],[0,"salla-file-upload",{"value":[1544],"files":[513],"height":[513],"cartItemId":[1,"cart-item-id"],"profileImage":[516,"profile-image"],"name":[1537],"payloadName":[1,"payload-name"],"type":[1],"accept":[1537],"fileId":[2,"file-id"],"url":[1025],"method":[1],"formData":[1,"form-data"],"required":[4],"maxFileSize":[1,"max-file-size"],"disabled":[4],"allowDrop":[4,"allow-drop"],"allowBrowse":[4,"allow-browse"],"allowPaste":[4,"allow-paste"],"allowMultiple":[4,"allow-multiple"],"allowReplace":[4,"allow-replace"],"allowRevert":[4,"allow-revert"],"allowRemove":[4,"allow-remove"],"allowProcess":[4,"allow-process"],"allowReorder":[4,"allow-reorder"],"allowImagePreview":[4,"allow-image-preview"],"imagePreviewHeight":[2,"image-preview-height"],"filePosterHeight":[2,"file-poster-height"],"storeAsFile":[4,"store-as-file"],"forceRevert":[4,"force-revert"],"maxFilesCount":[2,"max-files-count"],"maxParallelUploads":[2,"max-parallel-uploads"],"checkValidity":[4,"check-validity"],"itemInsertLocation":[1,"item-insert-location"],"itemInsertInterval":[2,"item-insert-interval"],"credits":[4],"dropOnPage":[4,"drop-on-page"],"dropOnElement":[4,"drop-on-element"],"dropValidation":[4,"drop-validation"],"ignoredFiles":[16,"ignored-files"],"instantUpload":[1028,"instant-upload"],"chunkUploads":[4,"chunk-uploads"],"chunkForce":[4,"chunk-force"],"chunkSize":[2,"chunk-size"],"chunkRetryDelays":[16,"chunk-retry-delays"],"labelDecimalSeparator":[1,"label-decimal-separator"],"labelThousandsSeparator":[1,"label-thousands-separator"],"labelIdle":[1025,"label-idle"],"iconRemove":[1,"icon-remove"],"iconProcess":[1,"icon-process"],"iconRetry":[1,"icon-retry"],"iconUndo":[1,"icon-undo"],"max_images_count":[32],"max_count_hint":[32],"uploadedFiles":[32],"isListScrollerListenerAdded":[32],"showMaxCountHint":[32],"setOption":[64]}],[4,"salla-list-tile",{"href":[1],"target":[1]}],[0,"salla-product-availability",{"channels":[1],"notifyOptionsAvailability":[4,"notify-options-availability"],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]},null,{"channels":["channelsWatcher"]}],[0,"salla-quick-buy",{"type":[1025],"productId":[1025,"product-id"],"cartId":[1025,"cart-id"],"amount":[1538],"currency":[1025],"options":[16],"isRequireShipping":[1028,"is-require-shipping"],"applePayOnly":[1028,"apple-pay-only"],"isApplePayActive":[32],"quickBuy":[32]}],[0,"salla-progress-bar",{"donation":[1],"target":[1026],"value":[1026],"height":[1025],"header":[1025],"stripped":[1028],"message":[1025],"unit":[1025],"color":[1025],"hideUnits":[4,"hide-units"]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2],"reviews":[2],"withLabel":[4,"with-label"],"editable":[4],"translationsLoaded":[32],"labels":[32],"reviewLabel":[32],"selectedStar":[32]}],[4,"salla-slider",{"blockTitle":[513,"block-title"],"listenToThumbnailsOption":[516,"listen-to-thumbnails-option"],"blockSubtitle":[513,"block-subtitle"],"displayAllUrl":[513,"display-all-url"],"arrowsCentered":[516,"arrows-centered"],"verticalThumbs":[516,"vertical-thumbs"],"gridThumbs":[516,"grid-thumbs"],"vertical":[516],"autoHeight":[516,"auto-height"],"showControls":[516,"show-controls"],"controlsOuter":[516,"controls-outer"],"showThumbsControls":[4,"show-thumbs-controls"],"autoPlay":[4,"auto-play"],"slidesPerView":[1,"slides-per-view"],"pagination":[4],"centered":[4],"loop":[4],"direction":[1537],"type":[1],"sliderConfig":[520,"slider-config"],"thumbsConfig":[520,"thumbs-config"],"currentIndex":[32],"isEnd":[32],"isBeginning":[32],"swiperScript":[32],"displayAllTitle":[32],"windowWidth":[32],"sliderInstance":[64],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"slideToLoop":[64],"slideNextLoop":[64],"slidePrevLoop":[64],"slideReset":[64],"slideToClosest":[64],"update":[64],"updateAutoHeight":[64],"updateSlides":[64],"updateProgress":[64],"updateSlidesClasses":[64],"getSlides":[64],"updateSize":[64],"sliderInit":[64],"thumbsSliderInstance":[64],"thumbsSliderInit":[64],"thumbsSliderUpdate":[64],"thumbsSliderUpdateSlides":[64],"getThumbsUpdateSize":[64],"thumbsSlideTo":[64],"getThumbsSlides":[64]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[0,"salla-tel-input",{"phone":[1025],"autofocus":[516],"name":[1],"disabled":[4],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]},[[0,"keyup","handleKeyUp"]],{"visible":["handleVisible"]}],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"type":[513],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["p-284dae41.system",[[0,"salla-booking-field",{"option":[16],"productId":[2,"product-id"],"bookNowLabel":[32],"editLabel":[32],"bookedLabel":[32],"selectDate":[32],"bookingUrl":[32],"iframeReady":[32],"reservations":[32],"reservationsInput":[32]}],[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-60e6d7e6.system",[[0,"salla-price-range",{"minPrice":[1032,"min-price"],"maxPrice":[1032,"max-price"],"option":[16],"filtersData":[520,"filters-data"],"min":[32],"max":[32],"priceOptions":[32],"moreThanLabel":[32],"lessThanLabel":[32],"toLabel":[32],"fromLabel":[32],"typing":[32],"isMin":[32],"isRTL":[32],"reset":[64]}]]]]'),t)]}}))}))}))}}}));
|
|
5
|
-
//# sourceMappingURL=p-ByGP8fWO.system.js.map
|