@salla.sa/twilight-components 2.14.230 → 2.14.231
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-CzeN2gey.js → app-globals-DzfApVXS.js} +3 -3
- package/dist/cjs/{app-globals-CzeN2gey.js.map → app-globals-DzfApVXS.js.map} +1 -1
- package/dist/cjs/{index-DAzolwX4.js → index-DvI9OL7G.js} +4 -4
- package/dist/cjs/index-DvI9OL7G.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- 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 +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 +1 -1
- 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 +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{app-globals-Bwee9N87.js → app-globals-Cm7knHYb.js} +3 -3
- package/dist/esm/{app-globals-Bwee9N87.js.map → app-globals-Cm7knHYb.js.map} +1 -1
- package/dist/esm/{index-DWuTKtBW.js → index-K-KnMaGu.js} +4 -4
- package/dist/esm/index-K-KnMaGu.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- 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 +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 +1 -1
- 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 +3 -3
- package/dist/esm-es5/{app-globals-Bwee9N87.js → app-globals-Cm7knHYb.js} +2 -2
- package/dist/esm-es5/{app-globals-Bwee9N87.js.map → app-globals-Cm7knHYb.js.map} +1 -1
- package/dist/esm-es5/{index-DWuTKtBW.js → index-K-KnMaGu.js} +3 -3
- package/dist/esm-es5/index-K-KnMaGu.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-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- 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 +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-739a5124.system.entry.js → p-02095113.system.entry.js} +2 -2
- package/dist/twilight/p-066ed2fb.system.entry.js +5 -0
- package/dist/twilight/{p-e4e860d1.entry.js → p-077a4227.entry.js} +2 -2
- package/dist/twilight/{p-ddfa5a64.system.entry.js → p-0953aebc.system.entry.js} +2 -2
- package/dist/twilight/{p-5a7bad68.system.entry.js → p-096b72e4.system.entry.js} +2 -2
- package/dist/twilight/{p-4c539fcc.system.entry.js → p-0a35b53b.system.entry.js} +2 -2
- package/dist/twilight/{p-20f238a0.system.entry.js → p-10e4b4e8.system.entry.js} +2 -2
- package/dist/twilight/{p-65939c80.system.entry.js → p-1228f8f9.system.entry.js} +2 -2
- package/dist/twilight/p-17d1f7fe.entry.js +5 -0
- package/dist/twilight/{p-6ea49b56.entry.js → p-180bfafc.entry.js} +2 -2
- package/dist/twilight/{p-3277f8a3.entry.js → p-189bf3cd.entry.js} +2 -2
- package/dist/twilight/{p-e4b88ce5.system.entry.js → p-27526d70.system.entry.js} +2 -2
- package/dist/twilight/{p-94056702.entry.js → p-29e5637d.entry.js} +2 -2
- package/dist/twilight/{p-BgTOBm1J.system.js.map → p-2HwE_jgf.system.js.map} +1 -1
- package/dist/twilight/{p-6a996e8a.system.entry.js → p-2b1afbb7.system.entry.js} +2 -2
- package/dist/twilight/{p-6245cde6.system.entry.js → p-2fb23114.system.entry.js} +2 -2
- package/dist/twilight/{p-68078462.system.entry.js → p-326a448a.system.entry.js} +2 -2
- package/dist/twilight/{p-2a4341a8.entry.js → p-3788713e.entry.js} +2 -2
- package/dist/twilight/{p-f02d527f.system.entry.js → p-3d3aac90.system.entry.js} +2 -2
- package/dist/twilight/{p-3562d025.entry.js → p-3d3f711a.entry.js} +2 -2
- package/dist/twilight/{p-7aefaf33.entry.js → p-46d0e7cb.entry.js} +2 -2
- package/dist/twilight/{p-0ad41836.entry.js → p-4b91a53e.entry.js} +2 -2
- package/dist/twilight/{p-38b6b862.entry.js → p-4c280325.entry.js} +2 -2
- package/dist/twilight/p-4d450d8c.entry.js +5 -0
- package/dist/twilight/{p-7586a50e.system.entry.js → p-52656faa.system.entry.js} +2 -2
- package/dist/twilight/{p-1066d12e.system.entry.js → p-57cec543.system.entry.js} +2 -2
- package/dist/twilight/{p-20faf731.system.entry.js → p-62289eaf.system.entry.js} +3 -3
- package/dist/twilight/{p-b86b81a0.entry.js → p-73d7e79d.entry.js} +2 -2
- package/dist/twilight/{p-92b6f034.system.entry.js → p-764e649f.system.entry.js} +2 -2
- package/dist/twilight/{p-ab55d416.entry.js → p-781681ee.entry.js} +2 -2
- package/dist/twilight/{p-DkuJrfYK.system.js.map → p-7PcOK3Fu.system.js.map} +1 -1
- package/dist/twilight/p-7bfbf14b.entry.js +5 -0
- package/dist/twilight/{p-3ee481e4.entry.js → p-7cdce1d5.entry.js} +2 -2
- package/dist/twilight/{p-9bce1b54.system.entry.js → p-7d2a9a54.system.entry.js} +2 -2
- package/dist/twilight/{p-pn78bMUz.system.js.map → p-7rzYRjAP.system.js.map} +1 -1
- package/dist/twilight/{p-5087750a.system.entry.js → p-806f3f41.system.entry.js} +2 -2
- package/dist/twilight/{p-516f3218.system.entry.js → p-81b89d1e.system.entry.js} +2 -2
- package/dist/twilight/{p-ae750319.system.entry.js → p-820dc67a.system.entry.js} +2 -2
- package/dist/twilight/{p-4b614548.system.entry.js → p-82d1977a.system.entry.js} +2 -2
- package/dist/twilight/{p-1344b38f.entry.js → p-89ea5295.entry.js} +2 -2
- package/dist/twilight/{p-f542d77e.system.entry.js → p-8a7753ca.system.entry.js} +2 -2
- package/dist/twilight/{p-39744d46.entry.js → p-8e912064.entry.js} +2 -2
- package/dist/twilight/{p-1bebbe3d.entry.js → p-908a0e44.entry.js} +2 -2
- package/dist/twilight/{p-5d7fff02.entry.js → p-9101db15.entry.js} +2 -2
- package/dist/twilight/{p-df0c4065.entry.js → p-95fe2aca.entry.js} +2 -2
- package/dist/twilight/{p-0f1b1e46.entry.js → p-985114b4.entry.js} +2 -2
- package/dist/twilight/{p-rD_uaRHC.js → p-B6s_pwWh.js} +2 -2
- package/dist/twilight/{p-rD_uaRHC.js.map → p-B6s_pwWh.js.map} +1 -1
- package/dist/twilight/{p-CCLDyorI.system.js.map → p-B7g6x8Am.system.js.map} +1 -1
- package/dist/twilight/{p-Cgf31f5d.system.js.map → p-BEDNQYRh.system.js.map} +1 -1
- package/dist/twilight/{p-DGMCd6h5.system.js.map → p-BF8GgH0S.system.js.map} +1 -1
- package/dist/twilight/{p-BPhhu2Q7.system.js.map → p-BOhb1ybL.system.js.map} +1 -1
- package/dist/twilight/{p-Cm-NUOuA.system.js.map → p-BmdaRQy5.system.js.map} +1 -1
- package/dist/twilight/{p--7AXCfED.system.js.map → p-C2mgCkib.system.js.map} +1 -1
- package/dist/twilight/{p-3jVXRqU4.system.js.map → p-C2tLKqJU.system.js.map} +1 -1
- package/dist/twilight/{p-fwGmpkUD.system.js.map → p-C9M8V0qH.system.js.map} +1 -1
- package/dist/twilight/{p-BTqyH9zP.system.js → p-CB4t6F0a.system.js} +6 -6
- package/dist/twilight/p-CB4t6F0a.system.js.map +1 -0
- package/dist/twilight/{p-CLFMzH2N.system.js.map → p-CF_7ZqRk.system.js.map} +1 -1
- package/dist/twilight/{p-CsndEHxH.system.js.map → p-CGqbo2hI.system.js.map} +1 -1
- package/dist/twilight/{p-B6ITtzm0.system.js → p-CHMcyXdn.system.js} +2 -2
- package/dist/twilight/{p-B6ITtzm0.system.js.map → p-CHMcyXdn.system.js.map} +1 -1
- package/dist/twilight/{p-X9KT5ssu.system.js.map → p-CNGCBimH.system.js.map} +1 -1
- package/dist/twilight/{p-D79MBbJJ.system.js.map → p-CR9kUb4q.system.js.map} +1 -1
- package/dist/twilight/{p-HcXgKso7.system.js.map → p-CqzLJ1tE.system.js.map} +1 -1
- package/dist/twilight/{p-BTZj9ahe.system.js → p-CwY5gn36.system.js} +2 -2
- package/dist/twilight/{p-BTZj9ahe.system.js.map → p-CwY5gn36.system.js.map} +1 -1
- package/dist/twilight/{p-CB2HThNi.system.js.map → p-Cz_STmL_.system.js.map} +1 -1
- package/dist/twilight/{p-D6LiKG0S.system.js.map → p-D-rWwr-c.system.js.map} +1 -1
- package/dist/twilight/{p-DguvW8UE.system.js.map → p-D59PXlDG.system.js.map} +1 -1
- package/dist/twilight/{p-BD76JVV3.system.js.map → p-DEvnY0kF.system.js.map} +1 -1
- package/dist/twilight/{p-wbYBcJxh.system.js.map → p-DG5FZOv8.system.js.map} +1 -1
- package/dist/twilight/{p-DN10t2cI.system.js.map → p-DNMYGYPt.system.js.map} +1 -1
- package/dist/twilight/{p-48yJmYvC.system.js.map → p-DrB70kjZ.system.js.map} +1 -1
- package/dist/twilight/{p-DwRDwfPU.system.js.map → p-Dsq_CfVc.system.js.map} +1 -1
- package/dist/twilight/{p-BPEkR7Uz.system.js.map → p-H7qlA4j8.system.js.map} +1 -1
- package/dist/twilight/{p-C_Gx4fNg.system.js.map → p-JoxQKOY3.system.js.map} +1 -1
- package/dist/twilight/{p-DWuTKtBW.js → p-K-KnMaGu.js} +3 -3
- package/dist/twilight/p-K-KnMaGu.js.map +1 -0
- package/dist/twilight/{p-CwbK3391.system.js.map → p-OYJA5F-t.system.js.map} +1 -1
- package/dist/twilight/{p-DRtUXiV3.system.js.map → p-S931banH.system.js.map} +1 -1
- package/dist/twilight/{p-DUa8YmqN.system.js.map → p-X-ZAIOoP.system.js.map} +1 -1
- package/dist/twilight/{p-3363633a.system.entry.js → p-a65d4018.system.entry.js} +2 -2
- package/dist/twilight/{p-9ae63c85.entry.js → p-a6b815e7.entry.js} +2 -2
- package/dist/twilight/{p-51831df7.entry.js → p-a7a849ad.entry.js} +2 -2
- package/dist/twilight/{p-9a63eaf0.entry.js → p-a8e8dd88.entry.js} +2 -2
- package/dist/twilight/{p-d75b04f0.entry.js → p-ab7bffa3.entry.js} +2 -2
- package/dist/twilight/{p-f20798f6.entry.js → p-acb230c4.entry.js} +2 -2
- package/dist/twilight/{p-698a3693.entry.js → p-b967c989.entry.js} +2 -2
- package/dist/twilight/{p-83cea4f0.system.entry.js → p-b9f2ef06.system.entry.js} +2 -2
- package/dist/twilight/{p-e7901c9d.system.entry.js → p-bbea9c9f.system.entry.js} +2 -2
- package/dist/twilight/{p-58af07d1.system.entry.js → p-bde99764.system.entry.js} +2 -2
- package/dist/twilight/{p-Bwzf6l2m.system.js.map → p-c0okMLAo.system.js.map} +1 -1
- package/dist/twilight/{p-5c76c2b2.system.entry.js → p-c184330c.system.entry.js} +2 -2
- package/dist/twilight/{p-63b3ea2f.entry.js → p-ce5e5b41.entry.js} +2 -2
- package/dist/twilight/{p-445886ad.entry.js → p-ceb7a4b7.entry.js} +2 -2
- package/dist/twilight/{p-e755c300.entry.js → p-cec0e390.entry.js} +2 -2
- package/dist/twilight/{p-2aee6a68.system.entry.js → p-d08afed8.system.entry.js} +2 -2
- package/dist/twilight/{p-7a0ce5d1.entry.js → p-d61a207e.entry.js} +2 -2
- package/dist/twilight/{p-4ff2bbf4.system.entry.js → p-d9c7d4fe.system.entry.js} +2 -2
- package/dist/twilight/{p-CnsQrhjY.system.js.map → p-drQmfOfa.system.js.map} +1 -1
- package/dist/twilight/{p-c175787a.system.entry.js → p-e6eeec59.system.entry.js} +2 -2
- package/dist/twilight/{p-2c9efa34.system.entry.js → p-ec773647.system.entry.js} +2 -2
- package/dist/twilight/{p-81b6008d.system.entry.js → p-ef538392.system.entry.js} +2 -2
- package/dist/twilight/{p-9e9ec157.entry.js → p-f38e5129.entry.js} +7 -7
- package/dist/twilight/{p-37d553e5.system.entry.js → p-f944716f.system.entry.js} +2 -2
- package/dist/twilight/{p-0f1a8a47.entry.js → p-fffa3845.entry.js} +2 -2
- package/dist/twilight/{p-BdwSnv-_.system.js.map → p-gAuJ6khj.system.js.map} +1 -1
- package/dist/twilight/{p-CrkO_aXc.system.js.map → p-nzWpjpWF.system.js.map} +1 -1
- package/dist/twilight/{p-DmwqyKEf.system.js.map → p-sZL82_Kt.system.js.map} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-DAzolwX4.js.map +0 -1
- package/dist/esm/index-DWuTKtBW.js.map +0 -1
- package/dist/esm-es5/index-DWuTKtBW.js.map +0 -1
- package/dist/twilight/p-77007b51.system.entry.js +0 -5
- package/dist/twilight/p-8d0c6a10.entry.js +0 -5
- package/dist/twilight/p-9063b7d7.entry.js +0 -5
- package/dist/twilight/p-BTqyH9zP.system.js.map +0 -1
- package/dist/twilight/p-DWuTKtBW.js.map +0 -1
- package/dist/twilight/p-b7f713fe.entry.js +0 -5
- /package/dist/twilight/{p-739a5124.system.entry.js.map → p-02095113.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-77007b51.system.entry.js.map → p-066ed2fb.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e4e860d1.entry.js.map → p-077a4227.entry.js.map} +0 -0
- /package/dist/twilight/{p-ddfa5a64.system.entry.js.map → p-0953aebc.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5a7bad68.system.entry.js.map → p-096b72e4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4c539fcc.system.entry.js.map → p-0a35b53b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-20f238a0.system.entry.js.map → p-10e4b4e8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-65939c80.system.entry.js.map → p-1228f8f9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b7f713fe.entry.js.map → p-17d1f7fe.entry.js.map} +0 -0
- /package/dist/twilight/{p-6ea49b56.entry.js.map → p-180bfafc.entry.js.map} +0 -0
- /package/dist/twilight/{p-3277f8a3.entry.js.map → p-189bf3cd.entry.js.map} +0 -0
- /package/dist/twilight/{p-e4b88ce5.system.entry.js.map → p-27526d70.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-94056702.entry.js.map → p-29e5637d.entry.js.map} +0 -0
- /package/dist/twilight/{p-6a996e8a.system.entry.js.map → p-2b1afbb7.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6245cde6.system.entry.js.map → p-2fb23114.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-68078462.system.entry.js.map → p-326a448a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2a4341a8.entry.js.map → p-3788713e.entry.js.map} +0 -0
- /package/dist/twilight/{p-f02d527f.system.entry.js.map → p-3d3aac90.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3562d025.entry.js.map → p-3d3f711a.entry.js.map} +0 -0
- /package/dist/twilight/{p-7aefaf33.entry.js.map → p-46d0e7cb.entry.js.map} +0 -0
- /package/dist/twilight/{p-0ad41836.entry.js.map → p-4b91a53e.entry.js.map} +0 -0
- /package/dist/twilight/{p-38b6b862.entry.js.map → p-4c280325.entry.js.map} +0 -0
- /package/dist/twilight/{p-8d0c6a10.entry.js.map → p-4d450d8c.entry.js.map} +0 -0
- /package/dist/twilight/{p-7586a50e.system.entry.js.map → p-52656faa.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1066d12e.system.entry.js.map → p-57cec543.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-20faf731.system.entry.js.map → p-62289eaf.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b86b81a0.entry.js.map → p-73d7e79d.entry.js.map} +0 -0
- /package/dist/twilight/{p-92b6f034.system.entry.js.map → p-764e649f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ab55d416.entry.js.map → p-781681ee.entry.js.map} +0 -0
- /package/dist/twilight/{p-9063b7d7.entry.js.map → p-7bfbf14b.entry.js.map} +0 -0
- /package/dist/twilight/{p-3ee481e4.entry.js.map → p-7cdce1d5.entry.js.map} +0 -0
- /package/dist/twilight/{p-9bce1b54.system.entry.js.map → p-7d2a9a54.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5087750a.system.entry.js.map → p-806f3f41.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-516f3218.system.entry.js.map → p-81b89d1e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ae750319.system.entry.js.map → p-820dc67a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4b614548.system.entry.js.map → p-82d1977a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1344b38f.entry.js.map → p-89ea5295.entry.js.map} +0 -0
- /package/dist/twilight/{p-f542d77e.system.entry.js.map → p-8a7753ca.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-39744d46.entry.js.map → p-8e912064.entry.js.map} +0 -0
- /package/dist/twilight/{p-1bebbe3d.entry.js.map → p-908a0e44.entry.js.map} +0 -0
- /package/dist/twilight/{p-5d7fff02.entry.js.map → p-9101db15.entry.js.map} +0 -0
- /package/dist/twilight/{p-df0c4065.entry.js.map → p-95fe2aca.entry.js.map} +0 -0
- /package/dist/twilight/{p-0f1b1e46.entry.js.map → p-985114b4.entry.js.map} +0 -0
- /package/dist/twilight/{p-3363633a.system.entry.js.map → p-a65d4018.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9ae63c85.entry.js.map → p-a6b815e7.entry.js.map} +0 -0
- /package/dist/twilight/{p-51831df7.entry.js.map → p-a7a849ad.entry.js.map} +0 -0
- /package/dist/twilight/{p-9a63eaf0.entry.js.map → p-a8e8dd88.entry.js.map} +0 -0
- /package/dist/twilight/{p-d75b04f0.entry.js.map → p-ab7bffa3.entry.js.map} +0 -0
- /package/dist/twilight/{p-f20798f6.entry.js.map → p-acb230c4.entry.js.map} +0 -0
- /package/dist/twilight/{p-698a3693.entry.js.map → p-b967c989.entry.js.map} +0 -0
- /package/dist/twilight/{p-83cea4f0.system.entry.js.map → p-b9f2ef06.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e7901c9d.system.entry.js.map → p-bbea9c9f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-58af07d1.system.entry.js.map → p-bde99764.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5c76c2b2.system.entry.js.map → p-c184330c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-63b3ea2f.entry.js.map → p-ce5e5b41.entry.js.map} +0 -0
- /package/dist/twilight/{p-445886ad.entry.js.map → p-ceb7a4b7.entry.js.map} +0 -0
- /package/dist/twilight/{p-e755c300.entry.js.map → p-cec0e390.entry.js.map} +0 -0
- /package/dist/twilight/{p-2aee6a68.system.entry.js.map → p-d08afed8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7a0ce5d1.entry.js.map → p-d61a207e.entry.js.map} +0 -0
- /package/dist/twilight/{p-4ff2bbf4.system.entry.js.map → p-d9c7d4fe.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c175787a.system.entry.js.map → p-e6eeec59.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2c9efa34.system.entry.js.map → p-ec773647.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-81b6008d.system.entry.js.map → p-ef538392.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9e9ec157.entry.js.map → p-f38e5129.entry.js.map} +0 -0
- /package/dist/twilight/{p-37d553e5.system.entry.js.map → p-f944716f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0f1a8a47.entry.js.map → p-fffa3845.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as t,h as s,H as i}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as e,c as t,h as s,H as i}from"./p-K-KnMaGu.js";import{a}from"./p-BedNk7k1.js";var r=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n`;const l=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";const n=class{constructor(s){e(this,s);this.changed=t(this,"changed");this.min=0;this.max=1e4;this.moreThanLabel="أكثر من";this.lessThanLabel="أقل من";this.toLabel="الى";this.fromLabel="من";this.typing=false;this.isMin=false;this.isRTL=salla.config.get("theme.is_rtl",true);this.filterValues=[]}connectedCallback(){var e;if(this.filtersData&&((e=this.filtersData)===null||e===void 0?void 0:e.price)){this.minPrice=this.filtersData.price.min;this.maxPrice=this.filtersData.price.max}salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel);this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel);this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel);this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)}));if(this.option.values.length==1){return}if(this.option.values.length<=5){this.filterValues=this.option.values;return}const t=Math.ceil(this.option.values.length/5);for(let e=0;e<this.option.values.length;e+=t){this.filterValues.push(this.option.values.slice(e,e+t).reduce(((e,t)=>{e.to=t.to;e.count+=t.count;return e})))}}async reset(){this.minInput.value=null;this.maxInput.value=null;this.minPrice=null;this.maxPrice=null}getPriceLabel(e){if(isNaN(e.from)||e.from<1){return`${this.lessThanLabel} ${salla.money(e.to)}`}if(isNaN(e.to)||e.to<1){return`${this.moreThanLabel} ${salla.money(e.from)}`}return`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){if(e&&(e>this.max||this.maxPrice&&e>this.maxPrice)){return}if(e<this.min){this.minPrice=this.min;return}if(e){this.minPrice=e}}maxInputValidation(e){if(e&&(e<this.min||this.minPrice&&e<this.minPrice)){return}if(e>this.max){this.maxPrice=this.max;return}}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput);salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?+this.minPrice*1:null;const s=this.maxPrice?+this.maxPrice*1:null;if(!this.maxPrice){this.maxPrice=""}if(this.isMin){this.minInputValidation(t)}else{if(!this.minPrice){this.minPrice=0}this.maxInputValidation(s)}this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from;this.maxPrice=t.to!=="*"?t.to:"";this.changedEventHandler(e)}isChecked(e){if(!this.minPrice&&!this.maxPrice){return false}let t=(e.from<1||e.from=="*")&&this.minPrice==0||e.from==this.minPrice;let s=e.to=="*"||!e.to||e.to==this.maxPrice;return t&&s}handleMinPrice(e){this.isMin=true;const t=e.target.value;this.minPrice=t===""?0:t}handleMaxPrice(e){this.isMin=false;const t=e.target.value;this.maxPrice=t===undefined?"":t}render(){return s(i,{key:"e257e65621d724438fd4fdd74cdec45596a81cd0"},this.filterValues.map(((e,t)=>s("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},s("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),s("span",{innerHTML:this.getPriceLabel(e)})))),s("div",{key:"097faf8d72b3c441bc22041a5643f91f61bbdd40",class:"flex justify-center items-center"},s("div",{key:"6adaa2b16c015de4ab5e254d4a9be05bb65b7848",class:"relative max-w-xl w-full"},s("div",{key:"3667d98c1e0886fc31600d23dd5a41a18d5ff8d0",class:"s-price-range-inputs"},s("div",{key:"98fdc0fdc9632318daa4664d4798154a17fe700a",class:"s-price-range-relative"},s("div",{key:"addd7b56c1e2496dba50db7ec320f8f5ea129d42",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"d36e129fd777ccfe30cf8d974dd96cf82e64c805",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),s("div",{key:"b1fcc176d31d724c646291262e42c6a74e75f299",class:"s-price-range-gray-text"}," -"),s("div",{key:"93db8728b9f118be78549c6839a4d85d4664a3dc",class:"s-price-range-relative"},s("div",{key:"7b63ca0ffd946d34549768bf87876868842478a4",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"ba005f3834bc2179e1346cae746b7c734abaf0dd",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),s("salla-button",{key:"74283ca210bf2f85a4e5d7dde69372e55453a5a5",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},s("span",{key:"04600f026e465f96f98d54841e8c7bd7d1c849bd",innerHTML:this.isRTL?a:r}))))))}componentDidLoad(){this.isReady=true}};n.style=l;export{n as salla_price_range};
|
|
5
|
+
//# sourceMappingURL=p-781681ee.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-7PcOK3Fu.system.js","sources":["src/components/salla-metadata/salla-metadata.scss?tag=salla-metadata","src/components/salla-metadata/salla-metadata.tsx"],"sourcesContent":["","import { Component, Host, h, Element, Prop, State } from '@stencil/core';\nimport { Field, Specs } from './interfaces';\n\n@Component({\n tag: 'salla-metadata',\n styleUrl: 'salla-metadata.scss',\n})\nexport class SallaMetadata {\n constructor() {\n if (this.entityId) {\n try {\n this.entityId = Array.isArray(this.entityId)\n ? this.entityId\n : JSON.parse(this.entityId as string);\n return;\n } catch (e) {\n salla.log('Bad json passed via entityId prop');\n }\n }\n }\n\n @Element() host: HTMLElement;\n\n /**\n * The entity type.\n */\n @Prop() entity: string = 'product';\n\n /**\n * The id of the product/the endity to which the specs are going to be fetched for.\n */\n @Prop() entityId: number | number[] | string;\n\n @State() specs: Specs[] = [];\n @State() download: string = salla.lang.get('pages.thank_you.download');\n\n private getValue(field: Field) {\n if (field.type === 'file') {\n return `<a href=\"${field.value}\" class=\"text-primary\" target=\"_blank\"><span class=\"sicon-download\"></span> ${this.download}</a>`;\n }\n if (field.type === 'url') {\n return `<a href=\"${field.value}\" class=\"text-blue-700 underline\" target=\"_blank\">${field.value}</a>`; // classes will be moved to the utilities.json file\n }\n if (field.type === 'date') {\n const date = new Date(field.value);\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based\n const year = date.getFullYear();\n\n const formattedDate = `${day}/${month}/${year}`;\n\n return formattedDate;\n }\n return field.value;\n }\n\n async componentWillLoad() {\n await salla.onReady();\n\n if (!salla.config.get('store.features')?.includes('custom-fields')) {\n return salla.logger.error('feature custom-fields is not activated');\n }\n\n //todo:: remove `product.showNewUrls` after changing it from BE\n if (!this.entityId && (salla.url.is_page('product.single') || salla.url.is_page(\"product.showNewUrls\"))) {\n this.entityId = salla.config.get('page.id');\n }\n\n if (!this.entityId) {\n return salla.logger.error(\"can't render salla-metadata without enity-id prop!\");\n }\n\n await salla.lang.onLoaded();\n this.download = salla.lang.get('pages.thank_you.download');\n\n const response = await Salla.api.metadata.fetchValues(this.entity, this.entityId);\n this.specs = response.data[0]?.sections;\n }\n render() {\n if (!this.specs.length) {\n return;\n }\n return (\n <Host class=\"s-metadata-wrapper\">\n {this.specs.map((item: Specs) => {\n return (\n <div class=\"s-metadata-box\">\n <div class=\"s-metadata-box-header\">\n <i class=\"sicon-list\"></i>\n {item.name}\n </div>\n\n {item.fields.map((field: Field) => {\n return (\n <div class=\"s-metadata-row\">\n <p class=\"s-metadata-row-name\">{field.name}</p>\n <p class=\"s-metadata-row-value\" innerHTML={this.getValue(field) as any}></p>\n </div>\n );\n })}\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as i,h as a}from"./p-K-KnMaGu.js";const e="";const t=class{constructor(a){i(this,a)}render(){return a("a",{key:"f4818ac9b7dc2573dd1ac8aa31aabc82454ea439",href:this.notification.url,class:{"s-notifications-item":true,"s-notifications-item-shadow":true,"s-notifications-item-read":!this.notification.is_new}},a("span",{key:"3766a4eb835408bf293054be3e04a561e1510728",class:"s-notifications-item-icon"},a("i",{key:"e9b1e4a18f22e765053b7d62f83a4af6e426bd47",class:{"s-notifications-item-icon sicon-bell-ring":true,"s-notifications-item-icon-new":this.notification.is_new}})),a("div",{key:"2005bcf68b61bb0aa5606480f703e4ee4cfbd415",class:"s-notifications-item-content"},a("div",{key:"a60fdc96431899c0c3183512ea81477f52e550d0",class:"s-notifications-item-content-leading"},a("h4",{key:"fb0eb1efe08440a1e2c12dc1af263adba0413d2b"},this.notification.title),a("p",{key:"c32790ad29bd267323d86e5c3abdec1ab75c09b2"},this.notification.sub_title)),a("span",{key:"e8fbfea5e91fe7d16c489a285502eaab08b16fd5",class:"s-notifications-item-content-trailing"},a("i",{key:"ea9fb9cf6ac2f9c84cde152fa1381e884971cba4",class:"sicon-time s-notifications-item-content-trailing-icon"}),a("span",{key:"1fb25f1463210c8ab467dff8aea22d9c4510301c"},this.notification.date))))}};t.style=e;export{t as salla_notification_item};
|
|
5
|
+
//# sourceMappingURL=p-7bfbf14b.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as t,h as a,H as i}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as e,c as t,h as a,H as i}from"./p-K-KnMaGu.js";const s="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";const c=class{constructor(a){e(this,a);this.prizeItemSelected=t(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return a(i,{key:"601dbcf73e68678eecc912c14c2b1be612a78551"},a("div",{key:"074f8b4cb736bfabd5885d9df77bf74e7c4829a1",onClick:this.onPrizeItemClick.bind(this)},a("img",{key:"4bec672992f7e998bde639295831a5c9ad5f5088",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),a("div",{key:"c8f858a7f406fe8e9123c57df627a4b6a2cbd719",class:"s-loyalty-prize-item-title"},this.item.name),a("div",{key:"81b954aa730e07c7f32ee538692581dede3543db",class:"s-loyalty-prize-item-subtitle"},this.item.description),a("div",{key:"b7baeada2da364fec6ee7bd606b595b1f652d8a8",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};c.style=s;export{c as salla_loyalty_prize_item};
|
|
5
|
+
//# sourceMappingURL=p-7cdce1d5.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,n,i,o){function r(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,e){function a(t){try{u(o.next(t))}catch(t){e(t)}}function s(t){try{u(o["throw"](t))}catch(t){e(t)}}function u(t){t.done?i(t.value):r(t.value).then(a,s)}u((o=o.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(e[0]&1)throw e[1];return e[1]},trys:[],ops:[]},o,r,e,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(n){return u([t,n])}}function u(s){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(i=0)),i)try{if(o=1,r&&(e=s[0]&2?r["return"]:s[0]?r["throw"]||((e=r["return"])&&e.call(r),0):r.next)&&!(e=e.call(r,s[1])).done)return e;if(r=0,e)s=[s[0]&2,e.value];switch(s[0]){case 0:case 1:e=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(e=i.trys,e=e.length>0&&e[e.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!e||s[1]>e[0]&&s[1]<e[3])){i.label=s[1];break}if(s[0]===6&&i.label<e[1]){i.label=e[1];e=s;break}if(e&&i.label<e[2]){i.label=e[2];i.ops.push(s);break}if(e[2])i.ops.pop();i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t];r=0}finally{o=e=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-BTqyH9zP.system.js","./p-Dxc5oJG6.system.js","./p-DTevZS21.system.js"],(function(t){"use strict";var n,i,o,r,e,a,s;return{setters:[function(t){n=t.r;i=t.c;o=t.h;r=t.H;e=t.g},function(t){a=t.I},function(t){s=t.C}],execute:function(){var u;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(u||(u={}));var c;(function(t){t["Sar"]="SAR"})(c||(c={}));var l='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n';var d="";var p=t("salla_product_options",function(){function t(t){var r=this;n(this,t);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=function(t,n,i){if(n==="custom"&&i==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:r.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();r.isCustomDonation=t.target.value==="custom";if(r.donationInput){if(t.target.value==="custom"){r.donationInput.value="";r.donationInput.focus()}else{r.donationInput.value=t.target.value}if(n==="custom"){return}salla.event.emit("product-options::donation-changed",{id:r.productId,price:t.target.value})}};this.hideLabel=function(t){if(t.type===u.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=function(t){if(!t.donation){return}var n=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":n,"s-product-options-donation-expired":!n}},o("p",null,t.donation.target_message),o("span",{innerHTML:n?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((function(){r.outOfStockText=salla.lang.get("pages.products.out_of_stock");r.donationAmount=salla.lang.get("pages.products.donation_amount");r.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");r.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((function(t){return r.setOptionsData(t.data.options)}))}}t.prototype.setOptionsData=function(t){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(r){this.optionsData=t;o=this;(i=(n=this.optionsData[0])===null||n===void 0?void 0:n.details)===null||i===void 0?void 0:i.forEach((function(t){Object.entries(t.skus_availability||{}).filter((function(t){return!t[1]})).map((function(t){return o.outSkus.push(Number(t[0]))}))}));return[2]}))}))};t.prototype.getSelectedOptionsData=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(i){t={};n=this.host.getElementSallaData();n.forEach((function(n,i){if(i.startsWith("options[")){t[i.replace("options[","").replace("]","")]=n}}));return[2,t]}))}))};t.prototype.reportValidity=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(o){t=this.host.querySelectorAll("[required]");n=true;for(i=0;i<t.length;i++){if("reportValidity"in t[i]&&!t[i].reportValidity()){n=false}}return[2,n]}))}))};t.prototype.hasOutOfStockOption=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;var i=this;return __generator(this,(function(o){return[2,this.selectedOptions.some((function(t){return t.is_out}))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((n=this.selectedSkus)===null||n===void 0?void 0:n.every((function(t){return i.outSkus.includes(t)})))]}))}))};t.prototype.getSelectedOptions=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.selectedOptions]}))}))};t.prototype.getOption=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.optionsData.find((function(n){return n.id===t}))]}))}))};t.prototype.invalidHandler=function(t,n){var i=t.target.closest(".s-product-options-option");if(!i.classList.contains("s-product-options-option-error")){i.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){var o=this.host.querySelector(".s-product-options-option-error");if(o===i){this.scrollToElement(i)}}};t.prototype.scrollToElement=function(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}};t.prototype.changedHandler=function(t,n,i){var o=this;if(i===void 0){i=true}var r={event:t,option:n,detail:null,productId:this.productId};if(n.details){var e=n.details.find((function(n){return Number(n.id)===Number(t.target.value)}));r.detail=e}if(n.type==="country"){this.handleCountryOptionChange(t,r.detail)}var a=t.target.closest(".s-product-options-option");if(t.target.value||(n.type===u.FILE||n.type===u.IMAGE)&&t.type==="added"||n.type===u.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((function(){a.classList.remove("s-product-options-option-error")}),200)}if(n.type===u.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(n);var s=this.selectedOptions.findIndex((function(t){return t.option_id===r.option.id}));if(r.option.type===u.MULTIPLE_OPTIONS){var c=this.selectedOptions.findIndex((function(t){var n;return t.option_id===r.option.id&&(t===null||t===void 0?void 0:t.id)===((n=r.detail)===null||n===void 0?void 0:n.id)}));if(c>-1){this.selectedOptions.splice(c,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},r.detail),{option_id:r.option.id}))}}else{if(!r.detail||Object.keys(r.detail).length===0){if(s>-1){this.selectedOptions.splice(s,1)}}else{if(s>-1){this.selectedOptions[s]=Object.assign(Object.assign({},r.detail),{option_id:r.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},r.detail),{option_id:r.option.id}))}}}this.optionsData=this.optionsData.map((function(t){if(t.id===r.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((function(t){var n,i;return Object.assign(Object.assign({},t),{is_selected:r.option.type===u.MULTIPLE_OPTIONS?o.selectedOptions.some((function(n){return n.id===t.id})):Number(t.id)===Number((n=r.detail)===null||n===void 0?void 0:n.id),value:(i=r.detail)===null||i===void 0?void 0:i.value})}))})}return t}));if(i){this.changed.emit(r);salla.event.emit("product-options::change",r)}};t.prototype.setSelectedSkus=function(){this.selectedSkus=this.selectedOptions.map((function(t){return Object.keys(t.skus_availability||{})})).reduce((function(t,n){return t.filter((function(t){return n.includes(t)}))}),[]).map((function(t){return Number(t)}))};t.prototype.handleRequiredMultipleOptions=function(t){if(t.type!==u.MULTIPLE_OPTIONS||!t.required){return}var n=this.host.querySelector('[data-option-id="'.concat(t.id,'"]'));var i=n.querySelectorAll("input:checked").length;n.querySelectorAll("input").forEach((function(t){return t.toggleAttribute("required",!i)}))};t.prototype.getLatLng=function(t,n){return t?t.split(",")[n==="lat"?0:1]:""};t.prototype.getDisplayForType=function(t){var n=this;if(this["".concat(t.type,"Option")]){return this["".concat(t.type,"Option")](t)}if(t.type===u.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===u.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===u.SINGLE_OPTION){return this.singleOption(t)}if(t.type===u.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===u.COUNTRY){return this.countryOption(t)}if(t.type===u.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:function(i){return n.invalidHandler(i,t)},option:t,productId:t.value})}salla.log("Couldn't find options type(".concat(t.type,")😢"));return""};t.prototype.getOptionShownWhen=function(t){return t.visibility_condition?{"data-show-when":"options[".concat(t.visibility_condition.option,"] ").concat(t.visibility_condition.operator," ").concat(t.visibility_condition.value)}:{}};t.prototype.getAvailableDigitalCardSKUs=function(t){var n=this.optionsData.find((function(t){var n=t.type;return n==="digital-code-value"}));if(!n)throw new Error("product-options:: No digital card options found");var i=Object.keys(t.skus_availability).filter((function(n){return t.skus_availability[n]===false}));this.availableDigitalCardValues=n.details.filter((function(t){return!Object.keys(t.skus_availability).filter((function(t){return i.includes(t)})).length}))};t.prototype.handleCountryOptionChange=function(t,n){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;var i=this.host.querySelector("input[data-code-value]:checked");if(i)i.checked=false;var o=this.optionsData.find((function(t){var n=t.type;return n==="digital-code-value"}));if(!o)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(n)};t.prototype.getSelectedDigitalCardOptions=function(t){var n=t.details.find((function(t){return t.is_selected}));var i=t.details.find((function(t){return!!t.is_default}))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return n||i};t.prototype.componentWillLoad=function(){var t=this;if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}var n=this.optionsData.filter((function(t){var n=t.type;return["country","digital-card-value"].includes(n)})).length>0&&salla.url.is_page("cart");if(n){var i=this.optionsData.find((function(t){return t.type==="country"}));var o=i&&this.getSelectedDigitalCardOptions(i);if(o){this.getAvailableDigitalCardSKUs(o)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");return salla.onReady((function(){var n=!salla.storage.get("cart.id")&&t.optionsData.some((function(t){return["file","image"].includes(t.type)}));return n?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}))};t.prototype.hideDigitalCardsOptions=function(t){return this.disableCardValue&&t.type===u.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")};t.prototype.render=function(){var t=this;var n;if(((n=this.optionsData)===null||n===void 0?void 0:n.length)===0){return}return o(r,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((function(n){return o("div",Object.assign({key:n.id,class:"s-product-options-option-container".concat(n.visibility_condition||t.hideDigitalCardsOptions(n)?" hidden":""),"data-option-id":n.id},t.getOptionShownWhen(n)),n.name==="splitter"?t.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":n.type===u.BOOKING&&salla.url.is_page("cart")},"data-option-type":n.type,"data-option-required":"".concat(n.required)},o("label",{htmlFor:"options[".concat(n.id,"]"),class:"s-product-options-option-label ".concat(t.hideLabel(n)?"s-product-options-option-label-hidden":"")},o("b",null,n.name,n.required&&o("span",null," * ")," "),o("small",null,n.placeholder)),o("div",{class:"s-product-options-option-content ".concat(t.hideLabel(n)||n.type===u.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":"")},t.getDisplayForType(n))))}))))};t.prototype.generateUniqueKey=function(t){return this.uniqueKey?"".concat(t,"-").concat(this.uniqueKey):t};t.prototype.fillSelectedOptions=function(){this.selectedOptions=this.optionsData.reduce((function(t,n){var i=n.details.filter((function(t){return t.is_selected}));var o=i.map((function(t){return Object.assign(Object.assign({},t),{option_id:n.id})}));return t.concat(o)}),[])};t.prototype.componentDidLoad=function(){var t=this;var n,i;if(((n=this.optionsData)===null||n===void 0?void 0:n.length)===0&&!this.optionsData.some((function(t){return t.type===u.DONATION}))){return}var o=(i=this.optionsData.find((function(t){return t.type===u.DONATION})))===null||i===void 0?void 0:i.details.find((function(t){return t.is_selected}));if(!o){return}setTimeout((function(){salla.event.emit("product-options::donation-changed",{id:t.productId,price:o.additional_price})}),1e3)};t.prototype.donationOption=function(t,n){var i=this;var r,e;return o("div",{class:"s-product-options-donation-wrapper"},((r=t.donation)===null||r===void 0?void 0:r.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map((function(n,r){return o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:i.generateUniqueKey("donation-option-".concat(r)),type:"radio",name:"donating_option",checked:n.is_selected,value:n.additional_price,onChange:function(t){return i.handleDonationOptions(t,n,"option")}}),o("label",{htmlFor:i.generateUniqueKey("donation-option-".concat(r))},o("span",{innerHTML:salla.money(n.name)})))})),((e=t.donation)===null||e===void 0?void 0:e.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:function(t){return i.handleDonationOptions(t,"custom","option")}}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:function(t){i.donationInput=t},value:t.details.length&&t.details.some((function(t){return t.is_selected}))?t.details.find((function(t){return t.is_selected})).additional_price:t.value,placeholder:t.placeholder,onInput:function(t){return i.handleDonationOptions(t,"custom","input")},onBlur:function(n){return i.changedHandler(n,t)},onInvalid:function(n){return i.invalidHandler(n,t)}}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))};t.prototype.fileUploader=function(t,n){var i=this;if(n===void 0){n=null}var r;return o("salla-file-upload",Object.assign({},n||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:"options[".concat(t.id,"]"),required:!t.visibility_condition&&t.required,height:"120px",onAdded:function(n){return i.changedHandler(n,t)},url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:function(n){return i.invalidHandler(n,t)},class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((r=n.accept)===null||r===void 0?void 0:r.split(",").every((function(t){return t.includes("image")})))?s:l}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))};t.prototype.imageOption=function(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})};t.prototype.fileOption=function(t){var n=this;var i=t.details.map((function(t){return n.fileTypes[t.name]})).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."};t.prototype.numberOption=function(t){var n=this;return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:"options[".concat(t.id,"]"),placeholder:t.placeholder,onBlur:function(i){return n.changedHandler(i,t)},onInvalid:function(i){return n.invalidHandler(i,t)},onInput:function(t){return salla.helpers.inputDigitsOnly(t.target)}})};t.prototype.splitterOption=function(){return o("div",{class:"s-product-options-splitter"})};t.prototype.textOption=function(t){var n=this;return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:"options[".concat(t.id,"]"),placeholder:t.placeholder,onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}}))};t.prototype.textareaOption=function(t){var n=this;return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:"options[".concat(t.id,"]"),name:"options[".concat(t.id,"]"),placeholder:t.placeholder,onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}})))};t.prototype.mapOption=function(t){var n=this;return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:"options[".concat(t.id,"]"),searchable:true,required:t.required,onInvalidInput:function(i){return n.invalidHandler(i,t)},onSelected:function(i){return n.changedHandler(i,t)}})};t.prototype.colorPickerOption=function(t){var n=this;return o("salla-color-picker",{onSubmitted:function(i){return n.changedHandler(i,t)},name:"options[".concat(t.id,"]"),required:!t.visibility_condition&&t.required,onInvalidInput:function(i){return n.invalidHandler(i,t)},color:t.value})};t.prototype.timeOption=function(t){var n=this;return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:"options[".concat(t.id,"]"),class:"s-product-options-time-element",onInvalidInput:function(i){return n.invalidHandler(i,t)},onPicked:function(i){return n.changedHandler(i,t)}})};t.prototype.dateOption=function(t){var n=this;return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:"options[".concat(t.id,"]"),onInvalidInput:function(i){return n.invalidHandler(i,t)},onPicked:function(i){return n.changedHandler(i,t)}}))};t.prototype.datetimeOption=function(t){var n=this;return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:"options[".concat(t.id,"]"),maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:function(i){return n.invalidHandler(i,t)},onPicked:function(i){return n.changedHandler(i,t)}}))};t.prototype.getOptionDetailName=function(t,n,i){if(n===void 0){n=true}var o;var r;if(i&&i===u.COLOR){r=t.name+(n&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?" <br/> <p> ".concat(this.outOfStockText," </p>"):"")+(t.additional_price?" <p> (".concat(salla.money(t.additional_price,false),") </p>"):"")}if(!r){r=t.name+(n&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?" - ".concat(this.outOfStockText):"")+(t.additional_price?" (".concat(salla.money(t.additional_price,false),")"):"")}return r.replace("<i class=sicon-sar></i>",((o=salla.config.currency())===null||o===void 0?void 0:o.symbol)||"ر.س")};t.prototype.isOptionDetailOut=function(t){var n=this;var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}var o=this.selectedOptions.filter((function(n){return n.id===t.id})).length;if(o&&this.selectedOptions.length===1){return false}if(o){var r=this.selectedSkus.filter((function(t){return n.outSkus.includes(t)}));return Object.keys(t.skus_availability).some((function(t){return r.includes(Number(t))}))}return this.selectedOptions.some((function(n){return n.is_out&&n.option_id!==t.option_id}))};t.prototype.renderInput=function(t,n,i,r,e,a){var s=this;var u=this.generateUniqueKey("".concat(t,"-").concat(i.id,"-").concat(n.id));var c=this.isOptionDetailOut(n);return o("label",{class:{"s-product-options-disabled":c}},o("input",{id:u,type:t,name:e,value:n.id,disabled:c,required:r,checked:n.is_selected,onInvalid:function(t){return s.invalidHandler(t,i)},onChange:function(t){return s.changedHandler(t,i)}}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":c}},this.getOptionDetailName(n)))};t.prototype.renderOptionDetails=function(t,n,i,o){var r=this;if(o===void 0){o=false}var e=t==="radio"?"options[".concat(n.id,"]"):"options[".concat(n.id,"][]");return n===null||n===void 0?void 0:n.details.map((function(a){return r.renderInput(t,a,n,i,e,o)}))};t.prototype.renderSelect=function(t){var n=this;return o("div",null,o("select",{name:"options[".concat(t.id,"]"),required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((function(t){return o("option",{key:t.id,value:t.id,disabled:n.canDisabled&&n.isOptionDetailOut(t),selected:t.is_selected},n.getOptionDetailName(t))}))))};t.prototype.renderButtonStyle=function(t,n,i){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,n,i,true))};t.prototype.singleOption=function(t){var n,i;var o=((i=(n=this.optionConfig)===null||n===void 0?void 0:n["single-option"])===null||i===void 0?void 0:i.type)==="button";var r=!t.visibility_condition&&t.required;return o?this.renderButtonStyle("radio",t,r):this.renderSelect(t)};t.prototype.multipleOptions=function(t){var n,i;var r=((i=(n=this.optionConfig)===null||n===void 0?void 0:n["multiple-option"])===null||i===void 0?void 0:i.type)==="button";var e=t.required&&!t.details.some((function(t){return t.is_selected}))&&!t.visibility_condition;return r?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))};t.prototype.colorOption=function(t){var n=this;return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((function(i){return o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:"options[".concat(t.id,"]"),disabled:n.canDisabled&&n.isOptionDetailOut(i),id:n.generateUniqueKey("color-".concat(n.productId,"-").concat(t.id,"-").concat(i.id)),onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}}),o("label",{htmlFor:n.generateUniqueKey("color-".concat(n.productId,"-").concat(t.id,"-").concat(i.id))},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:n.getOptionDetailName(i,true,t.type)})))})))};t.prototype.thumbnailOption=function(t){var n=this;return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((function(i){return o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:"options[".concat(t.id,"]"),"data-img-id":i.option_value,disabled:n.canDisabled&&n.isOptionDetailOut(i),id:n.generateUniqueKey("option_".concat(n.productId,"-").concat(t.id,"_").concat(i.id)),onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}}),o("label",{htmlFor:n.generateUniqueKey("option_".concat(n.productId,"-").concat(t.id,"_").concat(i.id)),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:a,class:"s-product-options-thumbnails-icon"}),n.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},n.outOfStockText),n.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,n.getOptionDetailName(i,false)," "))})))};t.prototype.digitalCardValuesOption=function(t){var n=this;return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((function(i){var r,e,a;var s=String(i.id);return o("label",{htmlFor:n.generateUniqueKey(s.toString()),key:s,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:"options[".concat(t.id,"]"),id:n.generateUniqueKey(s.toString()),required:!t.visibility_condition&&t.required,onInvalid:function(i){return n.invalidHandler(i,t)}},!n.ignoreDefaultCardValue?{defaultChecked:((r=n.getSelectedDigitalCardOptions(t))===null||r===void 0?void 0:r.id)===i.id}:{})),o("span",null,i.name," ",(a=(e=salla.config)===null||e===void 0?void 0:e.currency())===null||a===void 0?void 0:a.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))};t.prototype.countryOption=function(t){var n=this;return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((function(i){var r;return o("label",{htmlFor:n.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:n.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:"options[".concat(t.id,"]"),disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)},onClick:function(){n.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((r=n.getSelectedDigitalCardOptions(t))===null||r===void 0?void 0:r.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:"https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/".concat(String(i.code).toLocaleLowerCase(),".svg")}),o("span",null,i.name))})))};Object.defineProperty(t.prototype,"host",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());p.style=d}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-CB4t6F0a.system.js","./p-Dxc5oJG6.system.js","./p-DTevZS21.system.js"],(function(t){"use strict";var n,i,o,r,e,a,s;return{setters:[function(t){n=t.r;i=t.c;o=t.h;r=t.H;e=t.g},function(t){a=t.I},function(t){s=t.C}],execute:function(){var u;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(u||(u={}));var c;(function(t){t["Sar"]="SAR"})(c||(c={}));var l='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n';var d="";var p=t("salla_product_options",function(){function t(t){var r=this;n(this,t);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=function(t,n,i){if(n==="custom"&&i==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:r.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();r.isCustomDonation=t.target.value==="custom";if(r.donationInput){if(t.target.value==="custom"){r.donationInput.value="";r.donationInput.focus()}else{r.donationInput.value=t.target.value}if(n==="custom"){return}salla.event.emit("product-options::donation-changed",{id:r.productId,price:t.target.value})}};this.hideLabel=function(t){if(t.type===u.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=function(t){if(!t.donation){return}var n=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":n,"s-product-options-donation-expired":!n}},o("p",null,t.donation.target_message),o("span",{innerHTML:n?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((function(){r.outOfStockText=salla.lang.get("pages.products.out_of_stock");r.donationAmount=salla.lang.get("pages.products.donation_amount");r.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");r.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((function(t){return r.setOptionsData(t.data.options)}))}}t.prototype.setOptionsData=function(t){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(r){this.optionsData=t;o=this;(i=(n=this.optionsData[0])===null||n===void 0?void 0:n.details)===null||i===void 0?void 0:i.forEach((function(t){Object.entries(t.skus_availability||{}).filter((function(t){return!t[1]})).map((function(t){return o.outSkus.push(Number(t[0]))}))}));return[2]}))}))};t.prototype.getSelectedOptionsData=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(i){t={};n=this.host.getElementSallaData();n.forEach((function(n,i){if(i.startsWith("options[")){t[i.replace("options[","").replace("]","")]=n}}));return[2,t]}))}))};t.prototype.reportValidity=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(o){t=this.host.querySelectorAll("[required]");n=true;for(i=0;i<t.length;i++){if("reportValidity"in t[i]&&!t[i].reportValidity()){n=false}}return[2,n]}))}))};t.prototype.hasOutOfStockOption=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;var i=this;return __generator(this,(function(o){return[2,this.selectedOptions.some((function(t){return t.is_out}))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((n=this.selectedSkus)===null||n===void 0?void 0:n.every((function(t){return i.outSkus.includes(t)})))]}))}))};t.prototype.getSelectedOptions=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.selectedOptions]}))}))};t.prototype.getOption=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.optionsData.find((function(n){return n.id===t}))]}))}))};t.prototype.invalidHandler=function(t,n){var i=t.target.closest(".s-product-options-option");if(!i.classList.contains("s-product-options-option-error")){i.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){var o=this.host.querySelector(".s-product-options-option-error");if(o===i){this.scrollToElement(i)}}};t.prototype.scrollToElement=function(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}};t.prototype.changedHandler=function(t,n,i){var o=this;if(i===void 0){i=true}var r={event:t,option:n,detail:null,productId:this.productId};if(n.details){var e=n.details.find((function(n){return Number(n.id)===Number(t.target.value)}));r.detail=e}if(n.type==="country"){this.handleCountryOptionChange(t,r.detail)}var a=t.target.closest(".s-product-options-option");if(t.target.value||(n.type===u.FILE||n.type===u.IMAGE)&&t.type==="added"||n.type===u.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((function(){a.classList.remove("s-product-options-option-error")}),200)}if(n.type===u.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(n);var s=this.selectedOptions.findIndex((function(t){return t.option_id===r.option.id}));if(r.option.type===u.MULTIPLE_OPTIONS){var c=this.selectedOptions.findIndex((function(t){var n;return t.option_id===r.option.id&&(t===null||t===void 0?void 0:t.id)===((n=r.detail)===null||n===void 0?void 0:n.id)}));if(c>-1){this.selectedOptions.splice(c,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},r.detail),{option_id:r.option.id}))}}else{if(!r.detail||Object.keys(r.detail).length===0){if(s>-1){this.selectedOptions.splice(s,1)}}else{if(s>-1){this.selectedOptions[s]=Object.assign(Object.assign({},r.detail),{option_id:r.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},r.detail),{option_id:r.option.id}))}}}this.optionsData=this.optionsData.map((function(t){if(t.id===r.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((function(t){var n,i;return Object.assign(Object.assign({},t),{is_selected:r.option.type===u.MULTIPLE_OPTIONS?o.selectedOptions.some((function(n){return n.id===t.id})):Number(t.id)===Number((n=r.detail)===null||n===void 0?void 0:n.id),value:(i=r.detail)===null||i===void 0?void 0:i.value})}))})}return t}));if(i){this.changed.emit(r);salla.event.emit("product-options::change",r)}};t.prototype.setSelectedSkus=function(){this.selectedSkus=this.selectedOptions.map((function(t){return Object.keys(t.skus_availability||{})})).reduce((function(t,n){return t.filter((function(t){return n.includes(t)}))}),[]).map((function(t){return Number(t)}))};t.prototype.handleRequiredMultipleOptions=function(t){if(t.type!==u.MULTIPLE_OPTIONS||!t.required){return}var n=this.host.querySelector('[data-option-id="'.concat(t.id,'"]'));var i=n.querySelectorAll("input:checked").length;n.querySelectorAll("input").forEach((function(t){return t.toggleAttribute("required",!i)}))};t.prototype.getLatLng=function(t,n){return t?t.split(",")[n==="lat"?0:1]:""};t.prototype.getDisplayForType=function(t){var n=this;if(this["".concat(t.type,"Option")]){return this["".concat(t.type,"Option")](t)}if(t.type===u.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===u.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===u.SINGLE_OPTION){return this.singleOption(t)}if(t.type===u.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===u.COUNTRY){return this.countryOption(t)}if(t.type===u.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:function(i){return n.invalidHandler(i,t)},option:t,productId:t.value})}salla.log("Couldn't find options type(".concat(t.type,")😢"));return""};t.prototype.getOptionShownWhen=function(t){return t.visibility_condition?{"data-show-when":"options[".concat(t.visibility_condition.option,"] ").concat(t.visibility_condition.operator," ").concat(t.visibility_condition.value)}:{}};t.prototype.getAvailableDigitalCardSKUs=function(t){var n=this.optionsData.find((function(t){var n=t.type;return n==="digital-code-value"}));if(!n)throw new Error("product-options:: No digital card options found");var i=Object.keys(t.skus_availability).filter((function(n){return t.skus_availability[n]===false}));this.availableDigitalCardValues=n.details.filter((function(t){return!Object.keys(t.skus_availability).filter((function(t){return i.includes(t)})).length}))};t.prototype.handleCountryOptionChange=function(t,n){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;var i=this.host.querySelector("input[data-code-value]:checked");if(i)i.checked=false;var o=this.optionsData.find((function(t){var n=t.type;return n==="digital-code-value"}));if(!o)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(n)};t.prototype.getSelectedDigitalCardOptions=function(t){var n=t.details.find((function(t){return t.is_selected}));var i=t.details.find((function(t){return!!t.is_default}))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return n||i};t.prototype.componentWillLoad=function(){var t=this;if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}var n=this.optionsData.filter((function(t){var n=t.type;return["country","digital-card-value"].includes(n)})).length>0&&salla.url.is_page("cart");if(n){var i=this.optionsData.find((function(t){return t.type==="country"}));var o=i&&this.getSelectedDigitalCardOptions(i);if(o){this.getAvailableDigitalCardSKUs(o)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");return salla.onReady((function(){var n=!salla.storage.get("cart.id")&&t.optionsData.some((function(t){return["file","image"].includes(t.type)}));return n?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}))};t.prototype.hideDigitalCardsOptions=function(t){return this.disableCardValue&&t.type===u.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")};t.prototype.render=function(){var t=this;var n;if(((n=this.optionsData)===null||n===void 0?void 0:n.length)===0){return}return o(r,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((function(n){return o("div",Object.assign({key:n.id,class:"s-product-options-option-container".concat(n.visibility_condition||t.hideDigitalCardsOptions(n)?" hidden":""),"data-option-id":n.id},t.getOptionShownWhen(n)),n.name==="splitter"?t.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":n.type===u.BOOKING&&salla.url.is_page("cart")},"data-option-type":n.type,"data-option-required":"".concat(n.required)},o("label",{htmlFor:"options[".concat(n.id,"]"),class:"s-product-options-option-label ".concat(t.hideLabel(n)?"s-product-options-option-label-hidden":"")},o("b",null,n.name,n.required&&o("span",null," * ")," "),o("small",null,n.placeholder)),o("div",{class:"s-product-options-option-content ".concat(t.hideLabel(n)||n.type===u.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":"")},t.getDisplayForType(n))))}))))};t.prototype.generateUniqueKey=function(t){return this.uniqueKey?"".concat(t,"-").concat(this.uniqueKey):t};t.prototype.fillSelectedOptions=function(){this.selectedOptions=this.optionsData.reduce((function(t,n){var i=n.details.filter((function(t){return t.is_selected}));var o=i.map((function(t){return Object.assign(Object.assign({},t),{option_id:n.id})}));return t.concat(o)}),[])};t.prototype.componentDidLoad=function(){var t=this;var n,i;if(((n=this.optionsData)===null||n===void 0?void 0:n.length)===0&&!this.optionsData.some((function(t){return t.type===u.DONATION}))){return}var o=(i=this.optionsData.find((function(t){return t.type===u.DONATION})))===null||i===void 0?void 0:i.details.find((function(t){return t.is_selected}));if(!o){return}setTimeout((function(){salla.event.emit("product-options::donation-changed",{id:t.productId,price:o.additional_price})}),1e3)};t.prototype.donationOption=function(t,n){var i=this;var r,e;return o("div",{class:"s-product-options-donation-wrapper"},((r=t.donation)===null||r===void 0?void 0:r.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map((function(n,r){return o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:i.generateUniqueKey("donation-option-".concat(r)),type:"radio",name:"donating_option",checked:n.is_selected,value:n.additional_price,onChange:function(t){return i.handleDonationOptions(t,n,"option")}}),o("label",{htmlFor:i.generateUniqueKey("donation-option-".concat(r))},o("span",{innerHTML:salla.money(n.name)})))})),((e=t.donation)===null||e===void 0?void 0:e.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:function(t){return i.handleDonationOptions(t,"custom","option")}}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:function(t){i.donationInput=t},value:t.details.length&&t.details.some((function(t){return t.is_selected}))?t.details.find((function(t){return t.is_selected})).additional_price:t.value,placeholder:t.placeholder,onInput:function(t){return i.handleDonationOptions(t,"custom","input")},onBlur:function(n){return i.changedHandler(n,t)},onInvalid:function(n){return i.invalidHandler(n,t)}}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))};t.prototype.fileUploader=function(t,n){var i=this;if(n===void 0){n=null}var r;return o("salla-file-upload",Object.assign({},n||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:"options[".concat(t.id,"]"),required:!t.visibility_condition&&t.required,height:"120px",onAdded:function(n){return i.changedHandler(n,t)},url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:function(n){return i.invalidHandler(n,t)},class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((r=n.accept)===null||r===void 0?void 0:r.split(",").every((function(t){return t.includes("image")})))?s:l}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))};t.prototype.imageOption=function(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})};t.prototype.fileOption=function(t){var n=this;var i=t.details.map((function(t){return n.fileTypes[t.name]})).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."};t.prototype.numberOption=function(t){var n=this;return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:"options[".concat(t.id,"]"),placeholder:t.placeholder,onBlur:function(i){return n.changedHandler(i,t)},onInvalid:function(i){return n.invalidHandler(i,t)},onInput:function(t){return salla.helpers.inputDigitsOnly(t.target)}})};t.prototype.splitterOption=function(){return o("div",{class:"s-product-options-splitter"})};t.prototype.textOption=function(t){var n=this;return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:"options[".concat(t.id,"]"),placeholder:t.placeholder,onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}}))};t.prototype.textareaOption=function(t){var n=this;return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:"options[".concat(t.id,"]"),name:"options[".concat(t.id,"]"),placeholder:t.placeholder,onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}})))};t.prototype.mapOption=function(t){var n=this;return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:"options[".concat(t.id,"]"),searchable:true,required:t.required,onInvalidInput:function(i){return n.invalidHandler(i,t)},onSelected:function(i){return n.changedHandler(i,t)}})};t.prototype.colorPickerOption=function(t){var n=this;return o("salla-color-picker",{onSubmitted:function(i){return n.changedHandler(i,t)},name:"options[".concat(t.id,"]"),required:!t.visibility_condition&&t.required,onInvalidInput:function(i){return n.invalidHandler(i,t)},color:t.value})};t.prototype.timeOption=function(t){var n=this;return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:"options[".concat(t.id,"]"),class:"s-product-options-time-element",onInvalidInput:function(i){return n.invalidHandler(i,t)},onPicked:function(i){return n.changedHandler(i,t)}})};t.prototype.dateOption=function(t){var n=this;return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:"options[".concat(t.id,"]"),onInvalidInput:function(i){return n.invalidHandler(i,t)},onPicked:function(i){return n.changedHandler(i,t)}}))};t.prototype.datetimeOption=function(t){var n=this;return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:"options[".concat(t.id,"]"),maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:function(i){return n.invalidHandler(i,t)},onPicked:function(i){return n.changedHandler(i,t)}}))};t.prototype.getOptionDetailName=function(t,n,i){if(n===void 0){n=true}var o;var r;if(i&&i===u.COLOR){r=t.name+(n&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?" <br/> <p> ".concat(this.outOfStockText," </p>"):"")+(t.additional_price?" <p> (".concat(salla.money(t.additional_price,false),") </p>"):"")}if(!r){r=t.name+(n&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?" - ".concat(this.outOfStockText):"")+(t.additional_price?" (".concat(salla.money(t.additional_price,false),")"):"")}return r.replace("<i class=sicon-sar></i>",((o=salla.config.currency())===null||o===void 0?void 0:o.symbol)||"ر.س")};t.prototype.isOptionDetailOut=function(t){var n=this;var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}var o=this.selectedOptions.filter((function(n){return n.id===t.id})).length;if(o&&this.selectedOptions.length===1){return false}if(o){var r=this.selectedSkus.filter((function(t){return n.outSkus.includes(t)}));return Object.keys(t.skus_availability).some((function(t){return r.includes(Number(t))}))}return this.selectedOptions.some((function(n){return n.is_out&&n.option_id!==t.option_id}))};t.prototype.renderInput=function(t,n,i,r,e,a){var s=this;var u=this.generateUniqueKey("".concat(t,"-").concat(i.id,"-").concat(n.id));var c=this.isOptionDetailOut(n);return o("label",{class:{"s-product-options-disabled":c}},o("input",{id:u,type:t,name:e,value:n.id,disabled:c,required:r,checked:n.is_selected,onInvalid:function(t){return s.invalidHandler(t,i)},onChange:function(t){return s.changedHandler(t,i)}}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":c}},this.getOptionDetailName(n)))};t.prototype.renderOptionDetails=function(t,n,i,o){var r=this;if(o===void 0){o=false}var e=t==="radio"?"options[".concat(n.id,"]"):"options[".concat(n.id,"][]");return n===null||n===void 0?void 0:n.details.map((function(a){return r.renderInput(t,a,n,i,e,o)}))};t.prototype.renderSelect=function(t){var n=this;return o("div",null,o("select",{name:"options[".concat(t.id,"]"),required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((function(t){return o("option",{key:t.id,value:t.id,disabled:n.canDisabled&&n.isOptionDetailOut(t),selected:t.is_selected},n.getOptionDetailName(t))}))))};t.prototype.renderButtonStyle=function(t,n,i){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,n,i,true))};t.prototype.singleOption=function(t){var n,i;var o=((i=(n=this.optionConfig)===null||n===void 0?void 0:n["single-option"])===null||i===void 0?void 0:i.type)==="button";var r=!t.visibility_condition&&t.required;return o?this.renderButtonStyle("radio",t,r):this.renderSelect(t)};t.prototype.multipleOptions=function(t){var n,i;var r=((i=(n=this.optionConfig)===null||n===void 0?void 0:n["multiple-option"])===null||i===void 0?void 0:i.type)==="button";var e=t.required&&!t.details.some((function(t){return t.is_selected}))&&!t.visibility_condition;return r?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))};t.prototype.colorOption=function(t){var n=this;return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((function(i){return o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:"options[".concat(t.id,"]"),disabled:n.canDisabled&&n.isOptionDetailOut(i),id:n.generateUniqueKey("color-".concat(n.productId,"-").concat(t.id,"-").concat(i.id)),onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}}),o("label",{htmlFor:n.generateUniqueKey("color-".concat(n.productId,"-").concat(t.id,"-").concat(i.id))},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:n.getOptionDetailName(i,true,t.type)})))})))};t.prototype.thumbnailOption=function(t){var n=this;return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((function(i){return o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:"options[".concat(t.id,"]"),"data-img-id":i.option_value,disabled:n.canDisabled&&n.isOptionDetailOut(i),id:n.generateUniqueKey("option_".concat(n.productId,"-").concat(t.id,"_").concat(i.id)),onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)}}),o("label",{htmlFor:n.generateUniqueKey("option_".concat(n.productId,"-").concat(t.id,"_").concat(i.id)),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:a,class:"s-product-options-thumbnails-icon"}),n.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},n.outOfStockText),n.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,n.getOptionDetailName(i,false)," "))})))};t.prototype.digitalCardValuesOption=function(t){var n=this;return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((function(i){var r,e,a;var s=String(i.id);return o("label",{htmlFor:n.generateUniqueKey(s.toString()),key:s,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:"options[".concat(t.id,"]"),id:n.generateUniqueKey(s.toString()),required:!t.visibility_condition&&t.required,onInvalid:function(i){return n.invalidHandler(i,t)}},!n.ignoreDefaultCardValue?{defaultChecked:((r=n.getSelectedDigitalCardOptions(t))===null||r===void 0?void 0:r.id)===i.id}:{})),o("span",null,i.name," ",(a=(e=salla.config)===null||e===void 0?void 0:e.currency())===null||a===void 0?void 0:a.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))};t.prototype.countryOption=function(t){var n=this;return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((function(i){var r;return o("label",{htmlFor:n.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:n.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:"options[".concat(t.id,"]"),disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:function(i){return n.invalidHandler(i,t)},onChange:function(i){return n.changedHandler(i,t)},onClick:function(){n.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((r=n.getSelectedDigitalCardOptions(t))===null||r===void 0?void 0:r.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:"https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/".concat(String(i.code).toLocaleLowerCase(),".svg")}),o("span",null,i.name))})))};Object.defineProperty(t.prototype,"host",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());p.style=d}}}));
|
|
5
|
+
//# sourceMappingURL=p-7d2a9a54.system.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-7rzYRjAP.system.js","sources":["src/components/salla-order-summary/salla-order-summary.scss?tag=salla-order-summary","src/components/salla-order-summary/salla-order-summary.tsx"],"sourcesContent":[":host {\n display: block;\n}","import { Component, State, h, Prop } from '@stencil/core';\nimport { orderItem } from './interfaces';\n\nimport iconFileArchive from '../../assets/svg/file-archive.svg'\nimport iconDownload from '../../assets/svg/download.svg'\nimport iconCopy from '../../assets/svg/swap-stroke.svg'\nimport iconCheck from '../../assets/svg/check.svg'\nimport iconCreditCard from '../../assets/svg/debit-card-back.svg'\n\n@Component({\n tag: 'salla-order-summary',\n styleUrl: 'salla-order-summary.scss',\n})\nexport class SallaOrderSummary {\n\n copyCodeButtonTimeout: NodeJS.Timeout\n\n /**\n * The order ID to fetch items from\n */\n @Prop({ reflect: true }) orderId?: number;\n\n @State() codeCopied: string | null = null\n @State() noItemFound: boolean = true\n @State() order_items: orderItem[] = []\n\n private codes_text: string\n private copy_text: string\n private files_text: string\n private download_text: string\n\n private isDigitalCard = (item: orderItem) => item.product.type === 'codes'\n private isDigitalProduct = (item: orderItem) => item.product.type === 'digital'\n\n async componentWillLoad() {\n salla.lang.onLoaded(() => {\n this.codes_text = salla.lang.get('pages.thank_you.codes')\n this.copy_text = salla.lang.get('common.elements.copy')\n this.files_text = salla.lang.get('pages.thank_you.files')\n this.download_text = salla.lang.get('pages.thank_you.download')\n })\n return await this.getOrderItems()\n \n }\n\n private copyToClipboardHandler(code: string) {\n if (navigator && 'clipboard' in navigator) {\n try {\n navigator.clipboard.writeText(code).then(() => {\n this.codeCopied = code\n\n this.copyCodeButtonTimeout = setTimeout(() => {\n this.codeCopied = null\n }, 3000)\n\n })\n } catch (error) {\n salla.loggers.error('copy functionality is not supported by the browser')\n }\n }\n }\n\n private async getOrderItems() {\n\n const orderId = this.orderId || salla.config.get('page.id')\n const errorMessage = \"Failed to fetch order items\"\n\n if (!orderId) {\n salla.logger.error(errorMessage)\n throw new Error(errorMessage)\n }\n\n try {\n const { data: { items = [] } } = await salla.api.request(`orders/${orderId}`)\n\n const validItems = items.some((item) => (this.isDigitalCard(item) || this.isDigitalProduct(item)))\n\n if (validItems) {\n this.order_items = items\n this.noItemFound = false\n }\n } catch (error) {\n salla.logger.error(errorMessage)\n }\n }\n\n disconnectedCallback() {\n this.copyCodeButtonTimeout && clearTimeout(this.copyCodeButtonTimeout)\n }\n\n render() {\n return (\n\n <ul class=\"s-order-summary-wrapper\">\n {this.noItemFound ? <salla-placeholder alignment=\"center\">\n <span slot=\"title\" />\n </salla-placeholder> :\n this.order_items.map((item) => (\n this.isDigitalCard(item) ? (\n <li key={item.product.id} class=\"s-order-summary-item\">\n <h2 class=\"s-order-summary-item-title\">\n {this.codes_text} ({item.name})\n </h2>\n {item.codes.map((code) => (\n <div key={code.code} class=\"s-order-summary-code-item-wrapper\">\n <p>\n <span innerHTML={iconCreditCard} />\n <span>{code.code}</span>\n </p>\n <salla-button class={`s-order-summary-item-copy-button ${this.codeCopied === code.code ? 'copied' : ''}`} onClick={() => this.copyToClipboardHandler(code.code)} shape=\"link\">\n <span innerHTML={this.codeCopied === code.code ? iconCheck : iconCopy} />\n <span >{this.copy_text}</span>\n </salla-button >\n </div>\n ))}\n </li>\n ) :\n this.isDigitalProduct(item) ? (\n <li key={item.product.id} class=\"s-order-summary-item\">\n <h2 class=\"s-order-summary-item-title\">\n {this.files_text} ({item.name})\n </h2>\n <ul>\n {item.files.map((file) => (\n <li class=\"s-order-summary-digital-item-wrapper\">\n <div>\n <span innerHTML={iconFileArchive} />\n <span>{file.name}</span>\n </div>\n <a href={file.url} target=\"_blank\" class=\"s-order-summary-item-download\">\n <span innerHTML={iconDownload} />\n <span>{this.download_text}</span>\n </a>\n </li>\n ))}\n </ul>\n </li>\n ) : null\n ))\n }\n </ul>\n );\n }\n\n}\n\n\n"],"names":["iconCheck"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-CB4t6F0a.system.js","./p-Bnro4LR3.system.js","./p-CSGkUch3.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-806f3f41.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-CB4t6F0a.system.js"],(function(i){"use strict";var n,t,e;return{setters:[function(i){n=i.r;t=i.h;e=i.H}],execute:function(){var o;(function(i){i["PERCENTAGE"]="percentage";i["FIXED"]="fixed";i["FREE_PRODUCT"]="free_product"})(o||(o={}));var r;(function(i){i["PRODUCT_COUNT"]="products_count";i["PRODUCT_PURCHASE"]="order_amount"})(r||(r={}));var a=":host{display:block}";var l=i("salla_conditional_offer",function(){function i(i){n(this,i);this.offer=null;this.products={};this.isLoading=false;this.canRender=true}i.prototype.componentWillLoad=function(){var i=this;salla.onReady().then((function(){var i,n,t;if(!((i=salla.config.get("store.features"))===null||i===void 0?void 0:i.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((t=(n=salla.storage.get("cart"))===null||n===void 0?void 0:n.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(n){var t=n.data;i.offer=t.find((function(i){return i.type==="conditional"}));if(!i.offer){i.canRender=false;return}i.isLoading=true;i.offer.details.discounts.unshift({value:0,min_spend:0});return i.updateInitialOfferValue()})).then((function(){if(!i.offer)return;return i.getProducts()})).then((function(){if(!i.offer)return;salla.event.on("cart::updated",(function(n){return i.updateOfferValues(n)}))})).catch((function(n){i.canRender=false;salla.logger.warn("salla-conditional-offer:: ",n)})).finally((function(){i.isLoading=false}))};i.prototype.getProducts=function(){var i=this;var n=this.offer.details.discounts.filter((function(i){var n=i.type;return n===o.FREE_PRODUCT})).map((function(i){var n=i.value;return n}));if(n.length>0){return salla.product.fetch({source:"selected",source_value:n}).then((function(n){var t=n.data;t.forEach((function(n){var t=n.id,e=n.url,o=n.image;i.products[t]={url:e,image:o}}))}))}};i.prototype.updateInitialOfferValue=function(){var i=this;return salla.api.cart.details().then((function(n){var t=n.data.cart;return i.updateOfferValues(t)}))};i.prototype.updateOfferValues=function(i){var n=i.items,t=i.sub_total;var e,o;var a=this.offer.details.based_on===r.PRODUCT_COUNT?(e=n===null||n===void 0?void 0:n.reduce((function(i,n){var t=n.quantity;return i+t}),0))!==null&&e!==void 0?e:0:t;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(o=this.offer)===null||o===void 0?void 0:o.details),{current_value:a})});return this.offer};i.prototype.getCheckpointContent=function(i){var n,e;if(i.type===o.PERCENTAGE)return"".concat(i.value,"%");if(i.type===o.FIXED)return salla.money(i.value);if(i.type!==o.FREE_PRODUCT){salla.logger.error("salla-conditional-offer:: unexpected type (".concat(i.type,")!"));return""}var r=this.products[i.value];if(!r){salla.logger.error("salla-conditional-offer:: there is no product with id (".concat(i.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:((n=r===null||r===void 0?void 0:r.image)===null||n===void 0?void 0:n.alt)||"",src:(e=r===null||r===void 0?void 0:r.image)===null||e===void 0?void 0:e.url}))};i.prototype.getOfferType=function(i){var n;var t=(n=this.offer.details)===null||n===void 0?void 0:n.based_on;if(t===r.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",i.min_spend);if(t===r.PRODUCT_PURCHASE)return salla.money(i.min_spend);salla.logger.warn("salla-conditional-offer:: Unexpected offer detail's based_on value: ".concat(t));return"".concat(i.min_spend)};i.prototype.clamp=function(i,n,t){return Math.max(n,Math.min(i,t))};i.prototype.mapValueRanges=function(i,n,t,e,o){var r=(i-n)*(o-e)/(t-n)+e;if(r===Number.POSITIVE_INFINITY)return 100;if(r===Number.NEGATIVE_INFINITY)return 0;return this.clamp(r,0,100)};i.prototype.getCheckPointView=function(i,n){var e,o;var r=this.offer.details.discounts.findIndex((function(n){var t=n.min_spend;return t===i.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 l=this.mapValueRanges(this.offer.details.current_value,a,i.min_spend,0,100);var s=i.min_spend<=this.offer.details.current_value;return t("div",{class:"s-conditional-offer-checkpoint-container"},n>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(l,"%")}})),t("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint ".concat(s?"s-conditional-offer-active-checkpoint":"")},t("div",{class:"s-conditional-offer-item-avatar-content ".concat(s?"active":""),innerHTML:this.products&&this.getCheckpointContent(i)}),t("div",{class:"s-conditional-offer-checkpoint-label ".concat(s?"active":""),innerHTML:this.getOfferType(i)}))]:t("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":n===0,active:s},innerHTML:this.getOfferType(i)}))};i.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"}))]})))))};i.prototype.render=function(){var i=this;if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;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(n,e){return t("div",{class:{"flex-1":e>0},key:n.min_spend},i.getCheckPointView(n,e))}))))};return i}());l.style=a}}}));
|
|
5
|
+
//# sourceMappingURL=p-81b89d1e.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-CB4t6F0a.system.js"],(function(t){"use strict";var e,i,n;return{setters:[function(t){e=t.r;i=t.h;n=t.g}],execute:function(){var o='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;-webkit-transform:translateX(-39%);transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){-webkit-transform:translateX(-72%);transform:translateX(-72%)}';var s=t("salla_tooltip",function(){function t(t){e(this,t);this.show=false;this.targetElement=null}t.prototype.handleMouseOver=function(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=true}};t.prototype.handleMouseOut=function(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=false}};t.prototype.componentDidLoad=function(){this.targetElement=document.getElementById(this.targetId)};t.prototype.render=function(){return i("div",{key:"87a485eeb144377502782b6a7ac61417349423e2",class:"s-tooltip-container"},i("slot",{key:"8329e929fce52cd2ef4f9258548770576e67ee96"}),this.show&&i("div",{key:"18f9cd55110713d0b472601dc0a9ef20dd31af19",class:"s-tooltip-item"},this.text))};Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());s.style=o}}}));
|
|
5
|
+
//# sourceMappingURL=p-820dc67a.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-BTqyH9zP.system.js","./p-CKompMo1.system.js"],(function(c){"use strict";var l,t,n,s,i,e;return{setters:[function(c){l=c.r;t=c.h;n=c.H;s=c.g},function(c){i=c.f;e=c.t}],execute:function(){var o='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n';var a='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n';var v='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n';var r='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n';var h=":host{display:block}";var u=c("salla_social",function(){function c(c){var t=this;l(this,c);var n;this.links=salla.config.get("store.social");this.iconsList={instagram:o,twitter:e,facebook:i,youtube:a,snapchat:v,tiktok:r};this.socialSlot=((n=this.host.querySelector('[slot="social-item"]'))===null||n===void 0?void 0:n.innerHTML)||'<a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a>';salla.lang.onLoaded((function(){t.links=salla.config.get("store.social")}))}c.prototype.getLinksArray=function(){return this.links?Object.entries(this.links).filter((function(c){var l=c[0],t=c[1];return!!t&&l!=="whatsapp"})).map((function(c){var l=c[0],t=c[1];return{type:l,value:t}})):[]};c.prototype.componentWillLoad=function(){return new Promise((function(c){return salla.onReady(c)}))};c.prototype.render=function(){var c=this;var l=this.getLinksArray();return t(n,{key:"7ce07166eab2f88497fadd8f7a103c7afb431fd3"},t("ul",{key:"6d60b95f8268b717d92117217a385baf45b83a16",class:"s-social-list"},l.map((function(l){return t("li",{class:"s-social-link"},t("div",{id:"social-slot",innerHTML:c.socialSlot.replace(/\{icon\}/g,c.iconsList[l.type]).replace(/\{type\}/g,l.type).replace(/\{link\}/g,l.value.toString())}))}))))};c.prototype.componentDidRender=function(){var c;this.host.querySelectorAll("#social-slot").forEach((function(c){return c.replaceWith(c.firstChild)}));(c=this.host.querySelector('[slot="social-item"]'))===null||c===void 0?void 0:c.remove()};Object.defineProperty(c.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return c}());u.style=h}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-CB4t6F0a.system.js","./p-CKompMo1.system.js"],(function(c){"use strict";var l,t,n,s,i,e;return{setters:[function(c){l=c.r;t=c.h;n=c.H;s=c.g},function(c){i=c.f;e=c.t}],execute:function(){var o='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n';var a='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n';var v='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n';var r='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n';var h=":host{display:block}";var u=c("salla_social",function(){function c(c){var t=this;l(this,c);var n;this.links=salla.config.get("store.social");this.iconsList={instagram:o,twitter:e,facebook:i,youtube:a,snapchat:v,tiktok:r};this.socialSlot=((n=this.host.querySelector('[slot="social-item"]'))===null||n===void 0?void 0:n.innerHTML)||'<a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a>';salla.lang.onLoaded((function(){t.links=salla.config.get("store.social")}))}c.prototype.getLinksArray=function(){return this.links?Object.entries(this.links).filter((function(c){var l=c[0],t=c[1];return!!t&&l!=="whatsapp"})).map((function(c){var l=c[0],t=c[1];return{type:l,value:t}})):[]};c.prototype.componentWillLoad=function(){return new Promise((function(c){return salla.onReady(c)}))};c.prototype.render=function(){var c=this;var l=this.getLinksArray();return t(n,{key:"7ce07166eab2f88497fadd8f7a103c7afb431fd3"},t("ul",{key:"6d60b95f8268b717d92117217a385baf45b83a16",class:"s-social-list"},l.map((function(l){return t("li",{class:"s-social-link"},t("div",{id:"social-slot",innerHTML:c.socialSlot.replace(/\{icon\}/g,c.iconsList[l.type]).replace(/\{type\}/g,l.type).replace(/\{link\}/g,l.value.toString())}))}))))};c.prototype.componentDidRender=function(){var c;this.host.querySelectorAll("#social-slot").forEach((function(c){return c.replaceWith(c.firstChild)}));(c=this.host.querySelector('[slot="social-item"]'))===null||c===void 0?void 0:c.remove()};Object.defineProperty(c.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return c}());u.style=h}}}));
|
|
5
|
+
//# sourceMappingURL=p-82d1977a.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as l,h as a,H as t}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as l,h as a,H as t}from"./p-K-KnMaGu.js";import{G as s}from"./p-C0JNGIpa.js";const o="";const e=l=>{if(!l)return"";return new Date(Number(l)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})};const r=l=>{if(!l)return"";try{const a=l.toLowerCase();const t=salla.lang.get(`pages.loyalty_program.${a}`);return t===`pages.loyalty_program.${a}`?l:t}catch(a){return l}};const i=class{constructor(a){l(this,a);this.loyaltyPointsArray=[];this.isLoadingLoyalty=false;this.nextPageUrlLoyalty="";this.handleClick=()=>{this.loadMoreLoyaltyPoints()}}componentWillLoad(){return salla.onReady().then((()=>{this.loadLoyaltyPoints()}))}async loadLoyaltyPoints(){this.isLoadingLoyalty=true;try{let l=`/balance/points?page=1`;let a=await salla.api.request(l);this.loyaltyPointsArray=a.data;this.nextPageUrlLoyalty=a.cursor.next}catch(l){console.error("Error loading loyalty points transactions",l)}finally{this.isLoadingLoyalty=false}}async loadMoreLoyaltyPoints(){var l;if(!this.nextPageUrlLoyalty)return;this.isLoadingLoyalty=true;try{let a=await salla.api.request(this.nextPageUrlLoyalty);this.loyaltyPointsArray=[...this.loyaltyPointsArray,...a.data];this.nextPageUrlLoyalty=((l=a.cursor)===null||l===void 0?void 0:l.next)||""}catch(l){console.error("Error loading more loyalty points",l)}finally{this.isLoadingLoyalty=false}}render(){return a(t,{key:"985386d18096b99ef6114a6e21363900c5dab374"},a("div",{key:"67bb4fceebc5ef047cd3b0ee5b94297e4c9d9d17"},this.isLoadingLoyalty?a("salla-loading",null):a("div",null,this.loyaltyPointsArray.length>0?a("div",null,a("table",{class:"s-loyalty-program-table"},a("thead",{class:"s-loyalty-program-table-head"},a("tr",{class:"s-loyalty-program-table-head-tr"},a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.points")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.date")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.note")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.status")))),a("tbody",{class:"s-loyalty-program-table-tbody"},this.loyaltyPointsArray.map((l=>a("tr",{class:"s-loyalty-program-table-tbody-tr"},a("td",{class:"s-loyalty-program-table-tbody-tr-td"},(l===null||l===void 0?void 0:l.type)==="plus"?"+":"",(l===null||l===void 0?void 0:l.points)||""," ",salla.lang.get("pages.loyalty_program.point")),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},e((l===null||l===void 0?void 0:l.created_at)?Number(l.created_at)*1e3:undefined)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},e(l===null||l===void 0?void 0:l.points_expire_date)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(l===null||l===void 0?void 0:l.key)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(l===null||l===void 0?void 0:l.status_key))))))),a("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrlLoyalty&&a("salla-button",{onClick:this.handleClick,loading:this.isLoadingLoyalty},salla.lang.get("common.elements.load_more")))):a("div",null,a("div",{class:"s-loyalty-program-table-empty-state"},a("span",{innerHTML:s}),a("div",{class:"s-loyalty-program-table-placeholder-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_title")),a("div",{class:"s-loyalty-program-table-placeholder-sub-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_sub_title")))))))}};i.style=o;export{i as salla_loyalty_program};
|
|
5
|
+
//# sourceMappingURL=p-89ea5295.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,a,e,n){function r(t){return t instanceof e?t:new e((function(a){a(t)}))}return new(e||(e=Promise))((function(e,i){function s(t){try{o(n.next(t))}catch(t){i(t)}}function u(t){try{o(n["throw"](t))}catch(t){i(t)}}function o(t){t.done?e(t.value):r(t.value).then(s,u)}o((n=n.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(a){return o([t,a])}}function o(u){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(n=1,r&&(i=u[0]&2?r["return"]:u[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;if(r=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;r=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=a.call(t,e)}catch(t){u=[6,t];r=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-CB4t6F0a.system.js"],(function(t){"use strict";var a,e,n,r;return{setters:[function(t){a=t.r;e=t.h;n=t.H;r=t.g}],execute:function(){var i="";var s=t("salla_metadata",function(){function t(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(t){salla.log("Bad json passed via entityId prop")}}}t.prototype.getValue=function(t){if(t.type==="file"){return'<a href="'.concat(t.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(t.type==="url"){return'<a href="'.concat(t.value,'" class="text-blue-700 underline" target="_blank">').concat(t.value,"</a>")}if(t.type==="date"){var a=new Date(t.value);var e=String(a.getDate()).padStart(2,"0");var n=String(a.getMonth()+1).padStart(2,"0");var r=a.getFullYear();var i="".concat(e,"/").concat(n,"/").concat(r);return i}return t.value};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,e;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.onReady()];case 1:n.sent();if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("custom-fields"))){return[2,salla.logger.error("feature custom-fields is not activated")]}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return[2,salla.logger.error("can't render salla-metadata without enity-id prop!")]}return[4,salla.lang.onLoaded()];case 2:n.sent();this.download=salla.lang.get("pages.thank_you.download");return[4,Salla.api.metadata.fetchValues(this.entity,this.entityId)];case 3:e=n.sent();this.specs=(a=e.data[0])===null||a===void 0?void 0:a.sections;return[2]}}))}))};t.prototype.render=function(){var t=this;if(!this.specs.length){return}return e(n,{class:"s-metadata-wrapper"},this.specs.map((function(a){return e("div",{class:"s-metadata-box"},e("div",{class:"s-metadata-box-header"},e("i",{class:"sicon-list"}),a.name),a.fields.map((function(a){return e("div",{class:"s-metadata-row"},e("p",{class:"s-metadata-row-name"},a.name),e("p",{class:"s-metadata-row-value",innerHTML:t.getValue(a)}))})))})))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());s.style=i}}}));
|
|
5
|
+
//# sourceMappingURL=p-8a7753ca.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as i,h as s,g as t}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as i,h as s,g as t}from"./p-K-KnMaGu.js";import{I as e}from"./p-uTyAzPSy.js";var r=` <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="currentcolor" />\n</svg>`;var a=` <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="#DDDDDD" />\n</svg>`;var n=` <svg width="12" height="17" view-box="0 0 12 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 16.2501C9.10658 16.2501 11.625 13.7317 11.625 10.6251C11.625 9.976 11.4523 9.35252 11.25 8.77232C9.99998 10.0075 9.05002 10.6251 8.4 10.6251C11.3966 5.37512 9.75 3.12512 5.25 0.125122C5.625 3.87475 3.15302 5.58043 2.14634 6.52757C1.0559 7.5535 0.375 9.00977 0.375 10.6251C0.375 13.7317 2.89339 16.2501 6 16.2501ZM6.53205 2.92636C8.96333 4.98908 8.97495 6.59185 7.09725 9.88157C6.5265 10.8815 7.2486 12.1251 8.4 12.1251C8.9163 12.1251 9.43807 11.9745 9.98917 11.6789C9.52342 13.4466 7.91393 14.7501 6 14.7501C3.72182 14.7501 1.875 12.9033 1.875 10.6251C1.875 9.47072 2.34959 8.39582 3.17419 7.62002C3.2687 7.53115 3.74812 7.1062 3.76858 7.08782C4.08646 6.8017 4.34835 6.54985 4.60718 6.2727C5.52998 5.28461 6.19283 4.18735 6.53205 2.92636Z" fill="currentcolor" />\n </svg>`;const l=":host{display:block}";const d=class{constructor(s){i(this,s);this.currentSlide=0;this.showPurchaseCount=false;this.startPoint={x:0,y:0};this.isSwiping=false;this.isRTL="rtl";this.handlePointerDown=i=>{var s;if(!i.isPrimary)return;(s=this.sliderElement)===null||s===void 0?void 0:s.setPointerCapture(i.pointerId);this.startSwipe(i.clientX,i.clientY);i.preventDefault()};this.handlePointerMove=i=>{if(!this.isSwiping||!i.isPrimary)return;i.preventDefault()};this.handlePointerUp=i=>{var s;if(!this.isSwiping||!i.isPrimary)return;(s=this.sliderElement)===null||s===void 0?void 0:s.releasePointerCapture(i.pointerId);this.endSwipe(i.clientX,i.clientY)};this.handlePointerCancel=i=>{var s;if(!this.isSwiping||!i.isPrimary)return;(s=this.sliderElement)===null||s===void 0?void 0:s.releasePointerCapture(i.pointerId);this.isSwiping=false};this.goToSlide=i=>{this.currentSlide=Math.max(0,Math.min(i,this.images.length-1))}}async componentDidLoad(){var i,s;await salla.onReady();this.showPurchaseCount=!!salla.config.get("store.settings.product.total_sold_enabled",false);this.isRTL=salla.config.get("theme.is_rtl",true);this.purchasedCount=salla.lang.getWithDefault("blocks.home.reviews.purchased_count",this.isRTL?` تم شراءه ${(i=this.review.product)===null||i===void 0?void 0:i.sold_quantity} مرة`:`Purchased ${this.review.product.sold_quantity} times`,{count:(s=this.review.product)===null||s===void 0?void 0:s.sold_quantity});this.initializeSlider()}disconnectedCallback(){this.removeEventListeners()}get images(){var i,s;const{review:t}=this;return((i=t===null||t===void 0?void 0:t.images)===null||i===void 0?void 0:i.length)>1?t.images.map(((i,s)=>({url:i,alt:"",id:s}))):((s=t===null||t===void 0?void 0:t.product)===null||s===void 0?void 0:s.images)||[]}get hasMultipleImages(){return this.images.length>1}get slideTransform(){const i=this.isRTL?1:-1;return`translateX(${this.currentSlide*100*i}%)`}initializeSlider(){if(!this.hasMultipleImages)return;this.sliderElement=this.el.querySelector(".s-review-card-slider-container");if(!this.sliderElement)return;this.sliderElement.style.touchAction="pan-y pinch-zoom";this.addEventListeners()}addEventListeners(){if(!this.sliderElement)return;this.sliderElement.addEventListener("pointerdown",this.handlePointerDown,{passive:false});this.sliderElement.addEventListener("pointermove",this.handlePointerMove,{passive:false});this.sliderElement.addEventListener("pointerup",this.handlePointerUp,{passive:true});this.sliderElement.addEventListener("pointercancel",this.handlePointerCancel,{passive:true})}removeEventListeners(){if(!this.sliderElement)return;this.sliderElement.removeEventListener("pointerdown",this.handlePointerDown);this.sliderElement.removeEventListener("pointermove",this.handlePointerMove);this.sliderElement.removeEventListener("pointerup",this.handlePointerUp);this.sliderElement.removeEventListener("pointercancel",this.handlePointerCancel)}startSwipe(i,s){this.startPoint={x:i,y:s};this.isSwiping=true}componentDidRender(){this.removeEventListeners();this.addEventListeners()}endSwipe(i,s){this.isSwiping=false;const t=i-this.startPoint.x;const e=s-this.startPoint.y;this.processSwipe(t,e)}processSwipe(i,s){const t=10;if(Math.abs(i)<t||Math.abs(s)>Math.abs(i))return;const e=i<0;const r=this.isRTL?!e:e;if(r){this.goToNextSlide()}else{this.goToPrevSlide()}}goToNextSlide(){if(this.currentSlide<this.images.length-1){this.currentSlide++}}goToPrevSlide(){if(this.currentSlide>0){this.currentSlide--}}renderStars(){return Array(5).fill(null).map(((i,t)=>s("span",{key:t,innerHTML:this.review.stars>=t+1?r:a})))}renderDots(){return this.images.map((({url:i},t)=>s("button",{key:i||t,type:"button",class:`s-review-card-slider-dot ${this.currentSlide===t?"active":""}`,onClick:()=>this.goToSlide(t),"aria-label":`Go to slide ${t+1}`,onPointerDown:()=>this.goToSlide(t)})))}renderSlider(){if(!this.hasMultipleImages)return null;return s("div",{class:"s-review-card-slider-container"},s("div",{class:"s-review-card-slides",style:{transform:this.slideTransform}},this.images.map((i=>s("div",{key:i===null||i===void 0?void 0:i.id,class:"s-review-card-slider-slide"},s("img",{src:i.url,alt:i.alt||"Product image",width:275,height:275,loading:"lazy",draggable:false}))))),s("div",{class:"s-review-card-slider-dots"},this.renderDots()))}renderSingleImage(){var i,t;const e=(t=(i=this.review)===null||i===void 0?void 0:i.product)===null||t===void 0?void 0:t.image;if(!e||this.hasMultipleImages)return null;return s("img",{src:e.url,alt:e.alt||"Product image",class:"s-review-card-image",width:275,height:275,loading:"lazy",decoding:"async",draggable:false})}renderHeader(){var i,t;return s("div",{class:"s-review-card-header"},s("div",{class:"s-review-card-reviewer-name"},s("p",null,(i=this.review)===null||i===void 0?void 0:i.name),((t=this.review)===null||t===void 0?void 0:t.has_order)&&s("span",{class:"s-review-card-verified-icon",innerHTML:e})),s("div",{class:"s-review-card-stars"},this.renderStars()))}renderProductInfo(){var i,t,e,r,a;const l=(i=this.review)===null||i===void 0?void 0:i.product;if(!l)return null;return s("a",{href:(e=(t=this.review)===null||t===void 0?void 0:t.product)===null||e===void 0?void 0:e.url,class:"s-review-card-product-container"},s("img",{alt:((r=l.image)===null||r===void 0?void 0:r.alt)||"Product",src:(a=l.image)===null||a===void 0?void 0:a.url,class:"s-review-card-product-image",width:60,height:60,loading:"lazy",decoding:"async",draggable:false}),s("div",{class:"s-review-card-product-details"},s("p",{class:"s-review-card-product-details-name"},l.name),this.showPurchaseCount?s("p",{class:"s-review-card-product-details-purchase-count"},s("span",{innerHTML:n}),this.purchasedCount):null))}render(){var i;return s("div",{key:"8797bb6b8123ab8a8d4536eb990dcde15e1ddd06",class:"s-review-card-container"},this.renderSlider(),this.renderSingleImage(),o(),s("div",{key:"b2b3bdc4e8a63aae9103eca5274003b49d4bf19e",class:"s-review-card-content"},this.renderHeader(),s("p",{key:"0e64b3fe2ae5e59a1899515c04063f74b9828001",class:"s-review-card-review-content",innerHTML:(i=this.review)===null||i===void 0?void 0:i.content}),o(),this.renderProductInfo()))}get el(){return t(this)}};const o=i=>s("div",{class:`s-review-card-divider ${""}`});d.style=l;export{d as salla_review_card};
|
|
5
|
+
//# sourceMappingURL=p-8e912064.entry.js.map
|