@salla.sa/twilight-components 2.14.308 → 2.14.310

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.
Files changed (141) hide show
  1. package/dist/cjs/{filepond-OUUN-5NN.js → filepond-h5N922xu.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-CkePS8DS.js → filepond-plugin-file-poster-CRl7s-AG.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-d3Wn3PkY.js → filepond-plugin-file-validate-size-DARqmqRu.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-CLmEWQl_.js → filepond-plugin-file-validate-type-6YKtVIYy.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-C3vRwJRJ.js → filepond-plugin-image-edit-CIBU-x5i.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CPEad0SZ.js → filepond-plugin-image-exif-orientation-Dr0pROTo.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-B9fo9KBE.js → filepond-plugin-image-preview-BwizNP0O.js} +1 -1
  8. package/dist/cjs/{index-D4rsEAHT.js → index-BSAcismy.js} +2 -2
  9. package/dist/cjs/{index-Bc_DbVjx.js → index-Da-Fc_Dv.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/salla-accordion_62.cjs.entry.js +22 -25
  12. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  45. package/dist/cjs/twilight.cjs.js +1 -1
  46. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +12 -15
  47. package/dist/collection/components/salla-user-menu/salla-user-menu.js +1 -1
  48. package/dist/components/index.js +2 -2
  49. package/dist/components/salla-multiple-bundle-product-options-modal2.js +12 -15
  50. package/dist/components/salla-user-menu.js +1 -1
  51. package/dist/esm/{filepond-Yb-P3i1T.js → filepond-C5Ev_LRh.js} +1 -1
  52. package/dist/esm/{filepond-plugin-file-poster-DxDVU0an.js → filepond-plugin-file-poster-Cf4aX93c.js} +1 -1
  53. package/dist/esm/{filepond-plugin-file-validate-size-CXQcPSKc.js → filepond-plugin-file-validate-size-DzuISSe6.js} +1 -1
  54. package/dist/esm/{filepond-plugin-file-validate-type-DzBHcvIJ.js → filepond-plugin-file-validate-type-C9J5EVwa.js} +1 -1
  55. package/dist/esm/{filepond-plugin-image-edit-BdG17mhM.js → filepond-plugin-image-edit-B-kqsQ7Z.js} +1 -1
  56. package/dist/esm/{filepond-plugin-image-exif-orientation-bwmDnzkU.js → filepond-plugin-image-exif-orientation-CYim0AQy.js} +1 -1
  57. package/dist/esm/{filepond-plugin-image-preview-CNKGV3GP.js → filepond-plugin-image-preview-Bj8wrh8K.js} +1 -1
  58. package/dist/esm/{index-DLpukFTh.js → index-CS3HDvos.js} +2 -2
  59. package/dist/esm/{index-BCX93lY7.js → index-iOFc3cdD.js} +1 -1
  60. package/dist/esm/loader.js +2 -2
  61. package/dist/esm/salla-accordion_62.entry.js +22 -25
  62. package/dist/esm/salla-advertisement.entry.js +1 -1
  63. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  64. package/dist/esm/salla-apps-icons.entry.js +1 -1
  65. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  66. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  67. package/dist/esm/salla-contacts.entry.js +1 -1
  68. package/dist/esm/salla-custom-fields.entry.js +1 -1
  69. package/dist/esm/salla-filters-widget.entry.js +1 -1
  70. package/dist/esm/salla-filters.entry.js +1 -1
  71. package/dist/esm/salla-installment.entry.js +1 -1
  72. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  73. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  74. package/dist/esm/salla-metadata.entry.js +1 -1
  75. package/dist/esm/salla-notification-item.entry.js +1 -1
  76. package/dist/esm/salla-notifications.entry.js +1 -1
  77. package/dist/esm/salla-offer.entry.js +1 -1
  78. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  79. package/dist/esm/salla-order-details-options.entry.js +1 -1
  80. package/dist/esm/salla-order-details.entry.js +1 -1
  81. package/dist/esm/salla-order-summary.entry.js +1 -1
  82. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  83. package/dist/esm/salla-orders.entry.js +1 -1
  84. package/dist/esm/salla-payments.entry.js +1 -1
  85. package/dist/esm/salla-price-range.entry.js +1 -1
  86. package/dist/esm/salla-review-card.entry.js +1 -1
  87. package/dist/esm/salla-reviews-page.entry.js +1 -1
  88. package/dist/esm/salla-reviews.entry.js +1 -1
  89. package/dist/esm/salla-social.entry.js +1 -1
  90. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  91. package/dist/esm/salla-tooltip.entry.js +1 -1
  92. package/dist/esm/salla-trust-badges.entry.js +1 -1
  93. package/dist/esm/salla-verify.entry.js +1 -1
  94. package/dist/esm/salla-wallet.entry.js +1 -1
  95. package/dist/esm/twilight.js +2 -2
  96. package/dist/twilight/{p-51458fd8.entry.js → p-0090a073.entry.js} +1 -1
  97. package/dist/twilight/{p-1ae27c01.entry.js → p-1104aec0.entry.js} +1 -1
  98. package/dist/twilight/{p-120fdc67.entry.js → p-1fd4feea.entry.js} +1 -1
  99. package/dist/twilight/{p-986f14fc.entry.js → p-25b06f0b.entry.js} +1 -1
  100. package/dist/twilight/{p-6ff28aa6.entry.js → p-2863c253.entry.js} +1 -1
  101. package/dist/twilight/{p-534aebe8.entry.js → p-3085be93.entry.js} +1 -1
  102. package/dist/twilight/{p-fff75696.entry.js → p-33165663.entry.js} +1 -1
  103. package/dist/twilight/{p-Bm-OTntK.js → p-3aZYPmNi.js} +1 -1
  104. package/dist/twilight/{p-744bf31c.entry.js → p-48841974.entry.js} +1 -1
  105. package/dist/twilight/{p-8f1ef938.entry.js → p-4c7eb26d.entry.js} +1 -1
  106. package/dist/twilight/p-514b28b4.entry.js +4 -0
  107. package/dist/twilight/{p-5a95c459.entry.js → p-54750047.entry.js} +1 -1
  108. package/dist/twilight/{p-0ebf3cf5.entry.js → p-548eb5a9.entry.js} +1 -1
  109. package/dist/twilight/{p-08f3a904.entry.js → p-5abed22f.entry.js} +1 -1
  110. package/dist/twilight/{p-6af9f6d4.entry.js → p-5d831b24.entry.js} +1 -1
  111. package/dist/twilight/{p-b72246fc.entry.js → p-62f74d46.entry.js} +1 -1
  112. package/dist/twilight/{p-e00ffee6.entry.js → p-641e95ff.entry.js} +1 -1
  113. package/dist/twilight/{p-512e9e2a.entry.js → p-655334ed.entry.js} +1 -1
  114. package/dist/twilight/{p-79c01eeb.entry.js → p-6b633bad.entry.js} +1 -1
  115. package/dist/twilight/{p-195e0abd.entry.js → p-7921f34d.entry.js} +1 -1
  116. package/dist/twilight/{p-5995c4cf.entry.js → p-80f4782c.entry.js} +1 -1
  117. package/dist/twilight/{p-2fc57284.entry.js → p-8771caa4.entry.js} +1 -1
  118. package/dist/twilight/{p-bfc95eae.entry.js → p-9ed50290.entry.js} +1 -1
  119. package/dist/twilight/{p-C0bntoqM.js → p-BNCAsdrU.js} +2 -2
  120. package/dist/twilight/{p-Cv04OsQc.js → p-BftmF7A4.js} +1 -1
  121. package/dist/twilight/{p-DLpukFTh.js → p-CS3HDvos.js} +1 -1
  122. package/dist/twilight/{p-CC2JlxEZ.js → p-D64-sfKJ.js} +1 -1
  123. package/dist/twilight/{p-Cetso8sO.js → p-DAiXY47w.js} +1 -1
  124. package/dist/twilight/{p-_lsZ_Fz4.js → p-GC5QwqwX.js} +1 -1
  125. package/dist/twilight/{p-0d0dfb3c.entry.js → p-a5f714c7.entry.js} +1 -1
  126. package/dist/twilight/{p-554f07a3.entry.js → p-b3101599.entry.js} +1 -1
  127. package/dist/twilight/{p-7cbac0af.entry.js → p-b3bd3e08.entry.js} +1 -1
  128. package/dist/twilight/{p-00919833.entry.js → p-c0781b02.entry.js} +1 -1
  129. package/dist/twilight/{p-4b3a5c8d.entry.js → p-c79d3385.entry.js} +1 -1
  130. package/dist/twilight/{p-e4a5852a.entry.js → p-cb57b82f.entry.js} +1 -1
  131. package/dist/twilight/{p-714b8f8d.entry.js → p-cc522297.entry.js} +1 -1
  132. package/dist/twilight/{p-f938fc0d.entry.js → p-e3f0a14d.entry.js} +1 -1
  133. package/dist/twilight/{p-ab07f903.entry.js → p-ecb40dd9.entry.js} +1 -1
  134. package/dist/twilight/{p-da59dd6e.entry.js → p-f20c22d0.entry.js} +1 -1
  135. package/dist/twilight/{p-294d14e4.entry.js → p-fa0a4f00.entry.js} +1 -1
  136. package/dist/twilight/{p-952d3910.entry.js → p-fdcb5066.entry.js} +2 -2
  137. package/dist/twilight/{p-vdaGXF-0.js → p-q3t2oiUx.js} +1 -1
  138. package/dist/twilight/{p-BpxYnrUi.js → p-wxiLbf1Q.js} +1 -1
  139. package/dist/twilight/twilight.esm.js +1 -1
  140. package/package.json +5 -5
  141. package/dist/twilight/p-c5a35ba5.entry.js +0 -4
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as i,H as e,a as s,c as a,d as l,F as o,j as n}from"./p-DLpukFTh.js";import{a as r}from"./p-CgtvEd63.js";import{A as c,S as h}from"./p-yRO-ZESF.js";import{I as d}from"./p-uTyAzPSy.js";import{H as p}from"./p-Dljb4XCt.js";import{a as u}from"./p-BedNk7k1.js";import{C as g,G as m}from"./p-CBT_Nxny.js";import{S as f}from"./p-DiKTtDW5.js";import{M as b}from"./p-DmgxDvXL.js";import{w}from"./p-DWksgowB.js";import{f as y,t as _}from"./p-Dz7o69vX.js";import{G as v}from"./p-C0JNGIpa.js";const k=class{constructor(i){t(this,i),this.collapsible=!0,this.bordered=!1,this.size="md",this.collapsed=!0,this.dir=document.dir||"rtl"}directionChangedHandler(t){this.dir=t.detail.dir}handleCollapse(t){this.collapsed=t.detail.payload.collapsed}setcollapsibleProp(){const t=this.host.querySelector("salla-accordion-head");this.collapsible&&t&&(t.setAttribute("collapsible","true"),t.setAttribute("collapsed",this.collapsed.toString()))}componentDidRender(){this.setcollapsibleProp();const t=this.host.querySelector("salla-accordion-body");this.collapsible&&(this.host.setAttribute("data-collapsed",this.collapsed.toString()),t?.setAttribute("data-collapsed",this.collapsed.toString()))}render(){return i(e,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:`s-accordion-wrapper ${this.dir} ${this.bordered?"s-accordion-wrapper-bordered":""} ${this.size?`size-${this.size}`:""}`,"data-collapsed":this.collapsed.toString()},i("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))}get host(){return s(this)}};k.style="";const x=class{constructor(i){t(this,i)}render(){return i(e,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},i("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))}};x.style="";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>add</title>\n<path d="M26.667 14.667h-9.333v-9.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v9.333h-9.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h9.333v9.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-9.333h9.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n',M='\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>minus</title>\n<path d="M26.667 14.667h-21.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h21.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';const z=class{constructor(i){t(this,i),this.accordionToggle=a(this,"accordionToggle"),this.collapsible=!1,this.collapsed=!0}emitCollapsePanel(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})}toggleCollapse(){this.collapsible&&(this.collapsed=!this.collapsed,this.host.parentElement?.setAttribute("data-collapsed",this.collapsed.toString()),this.host.parentElement?.querySelector("salla-accordion-body")?.setAttribute("data-collapsed",this.collapsed.toString()),this.emitCollapsePanel())}render(){return i(e,{key:"9d88d243306cdf451c20d7068fbb9f48807b22e9","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},i("div",{key:"bad4c5a913ce1c4581b09c0b6d96fcbdb4236638",class:"s-accordion-head-wrapper-start"},i("slot",{key:"acb83cec8cbca5771a9f84e81c0b955c3edad731",name:"title"}),i("slot",{key:"a4ad42ea6fad4f452c4c218a9ee02dca0adb4a67",name:"progress"}),i("slot",{key:"96ab95d413dc906ac299079f4008816f01881990",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&i("div",{key:"8f9666a5038cd7b1ac6e357c6920ea26d31c5f03",class:"s-accordion-head-wrapper-end"},i("slot",{key:"14895e8c1385e91c14f046c9ae38ce5e4a4c9a60",name:"note"}),this.collapsible&&i("button",{key:"97dc7fabbb207fcc8b68ebf0a86f6c8a980dca13",class:{"s-accordion-head-wrapper-toggle":!0,active:!this.collapsed},onClick:t=>{t.stopPropagation(),this.toggleCollapse()}},i("span",{key:"3b24faf71dcd332663a354310b2ce09f7879eddc",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?A:M}))))}get host(){return s(this)}};z.style="";var S='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>cart</title>\n<path d="M15.426 28.084c0-1.412-0.85-2.684-2.156-3.226-1.305-0.54-2.807-0.241-3.805 0.758-0.999 0.998-1.298 2.5-0.758 3.805 0.54 1.303 1.815 2.155 3.226 2.155 1.928-0.003 3.49-1.564 3.492-3.492h0.001zM10.597 28.084h0.001c0-0.54 0.326-1.027 0.825-1.235 0.498-0.206 1.074-0.091 1.455 0.29 0.383 0.382 0.497 0.957 0.29 1.456-0.208 0.5-0.695 0.825-1.235 0.825-0.355 0-0.695-0.142-0.944-0.391-0.251-0.251-0.392-0.591-0.392-0.946h-0.001l0.001 0.001zM28.23 28.084c0-1.412-0.85-2.684-2.155-3.226-1.305-0.54-2.807-0.241-3.806 0.758s-1.297 2.5-0.756 3.805c0.54 1.303 1.813 2.155 3.226 2.155 1.927-0.003 3.49-1.564 3.491-3.492zM23.401 28.084c0-0.54 0.326-1.027 0.825-1.235 0.5-0.206 1.075-0.091 1.457 0.29s0.497 0.957 0.289 1.456c-0.206 0.5-0.693 0.825-1.233 0.825-0.738 0-1.337-0.599-1.337-1.337l-0.001 0.001zM1.953 0.234l-0.342-0.059c-0.29-0.064-0.594-0.004-0.839 0.166-0.247 0.169-0.414 0.436-0.463 0.734-0.050 0.3 0.023 0.607 0.201 0.85s0.444 0.402 0.738 0.44l0.341 0.059c1.825 0.324 3.248 1.794 3.548 3.662l1.981 12.369h-0.001c0.218 1.387 0.913 2.651 1.96 3.563s2.379 1.412 3.754 1.41h14.242c0.601 0 1.088-0.498 1.088-1.112s-0.487-1.112-1.088-1.112h-14.242c-1.679-0.001-3.139-1.183-3.525-2.854h11.463c1.614 0.004 3.188-0.518 4.493-1.49 1.305-0.973 2.271-2.346 2.762-3.918l1.298-4.136c0.145-0.455 0.065-0.953-0.213-1.336-0.278-0.385-0.72-0.608-1.187-0.602h-20.467l-0.181-1.141c-0.218-1.367-0.849-2.631-1.802-3.615-0.954-0.983-2.184-1.64-3.518-1.878h-0.001zM26.946 9.096l-0.993 3.169v-0.001c-0.353 1.122-1.044 2.101-1.975 2.796s-2.056 1.067-3.208 1.067h-11.833l-1.125-7.042 19.134 0.011z"></path>\n</svg>\n';const C=class{constructor(i){t(this,i),this.success=a(this,"success"),this.failed=a(this,"failed"),this.hostAttributes={},this.hasPreOrder=!1,this.productStatus="sale",this.productType="product",this.selectedOptions=[],this.buyNowText=salla.lang.get("pages.products.buy_now"),salla.lang.onLoaded((()=>{this.buyNowText=salla.lang.get("pages.products.buy_now")}))}getLabel(){return"sale"===this.productStatus&&this.supportStickyBar&&window.innerWidth<=768&&this.showQuickBuy&&this.isApplePayActive?S:this.hasPreOrder?salla.lang.get("pages.products.pre_order_now"):"sale"===this.productStatus&&"booking"===this.productType?salla.lang.get("pages.cart.book_now"):"sale"===this.productStatus?salla.lang.get("pages.cart.add_to_cart"):"donating"!==this.productType?salla.lang.get("pages.products.out_of_stock"):salla.lang.get("pages.products.donation_exceed")}addProductToCart(t){if("booking"===this.productType)return t.preventDefault(),this.addBookingProduct();if("submit"===this.hostAttributes.type)return!1;t.preventDefault(),this.btn?.disable();const i=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);return i&&"function"==typeof i.validateAndScroll?i.validateAndScroll().then((async t=>{const i={isValid:t,component:this};if(await salla.hooks.call("salla-add-product-button","validate",i),i.isValid)return this._proceedAddToCart();this.btn?.enable()})).catch((()=>{this.btn?.enable()})):this._proceedAddToCart()}async _proceedAddToCart(){const t=Object.entries({id:this.productId,donation_amount:this.donatingAmount,quantity:this.quantity,endpoint:"quickAdd"}).reduce(((t,[i,e])=>e?(t[i]=e,t):t),{});return salla.cart.addItem(t).then((async t=>(this.selectedOptions=[],this.btn?.enable(),this.success.emit(t),t))).catch((t=>{this.failed.emit(t),this.btn?.enable()}))}addBookingProduct(){return salla.config.isGuest()?(salla.auth.api.setAfterLoginEvent("booking::add",this.productId),void salla.event.dispatch("login::open")):salla.booking.add(this.productId).then((t=>this.success.emit(t))).catch((t=>this.failed.emit(t)))}getBtnAttributes(){for(let t=0;t<this.host.attributes.length;t++)["id","class"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes}getQuickBuyBtnAttributes(){return{...this.getBtnAttributes(),type:this.supportStickyBar&&window.innerWidth<=768?"plain":"donating"==this.productType?"donate":"buy"}}miniCheckoutWidget(){let t=salla.config.get("store.id");if(t)return i("salla-mini-checkout-widget",{language:salla.lang.locale,"store-id":t,config:{user:salla.config.get("user"),failure_url:window.location.href},products:[this.productId],api:salla.config.get("store.api"),outline:!0,"form-selector":"form.product-form",class:"s-add-product-button-mini-checkout"},i("div",{slot:"widget-label",class:"s-add-product-button-mini-checkout-content"},i("span",{innerHTML:'\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>full-wallet</title>\n<path d="M29 12h-26c-0.668-0.008-1.284-0.226-1.787-0.59l0.009 0.006c-0.744-0.552-1.222-1.428-1.222-2.416 0-1.657 1.343-3 2.999-3h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0h-6c-0.552 0-1 0.448-1 1 0 0.326 0.156 0.616 0.397 0.798l0.002 0.002c0.167 0.12 0.374 0.194 0.599 0.2l0.001 0h26c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM27 12c-0.552 0-1-0.448-1-1v0-3h-3c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM29 30h-26c-1.657 0-3-1.343-3-3v0-18c0-0.552 0.448-1 1-1s1 0.448 1 1v0 18c0 0.552 0.448 1 1 1v0h25v-5c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM29 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM31 24h-7c-2.209 0-4-1.791-4-4s1.791-4 4-4v0h7c0.552 0 1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2v0h6v-4zM25 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-2.306 1.152c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 3.2-1.6c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1v0zM21 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-15.104 7.552c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 16-8c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0z"></path>\n</svg>\n'}),this.buyNowText))}componentWillLoad(){return salla.onReady().then((()=>{if(document.documentElement.classList.add("hydrated"),this.showQuickBuy=this.quickBuy&&salla.config.get("store.settings.buy_now")&&"sale"==this.productStatus&&"booking"!==this.productType,this.isApplePayActive=window.ApplePaySession?.canMakePayments()&&salla.config.get("store.settings.payments")?.includes("apple_pay")&&salla.config.get("store.settings.is_salla_gateway",!1),this.passedLabel=this.host.innerHTML.replace("\x3c!----\x3e","").trim(),this.passedLabel&&window.innerWidth>=768)return this.btn?.setText(this.passedLabel);"submit"===this.host.getAttribute("type")&&this.supportStickyBar&&window.addEventListener("resize",(()=>this.btn?.setText(window.innerWidth>=768&&this.passedLabel?this.passedLabel:this.getLabel())))}))}render(){return this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":this.hasSubscribedOptions?i(e,null,i("salla-product-availability",{...this.getBtnAttributes(),"is-subscribed":!0},i("span",{class:"s-hidden"},i("slot",null)))):"out-and-notify"===this.productStatus&&this.channels||this.hasOutOfStockOption?i(e,null,i("salla-product-availability",{...this.getBtnAttributes()},i("span",{class:"s-hidden"},i("slot",null)))):i(e,{class:{"s-add-product-button-with-quick-buy":this.showQuickBuy,"s-add-product-button-with-sticky-bar":this.supportStickyBar,"s-add-product-button-with-apple-pay":this.showQuickBuy&&this.isApplePayActive}},i("div",{class:{"s-add-product-button-main":this.showQuickBuy,"w-full":!document.getElementById("fast-checkout-js")||["financial_support","donating"].includes(this.productType)}},i("salla-button",{color:"sale"===this.productStatus?"primary":"light",type:"button",fill:"sale"===this.productStatus?"solid":"outline",ref:t=>this.btn=t,onClick:t=>this.addProductToCart(t),disabled:"sale"!==this.productStatus,...this.getBtnAttributes(),"loader-position":"center"},i("slot",null)),this.showQuickBuy&&document.getElementById("fast-checkout-js")&&!["financial_support","donating"].includes(this.productType)?this.miniCheckoutWidget():""),this.showQuickBuy&&this.isApplePayActive?i("salla-quick-buy",{...this.getQuickBuyBtnAttributes()}):"")}async componentDidLoad(){await Salla.hooks.registerComponent("salla-add-product-button",this),this.notifyOptionsAvailability&&salla.event.on("product-options::change",(async t=>{if(!["thumbnail","color","single-option"].includes(t.option.type))return;this.hasSubscribedOptions=!1,this.selectedOptions=await(document.querySelector(`salla-product-options[product-id="${this.productId}"]`)?.getSelectedOptions()),this.hasOutOfStockOption=await(document.querySelector(`salla-product-options[product-id="${this.productId}"]`)?.hasOutOfStockOption());let i=salla.storage.get(`product-${this.productId}-subscribed-options`);if((i||this.subscribedOptions)&&this.hasOutOfStockOption)if(salla.config.isGuest()){const t=i?i.map((t=>t.split(",").map((t=>parseInt(t))))):[];this.hasSubscribedOptions=t.length>0&&t.some((t=>t.every((t=>this.selectedOptions.some((i=>i.id===t))))))}else this.hasSubscribedOptions=!(!this.subscribedOptions||"null"===this.subscribedOptions||"[]"===this.subscribedOptions)&&JSON.parse(this.subscribedOptions).some((t=>t.every((t=>this.selectedOptions.some((i=>i.id===t))))))}))}componentDidRender(){this.passedLabel&&(!this.supportStickyBar||window.innerWidth>=768)?this.btn?.setText(this.passedLabel):(this.btn?.setText(this.getLabel()),salla.lang.onLoaded((()=>this.btn?.setText(this.getLabel()))))}get host(){return s(this)}};C.style=":host{display:block}salla-add-product-button[width=wide]{width:100%}";const T=class{constructor(i){t(this,i),this.variant="info"}renderIcon(){const t=this.icon||this.variant;if("none"===t)return null;switch(t){case"success":return i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return i("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return i(e,{key:"3b5dd808399eeda5d930454542cd41cca26b0cc3",class:`s-alert-wrapper s-alert-${this.variant}`},i("span",{key:"4f58234774d1afc790fb83bff983ca9366faa349",class:"s-alert-icon"},this.renderIcon()),i("span",{key:"10eb3f87e6e77dcc5406a24f866feee1cc1f46ef",class:"s-alert-text"},this.message,i("slot",{key:"3656e15aeb25fb7285e88f694c090bad3b32dfbd"})))}};T.style=":host{display:block}";const P=class{constructor(i){t(this,i),this.invalidInput=a(this,"invalidInput"),this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد"),this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد"),this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح"),this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد"),this.bookingUrl="",this.iframeReady=!1,this.reservations=[],salla.lang.onLoaded((()=>this.setTranslations())),Salla.event.on("booking::open",(t=>this.handleBookingOpen(t)))}async setTranslations(){const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));await t("ar.trans","pages.cart.book_an_appointment","حجز موعد"),await t("en.trans","pages.cart.book_an_appointment","Book an Appointment"),await t("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد"),await t("en.trans","pages.cart.edit_an_appointment","Edit an Appointment"),await t("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح"),await t("en.trans","pages.cart.booked_successfully","Booked Successfully"),await t("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد"),await t("en.trans","pages.cart.select_appointment_date","Select appointment date"),this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment"),this.editLabel=salla.lang.get("pages.cart.edit_an_appointment"),this.bookedLabel=salla.lang.get("pages.cart.booked_successfully"),this.selectDate=salla.lang.get("pages.cart.select_appointment_date")}openBookingModal(t,i=!1){if(!i||t.detail&&"number"==typeof t.detail&&t.detail===this.productId)return salla.config.isGuest()?(this.setAfterReloadEvent("booking::open-after-reload",this.productId),void salla.event.dispatch("login::open")):void salla.booking.add(this.productId,!1).then((t=>{if("booking"!==t.data.redirect.to)throw new Error("Unexpected redirect!");salla.event.dispatch("booking::open",{url:t.data.redirect.url,id:this.productId})})).catch((t=>{salla.error(salla.lang.get("common.errors.error_occurred")),salla.logger.error(t.response||t)}))}handleBookingOpen(t){t.id===this.productId&&(this.bookingUrl=salla.url.addParamToUrl("product_id",t.id,t.url),this.iframeReady=!0,setTimeout((()=>{this.modal.setTitle(this.selectDate),this.modal.open()}),100))}setAfterReloadEvent(t,i){salla.storage.set("afterReloadEvent",{event:t,payload:i})}emitAfterReloadEvent(){const t=salla.storage.get("afterReloadEvent");if(t&&t.event){const i=new CustomEvent(t.event,{detail:t.payload});window.dispatchEvent(i),salla.storage.remove("afterReloadEvent")}}componentWillLoad(){this.option&&this.option.details.length&&(this.reservations=this.option.details)}componentDidLoad(){window.addEventListener("booking::open-after-reload",(t=>this.openBookingModal(t,!0))),this.emitAfterReloadEvent(),window.addEventListener("message",this.handleMessageEvent.bind(this)),this.reservationsInput.addEventListener("invalid",(t=>this.invalidInput.emit(t))),this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity(""),this.reservationsInput.reportValidity()}))}handleMessageEvent(t){if("booking"!==t.data.source)return;const i=t.data.type,e=t.data.message;if(localStorage.getItem("debug")&&console.log(`Received an action:${i}`,t.data),"error"===i){if(e.fields?.reservation)return void salla.notify.error(e.fields.reservation[0]);const t=Object.values(e.fields||[e.message]).flat().map((t=>`<li>${t}</li>`)).join("");salla.notify.error(`<ul>${t}</ul>`)}if("success"===i){if(Number(e.productId)!==Number(this.productId))return;this.reservations=e.data.reservations.map((t=>{if(t.time&&t.time.length>0){const i=t.time[0];return{date:t.date,day:t.day,from_timestamp:i.from,to_timestamp:i.to}}return null})).filter((t=>null!==t)),salla.notify.success(this.bookedLabel),this.modal?.close(),setTimeout((()=>window.location.reload()))}"height"===i&&(this.iframe.height=e?.height+"px")}bookingModal(){return i("salla-modal",{class:"s-booking-field-modal",ref:t=>this.modal=t,width:"md",position:"middle",noPadding:!0},i("iframe",{ref:t=>this.iframe=t,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(t){return i("span",{class:t.from_timestamp?"s-booking-field-reservations-has-time":""},i("i",{class:"s-booking-field-reservations-icon",innerHTML:'\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>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n'}),t.date)}renderReservationTime(t){return t.from_timestamp?i("span",{class:"s-booking-field-reservations-time"},i("i",{class:"s-booking-field-reservations-icon",innerHTML:'\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>time</title>\n<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'}),i("span",null,t.from_timestamp," - ",t.to_timestamp)):""}render(){return i(e,{key:"04c9e3dc3dc825bd6905221d858c260f7ca34748"},i("div",{key:"07ec38cec1bd1798640dd7ea9592bb3b17d945c6",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?i("div",{class:"s-booking-field-price"},i("span",{innerHTML:salla.money(this.option.price)})):"",i("salla-button",{key:"6b71889cfc0429d15c466a6f194df31549f09786",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:t=>this.openBookingModal(t,!1)},i("span",{key:"a16f8db6f52c7751ea605efcae04057ca0dc5b61",class:"s-booking-field-book-now-content"},i("span",{key:"95f6086a599bcc620c87ece6c6ae9620dba15581",innerHTML:'\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>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n'}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&i("div",{key:"b3615100bbfff3d98d0ac99145aaf53449790c94",class:"s-booking-field-reservations"},this.reservations.map(((t,e)=>i("div",{key:e,class:"s-booking-field-reservations-item"},this.renderReservationDate(t),this.renderReservationTime(t))))),i("input",{key:"126f14f2e520b8696bc7450e209bad30b267878b",class:"s-hidden",name:this.option.name,required:this.option.required,value:"[]"===JSON.stringify(this.reservations)?"":JSON.stringify(this.reservations),ref:t=>this.reservationsInput=t}),this.iframeReady&&this.bookingModal())}get host(){return s(this)}};P.style=":host{display:block}";var I='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>image</title>\n<path d="M21.333 6.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM21.333 12c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.599 1.333 1.333-0.597 1.333-1.333 1.333zM24 1.333h-16c-3.676 0-6.667 2.991-6.667 6.667v16c0 0.969 0.219 1.884 0.592 2.715 0.013 0.024 0.025 0.048 0.039 0.072 1.059 2.284 3.359 3.88 6.036 3.88h16c3.676 0 6.667-2.991 6.667-6.667v-16c0-3.676-2.991-6.667-6.667-6.667zM8 28c-1.376 0-2.592-0.699-3.312-1.76l7.312-9.401 8.681 11.161zM28 24c0 2.187-1.765 3.964-3.945 3.995l-11.003-14.147c-0.505-0.649-1.599-0.649-2.104 0l-6.948 8.933v-14.781c0-2.205 1.795-4 4-4h16c2.205 0 4 1.795 4 4z"></path>\n</svg>\n';const L=class{constructor(i){t(this,i),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.more_details","More Details"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price","Store Price"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.the_developer","المطور"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.the_developer","the developer"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.salla","سلة"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.salla","Salla"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100)}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((t=>{this.templateData=t.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return i("salla-drawer",{class:"s-bottom-alert-modal",ref:t=>this.drawer=t,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[i("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},i("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[i("div",{class:"s-bottom-alert-modal-content-title"},i("i",{innerHTML:I,class:"s-bottom-alert-modal-content-icon"}),i("span",null,this.storeFeatures)),i("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),i("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[i("div",{class:"s-bottom-alert-modal-content-title"},i("i",{innerHTML:'\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>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),i("span",null,this.storePriceDetails)),i("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((t=>i("div",{class:"s-bottom-alert-modal-content-price-details-item"},i("i",{innerHTML:'\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>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),i("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},t.name),i("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(t.price)})))))]:""),this.templateData?.link?i("div",{class:"s-bottom-alert-modal-content-footer"},i("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},i("i",{innerHTML:S}),this.buyTheTemplate)):"")]:"")}render(){const t=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return i(e,{key:"e5f273d72875760e30d99d419b247137583bc450",class:"s-bottom-alert-wrapper "+(t?"s-bottom-alert-wrapper-with-template":"")},t&&i("div",{key:"1db37d7c67aae449f41a9a3ed83489b2a0653cef",class:"s-bottom-alert-logo-section"},i("img",{key:"18701cd3d807042b4d852f283d43a6855282f791",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),i("span",{key:"66bb3f9b3c00aee5c2694d5ddb142e753ae7fa1a",class:"s-bottom-alert-logo-text"},this.readyStores)),i("div",{key:"01d47c9ec38370b83bdb3fdc29291f55e1b3aa42",class:"s-bottom-alert-content"},i("div",{key:"5380873bf9d393c0fa18da196e1bfb675a8c9c9b",class:"flex items-center gap-2"},i("div",{key:"882382de35a7c9a767e2eb90305c8a973d01ac21",class:"s-bottom-alert-icon"},i("i",this.icon?{class:this.icon}:{innerHTML:'\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>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'})),i("div",{key:"dfbaa427fd4e8b755a479e0b5459422e44a95f59",class:"s-bottom-alert-message"},this.message?this.message:t?i("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,i("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),i("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&i("div",{key:"327ef4b5ecdab7d994418c033a78c2531eb28de5",class:t?"s-bottom-alert-actions-group":"s-bottom-alert-action"},t?this.loading?i("salla-loading",{size:"20"}):i("div",{class:"s-bottom-alert-actions-group-container"},i("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?i("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):i("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return s(this)}};L.style=":host{display:block}";var D='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_left</title>\n<path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>\n</svg>\n',B='\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>keyboard_arrow_right</title>\n<path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>\n</svg>\n';const O=class{constructor(i){t(this,i),this.sessionStorageKey="breadcrumb_snapshot",this.itemSlot=this.host.querySelector('[slot="item"]')?.outerHTML||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>',this.iconSlot=this.host.querySelector('[slot="icon"]')?.outerHTML}componentWillLoad(){return new Promise((t=>salla.onReady((()=>salla.lang.onLoaded(t))))).then((()=>{if(salla.url.is_page("index"))throw new Error("salla-breadcrumb:: breadcrumb not supported on home page")})).then((()=>{if(!salla.config.get("theme.settings.is_breadcrumbs_enabled",!0))throw new Error("salla-breadcrumb:: merchant disabled the feature")})).then((()=>{const t=salla.config.get("page");if(!t||!t.slug)return salla.logger.error('salla-breadcrumbs:: page object not existed on salla.config.get("page")!'),void(this.breadcrumbs=[]);let i=this.getSessionBreadcrumbs();return"product.single"===t.slug&&i&&i.length>0?(i.push({title:t.title,url:t.url}),this.breadcrumbs=this.setBreadcrumbsFromArray(i),this.storeBreadcrumbSnapshot()):i&&i.length>0?this.isNewPage(t,i)?(this.breadcrumbs=this.generateBreadcrumbs(t),this.storeBreadcrumbSnapshot()):this.breadcrumbs=this.setBreadcrumbsFromArray(i):(this.breadcrumbs=this.generateBreadcrumbs(t),this.storeBreadcrumbSnapshot()),this.breadcrumbs?.length&&(this.breadcrumbs[this.breadcrumbs.length-1].is_last=!0),this.breadcrumbs})).catch((t=>{salla.logger.error("salla-breadcrumb:: unexpected error!",t),this.breadcrumbs=[]}))}getSessionBreadcrumbs(){return"search-bar"===new URLSearchParams(window.location.search).get("from")?[]:JSON.parse(sessionStorage.getItem(this.sessionStorageKey)||"[]")}isNewPage(t,i){const e=i[i.length-1];return e?.url!==t.url}setBreadcrumbsFromArray(t){return t.map(((i,e)=>({...i,is_last:e===t.length-1})))}sanitizeBreadcrumbTitle(t,i=1){return t.includes("|")?t.split("|").map((t=>t.trim()))[i]:t.trim()}generateBreadcrumbs(t){let i=[];if("product.single"===t.slug){const i=this.getSessionBreadcrumbs();if(i.length>0&&i[1]?.url===t.parent?.url)return this.setBreadcrumbsFromArray([...i,t])}let e=t;for(;e;)e.title&&i.unshift({title:e.title,url:e.url}),e=e.parent;return t.slug.includes("customer")&&"customer.profile"!==t.slug&&i.unshift({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")}),t.slug.includes("blog")&&i.unshift({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")}),"brands.single"===t.slug&&i.unshift({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")}),t.title||"loyalty"!==t.slug||i.unshift({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")}),i.unshift({title:salla.lang.get("common.titles.home"),url:salla.url.get("")}),i}storeBreadcrumbSnapshot(){try{const t=salla.config.get("page");if("product.single"===t?.slug)return;const i=[...this.breadcrumbs],e=i.length-1;e>=0&&(i[e].url=window.location.href);const s=JSON.stringify(i);sessionStorage.setItem(this.sessionStorageKey,s)}catch(t){salla.logger.error("salla-breadcrumb:: Failed to store breadcrumb snapshot in sessionStorage.",t)}}render(){return this.breadcrumbs.length<=1?(salla.log("salla-breadcrumb:: There is no breadcrumbs!"),null):i("ol",{class:{"s-breadcrumb-wrapper":!0,"s-breadcrumb-dark":salla.url.is_page("loyalty"),"s-breadcrumb-primary-reverse":salla.config.get("page.slug").includes("customer")}},this.breadcrumbs.map((t=>{const e="product.single"===salla.config.get("page.slug")&&t.is_last?t.title:this.sanitizeBreadcrumbTitle(t.title),s=this.itemSlot.replace(/\{url\}/g,t.url).replace(/\{title\}/g,e);return[i("div",{class:"s-breadcrumb-slot",innerHTML:s}),this.getArrowDomForItem(t)]})))}getArrowDomForItem(t){if(t.is_last)return"";let e=this.iconSlot||(salla.config.get("theme.is_rtl",!0)?D:B);return i("li",{class:"s-breadcrumb-arrow"},i("div",{class:{"s-breadcrumb-icon-slot":!0,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:e}))}componentDidRender(){this.host.querySelectorAll(".s-breadcrumb-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll(".s-breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((t=>t.replaceWith(t.querySelector("svg")))),this.host.querySelector('[slot="item"]')?.remove(),this.host.querySelector('[slot="icon"]')?.remove();let t=this.host.querySelectorAll(".s-breadcrumb-item")[this.breadcrumbs.length-1]?.querySelector("a");t&&t.replaceWith(t.firstChild)}get host(){return s(this)}};O.style=":host{display:block}";const H=class{constructor(i){t(this,i),this.hostAttributes={},this.shape="btn",this.color="primary",this.fill="solid",this.size="medium",this.width="normal",this.loading=!1,this.disabled=!1,this.loaderPosition="after",this.type="button"}async load(){return"center"==this.loaderPosition&&this.text.classList.add("s-button-hide"),this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),this.host.querySelector("button").removeAttribute("loading"),"center"==this.loaderPosition&&this.text.classList.remove("s-button-hide"),this.host}async setText(t){return this.text.innerHTML=t,this.host}async disable(){return this.host.setAttribute("disabled",""),this.host}async enable(){return this.host.removeAttribute("disabled"),this.host}getBtnAttributes(){for(let t=0;t<this.host.attributes.length;t++)["color","fill","size","width","id"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes.type=this.hostAttributes.type||this.type,this.hostAttributes.class+=" s-button-element s-button-"+this.shape+" s-button-"+("none"==this.fill?"fill-none":this.fill)+("medium"!=this.size?" s-button-"+this.size:"")+("normal"!=this.width?" s-button-"+this.width:"")+("link"==this.shape?" s-button-"+this.color+"-link":"")+("link"!=this.shape&&"outline"!=this.fill?" s-button-"+this.color:"")+("outline"==this.fill?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+("icon"==this.shape?" s-button-loader-center":" s-button-loader-"+this.loaderPosition),this.hostAttributes}button(){return i("button",{...this.getBtnAttributes(),disabled:this.disabled},i("span",{class:"s-button-text",ref:t=>this.text=t},i("slot",null)),this.loading?i("span",{class:"s-button-loader"}):"")}render(){return this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":i(e,{class:"s-button-wrap"},this.href?i("a",{href:this.href},this.button()):this.button())}get host(){return s(this)}};H.style="";const F=class{constructor(i){t(this,i),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",salla.cart.event.onUpdated((t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0}))}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!t?.src)return void salla.log("Failed to get the img element");let i=this.host.querySelector("#s-cart-icon"),e=i.getBoundingClientRect(),s=e.top+window.scrollY,a=e.left+window.scrollX,l=t.getBoundingClientRect(),o=t.offsetWidth+"px",n=t.offsetHeight+"px",c=l.top,h=l.left,d=document.createElement("img");d.src=t.getAttribute("src"),d.className="s-cart-thumb",d.setAttribute("style","object-fit:cover; width:"+o+"; height:"+n+"; top:"+c+"px; left:"+h+"px;z-index:99999999; "),document.body.append(d);let p=document.querySelector(".s-cart-thumb");i.classList.remove("animated","rubberBand"),(new r.timeline).add({targets:p,width:[150,30],height:[150,30],top:[c,window.scrollY>0?s-window.scrollY-40:s-40],left:[h,a],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:p,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?s-window.scrollY-40:s-40,window.scrollY>0?s-window.scrollY+10:s+10],left:[a,a+10]},"-=500").add({complete:function(){i.classList.add("animated","rubberBand"),p.remove()}},"-=1700")}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const i=salla.config.get("store.scope",salla.storage.get("scope"));if(i&&i.id)try{const e=new URL(t);return e.searchParams.set("scope",i.id),e.toString()}catch(e){const s=t.includes("?")?"&":"?";return`${t}${s}scope=${encodeURIComponent(i.id)}`}return t}render(){return i(e,{key:"f22c9fc5b6ad2c7b7f026a7b9ad2510a3c27c281"},i("a",{key:"b329fa512839a8dd6d8a1b175e254308c22a9fb0",class:"s-cart-summary-wrapper",href:this.getCartLink()},i("div",{key:"fbe89bcca0f38393a23016cf45358d38a53e5f8f",id:"s-cart-icon"},i("slot",{key:"f2668edcc903f0a8fd112c6449d8cda9113e2ffa",name:"icon"},i("i",{key:"f4a2c742903302b2676c4628961a90a7bcfe43eb",class:"s-cart-summary-icon",innerHTML:S}))),i("span",{key:"49678efeaae684b2da2c238382b014390516db8d",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),i("p",{key:"9a399f82fc90e6c974022b65ea75c3f556f67221",class:"s-cart-summary-content"},this.showCartLabel&&i("span",{key:"879348fe4998f2eb3f26e4bebe486877bc733bff",class:"s-cart-summary-label"},this.cartLabel),i("b",{key:"237d3ee6ebed4203752b6f5c4e2cb962c03cc087",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return s(this)}};F.style="";var E,R={exports:{}},j=(E||(E=1,R.exports=function(){var t=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,i){for(var e=0;e<i.length;e++){var s=i[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(i,e,s){return e&&t(i.prototype,e),s&&t(i,s),i}}(),e=function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,i){var e=[],s=!0,a=!1,l=void 0;try{for(var o,n=t[Symbol.iterator]();!(s=(o=n.next()).done)&&(e.push(o.value),!i||e.length!==i);s=!0);}catch(t){a=!0,l=t}finally{try{!s&&n.return&&n.return()}finally{if(a)throw l}}return e}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,i){for(var e=this;e.length<t;)e=i+e;return e};var s={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function a(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(i>0?t.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):t.toString())||"0"}var l=function(){function l(i,s,a,o){t(this,l);var n=this;if(void 0===i);else if(Array.isArray(i))this.rgba=i;else if(void 0===a){var r=i&&""+i;r&&function(t){if(t.startsWith("hsl")){var i=t.match(/([\-\d\.e]+)/g).map(Number),s=e(i,4),a=s[0],o=s[1],r=s[2],c=s[3];void 0===c&&(c=1),n.hsla=[a/=360,o/=100,r/=100,c]}else if(t.startsWith("rgb")){var h=t.match(/([\-\d\.e]+)/g).map(Number),d=e(h,4),p=d[3];void 0===p&&(p=1),n.rgba=[d[0],d[1],d[2],p]}else n.rgba=t.startsWith("#")?l.hexToRgb(t):l.nameToRgb(t)||l.hexToRgb(t)}(r.toLowerCase())}else this.rgba=[i,s,a,void 0===o?1:o]}return i(l,[{key:"printRGB",value:function(t){var i=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,i){return a(t,3===i?3:0)}));return t?"rgba("+i+")":"rgb("+i+")"}},{key:"printHSL",value:function(t){var i=[360,100,100,1],e=["","%","%",""],s=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,s){return a(t*i[s],3===s?3:1)+e[s]}));return t?"hsla("+s+")":"hsl("+s+")"}},{key:"printHex",value:function(t){var i=this.hex;return t?i:i.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=l.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=l.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(t,i){return i<3?t.toString(16):Math.round(255*t).toString(16)})).map((function(t){return t.padStart(2,"0")})).join("")},set:function(t){this.rgba=l.hexToRgb(t)}}],[{key:"hexToRgb",value:function(t){var i=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!i.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var e=i.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return e[3]=e[3]/255,e}},{key:"nameToRgb",value:function(t){var i=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),e=s[i];return void 0===e?e:l.hexToRgb(e.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var i=e(t,4),s=i[0],a=i[1],l=i[2],o=i[3];s/=255,a/=255,l/=255;var n=Math.max(s,a,l),r=Math.min(s,a,l),c=void 0,h=void 0,d=(n+r)/2;if(n===r)c=h=0;else{var p=n-r;switch(h=d>.5?p/(2-n-r):p/(n+r),n){case s:c=(a-l)/p+(a<l?6:0);break;case a:c=(l-s)/p+2;break;case l:c=(s-a)/p+4}c/=6}return[c,h,d,o]}},{key:"hslToRgb",value:function(t){var i=e(t,4),s=i[0],a=i[1],l=i[2],o=i[3],n=void 0,r=void 0,c=void 0;if(0===a)n=r=c=l;else{var h=function(t,i,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(i-t)*e:e<.5?i:e<2/3?t+(i-t)*(2/3-e)*6:t},d=l<.5?l*(1+a):l+a-l*a,p=2*l-d;n=h(p,d,s+1/3),r=h(p,d,s),c=h(p,d,s-1/3)}var u=[255*n,255*r,255*c].map(Math.round);return u[3]=o,u}}]),l}(),o=function(){function e(){t(this,e),this._events=[]}return i(e,[{key:"add",value:function(t,i,e){t.addEventListener(i,e,!1),this._events.push({target:t,type:i,handler:e})}},{key:"remove",value:function(t,i,s){this._events=this._events.filter((function(a){var l=!0;return t&&t!==a.target&&(l=!1),i&&i!==a.type&&(l=!1),s&&s!==a.handler&&(l=!1),l&&e._doRemove(a.target,a.type,a.handler),!l}))}},{key:"destroy",value:function(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,i,e){t.removeEventListener(i,e,!1)}}]),e}();function n(t,i,e){var s=!1;function a(t,i,e){return Math.max(i,Math.min(t,e))}function l(t,l,o){if(o&&(s=!0),s){t.preventDefault();var n=i.getBoundingClientRect(),r=n.width,c=n.height,h=l.clientY,d=a(l.clientX-n.left,0,r),p=a(h-n.top,0,c);e(d/r,p/c)}}function o(t,i){1===(void 0===t.buttons?t.which:t.buttons)?l(t,t,i):s=!1}function n(t,i){1===t.touches.length?l(t,t.touches[0],i):s=!1}t.add(i,"mousedown",(function(t){o(t,!0)})),t.add(i,"touchstart",(function(t){n(t,!0)})),t.add(window,"mousemove",o),t.add(i,"touchmove",n),t.add(window,"mouseup",(function(){s=!1})),t.add(i,"touchend",(function(){s=!1})),t.add(i,"touchcancel",(function(){s=!1}))}var r="keydown",c="mousedown",h="focusin";function d(t,i){return(i||document).querySelector(t)}function p(t,i,e,s){t.add(i,r,(function(t){e.indexOf(t.key)>=0&&s(t)}))}var u=function(){function e(i){t(this,e),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new o,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(i)}return i(e,[{key:"setOptions",value:function(t){var i=this;if(t){var e=this.settings;if(t instanceof HTMLElement)e.parent=t;else{e.parent&&t.parent&&e.parent!==t.parent&&(this._events.remove(e.parent),this._popupInited=!1),function(t,i){for(var e in t)i[e]=t[e]}(t,e),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var s=t.color||t.colour;s&&this._setColor(s)}var a=e.parent;if(a&&e.popup&&!this._popupInited){var l=function(t){return i.openHandler(t)};this._events.add(a,"click",l),p(this._events,a,[" ","Spacebar","Enter"],l),this._popupInited=!0}else t.parent&&!e.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var i=t&&t.type===r?this._domEdit:this.domElement;setTimeout((function(){return i.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var i=t&&t.type,e=!1;t?i===c||i===h?t.timeStamp>(this.__containedEvent||0)+100&&(e=!0):(function(t){t.preventDefault(),t.stopPropagation()}(t),e=!0):e=!0,e&&this.hide()&&(this.settings.parent.style.pointerEvents="",i!==c&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,i){this.closeHandler(),this.setOptions(t),i&&this.openHandler()}},{key:"setColor",value:function(t,i){this._setColor(t,{silent:i})}},{key:"_setColor",value:function(t,i){if("string"==typeof t&&(t=t.trim()),t){i=i||{};var e=void 0;try{e=new l(t)}catch(t){if(i.failSilently)return;throw t}if(!this.settings.alpha){var s=e.hsla;s[3]=1,e.hsla=s}this.colour=this.color=e,this._setHSLA(null,null,null,null,i)}}},{key:"setColour",value:function(t,i){this.setColor(t,i)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var i,e,s=(i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',(e=document.createElement("div")).innerHTML=i,e.firstElementChild);return this.domElement=s,this._domH=d(".picker_hue",s),this._domSL=d(".picker_sl",s),this._domA=d(".picker_alpha",s),this._domEdit=d(".picker_editor input",s),this._domSample=d(".picker_sample",s),this._domOkay=d(".picker_done button",s),this._domCancel=d(".picker_cancel button",s),s.classList.add("layout_"+this.settings.layout),this.settings.alpha||s.classList.add("no_alpha"),this.settings.editor||s.classList.add("no_editor"),this.settings.cancelButton||s.classList.add("no_cancel"),this._ifPopup((function(){return s.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,i=this,e=this.domElement,s=this._events;function a(t,i,e){s.add(t,i,e)}a(e,"click",(function(t){return t.preventDefault()})),n(s,this._domH,(function(t){return i._setHSLA(t)})),n(s,this._domSL,(function(t,e){return i._setHSLA(null,t,1-e)})),this.settings.alpha&&n(s,this._domA,(function(t,e){return i._setHSLA(null,null,null,1-e)}));var l=this._domEdit;a(l,"input",(function(){i._setColor(this.value,{fromEditor:!0,failSilently:!0})})),a(l,"focus",(function(){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var i=function(i){return t.closeHandler(i)};a(window,c,i),a(window,h,i),p(s,e,["Esc","Escape"],i);var l=function(i){t.__containedEvent=i.timeStamp};a(e,c,l),a(e,h,l),a(t._domCancel,"click",i)}));var o=function(i){t._ifPopup((function(){return t.closeHandler(i)})),t.onDone&&t.onDone(t.colour)};a(this._domOkay,"click",o),p(s,e,["Enter"],o)}},{key:"_setPosition",value:function(){var t=this.settings.parent,i=this.domElement;t!==i.parentNode&&t.appendChild(i),this._ifPopup((function(e){"static"===getComputedStyle(t).position&&(t.style.position="relative");var s=!0===e?"popup_right":"popup_"+e;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===s?i.classList.add(t):i.classList.remove(t)})),i.classList.add(s)}))}},{key:"_setHSLA",value:function(t,i,e,s,a){a=a||{};var l=this.colour,o=l.hsla;[t,i,e,s].forEach((function(t,i){(t||0===t)&&(o[i]=t)})),l.hsla=o,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(l)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var i=this.colour,e=i.hsla,s="hsl("+360*e[0]+", 100%, 50%)",a=i.hslString,l=i.hslaString,o=this._domH,n=this._domSL,r=this._domA,c=d(".picker_selector",o),h=d(".picker_selector",n),p=d(".picker_selector",r);b(0,c,e[0]),this._domSL.style.backgroundColor=this._domH.style.color=s,b(0,h,e[1]),w(0,h,1-e[2]),n.style.color=a,w(0,p,1-e[3]);var u=a,g=u.replace("hsl","hsla").replace(")",", 0)");if(this._domA.style.background="linear-gradient("+[u,g]+"), linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var m=this.settings.alpha,f=void 0;switch(this.settings.editorFormat){case"rgb":f=i.printRGB(m);break;case"hsl":f=i.printHSL(m);break;default:f=i.printHex(m)}this._domEdit.value=f}this._domSample.style.color=l}function b(t,i,e){i.style.left=100*e+"%"}function w(t,i,e){i.style.top=100*e+"%"}}},{key:"_ifPopup",value:function(t,i){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):i&&i()}},{key:"_toggleDOM",value:function(t){var i=this.domElement;if(!i)return!1;var e=t?"":"none",s=i.style.display!==e;return s&&(i.style.display=e),s}}]),e}(),g=document.createElement("style");return g.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(g),u.StyleElement=g,u}()),R.exports),q=l(j);
4
+ import{r as t,h as i,H as e,a as s,c as a,d as l,F as o,j as n}from"./p-CS3HDvos.js";import{a as r}from"./p-CgtvEd63.js";import{A as c,S as h}from"./p-yRO-ZESF.js";import{I as d}from"./p-uTyAzPSy.js";import{H as p}from"./p-Dljb4XCt.js";import{a as u}from"./p-BedNk7k1.js";import{C as g,G as m}from"./p-CBT_Nxny.js";import{S as f}from"./p-DiKTtDW5.js";import{M as b}from"./p-DmgxDvXL.js";import{w}from"./p-DWksgowB.js";import{f as y,t as _}from"./p-Dz7o69vX.js";import{G as v}from"./p-C0JNGIpa.js";const k=class{constructor(i){t(this,i),this.collapsible=!0,this.bordered=!1,this.size="md",this.collapsed=!0,this.dir=document.dir||"rtl"}directionChangedHandler(t){this.dir=t.detail.dir}handleCollapse(t){this.collapsed=t.detail.payload.collapsed}setcollapsibleProp(){const t=this.host.querySelector("salla-accordion-head");this.collapsible&&t&&(t.setAttribute("collapsible","true"),t.setAttribute("collapsed",this.collapsed.toString()))}componentDidRender(){this.setcollapsibleProp();const t=this.host.querySelector("salla-accordion-body");this.collapsible&&(this.host.setAttribute("data-collapsed",this.collapsed.toString()),t?.setAttribute("data-collapsed",this.collapsed.toString()))}render(){return i(e,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:`s-accordion-wrapper ${this.dir} ${this.bordered?"s-accordion-wrapper-bordered":""} ${this.size?`size-${this.size}`:""}`,"data-collapsed":this.collapsed.toString()},i("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))}get host(){return s(this)}};k.style="";const x=class{constructor(i){t(this,i)}render(){return i(e,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},i("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))}};x.style="";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>add</title>\n<path d="M26.667 14.667h-9.333v-9.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v9.333h-9.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h9.333v9.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-9.333h9.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n',M='\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>minus</title>\n<path d="M26.667 14.667h-21.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h21.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';const z=class{constructor(i){t(this,i),this.accordionToggle=a(this,"accordionToggle"),this.collapsible=!1,this.collapsed=!0}emitCollapsePanel(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})}toggleCollapse(){this.collapsible&&(this.collapsed=!this.collapsed,this.host.parentElement?.setAttribute("data-collapsed",this.collapsed.toString()),this.host.parentElement?.querySelector("salla-accordion-body")?.setAttribute("data-collapsed",this.collapsed.toString()),this.emitCollapsePanel())}render(){return i(e,{key:"9d88d243306cdf451c20d7068fbb9f48807b22e9","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},i("div",{key:"bad4c5a913ce1c4581b09c0b6d96fcbdb4236638",class:"s-accordion-head-wrapper-start"},i("slot",{key:"acb83cec8cbca5771a9f84e81c0b955c3edad731",name:"title"}),i("slot",{key:"a4ad42ea6fad4f452c4c218a9ee02dca0adb4a67",name:"progress"}),i("slot",{key:"96ab95d413dc906ac299079f4008816f01881990",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&i("div",{key:"8f9666a5038cd7b1ac6e357c6920ea26d31c5f03",class:"s-accordion-head-wrapper-end"},i("slot",{key:"14895e8c1385e91c14f046c9ae38ce5e4a4c9a60",name:"note"}),this.collapsible&&i("button",{key:"97dc7fabbb207fcc8b68ebf0a86f6c8a980dca13",class:{"s-accordion-head-wrapper-toggle":!0,active:!this.collapsed},onClick:t=>{t.stopPropagation(),this.toggleCollapse()}},i("span",{key:"3b24faf71dcd332663a354310b2ce09f7879eddc",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?A:M}))))}get host(){return s(this)}};z.style="";var S='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>cart</title>\n<path d="M15.426 28.084c0-1.412-0.85-2.684-2.156-3.226-1.305-0.54-2.807-0.241-3.805 0.758-0.999 0.998-1.298 2.5-0.758 3.805 0.54 1.303 1.815 2.155 3.226 2.155 1.928-0.003 3.49-1.564 3.492-3.492h0.001zM10.597 28.084h0.001c0-0.54 0.326-1.027 0.825-1.235 0.498-0.206 1.074-0.091 1.455 0.29 0.383 0.382 0.497 0.957 0.29 1.456-0.208 0.5-0.695 0.825-1.235 0.825-0.355 0-0.695-0.142-0.944-0.391-0.251-0.251-0.392-0.591-0.392-0.946h-0.001l0.001 0.001zM28.23 28.084c0-1.412-0.85-2.684-2.155-3.226-1.305-0.54-2.807-0.241-3.806 0.758s-1.297 2.5-0.756 3.805c0.54 1.303 1.813 2.155 3.226 2.155 1.927-0.003 3.49-1.564 3.491-3.492zM23.401 28.084c0-0.54 0.326-1.027 0.825-1.235 0.5-0.206 1.075-0.091 1.457 0.29s0.497 0.957 0.289 1.456c-0.206 0.5-0.693 0.825-1.233 0.825-0.738 0-1.337-0.599-1.337-1.337l-0.001 0.001zM1.953 0.234l-0.342-0.059c-0.29-0.064-0.594-0.004-0.839 0.166-0.247 0.169-0.414 0.436-0.463 0.734-0.050 0.3 0.023 0.607 0.201 0.85s0.444 0.402 0.738 0.44l0.341 0.059c1.825 0.324 3.248 1.794 3.548 3.662l1.981 12.369h-0.001c0.218 1.387 0.913 2.651 1.96 3.563s2.379 1.412 3.754 1.41h14.242c0.601 0 1.088-0.498 1.088-1.112s-0.487-1.112-1.088-1.112h-14.242c-1.679-0.001-3.139-1.183-3.525-2.854h11.463c1.614 0.004 3.188-0.518 4.493-1.49 1.305-0.973 2.271-2.346 2.762-3.918l1.298-4.136c0.145-0.455 0.065-0.953-0.213-1.336-0.278-0.385-0.72-0.608-1.187-0.602h-20.467l-0.181-1.141c-0.218-1.367-0.849-2.631-1.802-3.615-0.954-0.983-2.184-1.64-3.518-1.878h-0.001zM26.946 9.096l-0.993 3.169v-0.001c-0.353 1.122-1.044 2.101-1.975 2.796s-2.056 1.067-3.208 1.067h-11.833l-1.125-7.042 19.134 0.011z"></path>\n</svg>\n';const C=class{constructor(i){t(this,i),this.success=a(this,"success"),this.failed=a(this,"failed"),this.hostAttributes={},this.hasPreOrder=!1,this.productStatus="sale",this.productType="product",this.selectedOptions=[],this.buyNowText=salla.lang.get("pages.products.buy_now"),salla.lang.onLoaded((()=>{this.buyNowText=salla.lang.get("pages.products.buy_now")}))}getLabel(){return"sale"===this.productStatus&&this.supportStickyBar&&window.innerWidth<=768&&this.showQuickBuy&&this.isApplePayActive?S:this.hasPreOrder?salla.lang.get("pages.products.pre_order_now"):"sale"===this.productStatus&&"booking"===this.productType?salla.lang.get("pages.cart.book_now"):"sale"===this.productStatus?salla.lang.get("pages.cart.add_to_cart"):"donating"!==this.productType?salla.lang.get("pages.products.out_of_stock"):salla.lang.get("pages.products.donation_exceed")}addProductToCart(t){if("booking"===this.productType)return t.preventDefault(),this.addBookingProduct();if("submit"===this.hostAttributes.type)return!1;t.preventDefault(),this.btn?.disable();const i=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);return i&&"function"==typeof i.validateAndScroll?i.validateAndScroll().then((async t=>{const i={isValid:t,component:this};if(await salla.hooks.call("salla-add-product-button","validate",i),i.isValid)return this._proceedAddToCart();this.btn?.enable()})).catch((()=>{this.btn?.enable()})):this._proceedAddToCart()}async _proceedAddToCart(){const t=Object.entries({id:this.productId,donation_amount:this.donatingAmount,quantity:this.quantity,endpoint:"quickAdd"}).reduce(((t,[i,e])=>e?(t[i]=e,t):t),{});return salla.cart.addItem(t).then((async t=>(this.selectedOptions=[],this.btn?.enable(),this.success.emit(t),t))).catch((t=>{this.failed.emit(t),this.btn?.enable()}))}addBookingProduct(){return salla.config.isGuest()?(salla.auth.api.setAfterLoginEvent("booking::add",this.productId),void salla.event.dispatch("login::open")):salla.booking.add(this.productId).then((t=>this.success.emit(t))).catch((t=>this.failed.emit(t)))}getBtnAttributes(){for(let t=0;t<this.host.attributes.length;t++)["id","class"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes}getQuickBuyBtnAttributes(){return{...this.getBtnAttributes(),type:this.supportStickyBar&&window.innerWidth<=768?"plain":"donating"==this.productType?"donate":"buy"}}miniCheckoutWidget(){let t=salla.config.get("store.id");if(t)return i("salla-mini-checkout-widget",{language:salla.lang.locale,"store-id":t,config:{user:salla.config.get("user"),failure_url:window.location.href},products:[this.productId],api:salla.config.get("store.api"),outline:!0,"form-selector":"form.product-form",class:"s-add-product-button-mini-checkout"},i("div",{slot:"widget-label",class:"s-add-product-button-mini-checkout-content"},i("span",{innerHTML:'\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>full-wallet</title>\n<path d="M29 12h-26c-0.668-0.008-1.284-0.226-1.787-0.59l0.009 0.006c-0.744-0.552-1.222-1.428-1.222-2.416 0-1.657 1.343-3 2.999-3h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0h-6c-0.552 0-1 0.448-1 1 0 0.326 0.156 0.616 0.397 0.798l0.002 0.002c0.167 0.12 0.374 0.194 0.599 0.2l0.001 0h26c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM27 12c-0.552 0-1-0.448-1-1v0-3h-3c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM29 30h-26c-1.657 0-3-1.343-3-3v0-18c0-0.552 0.448-1 1-1s1 0.448 1 1v0 18c0 0.552 0.448 1 1 1v0h25v-5c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM29 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM31 24h-7c-2.209 0-4-1.791-4-4s1.791-4 4-4v0h7c0.552 0 1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2v0h6v-4zM25 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-2.306 1.152c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 3.2-1.6c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1v0zM21 12c-0.001 0-0.001 0-0.002 0-0.389 0-0.726-0.222-0.891-0.546l-0.003-0.006-3.552-7.106-15.104 7.552c-0.13 0.066-0.284 0.105-0.447 0.105-0.552 0-1-0.448-1-1 0-0.39 0.223-0.727 0.548-0.892l0.006-0.003 16-8c0.13-0.067 0.284-0.106 0.447-0.106 0.39 0 0.727 0.223 0.892 0.548l0.003 0.006 4 8c0.067 0.13 0.106 0.285 0.106 0.448 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0z"></path>\n</svg>\n'}),this.buyNowText))}componentWillLoad(){return salla.onReady().then((()=>{if(document.documentElement.classList.add("hydrated"),this.showQuickBuy=this.quickBuy&&salla.config.get("store.settings.buy_now")&&"sale"==this.productStatus&&"booking"!==this.productType,this.isApplePayActive=window.ApplePaySession?.canMakePayments()&&salla.config.get("store.settings.payments")?.includes("apple_pay")&&salla.config.get("store.settings.is_salla_gateway",!1),this.passedLabel=this.host.innerHTML.replace("\x3c!----\x3e","").trim(),this.passedLabel&&window.innerWidth>=768)return this.btn?.setText(this.passedLabel);"submit"===this.host.getAttribute("type")&&this.supportStickyBar&&window.addEventListener("resize",(()=>this.btn?.setText(window.innerWidth>=768&&this.passedLabel?this.passedLabel:this.getLabel())))}))}render(){return this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":this.hasSubscribedOptions?i(e,null,i("salla-product-availability",{...this.getBtnAttributes(),"is-subscribed":!0},i("span",{class:"s-hidden"},i("slot",null)))):"out-and-notify"===this.productStatus&&this.channels||this.hasOutOfStockOption?i(e,null,i("salla-product-availability",{...this.getBtnAttributes()},i("span",{class:"s-hidden"},i("slot",null)))):i(e,{class:{"s-add-product-button-with-quick-buy":this.showQuickBuy,"s-add-product-button-with-sticky-bar":this.supportStickyBar,"s-add-product-button-with-apple-pay":this.showQuickBuy&&this.isApplePayActive}},i("div",{class:{"s-add-product-button-main":this.showQuickBuy,"w-full":!document.getElementById("fast-checkout-js")||["financial_support","donating"].includes(this.productType)}},i("salla-button",{color:"sale"===this.productStatus?"primary":"light",type:"button",fill:"sale"===this.productStatus?"solid":"outline",ref:t=>this.btn=t,onClick:t=>this.addProductToCart(t),disabled:"sale"!==this.productStatus,...this.getBtnAttributes(),"loader-position":"center"},i("slot",null)),this.showQuickBuy&&document.getElementById("fast-checkout-js")&&!["financial_support","donating"].includes(this.productType)?this.miniCheckoutWidget():""),this.showQuickBuy&&this.isApplePayActive?i("salla-quick-buy",{...this.getQuickBuyBtnAttributes()}):"")}async componentDidLoad(){await Salla.hooks.registerComponent("salla-add-product-button",this),this.notifyOptionsAvailability&&salla.event.on("product-options::change",(async t=>{if(!["thumbnail","color","single-option"].includes(t.option.type))return;this.hasSubscribedOptions=!1,this.selectedOptions=await(document.querySelector(`salla-product-options[product-id="${this.productId}"]`)?.getSelectedOptions()),this.hasOutOfStockOption=await(document.querySelector(`salla-product-options[product-id="${this.productId}"]`)?.hasOutOfStockOption());let i=salla.storage.get(`product-${this.productId}-subscribed-options`);if((i||this.subscribedOptions)&&this.hasOutOfStockOption)if(salla.config.isGuest()){const t=i?i.map((t=>t.split(",").map((t=>parseInt(t))))):[];this.hasSubscribedOptions=t.length>0&&t.some((t=>t.every((t=>this.selectedOptions.some((i=>i.id===t))))))}else this.hasSubscribedOptions=!(!this.subscribedOptions||"null"===this.subscribedOptions||"[]"===this.subscribedOptions)&&JSON.parse(this.subscribedOptions).some((t=>t.every((t=>this.selectedOptions.some((i=>i.id===t))))))}))}componentDidRender(){this.passedLabel&&(!this.supportStickyBar||window.innerWidth>=768)?this.btn?.setText(this.passedLabel):(this.btn?.setText(this.getLabel()),salla.lang.onLoaded((()=>this.btn?.setText(this.getLabel()))))}get host(){return s(this)}};C.style=":host{display:block}salla-add-product-button[width=wide]{width:100%}";const T=class{constructor(i){t(this,i),this.variant="info"}renderIcon(){const t=this.icon||this.variant;if("none"===t)return null;switch(t){case"success":return i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return i("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return i("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return i(e,{key:"3b5dd808399eeda5d930454542cd41cca26b0cc3",class:`s-alert-wrapper s-alert-${this.variant}`},i("span",{key:"4f58234774d1afc790fb83bff983ca9366faa349",class:"s-alert-icon"},this.renderIcon()),i("span",{key:"10eb3f87e6e77dcc5406a24f866feee1cc1f46ef",class:"s-alert-text"},this.message,i("slot",{key:"3656e15aeb25fb7285e88f694c090bad3b32dfbd"})))}};T.style=":host{display:block}";const P=class{constructor(i){t(this,i),this.invalidInput=a(this,"invalidInput"),this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد"),this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد"),this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح"),this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد"),this.bookingUrl="",this.iframeReady=!1,this.reservations=[],salla.lang.onLoaded((()=>this.setTranslations())),Salla.event.on("booking::open",(t=>this.handleBookingOpen(t)))}async setTranslations(){const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));await t("ar.trans","pages.cart.book_an_appointment","حجز موعد"),await t("en.trans","pages.cart.book_an_appointment","Book an Appointment"),await t("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد"),await t("en.trans","pages.cart.edit_an_appointment","Edit an Appointment"),await t("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح"),await t("en.trans","pages.cart.booked_successfully","Booked Successfully"),await t("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد"),await t("en.trans","pages.cart.select_appointment_date","Select appointment date"),this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment"),this.editLabel=salla.lang.get("pages.cart.edit_an_appointment"),this.bookedLabel=salla.lang.get("pages.cart.booked_successfully"),this.selectDate=salla.lang.get("pages.cart.select_appointment_date")}openBookingModal(t,i=!1){if(!i||t.detail&&"number"==typeof t.detail&&t.detail===this.productId)return salla.config.isGuest()?(this.setAfterReloadEvent("booking::open-after-reload",this.productId),void salla.event.dispatch("login::open")):void salla.booking.add(this.productId,!1).then((t=>{if("booking"!==t.data.redirect.to)throw new Error("Unexpected redirect!");salla.event.dispatch("booking::open",{url:t.data.redirect.url,id:this.productId})})).catch((t=>{salla.error(salla.lang.get("common.errors.error_occurred")),salla.logger.error(t.response||t)}))}handleBookingOpen(t){t.id===this.productId&&(this.bookingUrl=salla.url.addParamToUrl("product_id",t.id,t.url),this.iframeReady=!0,setTimeout((()=>{this.modal.setTitle(this.selectDate),this.modal.open()}),100))}setAfterReloadEvent(t,i){salla.storage.set("afterReloadEvent",{event:t,payload:i})}emitAfterReloadEvent(){const t=salla.storage.get("afterReloadEvent");if(t&&t.event){const i=new CustomEvent(t.event,{detail:t.payload});window.dispatchEvent(i),salla.storage.remove("afterReloadEvent")}}componentWillLoad(){this.option&&this.option.details.length&&(this.reservations=this.option.details)}componentDidLoad(){window.addEventListener("booking::open-after-reload",(t=>this.openBookingModal(t,!0))),this.emitAfterReloadEvent(),window.addEventListener("message",this.handleMessageEvent.bind(this)),this.reservationsInput.addEventListener("invalid",(t=>this.invalidInput.emit(t))),this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity(""),this.reservationsInput.reportValidity()}))}handleMessageEvent(t){if("booking"!==t.data.source)return;const i=t.data.type,e=t.data.message;if(localStorage.getItem("debug")&&console.log(`Received an action:${i}`,t.data),"error"===i){if(e.fields?.reservation)return void salla.notify.error(e.fields.reservation[0]);const t=Object.values(e.fields||[e.message]).flat().map((t=>`<li>${t}</li>`)).join("");salla.notify.error(`<ul>${t}</ul>`)}if("success"===i){if(Number(e.productId)!==Number(this.productId))return;this.reservations=e.data.reservations.map((t=>{if(t.time&&t.time.length>0){const i=t.time[0];return{date:t.date,day:t.day,from_timestamp:i.from,to_timestamp:i.to}}return null})).filter((t=>null!==t)),salla.notify.success(this.bookedLabel),this.modal?.close(),setTimeout((()=>window.location.reload()))}"height"===i&&(this.iframe.height=e?.height+"px")}bookingModal(){return i("salla-modal",{class:"s-booking-field-modal",ref:t=>this.modal=t,width:"md",position:"middle",noPadding:!0},i("iframe",{ref:t=>this.iframe=t,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(t){return i("span",{class:t.from_timestamp?"s-booking-field-reservations-has-time":""},i("i",{class:"s-booking-field-reservations-icon",innerHTML:'\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>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n'}),t.date)}renderReservationTime(t){return t.from_timestamp?i("span",{class:"s-booking-field-reservations-time"},i("i",{class:"s-booking-field-reservations-icon",innerHTML:'\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>time</title>\n<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'}),i("span",null,t.from_timestamp," - ",t.to_timestamp)):""}render(){return i(e,{key:"04c9e3dc3dc825bd6905221d858c260f7ca34748"},i("div",{key:"07ec38cec1bd1798640dd7ea9592bb3b17d945c6",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?i("div",{class:"s-booking-field-price"},i("span",{innerHTML:salla.money(this.option.price)})):"",i("salla-button",{key:"6b71889cfc0429d15c466a6f194df31549f09786",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:t=>this.openBookingModal(t,!1)},i("span",{key:"a16f8db6f52c7751ea605efcae04057ca0dc5b61",class:"s-booking-field-book-now-content"},i("span",{key:"95f6086a599bcc620c87ece6c6ae9620dba15581",innerHTML:'\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>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n'}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&i("div",{key:"b3615100bbfff3d98d0ac99145aaf53449790c94",class:"s-booking-field-reservations"},this.reservations.map(((t,e)=>i("div",{key:e,class:"s-booking-field-reservations-item"},this.renderReservationDate(t),this.renderReservationTime(t))))),i("input",{key:"126f14f2e520b8696bc7450e209bad30b267878b",class:"s-hidden",name:this.option.name,required:this.option.required,value:"[]"===JSON.stringify(this.reservations)?"":JSON.stringify(this.reservations),ref:t=>this.reservationsInput=t}),this.iframeReady&&this.bookingModal())}get host(){return s(this)}};P.style=":host{display:block}";var I='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>image</title>\n<path d="M21.333 6.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM21.333 12c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.599 1.333 1.333-0.597 1.333-1.333 1.333zM24 1.333h-16c-3.676 0-6.667 2.991-6.667 6.667v16c0 0.969 0.219 1.884 0.592 2.715 0.013 0.024 0.025 0.048 0.039 0.072 1.059 2.284 3.359 3.88 6.036 3.88h16c3.676 0 6.667-2.991 6.667-6.667v-16c0-3.676-2.991-6.667-6.667-6.667zM8 28c-1.376 0-2.592-0.699-3.312-1.76l7.312-9.401 8.681 11.161zM28 24c0 2.187-1.765 3.964-3.945 3.995l-11.003-14.147c-0.505-0.649-1.599-0.649-2.104 0l-6.948 8.933v-14.781c0-2.205 1.795-4 4-4h16c2.205 0 4 1.795 4 4z"></path>\n</svg>\n';const L=class{constructor(i){t(this,i),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.more_details","More Details"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price","Store Price"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.the_developer","المطور"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.the_developer","the developer"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.salla","سلة"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.salla","Salla"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(salla.lang.messages["ar.trans"],"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(salla.lang.messages["en.trans"],"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100)}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((t=>{this.templateData=t.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return i("salla-drawer",{class:"s-bottom-alert-modal",ref:t=>this.drawer=t,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[i("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},i("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[i("div",{class:"s-bottom-alert-modal-content-title"},i("i",{innerHTML:I,class:"s-bottom-alert-modal-content-icon"}),i("span",null,this.storeFeatures)),i("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),i("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[i("div",{class:"s-bottom-alert-modal-content-title"},i("i",{innerHTML:'\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>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),i("span",null,this.storePriceDetails)),i("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((t=>i("div",{class:"s-bottom-alert-modal-content-price-details-item"},i("i",{innerHTML:'\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>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),i("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},t.name),i("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(t.price)})))))]:""),this.templateData?.link?i("div",{class:"s-bottom-alert-modal-content-footer"},i("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},i("i",{innerHTML:S}),this.buyTheTemplate)):"")]:"")}render(){const t=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return i(e,{key:"e5f273d72875760e30d99d419b247137583bc450",class:"s-bottom-alert-wrapper "+(t?"s-bottom-alert-wrapper-with-template":"")},t&&i("div",{key:"1db37d7c67aae449f41a9a3ed83489b2a0653cef",class:"s-bottom-alert-logo-section"},i("img",{key:"18701cd3d807042b4d852f283d43a6855282f791",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),i("span",{key:"66bb3f9b3c00aee5c2694d5ddb142e753ae7fa1a",class:"s-bottom-alert-logo-text"},this.readyStores)),i("div",{key:"01d47c9ec38370b83bdb3fdc29291f55e1b3aa42",class:"s-bottom-alert-content"},i("div",{key:"5380873bf9d393c0fa18da196e1bfb675a8c9c9b",class:"flex items-center gap-2"},i("div",{key:"882382de35a7c9a767e2eb90305c8a973d01ac21",class:"s-bottom-alert-icon"},i("i",this.icon?{class:this.icon}:{innerHTML:'\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>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'})),i("div",{key:"dfbaa427fd4e8b755a479e0b5459422e44a95f59",class:"s-bottom-alert-message"},this.message?this.message:t?i("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,i("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),i("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&i("div",{key:"327ef4b5ecdab7d994418c033a78c2531eb28de5",class:t?"s-bottom-alert-actions-group":"s-bottom-alert-action"},t?this.loading?i("salla-loading",{size:"20"}):i("div",{class:"s-bottom-alert-actions-group-container"},i("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?i("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):i("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return s(this)}};L.style=":host{display:block}";var D='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_left</title>\n<path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>\n</svg>\n',B='\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>keyboard_arrow_right</title>\n<path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>\n</svg>\n';const O=class{constructor(i){t(this,i),this.sessionStorageKey="breadcrumb_snapshot",this.itemSlot=this.host.querySelector('[slot="item"]')?.outerHTML||'<li class="s-breadcrumb-item"><a href={url}>{title}</a></li>',this.iconSlot=this.host.querySelector('[slot="icon"]')?.outerHTML}componentWillLoad(){return new Promise((t=>salla.onReady((()=>salla.lang.onLoaded(t))))).then((()=>{if(salla.url.is_page("index"))throw new Error("salla-breadcrumb:: breadcrumb not supported on home page")})).then((()=>{if(!salla.config.get("theme.settings.is_breadcrumbs_enabled",!0))throw new Error("salla-breadcrumb:: merchant disabled the feature")})).then((()=>{const t=salla.config.get("page");if(!t||!t.slug)return salla.logger.error('salla-breadcrumbs:: page object not existed on salla.config.get("page")!'),void(this.breadcrumbs=[]);let i=this.getSessionBreadcrumbs();return"product.single"===t.slug&&i&&i.length>0?(i.push({title:t.title,url:t.url}),this.breadcrumbs=this.setBreadcrumbsFromArray(i),this.storeBreadcrumbSnapshot()):i&&i.length>0?this.isNewPage(t,i)?(this.breadcrumbs=this.generateBreadcrumbs(t),this.storeBreadcrumbSnapshot()):this.breadcrumbs=this.setBreadcrumbsFromArray(i):(this.breadcrumbs=this.generateBreadcrumbs(t),this.storeBreadcrumbSnapshot()),this.breadcrumbs?.length&&(this.breadcrumbs[this.breadcrumbs.length-1].is_last=!0),this.breadcrumbs})).catch((t=>{salla.logger.error("salla-breadcrumb:: unexpected error!",t),this.breadcrumbs=[]}))}getSessionBreadcrumbs(){return"search-bar"===new URLSearchParams(window.location.search).get("from")?[]:JSON.parse(sessionStorage.getItem(this.sessionStorageKey)||"[]")}isNewPage(t,i){const e=i[i.length-1];return e?.url!==t.url}setBreadcrumbsFromArray(t){return t.map(((i,e)=>({...i,is_last:e===t.length-1})))}sanitizeBreadcrumbTitle(t,i=1){return t.includes("|")?t.split("|").map((t=>t.trim()))[i]:t.trim()}generateBreadcrumbs(t){let i=[];if("product.single"===t.slug){const i=this.getSessionBreadcrumbs();if(i.length>0&&i[1]?.url===t.parent?.url)return this.setBreadcrumbsFromArray([...i,t])}let e=t;for(;e;)e.title&&i.unshift({title:e.title,url:e.url}),e=e.parent;return t.slug.includes("customer")&&"customer.profile"!==t.slug&&i.unshift({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")}),t.slug.includes("blog")&&i.unshift({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")}),"brands.single"===t.slug&&i.unshift({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")}),t.title||"loyalty"!==t.slug||i.unshift({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")}),i.unshift({title:salla.lang.get("common.titles.home"),url:salla.url.get("")}),i}storeBreadcrumbSnapshot(){try{const t=salla.config.get("page");if("product.single"===t?.slug)return;const i=[...this.breadcrumbs],e=i.length-1;e>=0&&(i[e].url=window.location.href);const s=JSON.stringify(i);sessionStorage.setItem(this.sessionStorageKey,s)}catch(t){salla.logger.error("salla-breadcrumb:: Failed to store breadcrumb snapshot in sessionStorage.",t)}}render(){return this.breadcrumbs.length<=1?(salla.log("salla-breadcrumb:: There is no breadcrumbs!"),null):i("ol",{class:{"s-breadcrumb-wrapper":!0,"s-breadcrumb-dark":salla.url.is_page("loyalty"),"s-breadcrumb-primary-reverse":salla.config.get("page.slug").includes("customer")}},this.breadcrumbs.map((t=>{const e="product.single"===salla.config.get("page.slug")&&t.is_last?t.title:this.sanitizeBreadcrumbTitle(t.title),s=this.itemSlot.replace(/\{url\}/g,t.url).replace(/\{title\}/g,e);return[i("div",{class:"s-breadcrumb-slot",innerHTML:s}),this.getArrowDomForItem(t)]})))}getArrowDomForItem(t){if(t.is_last)return"";let e=this.iconSlot||(salla.config.get("theme.is_rtl",!0)?D:B);return i("li",{class:"s-breadcrumb-arrow"},i("div",{class:{"s-breadcrumb-icon-slot":!0,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:e}))}componentDidRender(){this.host.querySelectorAll(".s-breadcrumb-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll(".s-breadcrumb-icon-slot.s-breadcrumb-default-icon").forEach((t=>t.replaceWith(t.querySelector("svg")))),this.host.querySelector('[slot="item"]')?.remove(),this.host.querySelector('[slot="icon"]')?.remove();let t=this.host.querySelectorAll(".s-breadcrumb-item")[this.breadcrumbs.length-1]?.querySelector("a");t&&t.replaceWith(t.firstChild)}get host(){return s(this)}};O.style=":host{display:block}";const H=class{constructor(i){t(this,i),this.hostAttributes={},this.shape="btn",this.color="primary",this.fill="solid",this.size="medium",this.width="normal",this.loading=!1,this.disabled=!1,this.loaderPosition="after",this.type="button"}async load(){return"center"==this.loaderPosition&&this.text.classList.add("s-button-hide"),this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),this.host.querySelector("button").removeAttribute("loading"),"center"==this.loaderPosition&&this.text.classList.remove("s-button-hide"),this.host}async setText(t){return this.text.innerHTML=t,this.host}async disable(){return this.host.setAttribute("disabled",""),this.host}async enable(){return this.host.removeAttribute("disabled"),this.host}getBtnAttributes(){for(let t=0;t<this.host.attributes.length;t++)["color","fill","size","width","id"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes.type=this.hostAttributes.type||this.type,this.hostAttributes.class+=" s-button-element s-button-"+this.shape+" s-button-"+("none"==this.fill?"fill-none":this.fill)+("medium"!=this.size?" s-button-"+this.size:"")+("normal"!=this.width?" s-button-"+this.width:"")+("link"==this.shape?" s-button-"+this.color+"-link":"")+("link"!=this.shape&&"outline"!=this.fill?" s-button-"+this.color:"")+("outline"==this.fill?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+("icon"==this.shape?" s-button-loader-center":" s-button-loader-"+this.loaderPosition),this.hostAttributes}button(){return i("button",{...this.getBtnAttributes(),disabled:this.disabled},i("span",{class:"s-button-text",ref:t=>this.text=t},i("slot",null)),this.loading?i("span",{class:"s-button-loader"}):"")}render(){return this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":i(e,{class:"s-button-wrap"},this.href?i("a",{href:this.href},this.button()):this.button())}get host(){return s(this)}};H.style="";const F=class{constructor(i){t(this,i),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",salla.cart.event.onUpdated((t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0}))}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!t?.src)return void salla.log("Failed to get the img element");let i=this.host.querySelector("#s-cart-icon"),e=i.getBoundingClientRect(),s=e.top+window.scrollY,a=e.left+window.scrollX,l=t.getBoundingClientRect(),o=t.offsetWidth+"px",n=t.offsetHeight+"px",c=l.top,h=l.left,d=document.createElement("img");d.src=t.getAttribute("src"),d.className="s-cart-thumb",d.setAttribute("style","object-fit:cover; width:"+o+"; height:"+n+"; top:"+c+"px; left:"+h+"px;z-index:99999999; "),document.body.append(d);let p=document.querySelector(".s-cart-thumb");i.classList.remove("animated","rubberBand"),(new r.timeline).add({targets:p,width:[150,30],height:[150,30],top:[c,window.scrollY>0?s-window.scrollY-40:s-40],left:[h,a],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:p,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?s-window.scrollY-40:s-40,window.scrollY>0?s-window.scrollY+10:s+10],left:[a,a+10]},"-=500").add({complete:function(){i.classList.add("animated","rubberBand"),p.remove()}},"-=1700")}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const i=salla.config.get("store.scope",salla.storage.get("scope"));if(i&&i.id)try{const e=new URL(t);return e.searchParams.set("scope",i.id),e.toString()}catch(e){const s=t.includes("?")?"&":"?";return`${t}${s}scope=${encodeURIComponent(i.id)}`}return t}render(){return i(e,{key:"f22c9fc5b6ad2c7b7f026a7b9ad2510a3c27c281"},i("a",{key:"b329fa512839a8dd6d8a1b175e254308c22a9fb0",class:"s-cart-summary-wrapper",href:this.getCartLink()},i("div",{key:"fbe89bcca0f38393a23016cf45358d38a53e5f8f",id:"s-cart-icon"},i("slot",{key:"f2668edcc903f0a8fd112c6449d8cda9113e2ffa",name:"icon"},i("i",{key:"f4a2c742903302b2676c4628961a90a7bcfe43eb",class:"s-cart-summary-icon",innerHTML:S}))),i("span",{key:"49678efeaae684b2da2c238382b014390516db8d",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),i("p",{key:"9a399f82fc90e6c974022b65ea75c3f556f67221",class:"s-cart-summary-content"},this.showCartLabel&&i("span",{key:"879348fe4998f2eb3f26e4bebe486877bc733bff",class:"s-cart-summary-label"},this.cartLabel),i("b",{key:"237d3ee6ebed4203752b6f5c4e2cb962c03cc087",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return s(this)}};F.style="";var R,E={exports:{}},j=(R||(R=1,E.exports=function(){var t=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,i){for(var e=0;e<i.length;e++){var s=i[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(i,e,s){return e&&t(i.prototype,e),s&&t(i,s),i}}(),e=function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,i){var e=[],s=!0,a=!1,l=void 0;try{for(var o,n=t[Symbol.iterator]();!(s=(o=n.next()).done)&&(e.push(o.value),!i||e.length!==i);s=!0);}catch(t){a=!0,l=t}finally{try{!s&&n.return&&n.return()}finally{if(a)throw l}}return e}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,i){for(var e=this;e.length<t;)e=i+e;return e};var s={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function a(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(i>0?t.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):t.toString())||"0"}var l=function(){function l(i,s,a,o){t(this,l);var n=this;if(void 0===i);else if(Array.isArray(i))this.rgba=i;else if(void 0===a){var r=i&&""+i;r&&function(t){if(t.startsWith("hsl")){var i=t.match(/([\-\d\.e]+)/g).map(Number),s=e(i,4),a=s[0],o=s[1],r=s[2],c=s[3];void 0===c&&(c=1),n.hsla=[a/=360,o/=100,r/=100,c]}else if(t.startsWith("rgb")){var h=t.match(/([\-\d\.e]+)/g).map(Number),d=e(h,4),p=d[3];void 0===p&&(p=1),n.rgba=[d[0],d[1],d[2],p]}else n.rgba=t.startsWith("#")?l.hexToRgb(t):l.nameToRgb(t)||l.hexToRgb(t)}(r.toLowerCase())}else this.rgba=[i,s,a,void 0===o?1:o]}return i(l,[{key:"printRGB",value:function(t){var i=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,i){return a(t,3===i?3:0)}));return t?"rgba("+i+")":"rgb("+i+")"}},{key:"printHSL",value:function(t){var i=[360,100,100,1],e=["","%","%",""],s=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,s){return a(t*i[s],3===s?3:1)+e[s]}));return t?"hsla("+s+")":"hsl("+s+")"}},{key:"printHex",value:function(t){var i=this.hex;return t?i:i.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=l.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=l.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(t,i){return i<3?t.toString(16):Math.round(255*t).toString(16)})).map((function(t){return t.padStart(2,"0")})).join("")},set:function(t){this.rgba=l.hexToRgb(t)}}],[{key:"hexToRgb",value:function(t){var i=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!i.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var e=i.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return e[3]=e[3]/255,e}},{key:"nameToRgb",value:function(t){var i=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),e=s[i];return void 0===e?e:l.hexToRgb(e.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var i=e(t,4),s=i[0],a=i[1],l=i[2],o=i[3];s/=255,a/=255,l/=255;var n=Math.max(s,a,l),r=Math.min(s,a,l),c=void 0,h=void 0,d=(n+r)/2;if(n===r)c=h=0;else{var p=n-r;switch(h=d>.5?p/(2-n-r):p/(n+r),n){case s:c=(a-l)/p+(a<l?6:0);break;case a:c=(l-s)/p+2;break;case l:c=(s-a)/p+4}c/=6}return[c,h,d,o]}},{key:"hslToRgb",value:function(t){var i=e(t,4),s=i[0],a=i[1],l=i[2],o=i[3],n=void 0,r=void 0,c=void 0;if(0===a)n=r=c=l;else{var h=function(t,i,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(i-t)*e:e<.5?i:e<2/3?t+(i-t)*(2/3-e)*6:t},d=l<.5?l*(1+a):l+a-l*a,p=2*l-d;n=h(p,d,s+1/3),r=h(p,d,s),c=h(p,d,s-1/3)}var u=[255*n,255*r,255*c].map(Math.round);return u[3]=o,u}}]),l}(),o=function(){function e(){t(this,e),this._events=[]}return i(e,[{key:"add",value:function(t,i,e){t.addEventListener(i,e,!1),this._events.push({target:t,type:i,handler:e})}},{key:"remove",value:function(t,i,s){this._events=this._events.filter((function(a){var l=!0;return t&&t!==a.target&&(l=!1),i&&i!==a.type&&(l=!1),s&&s!==a.handler&&(l=!1),l&&e._doRemove(a.target,a.type,a.handler),!l}))}},{key:"destroy",value:function(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,i,e){t.removeEventListener(i,e,!1)}}]),e}();function n(t,i,e){var s=!1;function a(t,i,e){return Math.max(i,Math.min(t,e))}function l(t,l,o){if(o&&(s=!0),s){t.preventDefault();var n=i.getBoundingClientRect(),r=n.width,c=n.height,h=l.clientY,d=a(l.clientX-n.left,0,r),p=a(h-n.top,0,c);e(d/r,p/c)}}function o(t,i){1===(void 0===t.buttons?t.which:t.buttons)?l(t,t,i):s=!1}function n(t,i){1===t.touches.length?l(t,t.touches[0],i):s=!1}t.add(i,"mousedown",(function(t){o(t,!0)})),t.add(i,"touchstart",(function(t){n(t,!0)})),t.add(window,"mousemove",o),t.add(i,"touchmove",n),t.add(window,"mouseup",(function(){s=!1})),t.add(i,"touchend",(function(){s=!1})),t.add(i,"touchcancel",(function(){s=!1}))}var r="keydown",c="mousedown",h="focusin";function d(t,i){return(i||document).querySelector(t)}function p(t,i,e,s){t.add(i,r,(function(t){e.indexOf(t.key)>=0&&s(t)}))}var u=function(){function e(i){t(this,e),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new o,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(i)}return i(e,[{key:"setOptions",value:function(t){var i=this;if(t){var e=this.settings;if(t instanceof HTMLElement)e.parent=t;else{e.parent&&t.parent&&e.parent!==t.parent&&(this._events.remove(e.parent),this._popupInited=!1),function(t,i){for(var e in t)i[e]=t[e]}(t,e),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var s=t.color||t.colour;s&&this._setColor(s)}var a=e.parent;if(a&&e.popup&&!this._popupInited){var l=function(t){return i.openHandler(t)};this._events.add(a,"click",l),p(this._events,a,[" ","Spacebar","Enter"],l),this._popupInited=!0}else t.parent&&!e.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var i=t&&t.type===r?this._domEdit:this.domElement;setTimeout((function(){return i.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var i=t&&t.type,e=!1;t?i===c||i===h?t.timeStamp>(this.__containedEvent||0)+100&&(e=!0):(function(t){t.preventDefault(),t.stopPropagation()}(t),e=!0):e=!0,e&&this.hide()&&(this.settings.parent.style.pointerEvents="",i!==c&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,i){this.closeHandler(),this.setOptions(t),i&&this.openHandler()}},{key:"setColor",value:function(t,i){this._setColor(t,{silent:i})}},{key:"_setColor",value:function(t,i){if("string"==typeof t&&(t=t.trim()),t){i=i||{};var e=void 0;try{e=new l(t)}catch(t){if(i.failSilently)return;throw t}if(!this.settings.alpha){var s=e.hsla;s[3]=1,e.hsla=s}this.colour=this.color=e,this._setHSLA(null,null,null,null,i)}}},{key:"setColour",value:function(t,i){this.setColor(t,i)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var i,e,s=(i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',(e=document.createElement("div")).innerHTML=i,e.firstElementChild);return this.domElement=s,this._domH=d(".picker_hue",s),this._domSL=d(".picker_sl",s),this._domA=d(".picker_alpha",s),this._domEdit=d(".picker_editor input",s),this._domSample=d(".picker_sample",s),this._domOkay=d(".picker_done button",s),this._domCancel=d(".picker_cancel button",s),s.classList.add("layout_"+this.settings.layout),this.settings.alpha||s.classList.add("no_alpha"),this.settings.editor||s.classList.add("no_editor"),this.settings.cancelButton||s.classList.add("no_cancel"),this._ifPopup((function(){return s.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,i=this,e=this.domElement,s=this._events;function a(t,i,e){s.add(t,i,e)}a(e,"click",(function(t){return t.preventDefault()})),n(s,this._domH,(function(t){return i._setHSLA(t)})),n(s,this._domSL,(function(t,e){return i._setHSLA(null,t,1-e)})),this.settings.alpha&&n(s,this._domA,(function(t,e){return i._setHSLA(null,null,null,1-e)}));var l=this._domEdit;a(l,"input",(function(){i._setColor(this.value,{fromEditor:!0,failSilently:!0})})),a(l,"focus",(function(){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var i=function(i){return t.closeHandler(i)};a(window,c,i),a(window,h,i),p(s,e,["Esc","Escape"],i);var l=function(i){t.__containedEvent=i.timeStamp};a(e,c,l),a(e,h,l),a(t._domCancel,"click",i)}));var o=function(i){t._ifPopup((function(){return t.closeHandler(i)})),t.onDone&&t.onDone(t.colour)};a(this._domOkay,"click",o),p(s,e,["Enter"],o)}},{key:"_setPosition",value:function(){var t=this.settings.parent,i=this.domElement;t!==i.parentNode&&t.appendChild(i),this._ifPopup((function(e){"static"===getComputedStyle(t).position&&(t.style.position="relative");var s=!0===e?"popup_right":"popup_"+e;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===s?i.classList.add(t):i.classList.remove(t)})),i.classList.add(s)}))}},{key:"_setHSLA",value:function(t,i,e,s,a){a=a||{};var l=this.colour,o=l.hsla;[t,i,e,s].forEach((function(t,i){(t||0===t)&&(o[i]=t)})),l.hsla=o,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(l)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var i=this.colour,e=i.hsla,s="hsl("+360*e[0]+", 100%, 50%)",a=i.hslString,l=i.hslaString,o=this._domH,n=this._domSL,r=this._domA,c=d(".picker_selector",o),h=d(".picker_selector",n),p=d(".picker_selector",r);b(0,c,e[0]),this._domSL.style.backgroundColor=this._domH.style.color=s,b(0,h,e[1]),w(0,h,1-e[2]),n.style.color=a,w(0,p,1-e[3]);var u=a,g=u.replace("hsl","hsla").replace(")",", 0)");if(this._domA.style.background="linear-gradient("+[u,g]+"), linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var m=this.settings.alpha,f=void 0;switch(this.settings.editorFormat){case"rgb":f=i.printRGB(m);break;case"hsl":f=i.printHSL(m);break;default:f=i.printHex(m)}this._domEdit.value=f}this._domSample.style.color=l}function b(t,i,e){i.style.left=100*e+"%"}function w(t,i,e){i.style.top=100*e+"%"}}},{key:"_ifPopup",value:function(t,i){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):i&&i()}},{key:"_toggleDOM",value:function(t){var i=this.domElement;if(!i)return!1;var e=t?"":"none",s=i.style.display!==e;return s&&(i.style.display=e),s}}]),e}(),g=document.createElement("style");return g.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(g),u.StyleElement=g,u}()),E.exports),q=l(j);
5
5
  /*!
6
6
  * vanilla-picker v2.12.3
7
7
  * https://vanilla-picker.js.org
8
8
  *
9
9
  * Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
10
10
  * Released under the ISC license.
11
- */const N=class{constructor(i){t(this,i),this.colorChanged=a(this,"colorChanged"),this.invalidInput=a(this,"invalidInput"),this.submitted=a(this,"submitted"),this.popupOpened=a(this,"popupOpened"),this.popupClosed=a(this,"popupClosed"),this.name="color",this.required=!1,this.format="hex",this.showCancelButton=!1,this.showTextField=!0,this.enableAlpha=!1}colorChangeHandler(t){this.colorInput.value=t.hex,this.colorChanged.emit(t)}submittedHandler(t){this.setColorValue(t.rgbaString,!0),this.canvas.style.backgroundColor=t.rgbString,this.colorInput.value=t.hex,this.colorInput.dispatchEvent(new window.Event("change",{bubbles:!0})),this.submitted.emit(t)}popupOpenedHandler(t){this.setPopInPosition(),this.popupOpened.emit(t)}popupClosedHandler(t){this.popupClosed.emit(t)}async setPickerOption(t){this.picker.setOptions(t)}async movePopUp(t,i){this.picker.movePopup(t,i)}async setColorValue(t,i){this.picker.setColor(t,i)}async openPicker(){this.picker.show()}async closePicker(){this.picker.hide()}async destroyPicker(){this.picker.destroy()}componentWillLoad(){salla.onReady((()=>{this.color=this.color?this.color:salla.config.get("theme.color.primary","#5dd5c4")}))}setPopInPosition(){const t=this.host.querySelector(".picker_wrapper"),i=this.host.querySelector(".s-color-picker-widget").getBoundingClientRect(),e=window.innerWidth/2-i.width/2,s=e>i.x,a=e<i.x,l=e===i.x,o=window.innerWidth<768;o&&s&&(t.style.left="0"),o&&a&&(t.style.left="auto"),(!o||o&&(!a&&!s||l))&&(t.style.left="-95px")}initColorPicker(){this.picker=new q({parent:this.host,color:this.color,popup:"bottom",alpha:this.enableAlpha,editor:this.showTextField,editorFormat:this.format,cancelButton:this.showCancelButton,onChange:t=>this.colorChangeHandler(t),onDone:t=>this.submittedHandler(t),onOpen:t=>this.popupOpenedHandler(t),onClose:t=>this.popupClosedHandler(t)})}render(){return i(e,{key:"8ed135a77f4664ae0820fe116c115ecde8600630",class:"s-color-picker-main"},i("slot",{key:"9c03d6effac021a15f380b58e912556c8506df77",name:"widget"},i("div",{key:"079346b844adf30b07ce387fd0a0ea553d6f6c3a",class:"s-color-picker-widget"},i("div",{key:"b585d7bb86c1e66ecf624f985482594e250f5337",class:"s-color-picker-widget-canvas",ref:t=>this.canvas=t}),i("span",{key:"9a3029a2d447d5bcd7eeb17f4772b0c70ff6e1a5",innerHTML:c}))),i("input",{key:"9ceac07e6277a096b1a7070d3d9ba2def7aa0839",class:"s-hidden",name:this.name,required:this.required,value:this.color,ref:t=>this.colorInput=t}))}componentDidLoad(){this.canvas.style.backgroundColor=this.color,this.initColorPicker(),this.colorInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.colorInput.addEventListener("input",(()=>{this.colorInput.setCustomValidity(""),this.colorInput.reportValidity()}))}get host(){return s(this)}};N.style="";const G=class{constructor(i){t(this,i),this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit"),salla.lang.onLoaded((()=>{this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit")})),salla.onReady((()=>{this.canComment=salla.config.get("user.can_comment"),this.itemId=salla.config.get("page.id"),this.type=salla.url.is_page("page-single")?"page":salla.url.is_page("blog.single")?"blog":"product"}))}submit(){this.commentForm.reportValidity()?this.submitBtn.load().then((()=>salla.comment.add({id:this.itemId,comment:this.commentField.value,type:this.type}))).finally((()=>this.submitBtn.stop)):salla.log("CommentForm:: validation error!")}render(){return i(e,{key:"fbea28507c188a338ee066b5198bcf93de2fbda2"},this.canComment?i("form",{ref:t=>this.commentForm=t},i("div",{class:"s-comment-form-wrapper"},this.showAvatar?i("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",i("div",{class:"s-comment-form-content"},i("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:t=>this.commentField=t,placeholder:this.placeholder,class:"s-comment-form-input",required:!0}),i("br",null),i("div",{class:"s-comment-form-action"},i("salla-button",{ref:t=>this.submitBtn=t,"loader-position":"center",onClick:()=>this.submit()},this.submitText))))):"")}};G.style=":host{display:block}";const W=class{constructor(i){t(this,i),this.has_bought_trans=salla.lang.get("blocks.comments.has_bought"),this.rated_trans=salla.lang.get("pages.rating.rated"),this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval"),this.has_order_trans=salla.lang.get("blocks.comments.has_order"),this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد"),this.likesCount=0,this.likedComments=[],salla.lang.onLoaded((()=>{const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));this.has_bought_trans=salla.lang.get("blocks.comments.has_bought"),this.rated_trans=salla.lang.get("pages.rating.rated"),this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval"),this.has_order_trans=salla.lang.get("blocks.comments.has_order"),(async()=>{await t("ar.trans","blocks.comments.helpful","مفيد"),await t("en.trans","blocks.comments.helpful","Helpful"),this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد")})()}))}componentDidLoad(){this.likesCount=this.comment.likes_count;try{this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),this.likedComments.includes(this.comment.id)&&(this.likeBtn.classList.add("liked"),this.likeBtn.fill="solid")}catch{salla.log("Bad json for liked_comments")}}getReplies(){return Array.isArray(this.comment.replies)?this.comment.replies:[this.comment.replies]}getDate(t){const[i]=t.split(" "),[e,s,a]=i.split("-");return`${parseInt(a,10)}/${parseInt(s,10)}/${parseInt(e,10)}`}getTime(t){const[,i]=t.split(" "),[e,s]=i.split(":");return`${parseInt(e,10)}:${parseInt(s,10)}`}async toggleLike(){if(salla.config.isGuest())return salla.notify.error(salla.lang.get("common.messages.must_login"));this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");const t=this.likedComments.includes(this.comment.id);try{const i=t?`rating/${this.comment.id}/unlike`:`rating/${this.comment.id}/like`,e=await salla.api.request(i,"","put");salla.log(e.message),t?(this.likeBtn.classList.remove("liked"),this.likeBtn.fill="outline",this.updateLikedComments(this.comment.id,!1),this.likesCount--):(this.likeBtn.classList.add("liked"),this.likeBtn.fill="solid",this.updateLikedComments(this.comment.id,!0),this.likesCount++)}catch(t){409==t.response.status&&(this.likeBtn.classList.contains("liked")?(this.likeBtn.fill="outline",this.likeBtn.classList.remove("liked"),this.updateLikedComments(this.comment.id,!1),this.likesCount--):(this.likeBtn.fill="solid",this.likeBtn.classList.add("liked"),salla.logger.warn("Like already exists"),this.updateLikedComments(this.comment.id,!0)))}}updateLikedComments(t,i){this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),i?this.likedComments.includes(t)||this.likedComments.push(t):this.likedComments=this.likedComments.filter((i=>i!==t)),localStorage.setItem("liked_comments",JSON.stringify(this.likedComments))}render(){let t="admin"==this.comment.type;return i(e,{key:"23f7ca8136164177f5cf8f96b91193ff511e4fbb",class:t?"s-comments-item-admin":"s-comments-item"},i("div",{key:"dfbc3e5b58ddbcce247e1de767b477bab1eab2e3",class:{"s-comments-item-wrapper":!t,"s-comments-item-admin-wrapper":t},id:`s-comments-item-${this.comment.id}`},i("div",{key:"b6c77afa13d1ede6145bd85942dca414414e4e9c",class:"s-comments-item-inner s-comments-flex-1"},t&&i("span",{key:"cd8515e5bbe6b71ae23857cb7c3dca069b685475",class:"s-comments-item-reply-icon",innerHTML:'\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>reply</title>\n<path d="M20 14.667h-12.609l9.401-6.927c0.592-0.436 0.72-1.271 0.283-1.863-0.439-0.595-1.273-0.72-1.864-0.283l-12.667 9.333c-0.343 0.251-0.544 0.649-0.544 1.072s0.201 0.821 0.543 1.073l12.667 9.333c0.237 0.176 0.515 0.26 0.789 0.26 0.409 0 0.813-0.188 1.075-0.543 0.437-0.592 0.309-1.427-0.283-1.863l-9.4-6.928h12.609c4.412 0 8 3.588 8 8 0 0.737 0.597 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-5.881-4.785-10.667-10.667-10.667z"></path>\n</svg>\n'}),i("div",{key:"b12ce64b8afc4f1c77d20ac4e76c25e02ecd2f4b",class:"s-comments-item-avatar"},i("img",{key:"fd554e59e550c22618249ef76ef784bc380bba22","data-src":this.comment?.avatar,alt:this.comment?.name,src:this.comment?.avatar,class:"s-comments-item-avatar-img lazy"})),i("div",{key:"2e6c9beb412773bd117372768f67c28ac024a9c4",class:"s-comments-flex-1"},i("div",{key:"a4ea92bb3416fc603fcbe98a163ed506b1c43a49",class:"s-comments-item-user-wrapper"},i("div",{key:"22c882510812ba6f0ac51818015e7863c27c16d3",class:"s-comments-item-user-info"},i("h3",{key:"b69e6dec2c1000b91fa112cbdefe0d173d975a45",class:"s-comments-item-user-info-name"},this.comment?.name),!this.comment.has_order&&!this.comment.rating||this.comment.is_pending||this.hideBought?null:i("div",{class:"s-comments-flex"},this.comment.has_order?[i("span",{class:"s-comments-item-has-order-check-icon",innerHTML:d}),i("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,this.comment.rating?i("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null)),i("p",{key:"cc89bf414f7cd2f512fac82312f412abc38a022a",class:"s-comments-item-timestamp s-ltr"}," ",this.getDate(this.comment.created_at?.date)," ",i("span",{key:"ccc1a1c62a1584a25f165db0366d9c30dca54e4b",class:"s-comments-item-time"}," - ",this.getTime(this.comment.created_at?.date)," ")),this.comment.rating||this.comment.stars?i("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating||this.comment.stars}):null),i("div",{key:"c8de0a5afdb23c5c3cf78f0e0bee2f90e4222424",class:"s-comments-item-content"},i("p",{key:"a56d8cd320200f11b546f85729aac9c8e36a28e1",innerHTML:this.comment.content}),this.allowAttachImages&&i("div",{key:"b693e349105bb69a3f411f1ffcf84b700ac6aef5",class:"s-comments-item-images"},this.comment.images.map(((t,e)=>i("img",{key:e,src:t,alt:"",onClick:()=>this.modal.open()}))),i("salla-modal",{key:"cd57384d102f513beb82a8004663af1067a5b119",ref:t=>this.modal=t,width:"sm"},i("salla-slider",{key:"07e998f014edf222aab402ba8a0a7e0d05d19f53",id:`s-comments-item-${this.comment.id}-images`,class:"s-comments-item-images-slider",type:"thumbs","auto-height":!0,showControls:this.comment.images.length>1,"show-thumbs-controls":"false"},i("div",{key:"95edb3475172c8262eb98d32d5750b2dbdc866fc",slot:"items"},this.comment.images.map(((t,e)=>i("img",{key:e,src:t,alt:""})))),i("div",{key:"1c8b6d610fe47c20bd2f41fae5df1c069c0f8894",slot:"thumbs"},this.comment.images.map(((t,e)=>i("div",{class:"s-comments-item-images-slider-thumb"},i("img",{key:e,src:t,alt:""})))))))),this.allowLikes&&!t&&salla.url.is_page("product.single")?i("salla-button",{ref:t=>this.likeBtn=t,class:"s-comments-item-like-btn "+(this.likedComments.includes(this.comment.id)?"liked":""),loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleLike()},i("span",null,this.helpfulLabel," ",this.likesCount>0?`(${this.likesCount})`:""),i("span",{innerHTML:'\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>thumbs-up</title>\n<path d="M26.667 10.667h-8.261l1.279-3.38c0.723-1.911 0.087-4.051-1.549-5.203-0.909-0.639-2.004-0.881-3.085-0.684-1.101 0.203-2.061 0.837-2.703 1.787l-5.452 8.067c-0.148 0.22-0.228 0.48-0.228 0.747v12c0 3.676 2.991 6.667 6.667 6.667h8.688c2.535 0 4.817-1.407 5.955-3.671l2.548-5.063c0.093-0.187 0.143-0.392 0.143-0.6v-6.667c0-2.205-1.795-4-4-4zM28 21.017l-2.405 4.78c-0.683 1.359-2.052 2.203-3.573 2.203h-8.688c-2.205 0-4-1.795-4-4v-11.592l5.223-7.728c0.237-0.352 0.584-0.585 0.975-0.657 0.367-0.067 0.749 0.017 1.068 0.241 0.631 0.444 0.879 1.317 0.591 2.079l-1.963 5.185c-0.156 0.409-0.099 0.869 0.149 1.229s0.66 0.576 1.099 0.576h10.192c0.735 0 1.333 0.599 1.333 1.333zM2.667 10.667c-0.736 0-1.333 0.597-1.333 1.333v16c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-16c0-0.736-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'})):"",this.comment.is_pending?i("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),this.getReplies().length&&!t?this.getReplies().map((t=>i("div",null,i("salla-comment-item",{comment:t})))):null))}get host(){return s(this)}};var U;W.style=":host{display:block}",function(t){t.PAGE="page",t.PRODUCT="product",t.BLOG="blog"}(U||(U={}));const Y=class{constructor(i){t(this,i),this.type=U.PAGE,this.showFormAvatar=!1,this.hideBought=!1,this.testimonials=!1,this.noComments=salla.lang.get("blocks.comments.no_comments"),this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary"),this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),salla.onReady((()=>{this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})),salla.lang.onLoaded((()=>{this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.noComments=salla.lang.get("pages.rating.no_ratings");const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));(async()=>{await t("ar.trans","blocks.comments.most_helpful","الأكثر إفادة"),await t("en.trans","blocks.comments.most_helpful","Most helpful"),this.mostHelpfulLabel=salla.lang.get("blocks.comments.most_helpful"),this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.noComments=salla.lang.get("pages.rating.no_ratings")})()}))}pluralize(t,i){const e=t.split("|"),s=[{condition:0===i,index:0},{condition:1===i,index:1},{condition:2===i,index:2},{condition:i>2&&i<=10,index:3},{condition:i>=11,index:4}],{index:a}=s.find((({condition:t})=>t))||{index:e.length-1};return e[a].replace(":count",salla.helpers.number(i.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")}wrapConsoleError(){Salla.infiniteScroll.errorWrapped||((()=>{const t=console.error.bind(console);console.error=(...i)=>{const e=i[0];return"string"==typeof e&&e.toLowerCase().replace(/\s/g,"").includes("infinitescroll")?console.log(...i):t(...i)}})(),Salla.infiniteScroll.errorWrapped=!0)}initiateInfiniteScroll(){this.wrapper?(this.wrapConsoleError(),this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(t=>{this.pagination=t.pagination,this.nextPage="object"==typeof t.pagination.links&&t.pagination.links.next?t.pagination.links.next:null;for(const i of this.handleResponse(t))this.wrapper.append(i);const i=this.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");this.animateItems(i),this.loading(!1)})),this.infiniteScroll?.on("error",(t=>{salla.console.error("Error loading more comments:",t)}))):console.error("Wrapper is undefined. Cannot initiate infinite scroll.")}loading(t=!0){const i=this.status?.querySelector(".s-button-text");i&&(p.toggleElementClassIf(i,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}animateItems(t){r({targets:t,opacity:[0,1],duration:1200,translateY:[20,0],delay:(t,i)=>100*i,easing:"easeOutExpo",complete:()=>{for(const i of t)i.classList.add("animated")}})}async reload(){if(this.showPlaceholder=!1,this.wrapper){this.wrapper.innerHTML="";const t=document.createElement("salla-loading");this.wrapper.append(t)}this.nextPage=null,this.loadInitialData()}getCommentHTML(t){const i=document.createElement("salla-comment-item");return i.comment=t,i.hideBought=this.hideBought,i}handleResponse(t){return t.data?.map((t=>this.getCommentHTML(t)))||[]}componentWillLoad(){return salla.onReady().then((()=>{this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})).then((()=>this.loading())).then((()=>(this.hideTitle=this.hideTitle||this.testimonials,this.hideForm=this.hideForm||this.testimonials,this.loadInitialData())))}async loadInitialData(){try{let t={data:[],pagination:{}};const i=new URLSearchParams(window.location.search);if(i.has("sort")&&(this.sort=i.get("sort")),this.testimonials){const i={sort:this.sort,type:"store"};t=await salla.api.request("reviews",{params:i},"get")}else t=await salla.api.comment.getComments(this.type,this.itemId,1,5,this.sort);if(!t.data||!t.data.length)return this.showPlaceholder=!1,void this.loading(!1);if(this.wrapper&&(this.wrapper.innerHTML=""),this.comments=t.data,this.pagination=t.pagination,this.total=t.pagination.total,this.nextPage="object"==typeof t.pagination.links&&t.pagination.links.next?t.pagination.links.next:null,this.nextPage&&this.sort)try{const t=new URL(this.nextPage,window.location.origin);t.searchParams.get("sort")||(t.searchParams.set("sort",this.sort),this.nextPage=t.toString())}catch(t){const i=this.nextPage.includes("?");/[?&]sort=/.test(this.nextPage)||(this.nextPage=this.nextPage+(i?"&":"?")+`sort=${this.sort}`)}setTimeout((()=>{for(const i of this.handleResponse(t))this.wrapper.append(i);this.initiateInfiniteScroll();const i=this.wrapper.querySelectorAll("salla-comment-item:not(.animated)");this.animateItems(i)}),100)}catch(t){console.error("Error loading initial data:",t),this.showPlaceholder=!0,this.loading(!1)}}async loadMore(){this.infiniteScroll?.loadNextPage()}render(){return this.showPlaceholder?i("div",null,this.total&&!this.hideTitle?i("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",this.hideForm||this.testimonials?"":i("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),i("div",{class:"s-comments-placeholder"},i("span",{innerHTML:'\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>chat-bubbles</title>\n<path d="M15.333 17.333c4.779 0 8.667-3.888 8.667-8.667s-3.888-8.667-8.667-8.667h-6.667c-4.779 0-8.667 3.888-8.667 8.667 0 2.985 1.513 5.712 4 7.297v4.703c0 0.497 0.277 0.953 0.717 1.183 0.195 0.1 0.405 0.151 0.616 0.151 0.269 0 0.536-0.081 0.764-0.241l6.323-4.425zM11.236 14.908l-4.569 3.199v-2.913c0-0.5-0.28-0.959-0.725-1.187-2.020-1.035-3.275-3.080-3.275-5.34 0-3.308 2.692-6 6-6h6.667c3.308 0 6 2.692 6 6s-2.692 6-6 6h-3.333c-0.273 0-0.54 0.084-0.764 0.241zM29.196 12.964c-0.543-0.5-1.388-0.464-1.884 0.077-0.5 0.541-0.465 1.385 0.077 1.884 1.253 1.156 1.944 2.72 1.944 4.408 0 2.26-1.255 4.305-3.275 5.339-0.445 0.228-0.725 0.687-0.725 1.188v2.572l-5.441-2.939c-0.195-0.104-0.412-0.16-0.633-0.16h-2.592c-1.688 0-3.309-0.724-4.451-1.988-0.492-0.545-1.335-0.591-1.883-0.096-0.547 0.493-0.589 1.336-0.096 1.883 1.644 1.823 3.988 2.868 6.429 2.868h2.255l7.111 3.84c0.199 0.107 0.417 0.16 0.635 0.16 0.236 0 0.472-0.063 0.683-0.188 0.404-0.241 0.651-0.676 0.651-1.145v-4.036c2.487-1.585 4-4.311 4-7.297 0-2.407-1.023-4.727-2.804-6.369z"></path>\n</svg>\n'}),i("p",null,this.noComments))):i("div",{class:`s-comments s-comments-${this.testimonials?"testimonials":this.type}`},i("div",{class:this.type===U.PAGE?"s-comments-page-container":"s-comments-container"},this.total&&!this.hideTitle?i("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&i("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),salla.url.is_page("product.single")?i("salla-reviews-summary",{itemId:this.itemId}):"",i("div",{class:"s-comments-header "+(this.total?"has-total":"")},!!this.total&&i("span",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),this.total&&!this.testimonials&&this.type!==U.BLOG?i("div",{class:"s-comments-filter-wrapper"},i("label",{class:"s-comments-filter-label",htmlFor:"comments-filter"},salla.lang.get("pages.categories.sorting")),i("select",{id:"comments-filter",class:"s-form-control s-comments-sort-input",onChange:t=>{this.sort=t.target.value,this.reload()}},i("option",{value:"latest",selected:!0},salla.lang.get("pages.testimonials.sort_by_date_desc")),i("option",{value:"oldest"},salla.lang.get("pages.testimonials.sort_by_date_asc")),this.allowLikes&&i("option",{value:"most_helpful"},this.mostHelpfulLabel))):""),i("div",{ref:t=>{this.wrapper=t}}),this.nextPage&&i("div",{class:"s-infinite-scroll-wrapper",ref:t=>{this.status=t}},i("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary",type:"button"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>{this.btnLoader=t},style:{display:"none"}})))))}get host(){return s(this)}};Y.style=":host{display:block}";const Z=class{constructor(i){t(this,i)}hideAllOptions(t){this.host.querySelectorAll(`[data-show-when^="options[${t}"]`).forEach((t=>{t.classList.add("hidden"),this.hideAllOptions(t.dataset.optionId),this.disableInputs(t)}))}disableInputs(t){t.querySelectorAll("[name]").forEach((t=>{t.setAttribute("disabled",""),t.removeAttribute("required"),"select"===t?.tagName?.toLowerCase()&&(t.value=""),["checkbox"].includes(t.getAttribute("type"))&&t.hasOwnProperty("checked")&&(t.checked=!1)}))}changeHandler(t){if(salla.event.emit("salla-onditional-fields::change",t),salla.log("Received the change/input event: ",t),t.target&&(["SELECT","INPUT","TEXTAREA"].includes(t.target.tagName)||["checkbox","radio","text"].includes(t.target.getAttribute("type"))))return!["INPUT","TEXTAREA"].includes(t.target.tagName)||t.target.getAttribute("type")&&"text"!==t.target.getAttribute("type")||"input"!==t.type?void this.processConditionalFields(t):(clearTimeout(this.debounceTimeout),void(this.debounceTimeout=setTimeout((()=>{this.processConditionalFields(t)}),300)));salla.log("Ignore the event because is not a supported input: "+(t?.target?.tagName||"N/A"))}processConditionalFields(t){let i=t.target.name.replace("[]",""),e="checkbox"===t.target.getAttribute("type"),s="radio"===t.target.getAttribute("type"),a=["INPUT","TEXTAREA"].includes(t.target.tagName)&&(!t.target.getAttribute("type")||"text"===t.target.getAttribute("type"));salla.log("Trying to find all elements with condition:",`[data-show-when^="${i}"]`),this.host.querySelectorAll(`[data-show-when^="${i}"]`).forEach((i=>{let l,o=!i?.dataset.showWhen.includes("!="),n=i?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();l=e?Array.from(this.host.querySelectorAll(`input[name="${t.target.name}"]:checked`),(t=>t?.value)).includes(n.toString()):s?t.target.checked&&t.target.value===n:a?n===t.target.value||"true"===n.toLowerCase()&&""!==t.target.value.trim():n===t.target.value,salla.log("The input is ",e?"Multiple":s?"Radio":a?"Text":"Single"," value:",l),o&&l||!o&&!l?(i.classList.remove("hidden"),i.querySelectorAll("[name]").forEach((t=>{if(t.removeAttribute("disabled"),"true"===t.closest(".s-product-options-option").dataset.optionRequired&&t.setAttribute("required",""),"checkbox"===t.getAttribute("type")){const i=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${t.getAttribute("name")}"]`));i.some((t=>t.checked))&&i.forEach((t=>{t.removeAttribute("required")}))}}))):(this.hideAllOptions(i.dataset.optionId),i.classList.add("hidden"),this.disableInputs(i))}))}componentDidRender(){this.host.querySelectorAll("[data-show-when]").forEach((t=>{let i=t?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();i&&this.changeHandler({target:this.host.querySelector('[name^="'+i+'"]')})}))}render(){return i(e,{key:"af75ffed0725edefeb9e6fcd2f95bf9209f63dd0"},i("slot",{key:"b28f91555071a31d967d85ba7d693e16266bcc6c"}))}get host(){return s(this)}},V=class{constructor(i){t(this,i),this.size="md",this.color="dark",this.digits="auto",this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.offerEnded=!1,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0),salla.lang.onLoaded((()=>{this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")})),this.date&&this.isValidDate(this.date)&&this.startCountDown()}async endCountDown(){clearInterval(this.countInterval),this.offerEnded=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0)}componentWillLoad(){if("string"==typeof this.preOrder)try{this.normalizedPreOrder=JSON.parse(this.preOrder)}catch{this.normalizedPreOrder=void 0}else this.normalizedPreOrder=this.preOrder;this.normalizedPreOrder?.end_date&&(this.date=this.normalizedPreOrder.end_date,this.date&&this.isValidDate(this.date)&&this.startCountDown())}isValidDate(t){let i,e=t.includes("-"),s=t.split(" ");return i=e?s[0].replace(/-/g,"/"):s[0],!isNaN(Date.parse(i))}number(t){return salla.helpers.number(t,"en"===this.digits)}startCountDown(){let t=new Date(this.date.replace(/-/g,"/"));(this.endOfDay||1===this.date.split(" ").length)&&t.setHours(23,59,59,999);let i=t.getTime();this.countInterval=setInterval((()=>{let t=(new Date).getTime(),e=i-t;this.days=this.number(Math.floor(e/864e5)),this.hours=this.number(Math.floor(e%864e5/36e5)),this.minutes=this.number(Math.floor(e%36e5/6e4)),this.seconds=this.number(Math.floor(e%6e4/1e3)),e<0&&this.endCountDown()}),1e3)}renderCountDown(){return i("ul",{class:`s-count-down-list ${this.boxed?"s-count-down-boxed":""} ${this.offerEnded?"s-count-down-ended":""} s-count-down-${this.size} s-count-down-${this.color}`},i("li",{class:"s-count-down-item"},i("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&i("div",{class:"s-count-down-item-label"},this.secondsLabel)),i("li",{class:"s-count-down-item"},i("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&i("div",{class:"s-count-down-item-label"},this.minutesLabel)),i("li",{class:"s-count-down-item"},i("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&i("div",{class:"s-count-down-item-label"},this.hoursLabel)),i("li",{class:"s-count-down-item"},i("div",{class:"s-count-down-item-value"},this.days),this.labeled&&i("div",{class:"s-count-down-item-label"},this.daysLabel)))}renderInvalidDate(){return i("div",{class:"s-count-down-text-center"},this.invalidDate)}renderOfferEnded(){return i("div",{class:"s-count-down-end-text"},this.endText?this.endText:this.endLabel)}renderPreOrderToBeAvailableOn(){return this.normalizedPreOrder?.availability_date&&this.isValidDate(this.normalizedPreOrder?.availability_date)?i("div",{class:"s-count-down-info-message"},i("i",{class:"sicon-info"}),i("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),i("span",null,new Date(this.normalizedPreOrder?.availability_date).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))):null}renderPreOrderCountDown(){return this.normalizedPreOrder?.activate_countdown?i("div",{class:"s-count-down-pre-order-container"},i("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown()):null}renderPreOrder(){return i("div",null,"object"==typeof this.normalizedPreOrder&&this.normalizedPreOrder?.availability_date&&this.renderPreOrderToBeAvailableOn(),this.renderPreOrderCountDown())}renderContent(){return this.date?this.isValidDate(this.date)?this.preOrder?this.renderPreOrder():this.renderCountDown():this.renderInvalidDate():null}render(){return i(e,{key:"96bba6312e710673e1f249cabecfc8756fac5c0e",class:"s-count-down-wrapper "+(this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":"")},this.renderContent(),this.offerEnded&&this.renderOfferEnded())}};V.style="";const J=class{constructor(i){t(this,i),this.picked=a(this,"picked"),this.invalidInput=a(this,"invalidInput"),this.value=null,this.placeholder=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.allowInput=!0,this.allowInvalidPreload=!1,this.altFormat="F j, Y",this.altInput=!1,this.appendTo=void 0,this.ariaDateFormat="F j, Y",this.autoFillDefaultTime=!0,this.clickOpens=!0,this.closeOnSelect=!0,this.dateFormat="Y-m-d",this.defaultHour=12,this.defaultMinute=0,this.defaultSeconds=0,this.disable=[],this.disableMobile=!1,this.enable=[()=>!0],this.enableSeconds=!1,this.enableTime=!1,this.hourIncrement=1,this.inline=!1,this.locale="en",this.maxDate=null,this.maxTime=null,this.minDate=null,this.minTime=null,this.minuteIncrement=5,this.mode="single",this.monthSelectorType="dropdown",this.nextArrow='<span class="sicon-keyboard_arrow_right"></span>',this.noCalendar=!1,this.position="auto",this.prevArrow='<span class="sicon-keyboard_arrow_left"></span>',this.shorthandCurrentMonth=!1,this.static=!1,this.showMonths=1,this.time_24hr=!1,this.weekNumbers=!1,this.wrap=!1,this.disabled=!1}async loadFlatpickr(){if(!this.flatpickr)try{const t=await import("./p-D-twzdLJ.js");if(this.flatpickr=t.default,this.locale&&"en"!==this.locale)try{await import(`flatpickr/dist/l10n/${this.locale}.js`)}catch(t){console.warn(`Flatpickr locale ${this.locale} not found, using default`)}}catch(t){throw console.error("Failed to load Flatpickr:",t),salla.notify?.error?.("Failed to load date picker. Please refresh the page."),t}}render(){return i("div",{key:"f619b5fa5fdb68b3cc8562be43496dabb1d78f37",class:"s-datetime-picker"},i("input",{key:"dc9b5d0680cd31109a2b82fcf435b8b68d5fbb8d",type:"datetime",name:this.name,value:this.value,required:this.required,disabled:this.disabled,placeholder:this.placeholder,class:"s-datetime-picker-input",ref:t=>this.dateInput=t}))}async componentDidLoad(){await this.loadFlatpickr();let t={allowInput:this.allowInput,allowInvalidPreload:this.allowInvalidPreload,altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,appendTo:this.appendTo,ariaDateFormat:this.ariaDateFormat,autoFillDefaultTime:this.autoFillDefaultTime,clickOpens:this.clickOpens,closeOnSelect:this.closeOnSelect,conjunction:this.conjunction,dateFormat:this.dateFormat,defaultDate:this.value?Date.parse(this.value):this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,defaultSeconds:this.defaultSeconds,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableSeconds:this.enableSeconds,enableTime:this.enableTime,formatDate:this.formatDate,hourIncrement:this.hourIncrement,inline:this.inline,locale:this.locale,maxDate:this.maxDate,maxTime:this.maxTime,minDate:this.minDate,minTime:this.minTime,minuteIncrement:this.minuteIncrement,mode:this.mode,monthSelectorType:this.monthSelectorType,nextArrow:this.nextArrow,noCalendar:this.noCalendar,parseDate:this.dateParser,position:this.position,positionElement:this.positionElement,prevArrow:this.prevArrow,shorthandCurrentMonth:this.shorthandCurrentMonth,static:this.static,showMonths:this.showMonths,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,onChange:(t,i)=>this.picked.emit(this.value=i)};this.flatpickr(this.dateInput,t),this.dateInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.dateInput.addEventListener("input",(()=>{this.dateInput.setCustomValidity(""),this.dateInput.reportValidity()}))}};J.style='.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:\'\';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}';var Q='\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>cancel</title>\n<path d="M17.885 16l7.057-7.057c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-7.057 7.057-7.057-7.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l7.057 7.057-7.057 7.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l7.057-7.057 7.057 7.057c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n',K='\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>alert-engine</title>\n<path d="M16 18.673c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM2.667 16c0-3.092 1.083-6.105 3.047-8.484 0.469-0.568 0.389-1.408-0.179-1.877-0.568-0.468-1.408-0.388-1.877 0.179-2.359 2.857-3.657 6.473-3.657 10.183s1.299 7.325 3.657 10.183c0.264 0.319 0.645 0.484 1.029 0.484 0.299 0 0.6-0.1 0.848-0.305 0.568-0.469 0.648-1.309 0.179-1.877-1.964-2.379-3.047-5.392-3.047-8.484zM16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM28.343 5.817c-0.469-0.567-1.307-0.647-1.877-0.179-0.568 0.469-0.648 1.309-0.179 1.877 1.964 2.379 3.047 5.392 3.047 8.484s-1.083 6.105-3.047 8.484c-0.469 0.568-0.389 1.408 0.179 1.877 0.249 0.205 0.549 0.305 0.848 0.305 0.384 0 0.765-0.165 1.028-0.484 2.36-2.857 3.659-6.473 3.659-10.183s-1.299-7.325-3.657-10.183z"></path>\n</svg>\n',X='\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>check-circle2</title>\n<path d="M29.333 14.133c-0.8 0-1.333 0.533-1.333 1.333v1.2c0 6.667-5.333 12-12 12 0 0 0 0 0 0-6.667 0-12-5.333-12-12s5.333-12 12-12c0 0 0 0 0 0 1.733 0 3.333 0.4 4.933 1.067 0.667 0.267 1.467 0 1.733-0.667s0-1.467-0.667-1.733c-1.867-0.8-3.867-1.333-6-1.333 0 0 0 0 0 0-8.133 0-14.667 6.533-14.667 14.667s6.533 14.667 14.667 14.667c0 0 0 0 0 0 8.133 0 14.667-6.533 14.667-14.667v-1.2c0-0.8-0.533-1.333-1.333-1.333zM12.933 14.4c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l4 4c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4l13.333-13.333c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-12.4 12.4-3.067-3.067z"></path>\n</svg>\n';const tt=class{constructor(i){t(this,i),this.drawerVisibilityChanged=a(this,"drawerVisibilityChanged"),this.isClosable=!0,this.width="md",this.position="right",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("drawer::open",(t=>t==this.host.id&&this.open())),salla.event.on("drawer::close",(t=>t==this.host.id&&this.close())),this.drawerTitle=this.host.getAttribute("drawer-title")}handleVisible(t){if(!t)return this.drawerVisibilityChanged.emit(!1),void this.toggleDrawer(!1);this.drawerVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleDrawer(!0)))}handleKeyUp(t){"Escape"===t.key&&this.closeDrawer()}async open(){return this.host.setAttribute("visible",""),this.handleAutoFocus(),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(t){return this.drawerTitle=t,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}handleAutoFocus(){const t=this.host.querySelector("input, textarea, select");t&&setTimeout((()=>{t.focus()}),100)}toggleDrawer(t){const i=this.host.querySelector(".s-drawer-body");p.toggleElementClassIf(i,"s-drawer-entering","s-drawer-leaving",(()=>t)).toggleElementClassIf(this.overlay,"s-drawer-entering","s-drawer-overlay-leaving",(()=>t)).toggleElementClassIf(document.body,"drawer-is-open","drawer-is-closed",(()=>t)),t||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeDrawer(t){this.isClosable&&(salla.event.dispatch("drawer::close",{reason:t}),this.host.removeAttribute("visible"))}iconBlockClasses(){return{"s-drawer-icon":!0,"s-drawer-bg-error":"error"==this.iconStyle,"s-drawer-bg-success":"success"==this.iconStyle,"s-drawer-bg-normal":!this.iconStyle,"s-drawer-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-drawer",this.isLoading?i(e,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:t=>this.handleKeyUp(t)},i("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:t=>this.overlay=t,onClick:()=>this.closeDrawer("backdropClick")}),i("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},i("div",{class:"s-drawer-body flex justify-center s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},i("slot",{name:"loading"},i("salla-loading",null)),i("div",{class:"s-hidden"},i("slot",null))))):i(e,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog"},i("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:t=>this.overlay=t,onClick:()=>this.closeDrawer("backdropClick")}),i("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},i("div",{class:"s-drawer-body s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},i("div",{class:{"s-drawer-header":!0,"s-drawer-is-center":this.centered}},this.isClosable?i("button",{class:"s-drawer-close",onClick:()=>this.closeDrawer("closeButtonClick"),type:"button"},i("span",{innerHTML:Q})):"",this.drawerTitle||this.subTitle?i("div",{class:"s-drawer-header-inner"},i("slot",{name:"icon"},this.iconStyle?i("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?K:X}):""),i("div",{class:"s-drawer-header-content"},this.drawerTitle?i("div",{class:{"s-drawer-title":!0,"s-drawer-title-below":this.subTitleFirst},innerHTML:this.drawerTitle}):"",this.subTitle?i("p",{class:{"s-drawer-sub-title":!0},innerHTML:this.subTitle}):"")):""),i("slot",null),i("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return s(this)}static get watchers(){return{visible:["handleVisible"]}}};tt.style="";const it=class{async loadFilePond(){if(!this.filePondLoaded)try{const[t,i,e,s,a,l,o]=await Promise.all([import("./p-_lsZ_Fz4.js").then((function(t){return t.f})),import("./p-vdaGXF-0.js").then((function(t){return t.f})),import("./p-Cv04OsQc.js").then((function(t){return t.f})),import("./p-Cetso8sO.js").then((function(t){return t.f})),import("./p-Bm-OTntK.js").then((function(t){return t.f})),import("./p-C0bntoqM.js").then((function(t){return t.f})),import("./p-BpxYnrUi.js").then((function(t){return t.f}))]);this.FilePond=t,this.FilePond.registerPlugin(s.default,e.default,i.default,a.default,l.default,o.default),this.filePondLoaded=!0}catch(t){throw console.error("Failed to load FilePond:",t),salla.notify?.error?.("Failed to load file uploader. Please refresh the page."),t}}constructor(i){t(this,i),this.added=a(this,"added"),this.invalidInput=a(this,"invalidInput"),this.uploaded=a(this,"uploaded"),this.removed=a(this,"removed"),this.filePondLoaded=!1,this.max_images_count=t=>salla.lang.get("common.uploader.max_images_count",{count:t}),this.max_count_hint=t=>salla.lang.get("common.uploader.max_count_hint",{count:t}),this.uploadedFiles=[],this.isListScrollerListenerAdded=!1,this.showMaxCountHint=!1,this.profileImage=!1,this.payloadParams={},this.accept="image/png, image/jpeg, image/jpg, image/gif",this.method="POST",this.formData="{}",this.allowDrop=!0,this.allowBrowse=!0,this.allowReplace=!0,this.allowRevert=!0,this.allowRemove=!0,this.allowImagePreview=!0,this.imagePreviewHeight=null,this.filePosterHeight=null,this.maxFilesCount=1,this.maxParallelUploads=3,this.itemInsertLocation="after",this.itemInsertInterval=75,this.dropOnElement=!0,this.ignoredFiles=[".ds_store","thumbs.db","desktop.ini"],this.chunkSize=5e6,this.chunkRetryDelays=[500,1e3,3e3],this.labelDecimalSeparator=void 0,this.labelThousandsSeparator=void 0,this.iconRemove="<svg>...</svg>",this.iconProcess="<svg>...</svg>",this.iconRetry="<svg>...</svg>",this.iconUndo="<svg>...</svg>",this.openFileBrowser=()=>{this.filepond.browse()},!this.url&&this.cartItemId&&(this.url=salla.cart.getUploadImageEndpoint(),this.instantUpload=!0),!this.url&&this.profileImage&&(this.url=salla.url.api("profile/update"),this.instantUpload=!0,this.host.hasAttribute("name")||(this.name="avatar")),this.name||(this.name="file"),salla.lang.onLoaded((()=>{this.host.querySelectorAll(".filepond--drop-label>label").forEach((t=>t.innerHTML=this.getLabel())),this.filepond&&(this.filepond.labelFileTypeNotAllowed=salla.lang.get("common.uploader.invalid_type"),this.filepond.labelMaxFileSizeExceeded=salla.lang.get("common.uploader.too_large"),this.filepond.labelFileSizeNotAvailable=salla.lang.get("common.uploader.size_not_available"),this.filepond.labelFileLoading=salla.lang.get("common.elements.loading"),this.filepond.labelFileLoadError=salla.lang.get("common.uploader.failed_to_load"),this.filepond.labelFileProcessingAborted=salla.lang.get("common.uploader.upload_cancelled"),this.filepond.labelTapToCancel=salla.lang.get("common.elements.cancel"),this.filepond.labelTapToRetry=salla.lang.get("common.elements.retry"),this.filepond.labelButtonRemoveItem=salla.lang.get("common.elements.remove"),this.filepond.labelButtonUndoItemProcessing=salla.lang.get("common.elements.undo"),this.filepond.labelButtonProcessItem=salla.lang.get("common.uploader.upload"),this.filepond.labelFileProcessingComplete=salla.lang.get("common.uploader.file_processing_complete"),this.filepond.labelTapToUndo=salla.lang.get("common.uploader.tap_to_undo"),this.filepond.labelFileProcessing=salla.lang.get("common.uploader.file_processing"),this.filepond.labelFileProcessingError=salla.lang.get("common.uploader.file_processing_error"));const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));this.max_count_hint=t=>salla.lang.get("common.uploader.max_count_hint",{count:t}),this.max_images_count=t=>salla.lang.get("common.uploader.max_images_count",{count:t}),(async()=>{await t("ar.trans","common.uploader.max_images_count",".أضف :count صور كحد أقصى"),await t("en.trans","common.uploader.max_images_count","Add up to :count images maximum."),await t("ar.trans","common.uploader.max_count_hint","يمكنك رفع حتى :count صور"),await t("en.trans","common.uploader.max_count_hint","You can upload up to :count images.")})()}))}addedHandler(t,i){if(this.added.emit({error:t,file:i}),this.host.querySelector(".filepond--root").classList.remove("s-file-upload-has-error"),t||!i.file.type)return void this.host.querySelector(".filepond--root").classList.add("s-file-upload-has-error");let e=new DataTransfer,s=this.getFormDataFileInput();e.items.add(i.file),s.type="file",s.files=e.files,s.dispatchEvent(new window.Event("change",{bubbles:!0}))}uploadedHandler(){let t=this.getFormDataFileInput();return t.type="hidden",t.value=this.value,this.hiddenInput.value=this.value,t.dispatchEvent(new window.Event("change",{bubbles:!0})),this.uploaded.emit(this.value)}removedHandler(t){let i=this.getFormDataFileInput();i.type="hidden",i.value="",this.host.closest(".s-product-options-option")?.removeAttribute("data-has-value"),salla.url.is_page("cart")&&t.getMetadata("id")&&salla.cart.api.deleteImage(t.getMetadata("id")),this.height&&setTimeout((()=>this.host.querySelector(".filepond--root").style.height=this.height),1e3),this.hiddenInput.value="",i.dispatchEvent(new window.Event("change",{bubbles:!0}));let e=this.allowMultiple?t.getMetadata("id"):t;return this.removed.emit(e)}async setOption(t,i){this.filepond[t]=i}getLabel(){return this.labelIdle?this.labelIdle.replace("common.uploader.drag_and_drop",salla.lang.get("common.uploader.drag_and_drop")).replace("common.uploader.browse",salla.lang.get("common.uploader.browse")):`${salla.lang.get("common.uploader.drag_and_drop")}<span class="filepond--label-action"> ${salla.lang.get("common.uploader.browse")} </span>`}getFileSize(t){let i=new XMLHttpRequest;return i.open("HEAD",t,!1),i.send(null),200===i.status?i.getResponseHeader("content-length"):""}getFormDataFileInput(){return this.host.querySelector(".filepond--data input")}getFiles(){if(!this.value&&!this.files)return[];try{let t=this.files?"string"==typeof this.files?JSON.parse(this.files):this.files:this.value.split(",").map((t=>({url:t})));return t.length&&this.host.closest(".s-product-options-option")?.setAttribute("data-has-value","true"),t.map((t=>({source:t.id?`${t.id}`:t.url,options:{type:"local",file:{name:t.url.substring(t.url.lastIndexOf("/")+1),size:this.getFileSize(t.url)},metadata:{poster:t.url,name:t.url,id:t.id}}})))}catch(t){salla.log("failed To get files from: "+(this.files||this.value))}return[]}async componentWillLoad(){await this.loadFilePond(),this.labelIdle||(this.labelIdle=this.host.innerHTML,this.host.innerHTML="")}render(){return i(e,{key:"45383bff9bc408ef0328e888751827e6fc70038d",class:{"s-file-upload":!0,"s-file-upload-profile-image":this.profileImage,"s-file-upload-multiple":this.allowMultiple}},i("input",{key:"323e469923868db4e322d67c1dd8a7efc245fe5f",type:"file",name:this.name,value:this.value,ref:t=>this.fileUploader=t,required:this.required,class:"s-file-upload-wrapper s-file-upload-input",accept:this.accept}),this.allowMultiple&&this.showMaxCountHint?i("div",{class:"s-file-upload-hint s-hidden"},this.max_count_hint(this.maxFilesCount)):"",i("input",{key:"42458ac28b13ba4e6c6dc80a30054e0e567a9366",class:"s-hidden",name:"hidden-"+this.name,required:this.required,value:this.value,ref:t=>this.hiddenInput=t}))}componentDidLoad(){let t=this.getFiles();this.filepond=this.FilePond.create(this.fileUploader,{name:this.payloadName||this.name,files:t,required:this.required,disabled:this.disabled,allowDrop:this.allowDrop,allowBrowse:this.allowBrowse,allowPaste:this.allowPaste,allowMultiple:this.allowMultiple,allowReplace:this.allowReplace,allowRevert:this.allowRevert,allowProcess:this.allowProcess,allowReorder:this.allowReorder,storeAsFile:this.storeAsFile,forceRevert:this.forceRevert,maxFiles:this.maxFilesCount,imagePreviewHeight:this.imagePreviewHeight,filePosterHeight:this.filePosterHeight,allowImagePreview:this.allowImagePreview,maxParallelUploads:this.maxParallelUploads,checkValidity:this.checkValidity,itemInsertLocation:this.itemInsertLocation,itemInsertInterval:this.itemInsertInterval,credits:this.credits,dropOnPage:this.dropOnPage,dropOnElement:this.dropOnElement,dropValidation:this.dropValidation,ignoredFiles:this.ignoredFiles,onaddfile:(t,i)=>this.addedHandler(t,i),onwarning:t=>{"Max files"===t.body&&salla.notify.error(this.max_images_count(this.maxFilesCount))},onprocessfile:(t,i)=>{if(this.allowMultiple&&!t){const t=i.serverId,e=this.uploadedFiles.find((i=>i.id===t));e&&(i.setMetadata("id",e.id,!0),i.setMetadata("url",e.url,!0),this.value={id:e.id,url:e.url},this.uploadedHandler())}},onupdatefiles:t=>{const i=this.host.querySelector(".filepond--drop-label"),e=this.host.querySelector(".filepond--list-scroller");this.allowMultiple&&(t.length>0?(i.classList.add("s-hidden"),!this.isListScrollerListenerAdded&&t.length<this.maxFilesCount&&(this.showMaxCountHint=!0,e.addEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!0)):(i.classList.remove("s-hidden"),this.isListScrollerListenerAdded&&(e.removeEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!1)),t.length===this.maxFilesCount&&this.isListScrollerListenerAdded&&(e.removeEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!1,this.showMaxCountHint=!1))},server:{url:this.url,method:this.method,revert:null,process:{onload:t=>{let i=JSON.parse(t).data;if((this.instantUpload||this.allowMultiple)&&Array.isArray(i)&&i.length>0){const t=`${this.host.id}-${Math.floor(100+900*Math.random())}`;return this.uploadedFiles.push({id:t,url:i[0]}),t}return this.value=i.filePath||i.url,this.uploadedHandler(),this.value},headers:salla.api.getHeaders(),onerror:t=>{try{let i=JSON.parse(t).error.fields;return i=i[this.payloadName||this.name],i&&i[0]||salla.lang.get("common.errors.error_occurred")}catch(t){return salla.log("FileUpload:: Error",t),salla.lang.get("common.errors.error_occurred")}},ondata:t=>{if(this.allowMultiple){const i=new FormData;return t.forEach((t=>{i.append("files[]",t)})),i.append("type",this.type),i}if(this.payloadName&&this.payloadName!=this.name&&!this.allowMultiple&&(t.append(this.payloadName,this.filepond.getFile(0).file),t.delete(this.name)),this.payloadParams)for(const[i,e]of Object.entries(this.payloadParams))t.append(i,e);this.cartItemId&&t.append("cart_item_id",this.cartItemId);try{Object.entries(JSON.parse(this.formData)).forEach((i=>i[1]&&t.append(i[0],i[1])))}catch(t){salla.log("Error to inject formData",t)}return t}}},instantUpload:this.instantUpload,chunkUploads:this.chunkUploads,chunkForce:this.chunkForce,chunkSize:this.chunkSize,chunkRetryDelays:this.chunkRetryDelays,labelDecimalSeparator:this.labelDecimalSeparator,labelThousandsSeparator:this.labelThousandsSeparator,labelIdle:this.getLabel(),acceptedFileTypes:this.accept.replace(/\s+/g,"").split(","),labelFileTypeNotAllowed:salla.lang.get("common.uploader.invalid_type"),labelFileProcessingComplete:salla.lang.get("common.uploader.file_processing_complete"),labelTapToUndo:salla.lang.get("common.uploader.tap_to_undo"),labelFileProcessing:salla.lang.get("common.uploader.file_processing"),labelFileProcessingError:salla.lang.get("common.uploader.file_processing_error"),fileValidateTypeLabelExpectedTypes:"{allButLastType}, {lastType}",labelMaxFileSizeExceeded:salla.lang.get("common.uploader.too_large"),labelMaxFileSize:"{filesize}",maxFileSize:`${salla.config.get("store.settings.upload_size")}KB`||this.maxFileSize,beforeRemoveFile:t=>new Promise((i=>{this.removedHandler(t),i(!0)}))}),this.hiddenInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.hiddenInput.addEventListener("change",(()=>{this.hiddenInput.setCustomValidity(""),this.hiddenInput.reportValidity()}))}get host(){return s(this)}};it.style="/*!\n * FilePond 4.32.8\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--data{position:absolute;width:0;height:0;padding:0;margin:0;border:none;visibility:hidden;pointer-events:none;contain:strict}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{-webkit-transform-origin:center center;transform-origin:center center;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;left:0;will-change:transform,opacity}.filepond--drop-label{right:0;margin:0;color:#4f4f4f;display:flex;justify-content:center;align-items:center;height:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--drop-label.filepond--drop-label label{display:block;margin:0;padding:.5em}.filepond--drop-label label{cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--root[data-disabled] .filepond--drop-label label{opacity:.5}.filepond--file-action-button.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;outline:none;will-change:transform,opacity}.filepond--file-action-button.filepond--file-action-button span{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file-action-button.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button.filepond--file-action-button:after{position:absolute;left:-.75em;right:-.75em;top:-.75em;bottom:-.75em;content:\"\"}.filepond--file-action-button{cursor:auto;color:#fff;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;box-shadow:0 0 0 0 hsla(0,0%,100%,0);transition:box-shadow .25s ease-in}.filepond--file-action-button:focus,.filepond--file-action-button:hover{box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-action-button[disabled]{color:hsla(0,0%,100%,.5);background-color:rgba(0,0,0,.25)}.filepond--file-action-button[hidden]{display:none}.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=center]{margin-left:-.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=bottom]{margin-bottom:-.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 .25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--file-info{position:static;display:flex;flex-direction:column;align-items:flex-start;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out;white-space:nowrap}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:flex;flex-direction:column;align-items:flex-end;flex-grow:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out}.filepond--file-wrapper.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:flex;height:100%;align-items:flex-start;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--processing-complete-indicator{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.filepond--file .filepond--file-action-button,.filepond--file .filepond--processing-complete-indicator,.filepond--file .filepond--progress-indicator{position:absolute}.filepond--file [data-align*=left]{left:.5625em}.filepond--file [data-align*=right]{right:.5625em}.filepond--file [data-align*=center]{left:calc(50% - .8125em)}.filepond--file [data-align*=bottom]{bottom:1.125em}.filepond--file [data-align=center]{top:calc(50% - .8125em)}.filepond--file .filepond--progress-indicator{margin-top:.1875em}.filepond--file .filepond--progress-indicator[data-align*=right]{margin-right:.1875em}.filepond--file .filepond--progress-indicator[data-align*=left]{margin-left:.1875em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state~=processing] .filepond--file-status-sub{opacity:0}[data-filepond-item-state~=processing] .filepond--action-abort-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-error] .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-error] .filepond--action-retry-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{-webkit-animation:fall .5s linear .125s both;animation:fall .5s linear .125s both}[data-filepond-item-state=processing-complete] .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--file-info-sub,[data-filepond-item-state=processing-complete] .filepond--processing-complete-indicator:not([style*=hidden])~.filepond--file-status .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing~.filepond--file-info .filepond--file-info-sub{opacity:.5}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{-webkit-animation:shake .65s linear both;animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@-webkit-keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--hopper[data-hopper-state=drag-over]:after{content:\"\";position:absolute;left:0;top:0;right:0;bottom:0;z-index:100}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;z-index:1;padding:0;margin:.25em;will-change:transform,opacity;touch-action:auto}.filepond--item>.filepond--panel{z-index:-1}.filepond--item>.filepond--panel .filepond--panel-bottom{box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper,.filepond--item>.filepond--panel{transition:opacity .15s ease-out}.filepond--item[data-drag-state]{cursor:-webkit-grab;cursor:grab}.filepond--item[data-drag-state]>.filepond--panel{transition:box-shadow .125s ease-in-out;box-shadow:0 0 0 transparent}.filepond--item[data-drag-state=drag]{cursor:-webkit-grabbing;cursor:grabbing}.filepond--item[data-drag-state=drag]>.filepond--panel{box-shadow:0 .125em .3125em rgba(0,0,0,.325)}.filepond--item[data-drag-state]:not([data-drag-state=idle]){z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:hidden;-webkit-overflow-scrolling:touch;-webkit-mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent);mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent)}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list.filepond--list{position:absolute;top:0;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--list{left:.75em;right:.75em}.filepond--root[data-style-panel-layout~=integrated]{width:100%;height:100%;max-width:none;margin:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root{border-radius:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root>*,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{bottom:0;height:auto;display:flex;justify-content:center;align-items:center;z-index:7}.filepond--root[data-style-panel-layout~=circle] .filepond--item-panel,.filepond--root[data-style-panel-layout~=integrated] .filepond--item-panel{display:none}.filepond--root[data-style-panel-layout~=compact] .filepond--list-scroller,.filepond--root[data-style-panel-layout~=integrated] .filepond--list-scroller{overflow:hidden;height:100%;margin-top:0;margin-bottom:0}.filepond--root[data-style-panel-layout~=compact] .filepond--list,.filepond--root[data-style-panel-layout~=integrated] .filepond--list{left:0;right:0;height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--item,.filepond--root[data-style-panel-layout~=integrated] .filepond--item{margin:0}.filepond--root[data-style-panel-layout~=compact] .filepond--file-wrapper,.filepond--root[data-style-panel-layout~=integrated] .filepond--file-wrapper{height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{z-index:7}.filepond--root[data-style-panel-layout~=circle]{border-radius:99999rem;overflow:hidden}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel{border-radius:inherit}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--file-info,.filepond--root[data-style-panel-layout~=circle] .filepond--file-status{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--action-edit-item{opacity:1!important;visibility:visible!important}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.filepond--root[data-style-panel-layout~=circle]{will-change:transform}}}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:100%!important;pointer-events:none}.filepond-panel:not([data-scalable=false]){height:auto!important}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel[data-scalable=true]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:\"\";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,.5em,0);transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:\"\";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%;vertical-align:top;transform-box:fill-box}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{box-sizing:border-box;position:relative;margin-bottom:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{box-sizing:inherit;line-height:inherit}.filepond--root :not(text){font-size:inherit}.filepond--root[data-disabled]{pointer-events:none}.filepond--root[data-disabled] .filepond--list-scroller{pointer-events:all}.filepond--root[data-disabled] .filepond--list{pointer-events:none}.filepond--root .filepond--drop-label{min-height:4.75em}.filepond--root .filepond--list-scroller{margin-top:1em;margin-bottom:1em}.filepond--root .filepond--credits{position:absolute;right:0;opacity:.4;line-height:.85;font-size:11px;color:inherit;text-decoration:none;z-index:3;bottom:-14px}.filepond--root .filepond--credits[style]{top:0;bottom:auto;margin-top:14px}/*!\n * FilePondPluginImagePreview 4.6.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--image-preview-markup{position:absolute;left:0;top:0}.filepond--image-preview-wrapper{z-index:2}.filepond--image-preview-overlay{display:block;position:absolute;left:0;top:0;width:100%;min-height:5rem;max-height:7rem;margin:0;opacity:0;z-index:2;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--image-preview-overlay svg{width:100%;height:auto;color:inherit;max-height:inherit}.filepond--image-preview-overlay-idle{mix-blend-mode:multiply;color:rgba(40, 40, 40, 0.85)}.filepond--image-preview-overlay-success{mix-blend-mode:normal;color:rgba(54, 151, 99, 1)}.filepond--image-preview-overlay-failure{mix-blend-mode:normal;color:rgba(196, 78, 71, 1)}@supports (-webkit-marquee-repetition: infinite) and\n ((-o-object-fit: fill) or (object-fit: fill)){.filepond--image-preview-overlay-idle{mix-blend-mode:normal}}.filepond--image-preview-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;left:0;top:0;right:0;height:100%;margin:0;border-radius:0.45em;overflow:hidden;background:rgba(0, 0, 0, 0.01)}.filepond--image-preview{position:absolute;left:0;top:0;z-index:1;display:flex;align-items:center;height:100%;width:100%;pointer-events:none;background:#222;will-change:transform, opacity}.filepond--image-clip{position:relative;overflow:hidden;margin:0 auto;}.filepond--image-clip[data-transparency-indicator='grid'] img,.filepond--image-clip[data-transparency-indicator='grid'] canvas{background-color:#fff;background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");background-size:1.25em 1.25em}.filepond--image-bitmap,.filepond--image-vector{position:absolute;left:0;top:0;will-change:transform}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview-wrapper{border-radius:0}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview{height:100%;display:flex;justify-content:center;align-items:center}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-wrapper{border-radius:99999rem}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-overlay{top:auto;bottom:0;-webkit-transform:scaleY(-1);transform:scaleY(-1)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']){margin-bottom:0.325em}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='left']{left:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='right']{right:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='right']{margin-bottom:calc(0.325em + 0.1875em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='center']{margin-top:0;margin-bottom:0.1875em;margin-left:0.1875em}/*!\n * FilePondPluginImageEdit 1.6.3\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='center']{margin-left:-0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='bottom']{margin-bottom:-0.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 0.25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--root[data-style-panel-layout~='circle'] .filepond--action-edit-item{opacity:1 !important;visibility:visible !important}.s-file-upload-wrapper .filepond--file-info-main{-webkit-line-clamp:1;display:-webkit-box;-webkit-box-orient:vertical}";var et='\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>gift-sharing</title>\n<path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>\n</svg>\n';const st=class{constructor(i){t(this,i),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.formSelector="form.product-form, form.form--product-options",salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const t=document.querySelector(".s-quantity-input-input");this.quantity=t?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const t=document.querySelector(this.formSelector);return t?new FormData(t):null}mergeObjectToFormData(t,i,e){for(let s in t){if(!t.hasOwnProperty(s)||null==t[s])continue;const a=e?`${e}[${s}]`:s;"object"!=typeof t[s]||null===t[s]||t[s]instanceof File?i.set(a,t[s]):this.mergeObjectToFormData(t[s],i,a)}return i}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});await this.modal.open();const t=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(t).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async setWrapperHeight(t=1,i=250,e=0,s=0){let a=document.querySelector(`#${this.hostId} .gift-step-${t}`);setTimeout((()=>{this.stepsWrapper.style.height=s?`${s}px`:a.offsetHeight+e+"px"}),i)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let i=t.target.children[t.target.selectedIndex].getAttribute("data-id"),e="custom"==i;this.showGiftText=e,i?(this.selectedGiftTextOption=i,this.selectedText=e?void 0:t.target.value,this.setWrapperHeight(1,150,5)):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0,this.setWrapperHeight(1,150,-15))}async goToStep2(){return this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect.classList.remove("s-form-has-error"),this.customTextArea.classList.remove("s-form-has-error"),this.setWrapperHeight(2,600,0),(new r.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:r.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:r.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),this.currentStep=2,void(this.parentClass=`is-current-step-${this.currentStep}`)):(this.textSelect.classList.remove("s-form-has-error"),void this.customTextArea.classList.add("s-form-has-error")):(this.textSelect.classList.add("s-form-has-error"),void this.customTextArea.classList.remove("s-form-has-error"))}goToStep1(t){t.preventDefault();let i=new r.timeline({autoplay:!1});i.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:r.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:r.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),i.play(),this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload?this.selectImageOrUpload:""}</p></div>`}setPreview(t){this.uploader?.classList.add("has-bg");var i=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");i.classList.add("filepond-bg"),i.classList.remove("s-hidden"),i.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(i),this.uploadedImage=t.url,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(`#${this.hostId} .filepond-bg`);t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea.classList.remove("s-form-has-error")}handleSenderName(t){this.senderName=t.target.value}handleReceiverName(t){this.receiverName=t.target.value}handleReceiverCity(t){this.receiverCity=t.target.value}async handleCountryChange(t){const i=t.target.value;this.selectedCountryId=i;const e=this.gift?.countries?.find((t=>t.id==i));if(this.selectedCountryCode=e?.country_code,!i||0===this.gift?.countries?.length)return this.gift={...this.gift,cities:[]},this.receiverCity=void 0,void(this.selectedCountryCode=void 0);this.loadingCities=!0,this.gift={...this.gift,cities:[]},this.receiverCity=void 0;try{const t=await salla.api.request(`shipping/cities?for_branch=0&country_id=${i}`);t&&t.data&&(this.gift={...this.gift,cities:t.data})}catch(t){console.error("Error fetching cities:",t)}finally{this.loadingCities=!1}}handleUploadImage(t){this.uploadedImage=t,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let i=t.detail;this.receiverMobile=i.number,this.receiverCountryCode=i.country_code}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const t=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");if(this.physicalProducts&&!this.selectedCountryId)return this.errors||(this.errors={}),this.errors["receiver.country"]=salla.lang.get("common.messages.required_field"),void this.setWrapperHeight(2,150,0);const i={text:this.selectedText,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:t||null,receiver:{name:this.receiverName,country_code:this.selectedCountryCode&&this.physicalProducts?this.selectedCountryCode:this.receiverCountryCode,mobile:this.receiverMobile,...this.receiverCity&&this.physicalProducts?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let e;this.productId&&this.formSelector&&(e=this.getFormDataFromForm()||new FormData,e=this.mergeObjectToFormData(i,e));const s=this.productId?()=>salla.product.addProductGiftToCart(this.productId,e,!0):()=>salla.cart.addCartGiftToCart(i,!0);return await s().then((()=>this.modal.close())).catch((t=>{t.response&&422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const t=document.querySelector(this.formSelector);if(!t)return void console.error("SallaGifting:: Form not found in the document!");if(!(t instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!t.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!t||await t.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[i("div",{key:"52ed7ef8e9908a42d1815aa021654557ac1eb77e"},i("salla-list-tile",{key:"d8732567c5d2fcf0a007679087af5bb4a6589649",class:this.generateClass()},i("div",{key:"2d0b7cedaaa7b3248151dfa28683984accfbf57a",slot:"title"},this.vertical?i("span",{innerHTML:et}):"",i("h3",{key:"0089f484e18cb2da81c6c55e931298f80fd97348"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),i("div",{key:"a5b6e824a20b10ec8d0b1b2e64ecb672799a0035",slot:"subtitle"},i("div",{key:"fb15018d2a456bac146dc1b3ad9c93ffe23bb8f8"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),i("div",{key:"7c10860a3881e933850ee7828d604c7a08b3700b",slot:"action"},i("salla-button",{key:"a9a4fc5c746c6e57851f9ea5bb6e026db92428e4",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},i("slot",{key:"2d94342daa320d9e374b7a9945860f1ba4b92abf",name:"widget-btn-content"},i("div",{key:"74d29e05b046fa4d3cdd3dab35934f879e942be6",class:"s-gifting-widget-action-content"},i("span",{key:"40818643fb4ca55a007cbecf1e94b26bbe3afbe3",innerHTML:et}),"  ",i("span",{key:"2bd1fbcb4c0bdedcf93f7c6f677fa177c088d8a4"},this.sectionBtnText)))))),i("salla-modal",{key:"3bc1fe8bb1260983aae3750154025b6d5ce661bb",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},i("div",{key:"1fbd87115bde6dfcdf3c7c2753b051de51afda55",slot:"loading"},i("div",{key:"47d7f1b00a4752192cfa42c2d725546194633e2f",class:"s-gifting-skeleton"},i("div",{key:"189a65f204bd067e31ecdc7814b5cde81409f824",class:"s-gifting-modal-header"},i("salla-skeleton",{key:"bfe75d37f7933b1632c891eb1930e5a0f3efd4ac",type:"circle",height:"5rem",width:"5rem"}),i("h2",{key:"2e5a16d86c0f0c79ec5d272f515ea64e52b07d83",class:"s-gifting-modal-title"},i("div",{key:"931982ea16ad7b099ddc6c33929f96cf15c05307",class:"s-gifting-modal-badge-wrapper"},i("salla-skeleton",{key:"724cb7f8e35c1319e974a53ac7de72090a71bf6a",height:"15px",width:"150px"})))),i("div",{key:"851f77aadad1f617129f03245bc8faa5eaf6f9f3",class:"s-gifting-skeleton-content"},i("salla-skeleton",{key:"d414c203fe82bc06c8fcaa596f3905e186757682",height:"10px",width:"150px"}),i("salla-skeleton",{key:"a0bea49d6eae8d7a5c41f72f147ce7b702502f20",height:"230px"}),i("salla-skeleton",{key:"8d7af7c14a8adad6cfbf17a185148ce7b9324756",height:"10px",width:"150px"}),i("salla-skeleton",{key:"0e78d2bbe2035fd2fe3f3ad295e5901bf2a0e556",height:"30px"}),i("salla-skeleton",{key:"0a64e92db6ee425d22b332d3ada5c25ca5277076",height:"40px"})))),i("slot",{key:"f79fa4c8d457619e77de8dc459f0a65c1078c8ef",name:"header"}),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),i("span",{slot:"description"}," ")):[i("div",{class:"s-gifting-modal-header"},i("span",{class:"s-gifting-modal-icon"},i("span",{innerHTML:et})),i("h2",{class:"s-gifting-modal-title"},i("div",{class:"s-gifting-modal-badge-wrapper"},i("div",{class:"s-gifting-modal-badge"},i("span",null,i("span",null,this.currentStep),"/2")),i("span",null,this.giftDetails)))),i("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},i("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},i("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),i("div",{class:"s-gifting-modal-uploader anime-item",ref:t=>this.uploader=t},i("span",{class:"s-gifting-remove-preview",onClick:()=>this.removePreview(),innerHTML:Q}),this.selectImageOrUpload&&i("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),i("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?i("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},i("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>i("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},i("img",{style:{width:"120px"},src:t.url,alt:`${t.id}`})))):"")):""),i("div",{class:"anime-item"},i("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},i("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},i("option",{"data-id":null,selected:!0},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>i("option",{"data-id":t.id,value:t.text,key:t.id},t.text))):"",i("option",{"data-id":"custom"},this.giftCustomText))),i("div",{class:this.showGiftText?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},i("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),i("div",{class:"mt-1"},i("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))),i("div",{class:"anime-item"},i("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2()},i("span",null,this.nextStep)))),i("div",{class:"s-gifting-step-two gift-step-2",ref:t=>this.step2Elems=t},i("div",{class:this.errors&&this.errors.sender_name?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),i("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?i("span",{class:"s-gifting-error"},this.errors.sender_name):""),i("div",{class:this.errors&&this.errors["receiver.name"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),i("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?i("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),i("div",{class:this.errors&&this.errors["receiver.mobile"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{class:"s-form-label"},this.receiverMobileFieldLabel),i("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.selectedCountryCode||this.receiverCountryCode,key:`tel-input-${this.selectedCountryCode||this.receiverCountryCode||"default"}`,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?i("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.physicalProducts&&i("div",null,i("div",{class:this.errors&&this.errors["receiver.country"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{class:"s-form-label"},this.receiverCountryFieldLabel),i("select",{name:"country",class:"s-form-control",onChange:t=>this.handleCountryChange(t),required:!0},i("option",{value:""},this.selectCountry),this.gift?.countries?.map((t=>i("option",{value:t.id},t.name)))),this.errors&&this.errors["receiver.country"]?i("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),i("div",{class:this.errors&&this.errors["receiver.city_id"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{class:"s-form-label"},this.receiverCityFieldLabel),i("select",{name:"city",class:"s-form-control",onChange:t=>this.handleReceiverCity(t),disabled:this.loadingCities},i("option",{value:"",selected:!0},this.loadingCities?salla.lang.get("common.elements.loading"):this.selectCity),this.gift?.cities?.map((t=>i("option",{value:t.id},t.name)))),this.errors&&this.errors["receiver.city_id"]?i("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),i("div",{class:"s-gifting-info anime-item opacity-0"},i("span",{innerHTML:'\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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),i("span",null,this.selectCityInfo))),!this.physicalProducts&&i("div",{class:"anime-item opacity-0"},i("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},i("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",this.sendLater," "))),i("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},i("label",{class:"s-form-label"},this.selectSendDateAndTime),i("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),i("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),i("div",{class:"s-gifting-step-two-footer anime-item opacity-0"},i("a",{href:"#!",innerHTML:u,onClick:t=>this.goToStep1(t)}),i("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},i("span",null,this.sendGift)))))],i("slot",{key:"3a0375eeb53c624d60601045e695d56ba6b92838",name:"footer"})))]}};st.style=".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}";const at=class{constructor(i){t(this,i),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.lang.onLoaded((()=>{this.status.querySelector(".s-button-text").innerHTML=this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(t=!0){let i=this.status.querySelector(".s-button-text");p.toggleElementClassIf(i,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none"}render(){return this.nextPage.length>1?i(e,{class:"s-infinite-scroll-container"},i("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let t=this,i=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return t.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==i.pageIndex&&i.option({loadOnScroll:!1}),3==i.pageIndex&&i.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return s(this)}};at.style="";const lt=class{constructor(i){t(this,i),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return i(e,{key:"b1b2a6bf65c40643d59f392e91cc76acaea5e89e"},i("a",{key:"4b2026fd739b243a41bfc37fcb55bc07a1a54636",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},i("div",{key:"bbc7a7133da0e471ad92a5466e9ec0481d74cdd7",class:"s-list-tile-item-icon"},i("slot",{key:"e4e338854bfc7e6843c4b87f419c9aa59970c77b",name:"icon"})),i("div",{key:"1b7b2e0a65193be521cdf6cccc314c83f853216d",class:"s-list-tile-item-content"},i("div",{key:"4e6a178d219827b1feef394ea5564769bf11ded2",class:"s-list-tile-item-title"},i("slot",{key:"75b036812aca3e00162fc8c40459b67d4db2cc6f",name:"title"})),i("div",{key:"ab0959a43214ae0eb4cf092ea3738c71ed987709",class:"s-list-tile-item-subtitle"},i("slot",{key:"e13f66fb2a0e1c5ab2a9081c808973c9f9ecca45",name:"subtitle"}))),i("div",{key:"78c7542367a41a1f8bc74bca73d2581f5c0b7bfd",class:"s-list-tile-item-action"},i("slot",{key:"14c8c0f31d29855d743b52f82d52a3bed300b25f",name:"action"}))))}};lt.style="";const ot=class{constructor(i){t(this,i),this.size=32,this.width=2,this.color=void 0,this.bgColor="#e5e7eb"}render(){return i(e,{key:"0f3796a2a8f9610f40e20eb01e4d60fb56e11a03",class:"s-loading-container"},i("svg",{key:"d9d98cfa05e5c7d188237a0a4833c4cd13c2855c","aria-hidden":"true",style:{width:`${this.size}px`,height:`${this.size}px`,fill:this.color,color:this.bgColor},class:"s-loading",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{key:"75ea4d6f86456c86249dab53f3e18d21cc0380ef",d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i("path",{key:"8bfd0b7ea965749ed9456742f36d2ffa28cff9f3",d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})))}};ot.style=".s-loading{animation:spin 1s linear infinite;fill:var(--color-primary)}.s-loading-container{display:flex;justify-content:center;align-items:center}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const nt=class{constructor(i){t(this,i),this.translationLoaded=!1,this.languages=[],this.currencies=[],this.hasError=!1,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),salla.event.on("localization::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),this.languageSlot=this.host.querySelector('[slot="language"]')?.innerHTML||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span></label>',this.currencySlot=this.host.querySelector('[slot="currency"]')?.innerHTML||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{code}</small></label>'}async open(){return this.modal.open(),await salla.api.withoutNotifier((()=>this.getLanguages())).then((()=>this.getCurrencies())).then((()=>{this.languages.length<2&&this.currencies.length<2&&this.modal.close()})).catch((t=>{console.log(t),this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async getLanguages(){return this.language=this.language||salla.config.get("user.language_code"),this.languages.length>1?null:await salla.config.languages().then((t=>this.languages=t))}async getCurrencies(){return this.currency=this.currency||salla.config.get("user.currency_code"),this.currencies.length>1?null:await salla.config.currencies().then((t=>this.currencies=Object.values(t||{})))}onChangeCurrency(t){this.currency=t.target.value}onChangeLanguage(t){this.language=t.target.value}async submit(){let t;this.btn.load().then((()=>{if(this.currency){if(this.currency!==salla.config.get("user.currency_code","SAR"))return t=window.location.href,salla.currency.api.change(this.currency)}else salla.log("There is no currency!")})).then((()=>{this.language!==salla.config.get("user.language_code","ar")&&(t=salla.helpers.addParamToUrl("lang",this.language))})).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>{t&&(window.location.href=t.replace(`/${salla.config.get("user.language_code")}/`,`/${this.language}/`))}))}render(){return i("salla-modal",{key:"becc5db6a4715b1ba69440492785847a254e23c9",isLoading:!0,class:"s-hidden",ref:t=>this.modal=t,width:"xs"},i("div",{key:"116cda532167f767b73728422d580cfa9e269304",slot:"loading"},i("div",{key:"a53bd0db8a838cc8b989a5566da7c6386de516ec",class:"s-localization-modal-skeleton"},i("salla-skeleton",{key:"63d7c34e3ae8fa5c402f0f3cd9925bdd144d672e",width:"25%",height:"15px"}),i("div",{key:"86d07e0c84a66db39d3748ebc888cdc914a40600",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>i("div",{class:"s-localization-modal-skeleton-item"},i("div",{class:"s-localization-modal-skeleton-item-flex"},i("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),i("salla-skeleton",{height:"10px",width:"100px"})),i("salla-skeleton",{height:"15px",width:"20px"}))))),i("salla-skeleton",{key:"b810e2ddedf6b55276a61a346810b22d6a9518ac",width:"25%",height:"15px"}),i("div",{key:"c7a66c2a609b8262b9eb0518d416939d80f4fed6",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>i("div",{class:"s-localization-modal-skeleton-item"},i("div",{class:"s-localization-modal-skeleton-item-flex"},i("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),i("salla-skeleton",{height:"10px",width:"100px"})),i("salla-skeleton",{height:"15px",width:"20px"}))))),i("salla-skeleton",{key:"9d1e030584e3465bc4fae2176f854891b18bb0a1",height:"40px",width:"100%"}))),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"description"},this.errorMessage)):i("div",{class:"s-localization-modal-inner"},this.languages.length>1?i("div",{class:"s-localization-modal-section"},i("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.language")),i("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((t=>i("div",{class:"s-localization-modal-item"},i("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==t.iso_code,onChange:()=>this.language=t.iso_code,name:"language",id:"lang-"+t.code.toLowerCase(),value:t.code}),i("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,t.name).replace(/\{code\}/g,t.code).replace(/\{country_code\}/g,t.country_code)})))):i("select",{class:"s-localization-modal-select",name:"language",onChange:t=>this.onChangeLanguage(t)},this.languages.map((t=>i("option",{value:t.code,selected:this.language==t.code},t.name)))))):"",this.currencies.length>1?i("div",{class:"s-localization-modal-section"},i("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.currency")),i("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((t=>i("div",{class:"s-localization-modal-item"},i("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==t.code,onChange:()=>this.currency=t.code,id:"currency-"+t.code,value:t.code}),i("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,t.name).replace(/\{code\}/g,t.code).replace(/\{country_code\}/g,t.country_code)})))):i("select",{class:"s-localization-modal-select",name:"currency",onChange:t=>this.onChangeCurrency(t)},this.currencies.map((t=>i("option",{value:t.code,selected:this.currency==t.code},t.name)))))):"",i("salla-button",{width:"wide",ref:t=>this.btn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.ok"))))}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#language-slot").forEach((t=>t.replaceWith(t.firstChild)))}get host(){return s(this)}},rt=class{constructor(i){t(this,i),this.isMobileAllowed=!0,this.isEmailRequired=!1,this.supportWebAuth=!0,this.withoutReload=!1,this.source="",this.htmlElement=document.documentElement,this.messages=[],this.isClosable=!0,this.iframeLoaded=!1,this.scrolling="no",this.direction=document.dir,this.canRenderIframe=!1,salla.event.on("login::open",(t=>{this.isEmailAllowed||this.isMobileAllowed?(this.source=t?.source??!1,this.withoutReload=t?.withoutReload??this.withoutReload,this.open(t),this.openModal()):salla.logger.warn("Please enable atleast one login type to use this component.")})),salla.event.on("modal::close",(t=>{this.iframe&&this.sendMessageToIframe({source:"login",type:"modal_closed",data:t})})),salla.onReady((()=>{this.api=salla.config.get("store.api"),this.storeId=salla.config.get("store.id")}))}componentDidLoad(){window.addEventListener("message",(t=>{if("login"!=t.data.source)return;if(!this.inline&&!this.canRenderIframe)return;salla.log("salla-account:: recived an event",t.data);let i=t.data?.type?.replace("iframe::",""),e=t.data.message;if("ready"==i)return e.isPasskeyPage?void this.createPassKey.postMessage({source:"login",type:"init_passkey_page",data:{token:salla.storage.get("token"),store_id:salla.config.get("store.id"),locale:salla.config.get("user.language_code"),redirect:salla.config.get("store.url")}},salla.config.get("login.url")):void this.handleIframeReadyAction();if("height"==i)return this.iframe.height=e?.height+"px";if("storage"==i)return this.handleIframeStorageAction(e);if("scrolling"==i)return this.scrolling=e,void(this.isClosable=!1);if("direction"==i)return document.dir=this.direction=e?"rtl":"ltr";if("notify"==i)return salla.notify[e.type](e.message);if("authenticated"==i||"authenticated_web_auth"==i)return!e?.withoutClose&&this.close(),salla.auth.api.handlAfterAuthenticatedResponse(e,this.supportWebAuth).then((()=>!(e?.withoutReload||this.withoutReload)&&setTimeout((()=>window.location.reload()),1e3)));if("dispatchEvent"!=i||"auth::verified"!=e.event){if("dispatchEvent"==i)return salla.event.emit(e.event,...e.payload);if("reload"==i)return e?.withClose&&this.modal.close(),window.location.reload();if("open_page"===i)return window.location.href=e.url;if("open_passkey_page"!==i)return"guest-checkout"===i?this.handleGuestCheckout():void("close"==i&&this.close());this.createPassKey=window.open(`${salla.config.get("login.url")}/create-passkey`)}else salla.log("Ignored dispatchEvent `auth::verified` from iframe")})),this.observeDarkModeChanges(),setTimeout((()=>Salla.event.emit("salla-login::ready")),1)}async open(t=null){return salla.config.isGuest()?this.modal.open():this.withoutReload?void 0:location.reload()}close(){Salla.event.emit("salla-login::closing"),this.modal.close(),this.iframeLoaded=!1,this.canRenderIframe=!1,this.host.dispatchEvent(new CustomEvent("salla-login:closed",{cancelable:!0,bubbles:!0,detail:null})),Salla.event.emit("salla-login::closed")}handleIframeReadyAction(){this.sendInitMessage(),this.sendMessageToIframe({source:"login",type:"width",data:document.body.clientWidth})}observeDarkModeChanges(){new MutationObserver((t=>{t.forEach((t=>{"class"===t.attributeName&&this.sendMessageToIframe({source:"login",type:"darkMode",data:{isDark:!!this.htmlElement.classList.contains("dark")}})}))})).observe(this.htmlElement,{attributes:!0})}async handleIframeStorageAction(t){let i,e=salla.storage.get("cart.user_id"),s=!1;if(Object.entries(t).filter((t=>!Salla.storage.get(t[0]))).forEach((([t,a])=>{salla.log("Shared storage from accounts domain",t,a);let l="string"==typeof a?a?.replace(/^"|"$/g,""):a;salla.storage.set(t,l),"token"===t&&(i=l),"user"===t&&e&&l.id!==e&&(s=!0)})),i){this.modal.close(),Salla.auth.event.tokenFetched(i);try{await Salla.api.cart.assign()}catch(t){Salla.log("Error on assign after handle iframe",t)}return s&&Salla.cart.reset(),!Salla.auth.api.isSessionless()&&await Salla.auth.api.request("auth/jwt"),void setTimeout((()=>window.location.reload()),100)}s&&Salla.cart.reset()}sendMessageToIframe(t){if(this.iframe)return this.iframe.contentWindow.postMessage(t,"*")}sendInitMessage(){let t=this.headers;try{t="string"==typeof t?JSON.parse(t):t}catch(i){console.error("Failed to parse headers!",this.headers,i),t=void 0}const i={user:salla.storage.get("user"),s_translations:salla.storage.get("s_translations"),token:salla.storage.get("token")};i.user||delete i.user,i.s_translations||delete i.s_translations,i.token||delete i.token,this.sendMessageToIframe({source:"login",type:"init",data:{id:this.storeId,lang:salla.lang.locale,isDark:!!this.htmlElement.classList.contains("dark"),apiUrl:this.api?.replace(/\/+$/,""),supportWebAuth:this.supportWebAuth,withoutReload:this.withoutReload,inline:this.inline,settings:salla.config.all(),headers:t,storage:i}})}async handleGuestCheckout(){if(this.modal.close(),salla.config.isGuest())return await salla.api.cart.syncGuestCart(),salla.cart.submit(!0)}openModal(){this.canRenderIframe||(this.canRenderIframe=!0),this.modal.open()}render(){return this.inline?this.getLoginDom():i("salla-modal",{class:"s-login-modal",ref:t=>this.modal=t,width:"xs"},this.getLoginDom())}getLoginDom(){if(this.canRenderIframe)return i(o,null,i("iframe",{src:`${salla.config.get("login.url","https://accounts.salla.com")}?src=${this.source}`,title:"Salla Login",class:"hide-scroll",loading:"lazy",ref:t=>{this.iframe=t},allow:"publickey-credentials-get; publickey-credentials-create",scrolling:this.scrolling,frameborder:"0",width:"100%"}))}get host(){return s(this)}};rt.style="iframe{-moz-transition:height 0.3s;-ms-transition:height 0.3s;-o-transition:height 0.3s;-webkit-transition:height 0.3s;transition:height 0.3s;width:100%}";var ct='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>star2</title>\n<path d="M29.714 11.839c0 0.321-0.232 0.625-0.464 0.857l-6.482 6.321 1.536 8.929c0.018 0.125 0.018 0.232 0.018 0.357 0 0.464-0.214 0.893-0.732 0.893-0.25 0-0.5-0.089-0.714-0.214l-8.018-4.214-8.018 4.214c-0.232 0.125-0.464 0.214-0.714 0.214-0.518 0-0.75-0.429-0.75-0.893 0-0.125 0.018-0.232 0.036-0.357l1.536-8.929-6.5-6.321c-0.214-0.232-0.446-0.536-0.446-0.857 0-0.536 0.554-0.75 1-0.821l8.964-1.304 4.018-8.125c0.161-0.339 0.464-0.732 0.875-0.732s0.714 0.393 0.875 0.732l4.018 8.125 8.964 1.304c0.429 0.071 1 0.286 1 0.821z"></path>\n</svg>\n';const ht=class{constructor(i){t(this,i),this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.event.on("loyalty::open",(()=>this.open())),salla.auth.event.onLoggedIn((()=>{this.is_loggedin=!0})),salla.onReady((()=>{this.is_loggedin=salla.config.isUser()})),salla.lang.onLoaded((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0})),salla.cart.event.onUpdated((t=>{this.prizePoints=t.loyalty.prize?.points,this.prizeTitle=t.loyalty.prize?.title,this.customerPoints=t.loyalty.customer_points||this.customerPoints}))}setSelectedPrizeItem(t){this.selectedItem=this.selectedItem&&this.selectedItem?.id==t.id?void 0:t}handleLongText(t){return t.length>150?t.substring(0,150)+"...":t}prizeItem(t){return i("div",{onClick:()=>this.setSelectedPrizeItem(t),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==t.id,"s-loyalty-prize-item":!0}},i("img",{class:"s-loyalty-prize-item-image",src:t.image,alt:t.name}),i("div",{class:"s-loyalty-prize-item-title"},t.name),i("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(t.description)),i("div",{class:"s-loyalty-prize-item-points"},t.cost_points," ",salla.lang.get("pages.loyalty_program.point"),i("div",{class:"s-loyalty-prize-item-check"},i("div",null))))}getConfirmationModal(){return[i("salla-placeholder",{alignment:"center",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">\n<title>star3</title>\n <defs>\n <style>\n .a {\n fill: none !important;\n }\n\n .b {\n fill: #ff9e01;\n }\n\n .c {\n fill: #fff;\n opacity: 0.1;\n }\n\n </style>\n </defs>\n <g transform="translate(-683 -269)">\n <rect class="a" width="80" height="80" transform="translate(683 269)" />\n <g transform="translate(684.539 261.216)">\n <path class="b"\n d="M110.117,37.062,90.024,35.2,82.043,16.665a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l17.351-10.3,17.351,10.3a1.61,1.61,0,0,0,2.393-1.739L95.871,53.192l15.16-13.318A1.61,1.61,0,0,0,110.117,37.062Z"\n transform="translate(-42.104 -4.011)" />\n <g transform="translate(0 10.971)">\n <path class="b"\n d="M93.54,12.016c1.024,1.423,3.915,7.533,5.568,11.094a.559.559,0,0,1-.891.641c-2.853-2.7-7.73-7.377-8.754-8.8a2.512,2.512,0,0,1,4.077-2.935Z"\n transform="translate(-75.621 -10.971)" />\n <path class="b"\n d="M360.909,12.016c-1.024,1.423-3.915,7.533-5.568,11.094a.559.559,0,0,0,.891.641c2.853-2.7,7.73-7.377,8.754-8.8a2.512,2.512,0,0,0-4.077-2.935Z"\n transform="translate(-301.908 -10.971)" />\n <path class="b"\n d="M427.538,284.659c-1.667-.543-8.366-1.441-12.261-1.934a.559.559,0,0,0-.34,1.044c3.436,1.9,9.377,5.123,11.044,5.666a2.512,2.512,0,0,0,1.558-4.776Z"\n transform="translate(-352.351 -241.894)" />\n <path class="b"\n d="M1.734,284.659c1.667-.543,8.366-1.441,12.261-1.934a.559.559,0,0,1,.34,1.044c-3.436,1.9-9.377,5.123-11.044,5.666a2.512,2.512,0,0,1-1.558-4.776Z"\n transform="translate(0 -241.894)" />\n <path class="b"\n d="M239.794,412.414c0-1.753,1.224-8.4,1.963-12.257a.559.559,0,0,1,1.1,0c.739,3.855,1.963,10.5,1.963,12.257a2.512,2.512,0,0,1-5.023,0Z"\n transform="translate(-203.768 -341.301)" />\n </g>\n <path class="c"\n d="M84.945,23.4l-2.9-6.74a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l2.309-1.371A125,125,0,0,1,84.945,23.4Z"\n transform="translate(-42.104 -4.011)" />\n </g>\n </g>\n</svg>\n',class:"s-loyalty-confirmation-modal-content"},i("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),i("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",i("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",i("strong",null,this.selectedItem?.name)," )")),i("div",{class:"s-loyalty-confirmation-actions"},i("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),i("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return i("slot",{name:"points-applied-widget"},i("salla-list-tile",{class:"s-loyalty-after-exchange"},i("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle,"   -   ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),i("div",{slot:"action",class:"s-loyalty-after-exchange-action"},i("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},i("span",{innerHTML:Q})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((t=>{this.loyaltyProgram=t.data})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal?.stopLoading()))):salla.event.dispatch("login::open")}async close(){return this.modal.close()}async resetExchange(){return await salla.loyalty.reset()}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((t=>console.log(t)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((t=>console.log(t)))}async exchangeLoyaltyPoint(){return this.buttonLoading=!0,await salla.loyalty.exchange(this.selectedItem?.id).then((()=>"FREE_PRODUCT"==this.selectedItem.key&&salla.url.is_page("cart")&&window.location.reload())).finally((()=>{this.buttonLoading=!1,this.cancelProcess()}))}render(){return this.prizePoints?this.getAfterExchangeUI():[i("slot",{name:"widget"},this.customerPoints?i("salla-list-tile",{class:"s-loyalty-widget"},i("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:ct}),i("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,i("salla-button",{shape:"link",color:"primary",onClick:()=>salla.event.dispatch("loyalty::open")},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_point_exchange_now"):salla.lang.get("blocks.header.login")))):""),i("salla-modal",{noPadding:!0,width:"sm",ref:t=>this.confirmationModal=t},this.getConfirmationModal()),i("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},i("div",{slot:"loading"},i("div",{class:"s-loyalty-skeleton"},i("salla-list-tile",{class:"s-loyalty-header"},i("div",{slot:"icon",class:"s-loyalty-header-icon"},i("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),i("div",{slot:"title",class:"s-loyalty-header-title mb-5"},i("salla-skeleton",{height:"15px",width:"50%"})),i("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},i("salla-skeleton",{height:"10px"}),i("salla-skeleton",{height:"10px",width:"75%"}))),i("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>i("div",{class:"s-loyalty-prize-item swiper-slide"},i("salla-skeleton",{height:"9rem"}),i("div",{class:"s-loyalty-prize-item-title"},i("salla-skeleton",{height:"15px",width:"75%"})),i("div",{class:"s-loyalty-prize-item-subtitle"},i("salla-skeleton",{height:"10px",width:"50%"}),i("salla-skeleton",{height:"10px",width:"25%"})),i("div",{class:"s-loyalty-prize-item-points"},i("salla-skeleton",{height:"15px",width:"100px"}),i("div",{class:"s-loyalty-prize-item-check"},i("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[i("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},i("div",{slot:"icon",class:"s-loyalty-header-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="54.079" height="53.191" viewBox="0 0 54.079 53.191"><defs><style>.a{fill:#ee9d0d;}.b{fill:#c7830b;}.c{fill:#ea2b2d;}.d{fill:#cb2527;}.e{fill:#6699ce;}.f{fill:#faa6b2;}.g{fill:#a6deff;}.h{fill:#eeb436;}.i{fill:#f72d2f;}</style></defs><path class="a" d="M40,248H77.3v25.88a2.1,2.1,0,0,1-2.1,2.1H42.1a2.1,2.1,0,0,1-2.1-2.1Z" transform="translate(-38.135 -222.787)"/><path class="b" d="M250.632,248.711v12.755L236.2,248h13.67Z" transform="translate(-211.463 -222.787)"/><path class="b" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="c" d="M226.194,32.048l-.5.185a5.035,5.035,0,0,0-3.072,3.292l-.468,1.585-.759.414a5.035,5.035,0,0,0-2.422,3l8.865,8.271,5.09-5.456.262-6.205a5.191,5.191,0,0,0-7-5.083Z" transform="translate(-196.246 -31.722)"/><path class="c" d="M358.628,175.48l-.15.509a5.034,5.034,0,0,1-3.072,3.292l-1.55.577-.359.785a5.034,5.034,0,0,1-2.822,2.624L341.81,175l5.09-5.455,6.172-.69a5.191,5.191,0,0,1,5.555,6.629Z" transform="translate(-304.761 -152.837)"/><path class="d" d="M168,248h7.461v27.978H168Z" transform="translate(-151.213 -222.787)"/><path class="c" d="M40,336H77.3v7.461H40Z" transform="translate(-38.135 -300.528)"/><path class="d" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="a" d="M2.1,0H40.8a2.1,2.1,0,0,1,2.1,2.1V9.326H0V2.1A2.1,2.1,0,0,1,2.1,0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 18.641, 4.976)"/><path class="d" d="M0,0H9.326V9.326H0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 30.912, 16.424)"/><path class="d" d="M286.857,79.389a.931.931,0,0,1-.74-.365l-.615-.8a12.516,12.516,0,0,1-2.528-9,.933.933,0,0,1,1.855.2,10.66,10.66,0,0,0,2.153,7.667l.615.8a.933.933,0,0,1-.739,1.5Z" transform="translate(-252.718 -64.113)"/><path class="c" d="M185.485,178.151l-.039.014a30.78,30.78,0,0,1-12.034,1.906l-2.381-.1,4.092,3.817-1.181,4,3.728-1.206a30.775,30.775,0,0,0,9.833-5.315l.71-.572Z" transform="translate(-153.891 -161.081)"/><path class="d" d="M363.834,194.779a12.51,12.51,0,0,1-6.93-2.1l-.843-.559a.933.933,0,1,1,1.031-1.554l.842.558a10.659,10.659,0,0,0,7.8,1.618.933.933,0,1,1,.328,1.836A12.663,12.663,0,0,1,363.834,194.779Z" transform="translate(-316.982 -171.914)"/><path class="c" d="M275,202.524l-.012.04a30.776,30.776,0,0,0-1.069,12.137l.265,2.369-4.092-3.817-3.909,1.455.945-3.8a30.776,30.776,0,0,1,4.622-10.177l.521-.748Z" transform="translate(-237.949 -180.364)"/><circle class="e" cx="1.865" cy="1.865" r="1.865" transform="translate(10.259 0.032)"/><circle class="f" cx="1.865" cy="1.865" r="1.865" transform="translate(0 21.482)"/><path class="g" d="M36.663,36.663a.933.933,0,0,1-.885-.638l-.048-.143a2.946,2.946,0,0,0-2.8-2.017.933.933,0,1,1,0-1.865A4.808,4.808,0,0,1,37.5,35.292l.048.143a.933.933,0,0,1-.885,1.228Z" transform="translate(-31.067 -31.968)"/><path class="g" d="M79.493,194.438a.929.929,0,0,1-.506-.15l-.185-.12a2.074,2.074,0,0,0-2.192-.047.933.933,0,0,1-.947-1.607,3.929,3.929,0,0,1,4.153.088l.185.12a.933.933,0,0,1-.508,1.716Z" transform="translate(-69.235 -173.283)"/><path class="h" d="M27.751,85.141l2.88,2.644,3.811-.874-1.624,3.556,2.008,3.354-3.884-.446-2.569,2.946L27.6,92.49,24,90.957l3.4-1.922Z" transform="translate(-24 -78.914)"/><path class="h" d="M82.174,227.375l-.959,3.772,2.564,2.928-3.884.254L77.9,237.673l-1.442-3.615-3.8-.862,2.993-2.488-.353-3.876,3.291,2.078Z" transform="translate(-66.992 -204.086)"/><path class="i" d="M300.471,141.9l-5.455-5.09,5.09-5.456a8.342,8.342,0,0,1,5.455,5.09Z" transform="translate(-263.422 -119.737)"/></svg>'}),i("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),i("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),i("salla-tabs",null,this.loyaltyProgram.prizes.map((t=>i("salla-tab-header",{slot:"header",name:t.title},i("span",null,t.title)))),this.loyaltyProgram.prizes.map(((t,e)=>i("salla-tab-content",{slot:"content",name:t.title},i("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+e,type:"carousel"},i("div",{slot:"items"},t.items.map((t=>this.prizeItem(t))))))))),i("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:i("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?i("span",{slot:"description"},this.errorMessage):""))]}};ht.style="";const dt=class{constructor(i){t(this,i)}componentWillLoad(){this.title=salla.config.get("maintenance_details.title"),this.message=salla.config.get("maintenance_details.message"),this.buttonTitle=window.innerWidth<=768?salla.config.get("maintenance_details.button_title"):salla.config.get("maintenance_details.button_full_title")}closeAlert(){salla.storage.set("hide_salla-maintenance-alert_at",Date.now()),this.host.style.display="none"}render(){return i(e,{key:"ec1f4c39f02624943122e444dce1a19bbea34a07",class:"s-maintenance-alert-wrapper"},i("button",{key:"db2892331f6addedc5b916e9c4c666023d6765b0",class:"s-maintenance-alert-close",innerHTML:Q,onClick:()=>this.closeAlert()}),i("div",{key:"2cc604e98eccd343eb0fbe07d6a030aeca28d142",class:"s-maintenance-alert-content"},i("div",{key:"563c647d3e73b40f8db1c51dc6b74f4333c8964e",class:"s-maintenance-alert-container"},i("div",{key:"662cb7f23d6fba70fa6f2025188e73fd7fad965d",class:"s-maintenance-alert-icon"},i("img",{key:"d5ce8780910ebefa6e16a720170d799974813816",src:salla.url.cdn("images/alert.png"),alt:"Alert"})),i("div",{key:"35f7d4d0a3af396e0ec2bd2f7362f4f1aa620523",class:"s-maintenance-alert-text"},i("h2",{key:"14edaba08f2a7f48c673c5d9e714b7e6507543a2"},this.title),i("p",{key:"5fd4831d78deebfc7c7b999c9a71225ab038ec14"},this.message))),i("div",{key:"f76912d23fe45cd1bd83a89faf646b3038402476"},i("a",{key:"39f2609417b1ff80ea6376a0346fa1a227828c99",class:"s-maintenance-alert-btn",href:salla.config.get("maintenance_details.button_url")},this.buttonTitle))))}componentDidLoad(){let t=salla.storage.get("hide_salla-maintenance-alert_at");t&&(Date.now()-t)/1e3/60<60&&this.closeAlert()}get host(){return s(this)}};dt.style=".s-maintenance-alert-wrapper{display:flex;min-height:40px;width:100%;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(26, 38, 61, var(--tw-bg-opacity));padding:0.25rem 0.5rem;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-wrapper a{transition:0.35s cubic-bezier(0.2, 1, 0.3, 1)}.s-maintenance-alert-wrapper *{color:inherit}@media (min-width: 640px){.s-maintenance-alert-wrapper{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-content{margin-top:1rem;margin-bottom:1rem;display:flex;width:100%;align-items:center;justify-content:space-between}@media (min-width: 640px){.s-maintenance-alert-content{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-container{display:flex;align-items:center}.s-maintenance-alert-icon{margin-right:1.25rem;display:none}@media (min-width: 640px){.s-maintenance-alert-icon{display:block}}.s-maintenance-alert-text h2{margin-bottom:0.5rem;font-size:0.875rem;font-weight:700;line-height:1.4}@media (min-width: 640px){.s-maintenance-alert-text h2{font-size:1.5rem;line-height:2rem}}.s-maintenance-alert-text p{margin:0px;text-align:right;font-size:10px;line-height:1.2}@media (min-width: 640px){.s-maintenance-alert-text p{text-align:center;font-size:0.75rem;line-height:1}}.s-maintenance-alert-btn{position:relative;margin-left:4px;margin-right:4px;display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;border-radius:0.125rem;border-width:1px;--tw-border-opacity:1;border-color:rgba(93, 213, 196, var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(93, 213, 196, var(--tw-bg-opacity));padding:0.5rem;text-align:center;vertical-align:middle;font-size:0.875rem;font-weight:400;line-height:1.4;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-btn:hover{--tw-bg-opacity:1;background-color:rgba(53, 203, 181, var(--tw-bg-opacity))}.s-maintenance-alert-btn *{pointer-events:none}[dir=rtl] .s-maintenance-alert-btn{margin-left:1.25rem;margin-right:0}@media (min-width: 640px){.s-maintenance-alert-btn{padding:0.5rem 1rem}}";var pt={light:[{featureType:"water",elementType:"geometry",stylers:[{color:"#e9e9e9"},{lightness:17}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:20}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#ffffff"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#ffffff"},{lightness:29},{weight:.2}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:16}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:21}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#dedede"},{lightness:21}]},{elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#ffffff"},{lightness:16}]},{elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#333333"},{lightness:40}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#f2f2f2"},{lightness:19}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#fefefe"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#fefefe"},{lightness:17},{weight:1.2}]}],dark:[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}]};class ut{constructor(t=null,i={}){if(this.apiKey=t,this.options=i,"undefined"==typeof window)throw new Error("google-maps is supported only in browser environment")}load(){return void 0!==this.api?Promise.resolve(this.api):void 0!==this.loader?this.loader:(window[ut.CALLBACK_NAME]=()=>{if(this.api=window.google,void 0===this.resolve)throw new Error("Should not happen");this.resolve(this.api)},window.gm_authFailure=()=>{if(void 0===this.reject)throw new Error("Should not happen");this.reject(new Error("google-maps: authentication error"))},this.loader=new Promise(((t,i)=>{this.resolve=t,this.reject=i;const e=document.createElement("script");e.src=this.createUrl(),e.async=!0,e.onerror=t=>i(t),document.head.appendChild(e)})))}createUrl(){const t=[`callback=${ut.CALLBACK_NAME}`];this.apiKey&&t.push(`key=${this.apiKey}`);for(let i in this.options)if(this.options.hasOwnProperty(i)){let e=this.options[i];"version"===i&&(i="v"),"libraries"===i&&(e=e.join(",")),t.push(`${i}=${e}`)}return`https://maps.googleapis.com/maps/api/js?${t.join("&")}`}}ut.CALLBACK_NAME="_dk_google_maps_loader_cb";const gt=class{constructor(i){t(this,i),this.selected=a(this,"selected"),this.mapClicked=a(this,"mapClicked"),this.currentLocationChanged=a(this,"currentLocationChanged"),this.invalidInput=a(this,"invalidInput"),this.defaultLat=21.419421,this.defaultLng=39.82553,this.modalActivityTitle=salla.lang.get("pages.checkout.select_your_address_from_map"),this.confirmButtonTitle=salla.lang.get("pages.checkout.confirm_address"),this.locateButtonTitle=salla.lang.get("pages.cart.detect_location"),this.locateButtonEdit=salla.lang.get("common.elements.edit"),this.searchPlaceholder=salla.lang.get("pages.checkout.search_for_address"),this.searchInputValue=null,this.formattedAddress="",this.geolocationError=!1,this.name="location",this.required=!1,this.readonly=!1,this.searchable=!1,this.zoom=10,this.theme="light",salla.lang.onLoaded((()=>{this.modalActivityTitle=salla.lang.get("pages.checkout.select_your_address_from_map"),this.confirmButtonTitle=salla.lang.get("pages.checkout.confirm_address"),this.locateButtonTitle=salla.lang.get("pages.cart.detect_location"),this.locateButtonEdit=salla.lang.get("common.elements.edit"),this.searchPlaceholder=salla.lang.get("pages.checkout.search_for_address")})),salla.onReady((()=>{this.apiKey=salla.config.get("store.settings.keys.maps","AIzaSyBFgFISAizDP3YVWj0y5rF8JKKNQ2vohdc")}))}formatAddress(t){return t.length>25?t.substring(0,25)+"...":t}getLatLng(){return this.selectedLat&&this.selectedLng?`${this.selectedLat}, ${this.selectedLng}`:null}getPositionAddress(t,i=!1){(new google.maps.Geocoder).geocode({location:t},((t,e)=>{e===google.maps.GeocoderStatus.OK&&(this.searchable&&(this.searchInputValue=t[0].formatted_address,this.searchInput.value=t[0].formatted_address),i&&(this.formattedAddress=t[0].formatted_address))}))}initGoogleMaps(t,i){new ut(this.apiKey,t).load().then((t=>{if(this.map=new t.maps.Map(i,{center:this.lat||this.lng?{lat:this.lat,lng:this.lng}:{lat:this.defaultLat,lng:this.defaultLng},zoom:this.zoom,zoomControl:!0,mapTypeControl:!1,scaleControl:!1,streetViewControl:!1,rotateControl:!1,fullscreenControl:!1,disableDefaultUI:!1}),this.map.setOptions({styles:"light"===this.theme?pt.light:pt.dark}),this.marker=new t.maps.Marker({position:this.map.getCenter(),map:this.map,icon:{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect width="36" height="36" rx="18" fill="#5CD5C4"/>\n<path d="M18 10C17.0104 10 16.1458 10.1771 15.4062 10.5312C14.6562 10.8854 14.026 11.3542 13.5156 11.9375C13.0156 12.5104 12.6406 13.1667 12.3906 13.9062C12.1302 14.6458 12 15.401 12 16.1719C12 16.8906 12.2604 17.7656 12.7812 18.7969C13.3021 19.8281 13.8854 20.8333 14.5312 21.8125C15.1875 22.7812 15.8073 23.6406 16.3906 24.3906C16.9844 25.1302 17.349 25.5885 17.4844 25.7656C17.5469 25.8385 17.625 25.8958 17.7188 25.9375C17.8125 25.9792 17.9062 26 18 26C18.1042 26 18.1979 25.9792 18.2812 25.9375C18.375 25.8958 18.4531 25.8385 18.5156 25.7656C18.651 25.5885 19.0156 25.1302 19.6094 24.3906C20.1927 23.6406 20.8073 22.7812 21.4531 21.8125C22.1094 20.8333 22.6979 19.8281 23.2188 18.7969C23.7396 17.7656 24 16.8906 24 16.1719C24 15.401 23.8698 14.6458 23.6094 13.9062C23.3594 13.1667 22.9792 12.5104 22.4688 11.9375C21.9688 11.3542 21.3438 10.8854 20.5938 10.5312C19.8542 10.1771 18.9896 10 18 10ZM18 24.2812C17.5833 23.75 17.1094 23.1198 16.5781 22.3906C16.0365 21.651 15.526 20.901 15.0469 20.1406C14.5677 19.3698 14.1615 18.6302 13.8281 17.9219C13.4948 17.2135 13.3281 16.6302 13.3281 16.1719C13.3281 15.5885 13.4219 15.0052 13.6094 14.4219C13.7969 13.849 14.0781 13.3333 14.4531 12.875C14.8385 12.4167 15.3281 12.0469 15.9219 11.7656C16.5052 11.474 17.1979 11.3281 18 11.3281C18.8021 11.3281 19.4948 11.474 20.0781 11.7656C20.6719 12.0469 21.1562 12.4167 21.5312 12.875C21.9167 13.3333 22.2031 13.849 22.3906 14.4219C22.5781 15.0052 22.6719 15.5885 22.6719 16.1719C22.6719 16.6302 22.5052 17.2135 22.1719 17.9219C21.8385 18.6302 21.4323 19.3698 20.9531 20.1406C20.474 20.901 19.9688 21.651 19.4375 22.3906C18.8958 23.1198 18.4167 23.75 18 24.2812ZM18 13.3281C17.2604 13.3281 16.6302 13.5885 16.1094 14.1094C15.5885 14.6302 15.3281 15.2604 15.3281 16C15.3281 16.7396 15.5885 17.3698 16.1094 17.8906C16.6302 18.4115 17.2604 18.6719 18 18.6719C18.7396 18.6719 19.3698 18.4115 19.8906 17.8906C20.4115 17.3698 20.6719 16.7396 20.6719 16C20.6719 15.2604 20.4115 14.6302 19.8906 14.1094C19.3698 13.5885 18.7396 13.3281 18 13.3281ZM18 17.3281C17.6354 17.3281 17.3229 17.1979 17.0625 16.9375C16.8021 16.6771 16.6719 16.3646 16.6719 16C16.6719 15.6354 16.8021 15.3229 17.0625 15.0625C17.3229 14.8021 17.6354 14.6719 18 14.6719C18.3646 14.6719 18.6771 14.8021 18.9375 15.0625C19.1979 15.3229 19.3281 15.6354 19.3281 16C19.3281 16.3646 19.1979 16.6771 18.9375 16.9375C18.6771 17.1979 18.3646 17.3281 18 17.3281Z" fill="white"/>\n</svg>\n'),scaledSize:new t.maps.Size(30,30)}}),this.searchable){const i=new t.maps.places.SearchBox(this.searchInput);t.maps.event.addListener(i,"places_changed",(()=>{const t=i.getPlaces();t.length>0&&this.map&&(this.map.setCenter(t[0].geometry.location),this.lat=t[0].geometry.location.lat(),this.lng=t[0].geometry.location.lng(),this.marker.setPosition(t[0].geometry.location),this.searchInputValue=t[0].formatted_address,this.formattedAddress=t[0].formatted_address)}))}t.maps.event.addListener(this.map,"click",(t=>{this.readonly||(this.marker.setPosition(t.latLng),this.lat=t.latLng.lat(),this.lng=t.latLng.lng(),this.getPositionAddress(t.latLng),this.mapClicked.emit({lat:t.latLng.lat(),lng:t.latLng.lng(),address:this.formattedAddress?this.formattedAddress:null}))})),this.lat||this.lng||(this.getCurrentLocation(),this.geolocationError&&(this.map.setCenter({lat:this.lat,lng:this.lng}),this.marker.setPosition({lat:this.lat,lng:this.lng})))}))}getCurrentLocation(){navigator.geolocation&&this.map?navigator.geolocation.getCurrentPosition((t=>{const i={center:new google.maps.LatLng(t.coords.latitude,t.coords.longitude),zoom:15};this.map.setOptions(i),this.marker.setPosition(i.center),this.getPositionAddress(i.center),this.lat=t.coords.latitude,this.lng=t.coords.longitude,this.currentLocationChanged.emit({lat:t.coords.latitude,lng:t.coords.longitude,address:this.formattedAddress?this.formattedAddress:null})}),this.handleLocationError.bind(this)):(salla.log("Geolocation is not supported by this browser."),this.geolocationError=!0)}handleLocationError(t){switch(this.geolocationError=!0,t.code){case t.PERMISSION_DENIED:salla.log("User denied the request for Geolocation.");break;case t.POSITION_UNAVAILABLE:salla.log("Location information is unavailable.");break;case t.TIMEOUT:salla.log("The request to get user location timed out.");break;case t.UNKNOWN_ERROR:salla.log("An unknown error occurred.")}}componentDidLoad(){this.lat&&this.lng&&fetch(`https://maps.googleapis.com/maps/api/geocode/json?latlng=${this.lat},${this.lng}&key=${this.apiKey}&language=${salla.config.get("user.language_code")||document.documentElement.lang||"ar"}`).then((t=>t.json())).then((t=>{"OK"===t.status&&(this.formattedAddress=t.results[0].formatted_address,this.searchInputValue=t.results[0].formatted_address,this.searchInput.value=t.results[0].formatted_address,this.selectedLng=this.lng,this.selectedLat=this.lat)})),this.mapInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.mapInput.addEventListener("input",(()=>{this.mapInput.setCustomValidity(""),this.mapInput.reportValidity()}))}async open(){return this.map||this.initGoogleMaps({libraries:this.searchable?["places","search"]:[],language:salla.config.get("user.language_code")||document.documentElement.lang||"ar"},this.mapElement),await this.locationModal.open()}getLocationModal(){return i("div",null,i("div",{class:"s-map-modal-title"},this.modalTitle?this.modalTitle:this.modalActivityTitle),i("div",{class:"s-map-modal-body"},i("div",{class:"s-map-element",ref:t=>this.mapElement=t}),this.readonly?"":[this.searchable&&i("div",{class:"s-map-search-wrapper"},i("input",{class:"s-map-search-input",ref:t=>this.searchInput=t,placeholder:this.searchPlaceholder})),i("salla-button",{class:"s-map-my-location-button",onClick:()=>{this.getCurrentLocation()},shape:"icon",color:"primary"},i("span",{innerHTML:'\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>location-target</title>\n<path d="M16 9.333c-3.676 0-6.667 2.991-6.667 6.667s2.991 6.667 6.667 6.667 6.667-2.991 6.667-6.667-2.991-6.667-6.667-6.667zM16 20c-2.205 0-4-1.795-4-4s1.795-4 4-4 4 1.795 4 4-1.795 4-4 4zM30.667 14.667h-1.401c-0.627-6.289-5.643-11.305-11.932-11.932v-1.401c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.401c-6.289 0.627-11.305 5.643-11.932 11.932h-1.401c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h1.401c0.628 6.289 5.643 11.305 11.932 11.932v1.401c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-1.401c6.289-0.628 11.305-5.643 11.932-11.932h1.401c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333zM16 26.667c-5.881 0-10.667-4.785-10.667-10.667s4.785-10.667 10.667-10.667 10.667 4.785 10.667 10.667-4.785 10.667-10.667 10.667z"></path>\n</svg>\n'})),i("salla-button",{class:"s-map-submit-button",color:"primary",width:"wide",onClick:()=>{let t={lat:this.lat,lng:this.lng,address:this.formattedAddress?this.formattedAddress:null};salla.event.emit("salla-map::selected",t),this.selected.emit(t),this.selectedLat=t.lat,this.selectedLng=t.lng,this.getPositionAddress(new google.maps.LatLng(t.lat,t.lng),!0),this.mapInput.value=this.selectedLat&&this.selectedLng?`${this.selectedLat}, ${this.selectedLng}`:null,this.mapInput.dispatchEvent(new window.Event("change",{bubbles:!0})),this.locationModal.close()}},this.confirmButtonTitle)]))}render(){return i(e,{key:"4493051dec9a6e1dfd97037f913832badb001588",class:"s-map-wrapper"},i("salla-modal",{key:"5e492140d308e80f3a0572906e26a2750affd7ea",class:"s-map-modal-wrapper",noPadding:!0,ref:t=>{this.locationModal=t}},this.getLocationModal()),i("slot",{key:"c631ddacaa4d957d35f224137769669645841ef4",name:"button"},i("salla-button",{key:"2e6f39c033be6327460362a80b9b6be8a99cce75",onClick:()=>{this.open()},color:"primary",class:"s-map-location-button"},i("span",{key:"88371c09fa3aece12575e6759470279267d828be",class:"s-map-location-icon",innerHTML:this.formattedAddress?'\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>edit</title>\n<path d="M30.583 1.417c-1.828-1.829-5.019-1.829-6.847 0l-13.396 13.396c-0.161 0.161-0.279 0.361-0.341 0.581l-1.949 6.911c-0.131 0.464 0 0.964 0.341 1.305 0.253 0.252 0.593 0.389 0.943 0.389 0.121 0 0.243-0.016 0.361-0.051l6.911-1.949c0.22-0.061 0.419-0.179 0.581-0.34l10.455-10.453s0 0 0 0l2.941-2.941c1.887-1.888 1.887-4.96 0-6.848zM15.547 19.528l-4.284 1.208 1.208-4.284 9.265-9.265 3.076 3.076zM28.696 6.38l-1.999 1.999-3.076-3.076 1.999-1.999c0.849-0.848 2.227-0.848 3.076 0 0.848 0.848 0.848 2.227 0 3.076zM24 20c-0.737 0-1.333 0.597-1.333 1.333v4c0 2.205-1.795 4-4 4h-12c-2.205 0-4-1.795-4-4v-12c0-2.205 1.795-4 4-4h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-4c-3.676 0-6.667 2.991-6.667 6.667v12c0 3.676 2.991 6.667 6.667 6.667h12c3.676 0 6.667-2.991 6.667-6.667v-4c0-0.736-0.596-1.333-1.333-1.333z"></path>\n</svg>\n':'\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>location</title>\n<path d="M16.001 0c-7.879 0-12.001 6.204-12.001 12.333 0 5.813 9.853 17.833 10.976 19.185 0.253 0.305 0.629 0.481 1.025 0.481s0.772-0.176 1.027-0.481c1.121-1.352 10.972-13.372 10.972-19.185 0-6.129-4.121-12.333-11.999-12.333zM16.001 28.549c-3.32-4.184-9.335-12.527-9.335-16.216 0-4.656 2.92-9.667 9.335-9.667 6.412 0 9.332 5.011 9.332 9.667 0 3.689-6.013 12.032-9.332 16.216zM16 6.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16 14.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}),this.formattedAddress?i("div",null,this.locateButtonEdit," | ",this.formatAddress(this.formattedAddress)):this.locateButtonTitle)),i("input",{key:"bae03eb7d7f756f3b92b5eee56c7dc0f366aee74",class:"s-hidden",name:this.name,required:this.required,value:this.getLatLng(),ref:t=>this.mapInput=t}))}get host(){return s(this)}};gt.style="";const mt=class{constructor(i){t(this,i),this.source="header",this.useReactLink=!1,this.menus=[]}async componentWillLoad(){return salla.onReady((()=>{if(this.displayAllText=salla.lang.get("blocks.home.display_all"),!this.sourceValue||"json"!==this.source)return this.getMenuItems();this.menus="string"==typeof this.sourceValue?JSON.parse(this.sourceValue):this.sourceValue||[]}))}getMenuItems(){return salla.api.component.getMenus(this.source).then((({data:t})=>{this.menus=t})).catch((t=>{salla.logger.error("salla-menu::Error fetching menus",t)}))}hasChildren(t){return t?.children?.length>0}hasProducts(t){return t?.products?.length>0}getDesktopClasses(t,i){return`!hidden lg:!block ${i?"root-level lg:!inline-block":"relative"} ${t.products?" mega-menu":""}\n ${this.hasChildren(t)?"has-children":""}`}getAttributes(t){return t.trim().split(" ").reduce(((t,i)=>{let[e,s]=i.split("=");return t[e]=s.replace(/"/g,""),t}),{})}getMobileMenu(t,e){const s=t.image?i("img",{src:t.image,class:"rounded-full",width:"48",height:"48",alt:t.title}):null;return i("li",{class:"lg:hidden text-sm font-bold",...this.getAttributes(t.attrs)},this.hasChildren(t)?i(o,null,i("span",{class:t.image?"!py-3":""},s,t.title),i("ul",null,i("li",{class:"text-sm font-bold"},i("a",{href:t.url,class:"text-gray-500"},e)),t.children.map((t=>this.getMobileMenu(t,e))))):i("a",{href:t.url,"aria-label":t.title||"category",class:"text-gray-500 "+(t.image?"!py-3":""),...this.getAttributes(t.link_attrs)},s,i("span",null,t.title||"")))}getDesktopMenu(t,e){return i("li",{class:this.getDesktopClasses(t,e),...this.getAttributes(t.attrs)},i("a",{href:t.url,"aria-label":t.title||"category",...this.getAttributes(t.link_attrs)},i("span",null,t.title)),this.hasChildren(t)?i("div",{class:"sub-menu shadow-default "+(this.hasProducts(t)?"w-full left-0 flex":"w-56")},i("ul",{class:this.hasProducts(t)?"w-56 shrink-0 m-8 rtl:ml-0 ltr:mr-0":""},t.children.map((t=>this.getDesktopMenu(t,!1)))),this.hasProducts(t)?i("salla-products-list",{source:"selected","shadow-on-hover":!0,"source-value":`[${t.products}]`}):null):null)}getFooterMenu(t){const e=this.topnav||this.limit?t.slice(0,this.limit||3):t;return i("div",null,i("div",{class:{"s-menu-footer-list":!this.topnav,"s-menu-topnav-list":this.topnav}},e.map((t=>i("a",{key:t.id,href:t.url,target:t.target,class:{"s-menu-footer-item":!this.topnav,"s-menu-topnav-item topnav-link-item right-side":this.topnav}},t.title)))))}getHeaderMenu(t){return t.map((t=>[this.getMobileMenu(t,this.displayAllText),this.getDesktopMenu(t,!0)]))}render(){return"footer"===this.source?this.getFooterMenu(this.menus):[i("nav",{key:"main-nav",id:"mobile-menu",class:"mobile-menu"},i("ul",{class:"main-menu"},this.getHeaderMenu(this.menus)),i("button",{class:"btn--close close-mobile-menu sicon-cancel lg:hidden"})),i("button",{key:"close-btn",class:"btn--close-sm close-mobile-menu sicon-cancel hidden"})]}};mt.style=":host{display:block}";const ft=class{constructor(i){t(this,i),this.modalVisibilityChanged=a(this,"modalVisibilityChanged"),this.isClosable=!0,this.width="md",this.position="middle",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("modal::open",(t=>t==this.host.id&&this.open())),salla.event.on("modal::close",(t=>t==this.host.id&&this.close())),this.modalTitle=this.host.getAttribute("modal-title")}handleVisible(t){if(!t)return this.modalVisibilityChanged.emit(!1),void this.toggleModal(!1);this.modalVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleModal(!0)))}handleKeyUp(t){"KeyUp"===t.key&&this.closeModal()}async open(){return this.host.setAttribute("visible",""),this.handleAutoFocus(),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(t){return this.modalTitle=t,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}handleAutoFocus(){const t=this.host.querySelector("input, textarea, select");t&&setTimeout((()=>{t.focus()}),100)}toggleModal(t){const i=this.host.querySelector(".s-modal-body");p.toggleElementClassIf(i,"s-modal-entering","s-modal-leaving",(()=>t)).toggleElementClassIf(this.overlay,"s-modal-entering","s-modal-overlay-leaving",(()=>t)).toggleElementClassIf(document.body,"modal-is-open","modal-is-closed",(()=>t)),t||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeModal(t){this.isClosable&&(salla.event.dispatch("modal::close",{reason:t}),this.host.removeAttribute("visible"))}iconBlockClasses(){return{"s-modal-icon":!0,"s-modal-bg-error":"error"==this.iconStyle,"s-modal-bg-success":"success"==this.iconStyle,"s-modal-bg-normal":!this.iconStyle,"s-modal-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-modal",this.isLoading?i(e,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:t=>this.handleKeyUp(t)},i("div",{class:"s-modal-overlay",ref:t=>this.overlay=t,onClick:()=>this.closeModal("backdropClick")}),i("div",{class:"s-modal-wrapper"},i("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),i("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},i("slot",{name:"loading"},i("salla-loading",null)),i("div",{class:"s-hidden"},i("slot",null))))):i(e,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog"},i("div",{class:"s-modal-overlay",ref:t=>this.overlay=t,onClick:()=>this.closeModal("backdropClick")}),i("div",{class:"s-modal-wrapper"},i("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),i("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},i("div",{class:{"s-modal-header":!0,"s-modal-is-center":this.centered}},this.isClosable?i("button",{class:"s-modal-close",onClick:()=>this.closeModal("closeButtonClick"),type:"button"},i("span",{innerHTML:Q})):"",this.modalTitle||this.subTitle?i("div",{class:"s-modal-header-inner"},i("slot",{name:"icon"},this.iconStyle?i("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?K:X}):""),i("div",{class:"s-modal-header-content"},this.modalTitle?i("div",{class:{"s-modal-title":!0,"s-modal-title-below":this.subTitleFirst},innerHTML:this.modalTitle}):"",this.subTitle?i("p",{class:{"s-modal-sub-title":!0},innerHTML:this.subTitle}):"")):""),i("slot",null),i("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return s(this)}static get watchers(){return{visible:["handleVisible"]}}};ft.style="@media screen and (max-width: 470px){.modal-is-open{position:fixed;width:100%}}";const bt=class{constructor(i){t(this,i),this.parsedSections=[]}parseProducts(t){let i=[];if("string"==typeof t)try{const e=JSON.parse(t);i=this.extractSections(e)}catch(e){console.error("Invalid JSON passed to bundleSections prop:",t),i=[]}else t&&(i=this.extractSections(t));this.parsedSections=i}extractSections(t){return t.bundle&&t.bundle.sections&&Array.isArray(t.bundle.sections)?t.bundle.sections:Array.isArray(t)?t:t.sections&&Array.isArray(t.sections)?t.sections:(console.warn("No valid sections found in data:",t),[])}isCartPage(){return salla.url.is_page("cart")}renderCartPage(){return i("salla-multiple-bundle-product-cart",{sections:this.parsedSections})}renderDetailsPage(){return i("salla-multiple-bundle-product-details",{sections:this.parsedSections})}componentWillLoad(){this.parseProducts(this.bundleSections)}render(){return i(e,{key:"e9b525af3c011566cd15247b5f1eaf274036cd98",class:"s-multiple-bundle-product-wrapper"},this.isCartPage()?this.renderCartPage():this.renderDetailsPage())}static get watchers(){return{bundleSections:["parseProducts"]}}};bt.style=":host{display:block}";const wt=class{constructor(i){t(this,i),this.sections=[],this.itemNumber=""}deleteItem(t,i){const e=this.host.closest("form");if(e){const s=e.getAttribute("id");if(s&&"string"==typeof s){const e=s.match(/item-(\d+)/)?.[1];this.itemNumber=e||"";const a=this.host.querySelector(`#accordion-${i.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${i.id}&section_id=${t}`).then((()=>a?.remove()))}}}renderRemoveButton(t,e,s=!1){return i("salla-button",{type:"button",shape:s?"btn":"icon",fill:s?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,e)},s?salla.lang.get("common.elements.delete"):i("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,e){const s=e?.options&&e?.options?.length>0;return i("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},i("div",{class:"s-multiple-bundle-product-cart-header "+(s?"":"s-multiple-bundle-product-cart-header-no-options")},i("div",{class:"s-multiple-bundle-product-cart-header-content"},i("a",{href:e?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},i("img",{src:e?.image?.url,alt:e?.image?.alt||e?.name,class:"s-multiple-bundle-product-cart-header-image"})),i("div",{class:"s-multiple-bundle-product-cart-header-content-details"},i("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},i("a",{href:e?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},e?.name)),i("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},i("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},i("span",{innerHTML:e?.price?salla.money(e?.price):""})),e?.sale_price>0&&i("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},i("span",{innerHTML:salla.money(e?.sale_price)}))),e?.quantity_in_group>0&&0!==e?.quantity&&i("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},i("span",null,salla.lang.get("pages.products.number_of_pieces")),i("span",null,e?.quantity_in_group)))),!s&&i("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,e,!1))))}render(){return i(e,{key:"38c6c9885f273f77ddffa9141f2274941f8a2e50",class:"s-multiple-bundle-product-wrapper"},i("div",{key:"8e26eb6d1c58d2d86ba7671b0cd0b7fbeccfa90f",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,e)=>t.products.map((s=>{const a={sectionId:t.id,sectionIndex:e,productId:s.id};return i("salla-accordion",{key:s.id,collapsed:!1,bordered:!0,collapsible:!!(s.options&&s.options.length>0),size:"sm",id:`accordion-${s.id}`},i("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),s)),s.options&&s.options.length>0&&i("salla-accordion-body",null,i("salla-product-options",{options:JSON.stringify(s.options),key:`${s.id}-persistent`,"product-id":s.id,"bundle-context":JSON.stringify(a)}),i("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),s,!0))))}))))))}get host(){return s(this)}};wt.style="";const yt=class{constructor(i){t(this,i),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,i)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const e=i.id,s=this.selectedProducts[t].has(e);s?(this.selectedProducts[t].delete(e),this.clearProductFormData(e,t),this.clearProductModalOptions(e,t)):this.selectedProducts[t].add(e),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:i.id,name:i.name,options:i.options,wasSelected:s,isSelected:!s})},this.ensureProductSelected=(t,i)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const e=i.id;this.selectedProducts[t].has(e)||(this.selectedProducts[t].add(e),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:i.id,name:i.name,options:i.options}))},this.onSelectProductOptions=(t,i)=>{const e=this.sections.findIndex((t=>t.id==i)),s=this.sections.find((t=>t.id==i)),a=s?.products?.findIndex((i=>i.id==t.id))??0;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:i,sectionIndex:e,productIndex:a})},this.handleBundleSliderProductSelected=t=>{const{product:i,sectionId:e}=t.detail;this.onSelectProduct(e,i)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:i,sectionId:e}=t.detail;this.onSelectProductOptions(i,e)}}clearProductFormData(t,i){const e=this.host.closest("form");if(i){const s=`bundle[${i}][`;Array.from(e.querySelectorAll("input")).filter((i=>i.getAttribute("data-product-id")===String(t)&&i.name&&i.name.startsWith(s))).forEach((t=>t.remove()))}else e.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,i){let e=null,s=null;if(null!=i&&(e=this.sections.findIndex((t=>t.id==i)),e>-1)){const i=this.sections[e];if(i){const e=i.products?.findIndex((i=>i.id==t));s="number"==typeof e&&e>-1?e:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:i,sectionIndex:e,productIndex:s})}renderAccordionHeader(t,e){return i(o,null,i("h2",{slot:"title"},t?.name),t?.obligatory_products?i("span",{slot:"note"},salla.lang.get("pages.products.obligatory_products",{count:t?.obligatory_products||0})):"",i("span",{slot:"progress"},e,"/",t?.products?.length||0))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:i,sectionId:e,product:s,fromModal:a}=t.detail;a?this.ensureProductSelected(e,s||{id:i}):this.onSelectProduct(e,s||{id:i})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return i(e,{key:"faef370736cdde4ad6b8d1bfce7a5ae80a807f3c",class:"s-multiple-bundle-product-wrapper"},i("div",{key:"66bfb5f5f5736cd7ea37b9e620079c0ec3399685",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,e)=>i("salla-accordion",{key:t.id,collapsed:0!==e},i("salla-accordion-head",null,this.renderAccordionHeader(t,this.selectedProducts[t.id]?.size||0)),i("salla-accordion-body",null,i("salla-multiple-bundle-product-slider",{section:t,sectionIndex:e,selectedProducts:this.selectedProducts,onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),i("salla-multiple-bundle-product-options-modal",{key:"ea258265b6cf53de022afcaeddf5f7c407706156"}))}get host(){return s(this)}};yt.style="";const _t=class{constructor(i){t(this,i),this.optionsSaved=a(this,"optionsSaved"),this.productSelected=a(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[]}generateCacheKey(t,i,e){return`${t||"unknown"}-${i||0}-${e||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const{productId:i,option:e,detail:s}=t.detail,a=this.product?.id?String(this.product.id):null,l=i?String(i):null;a&&l&&a===l&&e&&s&&this.handleOptionChange(Number(a),e,s)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const i=t.target;if(i&&"checkbox"===i.type&&i.name&&i.name.includes("bundle[")&&i.name.includes("][id]")){const t=i.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!i.checked){const[,e,s]=t,a=i.value,l=this.host.closest("form");this.cleanupProductDeselection({sectionId:e,productIndex:parseInt(s,10),productId:a,form:l,uncheckedInput:i})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:i,productIndex:e,productId:s,form:a,uncheckedInput:l}=t;if(this.clearProductOptions(s,i,e),a){const t=`bundle[${i}][${e}]`;Array.from(a.querySelectorAll(`input[name^="${t}"]`)).forEach((i=>{if(i===l)return;const e="hidden"===i.type,a=i.getAttribute("data-product-id")===String(s)&&i.name?.startsWith(t);(e||a)&&i.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});a.dispatchEvent(t)}))}}generateFormInputName(t,i,e){return`bundle[${t}][${i}][options][${e}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,t),e=document.querySelector(`salla-product-options[product-id="${t}"]`);if(e)try{const t=await e.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[i]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,i,e){const s={...this.selectedOptions};if(null==i||null==e||Number.isNaN(e)){const i=`-${String(t)}`,e=[];Object.keys(s).forEach((t=>{t.endsWith(i)&&(delete s[t],e.push(t))})),e.forEach((t=>this.bumpOptionsResetToken(t)))}else{const a=this.generateCacheKey(i,e,t);delete s[a],this.bumpOptionsResetToken(a)}this.selectedOptions=s,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,i,e){const s=this.generateCacheKey(this.sectionId,this.productIndex,t),a=document.querySelector(`salla-product-options[product-id="${t}"]`);let l=[];if(a)try{l=await a.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(l.length>0)this.selectedOptions={...this.selectedOptions,[s]:l};else if(this.selectedOptions[s]&&this.selectedOptions[s].length>0){const t=[...this.selectedOptions[s]||[]],a=t.findIndex((t=>t.option_id===i.id));a>-1?e&&null!=e.id?t[a]={...e,option_id:i.id}:t.splice(a,1):e&&null!=e.id&&t.push({...e,option_id:i.id}),this.selectedOptions={...this.selectedOptions,[s]:t}}else e&&null!=e.id&&(this.selectedOptions={...this.selectedOptions,[s]:[{...e,option_id:i.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],i=this.product.id,e=this.generateCacheKey(this.sectionId,this.productIndex,i),s=document.querySelector(`salla-product-options[product-id="${i}"]`);let a=[];if(s)try{a=await s.getSelectedOptions()||[];const t=this.selectedOptions[e]||[];(t.length>a.length||0===a.length&&t.length>0)&&(a=t)}catch(t){a=this.selectedOptions[e]||[]}else a=this.selectedOptions[e]||[];return 0===a.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((i=>{i.required&&(a.some((t=>t.option_id==i.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:i.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const i=this.product?.id;if(!i)return;const e=this.generateCacheKey(this.sectionId,this.productIndex,i);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${i}"]`);let s=await(t?.getSelectedOptions());if((!s||0===s.length)&&this.selectedOptions[e]?.length>0&&(s=this.selectedOptions[e]),!s||0===s.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[e]:s};const a=this.host.closest("form");if(!a)return void(this.isLoading=!1);const l=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(a.querySelectorAll(`input[name^="${l}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(a.querySelectorAll(`[data-product-id="${i}"][name^="${l}"]`)).forEach((t=>t.remove()));const o=`bundle[${this.sectionId}][${this.productIndex}][id]`,n=document.getElementById(o);if(n)n.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(i),t.dataset.productId=String(i),a.appendChild(t)}s.forEach((t=>{const e=t.option_id,s=document.createElement("input");s.type="hidden",s.name=this.generateFormInputName(this.sectionId,this.productIndex??0,e),s.value=String(t.id),s.dataset.productId=String(i),a.appendChild(s)}));const r=new window.Event("change",{bubbles:!0});a.dispatchEvent(r),this.optionsSaved.emit({productId:Number(i),selectedOptions:s,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(i),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),i=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const e=i.some((i=>i.id===t.id));return{...t,is_selected:e}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),a=this.generateCacheKey(this.sectionId,this.productIndex,t),l=this.optionsResetTokens[a]||0;return i(e,{key:"ce4cec97975d0aef32b50a13237a2d64701d8e9f"},i("salla-modal",{key:"cda08db7768f0b987a9569ca1170b059a58a417e",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"d093204f6d85e7a874e0a69a826869e179aeafa4",slot:"loading"},i("salla-skeleton",{key:"140608027bb0237b62eeb24d1eb5e47c5279c7e3",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"807f2428e8219d9ab6e46163a5d03ad0b2e1b9a3",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesVisibility:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"f287bea52aa1e3c68debd0b68d011025ea3f9157",slot:"items"},this.product?.images&&this.product?.images.map(((t,e)=>i("div",{key:e,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${e+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"5d8064ef63c91a660a3b3267afb29e498ac76f4c",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,e)=>i("div",{key:e,"data-caption":`${this.product?.name} - Image ${e+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${e+1}`,alt:t.alt||`${this.product?.name} - ${e+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${a}-reset-${l}`,"product-id":t,"unique-key":`${a}-reset-${l}`}),i("div",{key:"2f6c7f133ccabd75bbb9e8649c056619ce754296",slot:"footer"},i("div",{key:"1c04908511a480af63fc4e358393514c74967508",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"49fbad4b1e71004dc8fd6df5d0f1a61b1ef25b8d",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:this.isLoading},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return s(this)}static get watchers(){return{product:["handleProductChange"]}}};_t.style=":host{display:block}";const vt=class{constructor(i){t(this,i),this.productSelected=a(this,"productSelected"),this.productOptionsSelected=a(this,"productOptionsSelected"),this.selectedProducts={},this.savedOptionsByInstance={},this.handleProductClick=(t,i)=>{const e=this.generateEventName(this.section.id,i),s=document.getElementById(e);if(s){if(s){const e=!s.checked;e||(this.dispatchClearOptionsEvent(t,i),this.clearSavedOptionsState(this.section.id,i)),s.checked=e,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});s.dispatchEvent(t)}))}this.productSelected.emit({product:t,sectionId:this.section.id})}},this.handleOptionsClick=t=>{this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getProductInstanceKey(t,i){return`${t}::${i}`}dispatchClearOptionsEvent(t,i){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:i})}handleOptionsSaved(t){const i=t.detail;if(!i)return;const{sectionId:e,productIndex:s,selectedOptions:a}=i;if(null==e||e!==this.section?.id)return;if(null==s||Number.isNaN(s))return;const l=this.getProductInstanceKey(e,s);if(a?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[l]:!0};else if(this.savedOptionsByInstance[l]){const t={...this.savedOptionsByInstance};delete t[l],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,i){const e=this.getProductInstanceKey(t,i);if(!this.savedOptionsByInstance[e])return;const s={...this.savedOptionsByInstance};delete s[e],this.savedOptionsByInstance=s}generateEventName(t,i){return`bundle[${t}][${i}][id]`}render(){return i(e,{key:"0aeceebde05ad98ab11016dda3bd65f118b656dc"},i("salla-slider",{key:"0834a28aa149f5ab1c62c173477e0db8936ee32f",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"635d79f8bfb386c60e93536197ad68e937842831",slot:"items"},this?.section?.products?.map(((t,e)=>{const s=this.selectedProducts[this.section.id]?.has(t.id)||!1,a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,e)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let l=salla.config.get("theme.is_rtl",!0)?D:B;return i("div",{class:"s-multiple-bundle-product-slide-one-third "+(0==t.quantity?"s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,e)},i("input",{id:this.generateEventName(this.section.id,e),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:s,name:this.generateEventName(this.section.id,e),value:t.id}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},t.name)),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.sale_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:l})))))})))))}get host(){return s(this)}};vt.style="";const kt=class{constructor(i){t(this,i),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(t=>this.open(t))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(t=>this.open(t))),salla.product.event.onOfferExisted((t=>{salla.storage.get("remember-offer-"+t.id)?salla.log("User selected to don't show this offer again."):this.open(t.product_id)}))}emitPromotionViewed(t){t&&salla.event.emit("promotion::viewed",[{id:t.id?.toString(),creative:t.message,name:t.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(t){t&&salla.event.emit("promotion::clicked",[{id:t.id?.toString(),creative:t.message,name:t.name,position:`${this.offer_type}_offer_modal`}])}async open(t){return this.productID=t,this.hasError=!1,this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.offers(t))).then((t=>this.showOffer(t.data[0]))).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>setTimeout((()=>this.modal.stopLoading()),1e3)))}async showOffer(t){this.offer=t,this.offer_name=t.name,this.offer_message=t.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length&&(this.offer_type="categories"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(t){salla.storage.set("remember-offer-"+this.offer.id,t.target.checked)}addToCart(t){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,t,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return i("div",{class:"s-offer-modal-discount-table"},i("table",null,i("tbody",null,this.offer.get.discounts_table?.map((t=>i("tr",null,i("td",null,t.text),i("td",{class:"s-offer-modal-discount-table-cell"},i("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(t.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const t=this.offer.get.products?.length||0,e={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,t),spaceBetween:16},1024:{slidesPerView:Math.min(3,t),spaceBetween:16}}};return i("salla-products-slider",{key:(this.offer.get.products?.map((t=>t.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((t=>t.id))||[]).join(",")}]`,"slider-config":JSON.stringify(e)})}return this.offer.get.categories?.length?i("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},i("div",{slot:"items"},this.offer.get.categories.map((t=>i("a",{href:t.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag</title>\n<path d="M28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n').replace(/\{name\}/g,t.name).replace(/\{url\}/g,t.urls.customer)}))))):void 0}render(){return i("salla-modal",{key:"b02cd6b8c4a1c04751c2de3a306141e3968763a0","has-skeleton":!0,"sub-title":this.offer_message,ref:t=>this.modal=t,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},i("div",{key:"c9b9e414107e0c07f67df5b58ffb805d27b97f47",slot:"loading"},i("div",{key:"f13f2d328f4e3e640c6f0e25bcd243b63674dede",class:"s-offer-modal-skeleton"},i("div",{key:"161a274876c65985d9fa60cee6d034c8b40e5bc6",class:"s-offer-modal-skeleton-header"},i("salla-skeleton",{key:"2f856e9c905b2cf79e91b48929598e9ac2a87447",type:"circle",height:"80px",width:"80px"}),i("salla-skeleton",{key:"a736af3fddd6dd8b747e7cc2d644d9b60821fcc1",height:"15px",width:"50%"}),i("salla-skeleton",{key:"f86ed33bdc4dd86dd2ecdef7eff2a9a9153ee84b",height:"10px",width:"30%"})),i("div",{key:"3a901c4c34503323d3401a63fb2ea321eb272240",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>i("div",{class:"s-offer-modal-skeleton-item"},i("salla-skeleton",{height:"9rem"}),i("div",{class:"s-offer-modal-skeleton-item-title"},i("salla-skeleton",{height:"15px",width:"100%"})),i("div",{class:"s-offer-modal-skeleton-item-subtitle"},i("salla-skeleton",{height:"9px",width:"50%"}),i("div",{innerHTML:'\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>cart2</title>\n<path d="M6.845 5.333l-1.905-5.333h-3.607c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333v0h1.727l5.72 16.012c0.569 1.56 2.039 2.654 3.765 2.655h12.133c0.001 0 0.002 0 0.003 0 1.825 0 3.364-1.222 3.845-2.892l0.007-0.028 3.161-13.080zM25.96 17.716c-0.167 0.554-0.672 0.951-1.27 0.951-0.002 0-0.005 0-0.007-0h-12.133c-0.575-0-1.065-0.364-1.252-0.875l-0.003-0.009-3.497-9.783h20.508zM13.333 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM13.333 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0zM24 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM24 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0z"></path>\n</svg>\n'})))))),i("div",{key:"db979f351fbddf7508064633f90b44e6df84b86c",class:"s-offer-modal-skeleton-footer"},i("salla-skeleton",{key:"c88fa86157d68be127fe67546bdb498cdf07fe6c",height:"15px",width:"50%"}),i("salla-skeleton",{key:"c30f40898e2c28e7de57fbb205be287740fe1aa2",height:"15px",width:"30%"})))),this.hasError||null===this.offer?i("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?i("span",{slot:"description"},this.errorMessage):""):[i("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:h}),this.getOfferContent(),i("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?i("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",i("label",{class:"s-offer-modal-remember-label"},i("input",{type:"checkbox",onChange:t=>this.rememberMe(t),class:"s-offer-modal-remember-input"}),"  ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return s(this)}};kt.style=".s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}";const xt=class{constructor(i){t(this,i),this.translationLoaded=!1,this.icon='\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>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return i(e,{key:"547b7d65011d9c7bd6e6869f5696a25f43ecf097",class:this.alignmentClass()},i("div",{key:"1de300f1452db30b4f01d9faaff0e65082405816",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),i("div",{key:"051acd85460d00197e8a262fb5ce1392568fed44",class:"s-placeholder-title"},i("slot",{key:"6ce6ce968005423d9da909a10a394baf2f216d5d",name:"title"},i("span",{key:"f5a25392b23919df87830a30cbee430a3c9bf4c8"},salla.lang.get("common.elements.no_options")))),i("div",{key:"29cb81f664c1d55d8d5e6d625b0252113ca438b8",class:"s-placeholder-description"},i("slot",{key:"bf16d9d8ddfc1c3674ce8068f1bb8016b819d0ba",name:"description"},i("span",{key:"07ec33e7aaf36b729adbc9f3f401e287fe18035c"},salla.lang.get("common.errors.empty_results")))))}};xt.style="";var At='\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>bell-ring</title>\n<path d="M2.667 13.333v-4c0-2.592 0.748-5.107 2.161-7.271 0.404-0.616 0.231-1.443-0.387-1.845-0.616-0.401-1.443-0.228-1.845 0.388-1.699 2.599-2.596 5.617-2.596 8.728v4c0 0.736 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333zM25.333 15.647v-6.313c0-5.147-4.188-9.333-9.333-9.333s-9.333 4.187-9.333 9.333v6.312l-5.157 9.027c-0.236 0.413-0.235 0.92 0.004 1.331 0.239 0.412 0.679 0.664 1.153 0.664h8c0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333h8c0.475 0 0.915-0.252 1.153-0.664 0.239-0.411 0.24-0.917 0.004-1.331zM16 29.333c-1.471 0-2.667-1.196-2.667-2.667h5.333c0 1.472-1.196 2.667-2.667 2.667zM4.965 24l4.193-7.339c0.113-0.2 0.175-0.429 0.175-0.661v-6.667c0-3.676 2.991-6.667 6.667-6.667s6.667 2.991 6.667 6.667v6.667c0 0.232 0.061 0.46 0.176 0.661l4.192 7.339zM29.403 0.603c-0.403-0.616-1.232-0.789-1.845-0.387-0.617 0.403-0.791 1.229-0.387 1.845 1.415 2.165 2.163 4.68 2.163 7.272v4c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-3.112-0.899-6.132-2.597-8.731z"></path>\n</svg>\n';const Mt=class{constructor(i){t(this,i),this.isUser=salla.config.isUser(),this.translationLoaded=!1,this.notifyOptionsAvailability=!1,this.isSubscribed=!1,this.handleSubmitOptions=async()=>{let t={id:this.productId};if(!this.notifyOptionsAvailability)return t;let i=document.querySelector(`salla-product-options[product-id="${this.productId}"]`),e=Object.values(await(i?.getSelectedOptionsData())||{});if(e.length&&!await(i?.reportValidity())){let t=salla.lang.get("common.messages.required_fields");throw salla.error(t),t}return t.options=[],e.forEach((i=>{i&&!isNaN(i)&&t.options.push(Number(i))})),t},this.typing=t=>{const i=t.target.nextElementSibling;t.target.classList.remove("s-has-error"),i?.classList.contains("s-product-availability-error-msg")&&(i.innerText=""),13===t.keyCode&&this.submit()},salla.lang.onLoaded((()=>{this.translationLoaded=!0,this.title_=this.host.title||salla.lang.get("pages.products.notify_availability_title"),this.modal?.setTitle(this.title_)})),this.productId||(this.productId=salla.config.get("page.id")),this.isUser||(this.channelsWatcher(this.channels),this.title_=this.host.title||salla.lang.get("pages.products.notify_availability_title"),this.host.removeAttribute("title"),this.isVisitorSubscribed=this.notifyOptionsAvailability?"":salla.storage.get(`product-${this.productId}-subscribed`))}channelsWatcher(t){this.channels_=t?t.split(","):[]}openModel(){this.handleSubmitOptions().then((t=>t?this.modal.open():null))}async submit(){let t=await this.handleSubmitOptions();if(this.isUser)return salla.api.product.availabilitySubscribe(t).then((()=>this.isSubscribed=!0));if(this.channels_.includes("sms")){let{phone:i,countryCode:e}=await this.mobileInput.getValues();t.country_code=e,t.phone=i}return this.channels_.includes("email")&&""!==this.email.value&&(t.email=this.email.value),await this.validateform(),this.btn.load().then((()=>this.btn.disable())).then((()=>salla.api.product.availabilitySubscribe(t))).then((()=>{if(!this.notifyOptionsAvailability)return salla.storage.set(`product-${this.productId}-subscribed`,!0),void(this.isSubscribed=!0);if(t.options.length){let i=salla.storage.get(`product-${this.productId}-subscribed-options`)||[],e=t.options.join(",");i.includes(e)?salla.log("already subscribed to this options"):(i.push(e),salla.storage.set(`product-${this.productId}-subscribed-options`,i),this.isSubscribed=!0)}})).then((()=>this.btn.stop())).then((()=>this.modal.close())).catch((()=>this.btn.stop()&&this.btn.enable()))}async validateform(){try{if(this.channels_.includes("email")){const t=p.isValidEmail(this.email.value);if(t)return;!t&&this.validateField(this.email,salla.lang.get("common.elements.email_is_valid"))}if(this.channels_.includes("sms")&&await this.mobileInput.isValid())return}catch(t){throw"Please insert required fields"}}validateField(t,i){t.classList.add("s-has-error"),t.nextElementSibling.innerText="* "+i}render(){return i(e,{key:"94979dc80347804a72904cb54f917070e0476489",class:"s-product-availability-wrap"},this.isSubscribed||this.isVisitorSubscribed?i("div",{class:"s-product-availability-subscribed"},i("span",{innerHTML:At,class:"s-product-availability-subs-icon"}),salla.lang.get("pages.products.notify_availability_success")):i("salla-button",{width:"wide",onClick:()=>this.isUser?this.submit():this.openModel()},salla.lang.get("pages.products.notify_availability")),this.isUser||this.isSubscribed||this.isVisitorSubscribed?"":this.renderModal())}renderModal(){return i("salla-modal",{ref:t=>this.modal=t,"modal-title":this.title_,subTitle:salla.lang.get("pages.products.notify_availability_subtitle"),width:"sm"},i("span",{slot:"icon",class:"s-product-availability-header-icon",innerHTML:At}),i("div",{class:"s-product-availability-body"},this.channels_.includes("email")?[i("label",{class:"s-product-availability-label"},salla.lang.get("common.elements.email")),i("input",{class:"s-product-availability-input",onKeyDown:t=>this.typing(t),placeholder:salla.lang.get("common.elements.email_placeholder")||"your@email.com",ref:t=>this.email=t,type:"email"}),i("span",{class:"s-product-availability-error-msg"})]:"",this.channels_.includes("sms")?[i("label",{class:"s-product-availability-label"},salla.lang.get("common.elements.mobile")),i("salla-tel-input",{ref:t=>this.mobileInput=t,onKeyDown:t=>this.typing(t)})]:""),i("div",{slot:"footer",class:"s-product-availability-footer"},i("salla-button",{class:"modal-cancel-btn",width:"wide",color:"light",fill:"outline",onClick:()=>this.modal.close()},salla.lang.get("common.elements.cancel")),i("salla-button",{class:"submit-btn","loader-position":"center",width:"wide",ref:t=>this.btn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.submit"))))}get host(){return s(this)}static get watchers(){return{channels:["channelsWatcher"]}}};Mt.style="";var zt='\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>heart</title>\n<path d="M23.333 2.267c-3.547 0-5.779 1.605-7.333 3.061-1.555-1.456-3.787-3.061-7.333-3.061-5.955 0-8.667 5.045-8.667 9.733 0 8.503 10.147 14.735 15.513 16.841 0.156 0.061 0.321 0.092 0.487 0.092s0.331-0.031 0.487-0.092c5.367-2.107 15.513-8.339 15.513-16.841 0-4.688-2.712-9.733-8.667-9.733zM16 26.161c-5.537-2.309-13.333-7.799-13.333-14.161 0-3.517 1.856-7.067 6-7.067 2.983 0 4.656 1.451 6.384 3.203 0.5 0.508 1.399 0.508 1.899 0 1.728-1.752 3.401-3.203 6.384-3.203 4.144 0 6 3.549 6 7.067 0 6.363-7.796 11.852-13.333 14.161z"></path>\n</svg>\n';const St=class{constructor(i){if(t(this,i),salla.onReady((()=>{this.fitImageHeight=salla.config.get("store.settings.product.fit_type"),salla.wishlist.event.onAdded(((t,i)=>this.toggleFavoriteIcon(!0,i))),salla.wishlist.event.onRemoved(((t,i)=>this.toggleFavoriteIcon(!1,i))),this.placeholder=salla.url.asset(salla.config.get("theme.settings.placeholder"))})),salla.lang.onLoaded((()=>{this.remained=salla.lang.get("pages.products.remained"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.startingPrice=salla.lang.get("pages.products.starting_price"),this.addToCart=salla.lang.get("pages.cart.add_to_cart"),this.outOfStock=salla.lang.get("pages.products.out_of_stock")})),this.product)try{this.productData="object"==typeof this.product?this.product:JSON.parse(this.product)}catch(t){salla.log("Bad json passed via product prop")}}initCircleBar(){let t=this.productData.quantity/(this.productData.quantity>100?2*this.productData.quantity:100)*100;this.pie.querySelector(".s-product-card-content-pie-svg-bar").style.strokeDashoffset=100-t}toggleFavoriteIcon(t=!0,i=null){i&&i!==this.productData.id||this.wishlistBtn?.classList.toggle("s-product-card-wishlist-added",t)}formatDate(t){let i=new Date(t);return`${i.getFullYear()}-${i.getMonth()+1}-${i.getDate()}`}getProductBadge(){return this.productData.promotion_title?i("div",{class:"s-product-card-promotion-title"},this.productData.promotion_title):this.showQuantity&&this.productData?.quantity?i("div",{class:"s-product-card-quantity"},this.remained," ",salla.helpers.number(this.productData?.quantity)):this.showQuantity&&this.productData?.is_out_of_stock?i("div",{class:"s-product-card-out-badge"},this.outOfStock):""}getPriceFormat(t){return t&&0!=t?salla.money(t):salla.config.get("store.settings.product.show_price_as_dash")?"-":""}getProductPrice(){return this.productData.is_on_sale?i("div",{class:"s-product-card-sale-price"},i("h4",{innerHTML:this.getPriceFormat(this.productData.sale_price)}),i("span",{innerHTML:this.getPriceFormat(this.productData?.regular_price)})):this.productData.starting_price?i("div",{class:"s-product-card-starting-price"},i("p",null,this.startingPrice),i("h4",{innerHTML:this.getPriceFormat(this.productData?.starting_price)})):i("h4",{class:"s-product-card-price",innerHTML:this.getPriceFormat(this.productData?.price)})}render(){const t={"s-product-card-entry":!0,"s-product-card-vertical":!this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-horizontal":this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-fit-height":this.fitImageHeight&&!this.isSpecial&&!this.fullImage&&!this.minimal,"s-product-card-special":this.isSpecial,"s-product-card-full-image":this.fullImage,"s-product-card-minimal":this.minimal,"s-product-card-donation":this.productData?.donation,"s-product-card-shadow":this.shadowOnHover,"s-product-card-out-of-stock":this.productData?.is_out_of_stock},s=this.productData?.url?{href:this.productData.url,title:`Learn more about ${this.productData?.name}`}:{};return i(e,{key:"55d26993163d8a0f02afb90bcd2e4775c0917377",id:`product-${this.productData?.id}`,class:t},i("div",{key:"e43d1bc58fa8108fd9472ca4887fab659a3eeccc",class:this.fullImage?"s-product-card-image-full":"s-product-card-image"},i("a",{key:"73d9499d8d61f834aa95278f061c9c891c1d590a",...s},i("img",{key:"be4520c090a16a81078615d6a62affd507da6dd0",class:`s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)?"contain":this.fitImageHeight?this.fitImageHeight:"cover"} lazy`,src:this.placeholder,alt:this.productData?.image?.alt||this.productData?.name,"data-src":this.productData?.image?.url||this.productData?.thumbnail}),this.fullImage||this.minimal?"":this.getProductBadge()),this.fullImage&&i("a",{key:"577b58ab0434c3b473ce2de3f28dc3e8b1c03f99",...s,class:"s-product-card-overlay"}),this.horizontal||this.fullImage?"":i("salla-button",{shape:"icon",fill:"none",color:"light","aria-label":"Add or remove to wishlist",ref:t=>this.wishlistBtn=t,class:"s-product-card-wishlist-btn animated",onClick:()=>salla.wishlist.toggle(this.productData.id)},i("span",{innerHTML:zt}))),i("div",{key:"1593d8c5336cc43e2aa1ba8d5ca7931b67fd9d46",class:"s-product-card-content"},this.isSpecial&&this.productData?.quantity?i("div",{class:"s-product-card-content-pie",ref:t=>this.pie=t},i("span",null,i("b",null,salla.helpers.number(this.productData?.quantity)),this.remained),i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -1 36 34",class:"s-product-card-content-pie-svg"},i("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-base"}),i("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-bar"}))):"",i("div",{key:"a0605f788b05342c259e3f2ad87c8cf48f6d88ee",class:{"s-product-card-content-main":!0,"s-product-card-content-extra-padding":this.isSpecial}},i("h3",{key:"fce73d249c7a0a82bd395d291716c5b96e6b4a5a",class:"s-product-card-content-title"},i("a",{key:"8610e37c9d8cb8cbb74578ae1fa9da3d59852d48",...s},this.productData?.name)),this.productData?.subtitle&&!this.minimal?i("p",{class:"s-product-card-content-subtitle"},this.productData?.subtitle):""),!this.productData?.donation||this.minimal||this.fullImage?"":[i("salla-progress-bar",{donation:this.productData?.donation}),i("div",{class:"s-product-card-donation-input"},this.productData?.donation?.can_donate?[i("label",{htmlFor:"donation-amount"},this.donationAmount," ",i("span",null,"*")),i("input",{type:"text",onInput:t=>{salla.helpers.inputDigitsOnly(t.target),this.addBtn.donatingAmount=t.target.value},id:"donation-amount",name:"donating_amount",class:"s-form-control",placeholder:this.donationAmount})]:"")],i("div",{key:"1d1f7f7eaa467b059f6776d1e6f15d981edd0106",class:{"s-product-card-content-sub":!0,"s-product-card-content-extra-padding":this.isSpecial}},this.getProductPrice(),this.productData?.rating?.stars&&!this.minimal?i("div",{class:"s-product-card-rating"},i("span",{innerHTML:ct}),i("span",null,this.productData.rating.stars)):""),this.isSpecial&&this.productData.discount_ends?i("salla-count-down",{date:this.formatDate(this.productData.discount_ends),"end-of-day":!0,boxed:!0,labeled:!0}):"",this.hideAddBtn?"":i("div",{class:"s-product-card-content-footer"},i("salla-add-product-button",{fill:"outline",width:"wide",ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type},i("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label)),this.horizontal||this.fullImage?i("salla-button",{shape:"icon",fill:"none",color:"light",ref:t=>this.wishlistBtn=t,"aria-label":"Add or remove to wishlist",class:"s-product-card-wishlist-btn animated",onClick:()=>salla.wishlist.toggle(this.productData.id),"data-id":"{{ product.id }}"},i("span",{class:"text-xl",innerHTML:zt})):"")))}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy")),this.productData?.quantity&&this.isSpecial&&this.initCircleBar(),!salla.config.isGuest()&&salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)&&this.toggleFavoriteIcon()}static get assetsDirs(){return["assets"]}get host(){return s(this)}};var Ct,Tt;St.style='.s-product-card-image::before{font-family:"sallaicons";content:"\\ec1f" !important}.s-product-card-content-pie-svg circle{transition:stroke-dashoffset 1s linear;-webkit-transition:stroke-dashoffset 1s linear;-moz-transition:stroke-dashoffset 1s linear;-ms-transition:stroke-dashoffset 1s linear;-o-transition:stroke-dashoffset 1s linear;stroke:#E8EDF2;stroke-width:2px;stroke-linecap:round;fill:none}.s-product-card-content-pie-svg-bar{stroke:var(--color-primary) !important;stroke-dasharray:100 100;stroke-dashoffset:100}',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"}(Ct||(Ct={})),function(t){t.Sar="SAR"}(Tt||(Tt={}));const Pt=class{constructor(e){if(t(this,e),this.changed=a(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=!1,this.selectedOptions=[],this.disableCardValue=!0,this.availableDigitalCardValues=[],this.userInitiatedValidation=!1,this.outSkus=[],this.ignoreDefaultCardValue=!1,this.productId=salla.config.get("page.id"),this.handleDonationOptions=(t,i,e)=>{if("custom"===i&&"input"===e)return salla.helpers.inputDigitsOnly(t.target),void salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});if(t.preventDefault(),t.stopPropagation(),this.isCustomDonation="custom"===t.target.value,this.donationInput){if("custom"===t.target.value?(this.donationInput.value="",this.donationInput.focus()):this.donationInput.value=t.target.value,"custom"===i)return;salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}},this.hideLabel=t=>!(t.type!==Ct.DONATION||!t.donation||t.donation.can_donate),this.getExpireDonationMessage=t=>{if(!t.donation)return;const e=t.donation.target_amount<=t.donation.collected_amount;return i("div",{class:{"s-product-options-donation-message":!0,"s-product-options-donation-completed":e,"s-product-options-donation-expired":!e}},i("p",null,t.donation.target_message),i("span",{innerHTML:e?salla.money(t.donation.target_amount):""}))},this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart"),salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع"),this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")})),this.options)try{return void this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options))}catch(t){salla.log("Bad json passed via options prop")}Array.isArray(this.optionsData)||(salla.log("Options is not an array[] ---\x3e ",this.optionsData),this.setOptionsData([])),this.productId&&!salla.url.is_page("cart")&&salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}async setOptionsData(t){this.optionsData=t;const i=this;this.optionsData[0]?.details?.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>i.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={},i=this.host.getElementSallaData(),e=void 0!==this.bundleContext?this.bundleContext:null;return i.forEach(((i,s)=>{if(e){if(s.startsWith("bundle[")&&s.includes("[options][")){const e=s.split("[options][")[1].replace("]","");t[e]=i}}else s.startsWith("options[")&&(t[s.replace("options[","").replace("]","")]=i)})),t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=!0;for(let e=0;e<t.length;e++)"reportValidity"in t[e]&&!t[e].reportValidity()&&(i=!1);return i}async hasOutOfStockOption(){return this.selectedOptions.some((t=>t.is_out))||this.selectedSkus?.length&&this.selectedSkus?.every((t=>this.outSkus.includes(t)))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const e=t.target.closest(".s-product-options-option");e.classList.contains("s-product-options-option-error")||e.classList.add("s-product-options-option-error"),this.userInitiatedValidation&&!salla.url.is_page("cart")&&this.host.querySelector(".s-product-options-option-error")===e&&this.scrollToElement(e)}scrollToElement(t){t&&t.scrollIntoView({behavior:"smooth",block:"center"})}changedHandler(t,i,e=!0){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const e=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=e}"country"===i.type&&this.handleCountryOptionChange(t,s.detail);const a=t.target.closest(".s-product-options-option");(t.target.value||(i.type===Ct.FILE||i.type===Ct.IMAGE)&&"added"===t.type||i.type===Ct.MAP&&"selected"===t.type&&t.target.lat&&t.target.lng)&&setTimeout((()=>{a.classList.remove("s-product-options-option-error")}),200),i.type===Ct.DONATION&&salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value}),this.setSelectedSkus(),this.handleRequiredMultipleOptions(i);const l=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===Ct.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>t.option_id===s.option.id&&t?.id===s.detail?.id));t>-1?this.selectedOptions.splice(t,1):this.selectedOptions.push({...s.detail,option_id:s.option.id})}else s.detail&&0!==Object.keys(s.detail).length?l>-1?this.selectedOptions[l]={...s.detail,option_id:s.option.id}:this.selectedOptions.push({...s.detail,option_id:s.option.id}):l>-1&&this.selectedOptions.splice(l,1);this.optionsData=this.optionsData.map((t=>t.id===s.option.id?{...t,details:t.details.map((t=>({...t,is_selected:s.option.type===Ct.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number(s.detail?.id),value:s.detail?.value})))}:t)),e&&(this.changed.emit(s),salla.event.emit("product-options::change",s))}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==Ct.MULTIPLE_OPTIONS||!t.required)return;const i=this.host.querySelector(`[data-option-id="${t.id}"]`),e=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!e)))}getLatLng(t,i){return t?t.split(",")["lat"===i?0:1]:""}getDisplayForType(t){return this[`${t.type}Option`]?this[`${t.type}Option`](t):t.type===Ct.COLOR_PICKER?this.colorPickerOption(t):t.type===Ct.MULTIPLE_OPTIONS?this.multipleOptions(t):t.type===Ct.SINGLE_OPTION?this.singleOption(t):t.type===Ct.RADIO?this.radioOption(t):t.type===Ct.DIGITAL_CARD_VALUE?this.digitalCardValuesOption(t):t.type===Ct.COUNTRY?this.countryOption(t):t.type===Ct.BOOKING&&salla.url.is_page("cart")?i("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value}):(salla.log(`Couldn't find options type(${t.type})😢`),"")}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>"digital-code-value"===t));if(!i)throw new Error("product-options:: No digital card options found");const e=Object.keys(t.skus_availability).filter((i=>!1===t.skus_availability[i]));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>e.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation(),this.ignoreDefaultCardValue=!0;const e=this.host.querySelector("input[data-code-value]:checked");if(e&&(e.checked=!1),!this.optionsData.find((({type:t})=>"digital-code-value"===t)))throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected)),e=t.details.find((t=>!!t.is_default))||t.details[0];if(["digital-code-value","country"].includes(t.type))return i||e}async componentWillLoad(){if(salla.url.is_page("cart")&&(this.disableCardValue=!1,this.fillSelectedOptions()),this.config)try{this.optionConfig="string"==typeof this.config?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}if(this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart")){const t=this.optionsData.find((t=>"country"===t.type)),i=t&&this.getSelectedDigitalCardOptions(t);i&&this.getAvailableDigitalCardSKUs(i)}return this.outOfStockText=salla.lang.get("pages.products.out_of_stock"),await salla.onReady(),document.addEventListener("paste",this.handlePaste.bind(this)),!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)))?salla.api.cart.getCurrentCartId(!1,"salla-product-options"):null}handlePaste(t){const i=t.target;if(!Salla.helpers.isAppleDevice()||!(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)||!i.classList.contains("s-form-control"))return;t.preventDefault();const e=t.clipboardData?.getData("text")||"",s=i.selectionStart,a=i.selectionEnd,l=i.value.slice(0,s)+e+i.value.slice(a);i.value=l,i.setSelectionRange(s+e.length,s+e.length);try{i.dispatchEvent(new window.Event("change",{bubbles:!0}))}catch(t){Salla.log("Error on change")}}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===Ct.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){if(0!==this.optionsData?.length)return i(e,{class:"s-product-options-wrapper"},i("salla-conditional-fields",null,this.optionsData.map((t=>i("div",{key:t.id,class:"s-product-options-option-container"+(t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""),"data-option-id":t.id,...this.getOptionShownWhen(t)},"splitter"===t.name?this.splitterOption():i("div",{class:{"s-product-options-option":!0,"s-product-options-option-booking":t.type===Ct.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},i("label",{htmlFor:this.generateInputName(t.id),class:"s-product-options-option-label "+(this.hideLabel(t)?"s-product-options-option-label-hidden":"")},i("b",null,t.name,t.required&&i("span",null," * ")," "),i("small",null,t.placeholder)),i("div",{class:"s-product-options-option-content "+(this.hideLabel(t)||t.type===Ct.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":"")},this.getDisplayForType(t))))))))}generateUniqueKey(t){const i=this.bundleContext;let e=this.uniqueKey?`${t}-${this.uniqueKey}`:t;if(i)try{const t="string"==typeof i?JSON.parse(i):i,{sectionId:s,productId:a}=t;e=`${e}-bundle-${s}-${a}`}catch(t){}return e}generateInputName(t){const i=this.bundleContext;if(i)try{const e="string"==typeof i?JSON.parse(i):i,{sectionId:s,productId:a}=e;return`bundle[${s}][${a}][options][${t}]`}catch(i){return`options[${t}]`}return`options[${t}]`}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const e=i.details.filter((t=>t.is_selected)).map((t=>({...t,option_id:i.id})));return t.concat(e)}),[])}componentDidLoad(){if(0===this.optionsData?.length&&!this.optionsData.some((t=>t.type===Ct.DONATION)))return;const t=this.optionsData.find((t=>t.type===Ct.DONATION))?.details.find((t=>t.is_selected));t&&setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.additional_price})}),1e3)}async enableUserInitiatedValidation(){this.userInitiatedValidation=!0}async validateAndScroll(){return await this.enableUserInitiatedValidation(),this.reportValidity()}donationOption(t,e){return i("div",{class:"s-product-options-donation-wrapper"},t.donation?.can_donate?[t.donation?i("div",{key:t.id,class:"s-product-options-donation-progress"},i("salla-progress-bar",{donation:t.donation})):"",t.details.length?[i("h4",{key:t.id},this.selectAmount),i("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((e,s)=>i("div",{key:t.id,class:"s-product-options-donation-options-item"},i("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:e.is_selected,value:e.additional_price,onChange:t=>this.handleDonationOptions(t,e,"option")}),i("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},i("span",{innerHTML:salla.money(e.name)}))))),t.donation?.custom_amount_enabled?i("div",{class:"s-product-options-donation-options-item"},i("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),i("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},i("span",null," ",this.selectDonationAmount," "))):"")]:"",i("div",{key:t.id,class:{"s-product-options-donation-input-group":!0,shown:!t.details.length||t.details.length&&this.isCustomDonation}},i("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),i("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,e=null){return i("salla-file-upload",{...e||{},"payload-name":"file",value:t.value,"instant-upload":!0,name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":!0,required:t.required}},i("div",{class:"s-product-options-filepond-placeholder"},i("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:e.accept?.split(",").every((t=>t.includes("image")))?g:'\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'}),i("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),i("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return i?.length?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return i("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:this.generateInputName(t.id),placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return i("div",{class:"s-product-options-splitter"})}textOption(t){return i("div",{class:"s-product-options-text"},i("input",{type:"text",value:t.value,maxLength:t?.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:this.generateInputName(t.id),placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return i("div",{class:"s-product-options-textarea"},i("div",{class:"mt-1"},i("textarea",{rows:4,value:t.value,maxLength:t?.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:this.generateUniqueKey(t.id.toString()),name:this.generateInputName(t.id),placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return i("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:this.generateInputName(t.id),searchable:!0,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return i("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return i("salla-datetime-picker",{noCalendar:!0,enableTime:!0,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:this.generateInputName(t.id),class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return i("div",{class:"s-product-options-date-element"},i("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:this.generateInputName(t.id),onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return i("div",{class:"s-product-options-datetime-element"},i("salla-datetime-picker",{enableTime:!0,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:this.generateInputName(t.id),maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=!0,e){let s;return e&&e===Ct.COLOR&&(s=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,!1)}) </p>`:"")),s||(s=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,!1)})`:"")),s.replace("<i class=sicon-sar></i>",salla.config.currency()?.symbol||"ر.س")}isOptionDetailOut(t){if(t.is_out||!t.skus_availability||!this.selectedSkus?.length)return t.is_out;const i=this.selectedOptions.filter((i=>i.id===t.id)).length;if(i&&1===this.selectedOptions.length)return!1;if(i){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,e,s,a,l,o){const n=this.generateUniqueKey(`${t}-${s.id}-${e.id}`),r=this.isOptionDetailOut(e);return i("label",{class:{"s-product-options-disabled":r}},i("input",{id:n,type:t,name:l,value:e.id,disabled:r,required:a,checked:e.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),i("div",{class:{"s-product-options-grid-mode-span":o,"s-product-options-disabled":r}},this.getOptionDetailName(e)))}renderOptionDetails(t,i,e,s=!1){const a=this.generateInputName(i.id),l="radio"===t?a:`${a}[]`;return i?.details.map((a=>this.renderInput(t,a,i,e,l,s)))}renderSelect(t){return i("div",null,i("select",{name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},i("option",{value:""},t.placeholder),t?.details.map((t=>i("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,e,s){return i("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,e,s,!0))}singleOption(t){return"button"===this.optionConfig?.["single-option"]?.type?this.renderButtonStyle("radio",t,!t.visibility_condition&&t.required):this.renderSelect(t)}multipleOptions(t){const e="button"===this.optionConfig?.["multiple-option"]?.type,s=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return e?this.renderButtonStyle("checkbox",t,s):i("div",{class:{"s-product-options-multiple-options-wrapper":!0,required:t.required}},this.renderOptionDetails("checkbox",t,s))}radioOption(t){return this.singleOption(t)}colorOption(t){return i("fieldset",{class:"s-product-options-colors-wrapper"},t?.details.map((e=>i("div",{class:"s-product-options-colors-item",key:e.id},i("input",{type:"radio",value:e.id,required:!t.visibility_condition&&t.required,checked:e.is_selected,name:this.generateInputName(t.id),disabled:this.canDisabled&&this.isOptionDetailOut(e),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${e.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),i("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${e.id}`)},i("span",{style:{backgroundColor:e.color}}),i("div",{innerHTML:this.getOptionDetailName(e,!0,t.type)}))))))}thumbnailOption(t){return i("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((e=>i("div",{key:e.id},i("input",{type:"radio",value:e.id,"data-itemid":e.id,required:!t.visibility_condition&&t.required,checked:e.is_selected,name:this.generateInputName(t.id),"data-img-id":e.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(e),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${e.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),i("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${e.id}`),"data-img-id":e.option_value,class:"go-to-slide"},i("img",{"data-src":e.image,src:e.image,title:e.name,alt:e.name}),i("span",{innerHTML:d,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(e)?[i("small",{key:e.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?i("div",{key:e.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),i("p",null,this.getOptionDetailName(e,!1)," ")))))}digitalCardValuesOption(t){return i("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((e=>{const s=String(e.id);return i("label",{htmlFor:this.generateUniqueKey(s.toString()),key:s,class:"s-product-options-digital-card-option"},i("input",{type:"radio","data-code-value":!0,class:"s-form-control s-product-options-digital-card-input",value:e.id,name:this.generateInputName(t.id),id:this.generateUniqueKey(s.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),...this.ignoreDefaultCardValue?{}:{defaultChecked:this.getSelectedDigitalCardOptions(t)?.id===e.id}}),i("span",null,e.name," ",salla.config?.currency()?.symbol))})):i("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return i("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((e=>i("label",{htmlFor:this.generateUniqueKey(e.id.toString()),key:e.id,class:{"s-product-options-digital-card-option":!0,"s-product-options-digital-card-option-stock-out":e.is_out}},i("input",{id:this.generateUniqueKey(e.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:e.id,name:this.generateInputName(t.id),disabled:e.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=!1},...salla.url.is_page("cart")?{defaultChecked:this.getSelectedDigitalCardOptions(t)?.id===e.id}:{}}),i("img",{loading:"lazy",alt:e.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(e.code).toLocaleLowerCase()}.svg`}),i("span",null,e.name)))))}get host(){return s(this)}};Pt.style="";const It=class{constructor(i){t(this,i),this.hasError=!1,salla.event.on("size-guide::open",(t=>this.open(t))),salla.lang.onLoaded((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}async open(t){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(t))).then((t=>{this.guides=t.data})).catch((t=>{console.log(t),this.hasError=!0,this.placeholder_description=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return i("salla-placeholder",{alignment:"center",iconSize:"xl"},i("div",{slot:"title"},this.placeholder_title),i("div",{slot:"description"},this.placeholder_description))}render(){return i("salla-modal",{key:"e1a4f46c6b2a3b9d06b2cd439a29dae3d3df1e2b",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},i("span",{key:"921988dcf15f88a4382244a710117a30466e51ec",slot:"icon",class:"s-product-size-guide-header-icon",innerHTML:'\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>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),i("div",{key:"7a74a5995882d1d597e3e3ca6594248e03225be9",slot:"loading"},i("div",{key:"c08eaeb646f503f14b1a6bc9e0132970b09c154c",class:"s-product-size-guide-skeleton"},i("salla-skeleton",{key:"b0319b0ac90388145e1db879571680eea3742722",height:"15px",width:"25%"}),i("div",{key:"4cb3620675a3f6ef49a33e35113fbac468578034",class:"s-product-size-guide-skeleton-header"},i("salla-skeleton",{key:"7413b92d0b53d179876bf9938f546819d190b01f",height:"40px"}),i("salla-skeleton",{key:"d4f211c5548045bb4faea5e1e832c784cc85d2d0",height:"40px"}),i("salla-skeleton",{key:"23cb9409fb9f4863e233fdbe86a7ddd89761e7ed",height:"40px"}),i("salla-skeleton",{key:"93f027dbf97b43bcffae29ebfdf5c15c7fa012bf",height:"40px"})),i("div",{key:"494ca32976d92c800c5be8e44f26cb972f8cf1e0",class:"s-product-size-guide-skeleton-content"},i("salla-skeleton",{key:"9889791d8bba3e58c6315e5d76b6536ef14ac29d",height:"15px",width:"25%"}),i("salla-skeleton",{key:"e607037bbcab29681ffe47424b9566fcf32e7a58",height:"10px",width:"75%"}),i("salla-skeleton",{key:"9eedac50c162985e5c49b6e5b56c4ad86e86c5a6",height:"10px",width:"50%"}),i("salla-skeleton",{key:"9b189d240da2d519a4b0586bb827fd79d9021e3e",height:"10px",width:"75%"}),i("salla-skeleton",{key:"b9341d1249c837d8b8a71b1c9c8793521c49808d",height:"10px",width:"100%"}),i("salla-skeleton",{key:"c57270b467abbdae57a1a1389b4df6853b2de586",height:"10px",width:"25%"}),i("salla-skeleton",{key:"e0d9e3646ffbd28ccf5c93fa99bb294b93f597e7",height:"10px",width:"60%"}),i("salla-skeleton",{key:"20bed29a322cfe01caf9b2c1c49c0d6b2be7afc5",height:"10px",width:"45%"}),i("salla-skeleton",{key:"132d3aee12bad2b3b84b769742c758854498a5b1",height:"10px",width:"30%"})))),i("slot",{key:"008b024c1d8daea0b17f184eda43eaab3d72069a",name:"header"}),!this.hasError&&this.guides?[i("salla-tabs",null,this.guides.map((t=>i("salla-tab-header",{slot:"header",name:t.name},i("span",null,t.name)))),this.guides.map((t=>i("salla-tab-content",{slot:"content",name:t.name},i("div",{innerHTML:t.description})))))]:this.showPlaceholder(),i("slot",{key:"6aedc0d9ac633fe98c6475d2375d59ef761cc64e",name:"footer"}))}get host(){return s(this)}};It.style="";const Lt=class{constructor(i){t(this,i),this.productsFetched=a(this,"productsFetched"),this.autoload=!1,this.productCardComponent="custom-salla-product-card",this.page=1,this.placeholderText=salla.lang.get("pages.categories.no_products"),this.endOfText=salla.lang.get("common.elements.end_of_content"),this.failedLoadMore=salla.lang.get("common.elements.failed_to_load_more"),this.currentPage=salla.config.get("page"),this.filtersSnapshot=[],this.lastViewedProductKey="lastViewedProductId",this.filtersKey="filters",this.infiniteScrollStateKey="infiniteScrollState",this.prevCategoryIdKey="prevCategoryId",this.isProcessing=!1,this.scrollTimeout=null,this.specialPagesWithoutIds={"product.index.latest":"latest","product.index.offers":"offers","product.index.search":"search","product.index.sales":"sales"},this.includes=p.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),p.setIncludes(this.includes),salla.lang.onLoaded((()=>{this.placeholderText=salla.lang.get("pages.categories.no_products"),this.endOfText=salla.lang.get("common.elements.end_of_content"),this.failedLoadMore=salla.lang.get("common.elements.failed_to_load_more"),this.currentPage=salla.config.get("page")}))}connectedCallback(){"scrollRestoration"in history&&(history.scrollRestoration="manual"),window.addEventListener("DOMContentLoaded",this.scrollToLastViewedProduct.bind(this)),salla.event.on("salla-filters::changed",(t=>this.setFilters(t)))}disconnectedCallback(){window.removeEventListener("DOMContentLoaded",this.scrollToLastViewedProduct)}async setFilters(t){if(t&&JSON.stringify(t)!==JSON.stringify(this.parsedFilters))return window.scrollTo({top:0,behavior:"smooth"}),this.parsedFilters=JSON.parse(JSON.stringify(t)),this.filtersSnapshot=this.parsedFilters,"product.index"==this.currentPage?.slug&&this.parsedFilters&&this.parsedFilters.category_id&&(this.currentCategoryIdFilter=[this.parsedFilters.category_id]),this.reload()}async reload(){!this.autoload&&this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="none"),this.hasInfiniteScroll&&salla.infiniteScroll.destroy(this.infiniteScroll),this.buildNextPageUrl(),this.wrapper.innerHTML="",this.hasInfiniteScroll?this.init():this.getInitialData(),this.showPlaceholder&&(this.showPlaceholder=!1,this.placeholderLoader=document.createElement("div"),this.placeholderLoader.classList.add("s-products-list-loading-wrapper"),this.placeholderLoader.style.display="inherit",this.placeholderLoader.innerHTML='<span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"></span>',this.host.insertAdjacentElement("afterend",this.placeholderLoader))}isFilterable(){return salla.config.get("store.settings.product.filters")&&this.filtersResults}isSourceWithoutValue(){return["offers","latest","sales","wishlist","top-rated","reorder"].includes(this.getSource())}animateItems(){r({targets:"salla-products-list salla-product-card",opacity:[0,1],duration:1200,translateY:[20,0],delay:function(t,i){return 100*i}})}initBaseNextPageUrl(t){this.nextPage=salla.url.api(`products?source=${t}`),this.includes?.length&&(this.nextPage+=`&includes[]=${this.includes.join("&includes[]=")}`),this.limit&&(this.nextPage+=`&per_page=${this.limit>32?32:this.limit}`),this.sortBy&&(this.nextPage+=`&sort=${this.sortBy}`),"preview"===salla.config.get("theme.mode")&&(this.nextPage+="&use_username_url=1"),this.nextPage+="&filterable=1";for(const[t,i]of Object.entries(this.parsedFilters||{}))if(["string","number"].includes(typeof i))this.nextPage+=`&filters[${encodeURIComponent(t)}]=${encodeURIComponent(i)}`;else if(Array.isArray(i))i.forEach((i=>this.nextPage+=`&filters[${encodeURIComponent(t)}][]=${encodeURIComponent(i)}`));else if("object"==typeof i)for(const[e,s]of Object.entries(i))this.nextPage+=`&filters[${encodeURIComponent(t)}][${encodeURIComponent(e)}]=${encodeURIComponent(s)}`}buildNextPageUrl(){let t=this.getSource();if("json"===t)return;const i=sessionStorage.getItem(this.infiniteScrollStateKey);if(i){const{nextPage:t}=JSON.parse(i);if(!t)return}if(this.initBaseNextPageUrl(t),!this.isSourceWithoutValue())if(["search","related","landing-page"].includes(t))this.nextPage+=`&source_value=${this.getSourceValue()}`;else try{this.nextPage+=`&source_value[]=${this.getSourceValue().join("&source_value[]=")}`}catch(i){salla.logger.warn(`source-value prop should be array of ids ex source-value="[1,2,3]" for the source [${t}]`),this.sourceValueIsValid=!1}}loading(t=!0,i=!1){if(t){let t=i&&!this.autoload?this.btnLoader:this.loader;t&&(t.style.display="inherit")}else this.autoload||this.btnLoader&&(this.btnLoader.style.display="none"),this.loader&&(this.loader.style.display="none")}getItemHTML(t){"landing-page"===this.getSource()&&(t.url="");const i=document.createElement(this.hasCustomComponent?this.productCardComponent:"salla-product-card");return i.product=t,this.applyLandingPageStyles(i),this.applyHorizontalCardStyles(i),i.addEventListener("click",(i=>{this.hasInfiniteScroll&&i.target.closest("a")&&(this.takeStateSnapshot(),sessionStorage.setItem(this.lastViewedProductKey,t.id))})),i}applyLandingPageStyles(t){"landing-page"!==this.getSource()||this.hasCustomComponent||(t.toggleAttribute("hide-add-btn",!0),t.classList.add("s-product-card-fit-height"))}applyHorizontalCardStyles(t){this.horizontalCards&&(t.setAttribute("horizontal",!0),this.hasCustomComponent||t.setAttribute("shadow-on-hover",!0))}waitForResizing(t){let i=null;return new Promise((e=>{const s=new ResizeObserver((()=>{clearTimeout(i),i=setTimeout((()=>{s.disconnect(),e(null)}),160)}));s.observe(t)}))}waitForLayoutStable(t){let i=null;return new Promise((e=>{const s=new MutationObserver((()=>{clearTimeout(i),i=setTimeout((()=>{s.disconnect(),e(null)}),160)}));s.observe(t,{childList:!0,subtree:!0,attributes:!0})}))}async waitForStableLayout(t){return await Promise.allSettled([this.waitForResizing(t),this.waitForLayoutStable(t)])}scrollToLastViewedProduct(){const t=sessionStorage.getItem(this.lastViewedProductKey);t&&!salla.url.is_page("product.single")&&this.isElementLoaded(`[id*="${t}"]`).then((()=>{const i=this.wrapper?.querySelector(`[id*="${t}"]`);if(!i)return;const e=()=>{const t=()=>{i.scrollIntoView({block:"start",behavior:"instant"});const t=matchMedia("(max-width: 1024px)").matches?"header .inner":"ul.main-menu",e=window?.header_is_sticky?document.querySelector(t)?.getBoundingClientRect()?.height??56:0,s=parseInt(getComputedStyle(this.wrapper).rowGap)??16;scrollBy({top:-1*(e+s),behavior:"instant"})};requestAnimationFrame(t),i.querySelectorAll("img.lazy").forEach((i=>{const e=i,s=()=>{requestAnimationFrame(t),e.onload=e.onerror=null};e.onload=s,e.onerror=s})),this.removeScrollRestorationSession()};this.waitForStableLayout(this.host).then((()=>requestAnimationFrame(e)))}))}isElementLoaded(t){return new Promise((i=>{const e=setInterval((()=>{if(document.querySelector(t))return clearInterval(e),i(document.querySelector(t))}),50)}))}takeStateSnapshot(){const t=[];for(let i=0;i<this.wrapper.children.length;i++){const e=this.wrapper.children?.[i];t.push(e.product)}const i={pageIndex:Math.max((this.infiniteScroll?.pageIndex??1)-1,1),nextPage:this.nextPage,currentPageData:t};if(this.isFilterable()){const t=sessionStorage.getItem(this.filtersKey);sessionStorage.setItem(this.filtersKey,t||JSON.stringify(this.filtersSnapshot))}sessionStorage.setItem(this.infiniteScrollStateKey,JSON.stringify(i));let e=salla.config.get("page.id");const s=Object.keys(this.specialPagesWithoutIds).find((t=>salla.url.is_page(t)));s?e=this.specialPagesWithoutIds[s]:null!==e&&(e=String(e)),sessionStorage.setItem(this.prevCategoryIdKey,e)}removeScrollRestorationSession(){this.isFilterable()||sessionStorage.removeItem(this.filtersKey),sessionStorage.removeItem(this.infiniteScrollStateKey),sessionStorage.removeItem(this.lastViewedProductKey),sessionStorage.removeItem(this.prevCategoryIdKey)}loadStoredScrollState(){const t=sessionStorage.getItem(this.infiniteScrollStateKey),i=sessionStorage.getItem(this.filtersKey),e=sessionStorage.getItem(this.prevCategoryIdKey),s=this.specialPagesWithoutIds[salla.config.get("page.slug")]||null,a=salla.config.get("page.id"),l=salla.url.is_page("index"),o=salla.url.is_page("product.single"),n=s?e!==s:e!==String(a);if(e&&n&&!l&&!o||l&&!this.hasInfiniteScroll)return this.removeScrollRestorationSession(),this.switchToNormalBehavior=!0,!1;if(o)return this.switchToNormalBehavior=!0,!1;if(t)try{const{pageIndex:e,nextPage:s,currentPageData:a}=JSON.parse(t);if("undefined"!==i){const t=JSON.parse(i);salla.event.emit("filters::fetched",{filters:t})}this.page=e,this.nextPage=s;for(let t=0;t<a.length;t++)this.wrapper.append(this.getItemHTML(a?.[t]));return!0}catch(t){console.error("Failed to load stored scroll state:",t),this.removeScrollRestorationSession()}return!1}getSource(){return p.getProductsSource(this.source)}getSourceValue(){return this.currentCategoryIdFilter?this.currentCategoryIdFilter:p.getProductsSourceValue(this.source,this.sourceValue)}appendDataLayer(t){"object"==typeof dataLayer&&Array.isArray(dataLayer)&&dataLayer.push({event:"impressions",ecommerce:{currencyCode:salla.config.currency().code,impressions:t.map(((t,i)=>({id:t.id,name:t.name,price:t.price,brand:t.brand?.name||"",quantity:t.quantity,categories:[{name:t.category?.name||salla.config.get("page.title"),id:salla.config.get("page.id")}],category:t.category?.name||salla.config.get("page.title"),position:i+1})))}})}initiateInfiniteScroll(){if(!this.hasInfiniteScroll)return;const t=this.autoload&&this.includes&&this.includes.length>0;this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!t&&!!this.autoload&&100,loadOnScroll:!t&&this.autoload},!0),this.infiniteScroll.pageIndex=this.page,this.infiniteScroll?.on("request",(()=>{this.loading(!0,!this.autoload)})),t&&window.addEventListener("scroll",this.handleScroll.bind(this)),this.infiniteScroll?.on("load",(async t=>{if(!this.isProcessing){this.isProcessing=!0;try{if(!t.data?.length&&2===this.infiniteScroll.pageIndex)return this.showPlaceholder=!0,salla.infiniteScroll.destroy(this.infiniteScroll),this.loading(!1),void(this.placeholderLoader&&this.placeholderLoader.remove());this.includes&&await this.injectAndProcessData(t);const i=this.handleResponse(t);this.infiniteScroll.appendItems(i),2===this.infiniteScroll.pageIndex&&(!this.autoload&&this.nextPage&&(this.loadMoreWrapper.style.display="block"),this.animateItems())}catch(t){console.error("Error during load:",t)}finally{this.isProcessing=!1}}})),this.infiniteScroll?.on("error",(()=>{console.log("Error occurred during request"),this.status.querySelector(".s-infinite-scroll-error").classList.remove("s-hidden"),this.placeholderLoader&&this.placeholderLoader.remove(),this.loading(!1),this.isProcessing=!1})),salla.onReady((()=>{sessionStorage.getItem(this.infiniteScrollStateKey)||this.manualLoadNextPage()}))}handleScroll(){this.isProcessing||this.scrollTimeout||(this.scrollTimeout=setTimeout((()=>{this.scrollTimeout=null;const t=this.wrapper.getBoundingClientRect(),i=window.innerHeight;t.bottom-i<=200&&!this.isProcessing&&this.nextPage&&this.manualLoadNextPage()}),200))}manualLoadNextPage(){this.nextPage&&this.infiniteScroll.loadNextPage()}async injectAndProcessData(t){try{await p.injectExtraFieldsToResponse(t)}catch(t){console.error("Error injecting data:",t)}}getInitialData(){return this.loading(),salla.product.api.fetch({source:this.getSource(),source_value:this.getSourceValue(),limit:this.limit}).then((async t=>t.data.length?(await p.injectExtraFieldsToResponse(t),this.firstPageResponse?void this.handleResponse(t).forEach((t=>this.wrapper.append(t))):(this.firstPageResponse=t,void(this.nextPage=t.cursor?t.cursor.next:this.nextPage))):(this.showPlaceholder=!0,this.placeholderLoader&&this.placeholderLoader.remove(),void this.loading(!1))))}async loadMore(){this.infiniteScroll?.loadNextPage()}componentWillLoad(){return salla.onReady().then((()=>{this.hasCustomComponent=!!customElements.get(this.productCardComponent),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.hasInfiniteScroll=!["json","selected","related","landing-page"].includes(this.getSource())&&!this.limit;let t=new URLSearchParams(window.location.search);try{this.sortBy=this.sortBy||t.get("sort")||t.get("by"),this.parsedFilters=p.extractFiltersFromUrl(t),this.parsedFilters&&this.parsedFilters.category_id&&(this.currentCategoryIdFilter=[this.parsedFilters.category_id])}catch(t){salla.logger.warn("failed to get filters from url",t.message)}if(this.buildNextPageUrl(),this.isReady=!0,!sessionStorage.getItem(this.infiniteScrollStateKey))if(this.sourceValueIsValid){if(!this.hasInfiniteScroll){if("json"===this.getSource())return this.getSourceValue().length?void setTimeout((()=>{this.getSourceValue().map((t=>this.wrapper.append(this.getItemHTML(t))))})):void(this.showPlaceholder=!0);if("selected"!==this.getSource()||this.getSourceValue().length)return this.getInitialData();this.showPlaceholder=!0}}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}async componentDidLoad(){this.hasInfiniteScroll&&this.init(),await Salla.hooks.registerComponent("salla-products-list",this),this.loadStoredScrollState()?(this.autoload?!this.nextPage&&this.loading(!1):this.nextPage?this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="block"):(this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="none"),this.status.querySelector(".s-infinite-scroll-last").classList.remove("s-hidden")),this.scrollToLastViewedProduct()):!this.firstPageResponse&&this.switchToNormalBehavior?this.getInitialData().then((()=>{this.firstPageResponse?(this.handleResponse(this.firstPageResponse,!1).forEach((t=>{this.wrapper.append(t)})),setTimeout((()=>{if(!this.autoload&&this.nextPage&&1==this.infiniteScroll.pageIndex){const t=this.host.querySelector(".s-infinite-scroll-wrapper");t&&(t.style.display="block")}}))):console.error("No response received after getInitialData.")})).catch((t=>{console.error("Error during initial data fetch:",t)})):this.firstPageResponse&&this.handleResponse(this.firstPageResponse,!1).forEach((t=>this.wrapper.append(t)))}canRender(){return this.sourceValueIsValid&&this.isReady}render(){return this.canRender()?this.showPlaceholder?i("div",{class:"s-products-list-placeholder"},i("span",{innerHTML:f}),i("p",null,this.placeholderText)):i(e,{class:"s-products-list"},i("div",{class:{"s-products-list-wrapper":!0,"s-products-list-horizontal-cards":this.horizontalCards&&!this.filtersResults,"s-products-list-vertical-cards":!this.horizontalCards&&!this.rowCards&&!this.filtersResults,"s-products-list-row-cards":this.rowCards,"s-products-list-filters-results":this.filtersResults},ref:t=>this.wrapper=t}),i("div",{class:"s-infinite-scroll-status",ref:t=>this.status=t},i("p",{class:"s-infinite-scroll-last infinite-scroll-last s-hidden"},this.endOfText),i("p",{class:"s-infinite-scroll-error infinite-scroll-error s-hidden"},this.failedLoadMore)),this.autoload&&i("div",{class:"s-products-list-loading-wrapper",style:{display:"none"},ref:t=>this.loader=t},i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"})),this.hasInfiniteScroll&&this.nextPage&&!this.autoload?i("div",{class:"s-infinite-scroll-wrapper",style:{display:"none"},ref:t=>this.loadMoreWrapper=t},i("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))):""):""}init(){this.initiateInfiniteScroll(),this.loading()}handleResponse(t,i=!0){if(!t)return[];let e=this.getSource(),s="";if(1===t.cursor?.current){s=p.getPageTitleForSource(e);try{if("search"===this.getSource())s=salla.lang.get("common.elements.search_about",{word:this.getSourceValue()});else if(!s){let i=this.parsedFilters.category_id||this.getSourceValue()[0];s=t.filters?.find((t=>"category_id"===t.key))?.values?.find((t=>t.key===i))?.value??"",this.filtersSnapshot=t.filters}s+=(s?" - ":"")+salla.lang.choice("blocks.header.products_count",t.data?.length),15===t.data.length&&(s=s.replace(t.data.length,salla.lang.get("common.elements.more_than")+" "+t.data.length)),t.title=s}catch(t){salla.logger.error("Error::falid to handle response",t)}p.generateProductSchema(t.data)}this.appendDataLayer(t.data),t.nextPage=this.nextPage,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-list::products.fetched",t),this.productsFetched.emit(t),t.filters&&this.isFilterable()?(this.filtersResults=!0,this.filtersSnapshot=JSON.parse(JSON.stringify(t.filters)),salla.event.emit("filters::fetched",{filters:t.filters})):this.isFilterable()&&salla.event.emit("filters::hidden"),i&&(this.nextPage=t.cursor?t.cursor.next:this.nextPage),this.loading(!1),this.placeholderLoader&&this.placeholderLoader.remove(),this.hasInfiniteScroll&&!this.nextPage&&(this.infiniteScroll.option({scrollThreshold:!1,loadOnScroll:!1}),this.status.querySelector(".s-infinite-scroll-last").classList.remove("s-hidden"));const a=[];for(let i=0;i<t.data.length;i++)a.push(this.getItemHTML(t.data?.[i]));return a}get host(){return s(this)}};Lt.style="";const $t=class{constructor(i){t(this,i),this.productCardComponent="custom-salla-product-card",this.apiUrl=""}componentWillLoad(){return salla.onReady().then((()=>{if(this.includes=p.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),p.setIncludes(this.includes),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.sourceValueIsValid){if(this.hasCustomComponent=!!customElements.get(this.productCardComponent),"json"===this.source)return this.productsData=this.getSourceValue(),void(this.isReady=!0);if("related"!=this.getSource()||salla.config.get("store.settings.product.related_products_enabled"))return salla.product.api.fetch({source:this.getSource(),source_value:this.getSourceValue(),limit:this.limit}).then((t=>p.injectExtraFieldsToResponse(t))).then((t=>{this.productsData=t.data,this.isReady=!0,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-slider::products.fetched",t.data)}));this.isReady=!1}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}componentDidRender(){let t=0;const i=setInterval((()=>{this.host.querySelectorAll('[loading="lazy"]')?.forEach((t=>t.removeAttribute("loading"))),t++,t>=10&&clearInterval(i)}),1e3)}isSourceWithoutValue(){return["offers","latest","sales","top-rated"].includes(this.getSource())}getItemHTML(t){if("landing-page"===this.getSource()&&(t.url=""),this.hasCustomComponent&&"custom-salla-product-card"==this.productCardComponent.toLowerCase())return i("div",{class:"s-products-slider-card"},i("custom-salla-product-card",{product:t,source:this.getSource(),"source-value":this.getSourceValue()}));if(this.hasCustomComponent){const e=document.createElement(this.productCardComponent);return e.setAttribute("product",JSON.stringify(t)),e.setAttribute("source",this.getSource()),e.setAttribute("source-value",this.getSourceValue()),i("div",{class:"s-products-slider-card",innerHTML:e.outerHTML})}return i("div",{class:"s-products-slider-card"},i("salla-product-card",{"show-quantity":"landing-page"==this.getSource(),"hide-add-btn":"landing-page"==this.getSource(),"shadow-on-hover":!0,product:t}))}canRender(){return this.sourceValueIsValid&&this.isReady}getSource(){return p.getProductsSource(this.source)}getSourceValue(){return p.getProductsSourceValue(this.source,this.sourceValue)}render(){if(this.canRender())return i(e,{class:"s-products-slider-wrapper"},i("salla-slider",{class:"s-products-slider-slider",id:this.sliderId||`s-products-slider-${Math.random().toString(36).substr(2,9)}`,"auto-play":this.autoplay,type:"carousel","block-title":this.blockTitle,"block-subTitle":this.subTitle,"display-all-url":this.displayAllUrl,sliderConfig:this.sliderConfig?this.sliderConfig:null},i("div",{slot:"items"},this.productsData?.map((t=>this.getItemHTML(t))))))}get host(){return s(this)}};$t.style="";const Dt=class{constructor(i){t(this,i),this.height="10px";try{if(this.donation){let t="string"==typeof this.donation?JSON.parse(this.donation):this.donation;t.can_donate&&t.target_amount?(t.target_end_date="0000-00-00"==t.target_end_date?null:t.target_end_date,this.value=t.collected_amount,this.target=t.target_amount,this.header=salla.lang.get("pages.products.target"),this.message=t.target_end_date?salla.lang.get("pages.products.donation_target_date")+" "+t.target_end_date:""):this.message=t.target_amount?t.target_message:""}}catch(t){salla.log("Wrong donation json")}salla.lang.onLoaded((()=>{this.header=this.header?.replace("pages.products.target",salla.lang.get("pages.products.target")),this.message=this.message?.replace("pages.products.donation_target_date",salla.lang.get("pages.products.donation_target_date"))})),salla.onReady((()=>{this.color=this.color||salla.config.get("theme.color.primary","#ffd5c4"),this.unit||(this.unit=salla.config.currency().symbol)}))}getPercentage(){return this.value/this.target*100}render(){return this.target||this.message?i("div",{class:"s-progress-bar-container"},this.header?i("div",{class:"s-progress-bar-header"},this.header):"",this.getProgressBar(),this.message?i("span",{class:"s-progress-bar-message"},this.message):""):""}getProgressBar(){return this.target?[this.hideUnits?null:i("div",{class:"s-progress-bar-target-section"},i("span",{innerHTML:`${salla.helpers.number(this.value)} ${this.unit}`}),i("span",{innerHTML:`${salla.helpers.number(this.target)} ${this.unit}`})),i("div",{class:"s-progress-bar-wrapper",style:{height:this.height}},i("div",{class:{"s-progress-bar-progress":!0,"s-progress-bar-progress-stripped":this.stripped},style:{width:`${this.getPercentage()}%`,backgroundColor:this.color}}))]:null}};Dt.style="";const Bt=class{constructor(i){t(this,i),this.hostAttributes={},this.hasIncrementSlot=!1,this.hasDecrementSlot=!1,this.didLoaded=!1,this.quantity=1,this.fireChangeEvent=!0}watchPropHandler(){this.didLoaded&&(this.fireChangeEvent?p.debounce((()=>{salla.document.event.fireEvent(this.textInput,"change",{bubbles:!0,detail:{productId:this.cartItemId,quantity:this.quantity}})})):this.fireChangeEvent=!0)}componentWillLoad(){this.quantity=parseInt(this.host.getAttribute("value"))||1,this.hasIncrementSlot=!!this.host.querySelector('[slot="increment-button"]'),this.hasDecrementSlot=!!this.host.querySelector('[slot="decrement-button"]')}componentDidLoad(){this.didLoaded=!0,this.textInput.addEventListener("input",(t=>salla.helpers.inputDigitsOnly(t.target)))}getInputAttributes(){for(let t=0;t<this.host.attributes.length;t++)["id","value","min","class"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes}async decrease(){return this.setValue(this.quantity-1)}async increase(){return this.setValue(Number(this.quantity)+1)}async setValue(t,i=!0){this.fireChangeEvent=i;let e=parseInt(this.host.getAttribute("max"));return e&&t>e&&(t=e),t<=1&&(t=1),this.quantity=t,this.host}render(){return i(e,{key:"38d9902bc9bec3bca5f00d171bd39e86270e8c48",class:"s-quantity-input"},i("div",{key:"20cb75636c55b09705a7a95857bc98d37b56e94c",class:"s-quantity-input-container"},i("button",{key:"59077c6462c02124fde23a180766fa130d9ceb92",onClick:()=>this.increase(),class:"s-quantity-input-increase-button s-quantity-input-button",type:"button"},this.hasIncrementSlot?"":i("span",{innerHTML:A}),i("slot",{key:"741be510b7b82a323be7a75d077bdb2e06dc4995",name:"increment-button"})),i("input",{key:"7d482864cf0e66d0d74c335f2b7e72302adaea47",class:"s-quantity-input-input",...this.getInputAttributes(),ref:t=>this.textInput=t,onInput:t=>this.setValue(t.target.value),min:"1",value:this.quantity}),i("button",{key:"9a1458df4fecee23827801e9b3e463e86f47d497",class:"s-quantity-input-decrease-button s-quantity-input-button",onClick:()=>this.decrease(),type:"button"},this.hasDecrementSlot?"":i("span",{innerHTML:M}),i("slot",{key:"3b5fabbb5a3792608921ee14b45bc48f4068d21c",name:"decrement-button"}))))}get host(){return s(this)}static get watchers(){return{quantity:["watchPropHandler"]}}};Bt.style="";var Ot={request:(t,i,e,s=null,a=null)=>n.request({url:i,data:e,method:t.toLowerCase(),responseType:"json"}).then(s).catch(a),get:(t,i=null,e=null,s)=>n.get(t,{params:s}).then(i).catch(e),post(t,i,e=null,s=null){return this.request("post",t,i,e,s)},put(t,i,e=null,s=null){return this.request("put",t,i,e,s)},delete(t,i,e=null,s=null){return this.request("delete",t,i,e,s)},requestWithSupportAjax(t,i,e="post"){return new Promise(((s,a)=>{if(!window?.isLegacyTheme)return this.request(e,t,i,(({data:t})=>s(t)),(({response:t})=>a(t)));$.ajax({url:t,method:e.toUpperCase(),data:i,async:!1,success:function({data:t}){return s(t)},error:function({response:t}){return a(t)}})}))}},Ht={options:[],header:[navigator.platform,navigator.userAgent,navigator.appVersion,navigator.vendor,window.opera],dataos:[{name:"Windows Phone",value:"Windows Phone",version:"OS"},{name:"Windows",value:"Win",version:"NT"},{name:"iPhone",value:"iPhone",version:"OS"},{name:"iPad",value:"iPad",version:"OS"},{name:"Kindle",value:"Silk",version:"Silk"},{name:"Android",value:"Android",version:"Android"},{name:"PlayBook",value:"PlayBook",version:"OS"},{name:"BlackBerry",value:"BlackBerry",version:"/"},{name:"Macintosh",value:"Mac",version:"OS X"},{name:"Linux",value:"Linux",version:"rv"},{name:"Palm",value:"Palm",version:"PalmOS"}],databrowser:[{name:"Chrome",value:"Chrome",version:"Chrome"},{name:"Firefox",value:"Firefox",version:"Firefox"},{name:"Safari",value:"Safari",version:"Version"},{name:"Internet Explorer",value:"MSIE",version:"MSIE"},{name:"Opera",value:"Opera",version:"Opera"},{name:"BlackBerry",value:"CLDC",version:"CLDC"},{name:"Mozilla",value:"Mozilla",version:"Mozilla"}],init:function(){var t=this.header.join(" ");return{os:this.matchItem(t,this.dataos),browser:this.matchItem(t,this.databrowser)}},matchItem:function(t,i){var e,s,a,l=0,o=0;for(l=0;l<i.length;l+=1)if(new RegExp(i[l].value,"i").test(t)){if(e=new RegExp(i[l].version+"[- /:;]([\\d._]+)","i"),a="",(s=t.match(e))&&s[1]&&(s=s[1]),s)for(s=s.split(/[._]+/),o=0;o<s.length;o+=1)a+=0===o?s[o]+".":s[o];else a="0";return{name:i[l].name,version:parseFloat(a)}}return{name:"unknown",version:0}}};function Ft(t,i,e=!1){if(console.log("mutateShipmentAddress called",i,e),t.detail.requiredShippingContactFields)return Ot.post(t.detail.shippingContactSelected.url.replace("{id}",t.id),{country:i.country,city:i.locality,local:i.subLocality,description:i.subAdministrativeArea,street:i.addressLines?.join(", ")||i.administrativeArea,country_code:i.countryCode,postal_code:i.postalCode,is_authorized:e},(async({data:i})=>{if(!e){if("function"==typeof t.detail.shippingContactSelected.onSuccess&&t.detail.shippingContactSelected.onSuccess(i),t.address_id=i.data.address_id,t.shipping_methods=i.data.shipping_methods,!t.shipping_methods||t.shipping_methods&&!t.shipping_methods.length)return salla.logger.warn("🍏 Pay: We dont found any supported methods",i),t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]});try{await t.selectApplePayShippingMethod(t.shipping_methods[0].ship_id,t.shipping_methods[0].private_ship_id)}catch(i){return salla.logger.warn("Failed set the shipping details to api",i),t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]})}try{await t.recalculateTotal()}catch(i){return salla.logger.warn("🍏 Pay: Failed recalculate total",i),t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]})}t.session.completeShippingContactSelection({newTotal:t.prepareTotal(),newLineItems:t.prepareLineItems(),newShippingMethods:t.mappingShippingMethods(t.shipping_methods)})}}),(({response:i})=>{salla.logger.warn("🍏 Pay: Failed add address via api",i),"function"==typeof t.detail.shippingContactSelected.onFailed&&t.detail.shippingContactSelected.onFailed(i);let e=i?.data?.error?.fields,s=[];e?.country_code&&s.push(new window.ApplePayError("shippingContactInvalid","countryCode",e?.country_code[0])),e?.city&&s.push(new window.ApplePayError("shippingContactInvalid","locality",e?.city[0])),e?.country&&s.push(new window.ApplePayError("shippingContactInvalid","country",e?.country[0])),0===s.length&&i?.data?.error?.message&&s.push(new window.ApplePayError("shippingContactInvalid","locality",i?.data?.error?.message)),t.session.completeShippingContactSelection({newTotal:t.prepareTotal(),newLineItems:t.prepareLineItems(),status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:s})}))}window.Salla=window.Salla||{},window.Salla.Payments=window.Salla.Payments||{},window.SallaApplePay={session:null,detail:null,address_id:null,shipping_methods:[],total:void 0,request:void 0,id:void 0,countryCode:null,init:function(){document.removeEventListener("payments::apple-pay.start-transaction",SallaApplePay.startSession),Salla.event.addEventListener("payments::apple-pay.start-transaction",SallaApplePay.startSession)},initDefault:function(){SallaApplePay.detail.onError||(SallaApplePay.detail.onError=function(t){salla.notify.error(t)}),SallaApplePay.detail.authorized.onFailed||(SallaApplePay.detail.authorized.onFailed=t=>{salla.logger.log(JSON.stringify(t)),salla.api.handleErrorResponse(t),SallaApplePay.onCancel({},t.data.error.message)}),SallaApplePay.detail.validateMerchant.onFailed||(SallaApplePay.detail.validateMerchant.onFailed=t=>{salla.logger.log(JSON.stringify(t)),salla.api.handleErrorResponse(t),SallaApplePay.onCancel({},t.data.error.message)}),SallaApplePay.detail.authorized.onSuccess||(SallaApplePay.detail.authorized.onSuccess=t=>{salla.logger.log(JSON.stringify(t)),salla.api.handleAfterResponseActions(t)})},prepareLineItems:function(){return SallaApplePay.detail?.items?.length||(SallaApplePay.detail.items=[{label:salla.lang.get("pages.cart.items_total"),amount:SallaApplePay.detail.amount}]),SallaApplePay.detail.items},prepareTotal:function(){return{label:window.location.hostname||"Salla",amount:SallaApplePay.detail.amount}},startSession:async function(t){SallaApplePay.detail=t.detail||t,salla.log("🍏 Pay: payments::apple-pay.start-transaction",SallaApplePay.detail),SallaApplePay.initDefault();let i=SallaApplePay.getApplePaySessionVersion(),e=SallaApplePay.detail.supportedNetworks||["masterCard","visa"];5===i&&e.push("mada"),SallaApplePay.request={countryCode:SallaApplePay.detail.countryCode||"SA",supportsCouponCode:!0,couponCode:"",currencyCode:SallaApplePay.detail.currency||"SAR",requiredShippingContactFields:SallaApplePay.detail.requiredShippingContactFields?SallaApplePay.detail.requiredShippingContactFields:[],merchantCapabilities:["supports3DS"],supportedNetworks:e,supportedCountries:SallaApplePay.detail.supportedCountries||["SA"],total:SallaApplePay.prepareTotal(),shippingContact:SallaApplePay.detail.shippingContact?SallaApplePay.detail.shippingContact:{},shippingMethods:SallaApplePay.detail.shippingMethods&&SallaApplePay.detail.shippingMethods.length?SallaApplePay.mappingShippingMethods(t.detail.shippingMethods):[],lineItems:SallaApplePay.prepareLineItems()},salla.log("🍏 Pay: init ",SallaApplePay.request),SallaApplePay.session=new ApplePaySession(i,SallaApplePay.request),SallaApplePay.session.onshippingcontactselected=SallaApplePay.onShippingContactSelected,SallaApplePay.session.onshippingmethodselected=SallaApplePay.onShippingMethodSelected,SallaApplePay.session.onvalidatemerchant=SallaApplePay.onValidateMerchant,SallaApplePay.session.onpaymentauthorized=SallaApplePay.onPaymentAuthorized,SallaApplePay.session.oncancel=SallaApplePay.onCancel,SallaApplePay.session.oncouponcodechanged=SallaApplePay.oncouponcodechanged,SallaApplePay.session.onpaymentmethodselected=SallaApplePay.onpaymentmethodselected,SallaApplePay.session.begin()},async onpaymentmethodselected(t){await SallaApplePay.recalculateTotal();const i={newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()};SallaApplePay.session.completePaymentMethodSelection(i)},oncouponcodechanged:t=>(Salla.event.dispatch("payments::apple-pay.coupon.change",t),Ot.post(SallaApplePay.detail.oncouponcodechanged.url.replace("{id}",SallaApplePay.id),{coupon:t.couponCode,payment_method:"apple_pay"},(async({data:t})=>{"function"==typeof SallaApplePay.detail.oncouponcodechanged.onSuccess&&SallaApplePay.detail.oncouponcodechanged.onSuccess(t),salla.log("🍏 Pay: Coupon applied success"),await SallaApplePay.recalculateTotal(),SallaApplePay.session.completeCouponCodeChange({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()})}),(async t=>{let i=t?.response;Salla.event.dispatch("payments::apple-pay.coupon.failed",i),"function"==typeof SallaApplePay.detail.oncouponcodechanged.onFailed&&SallaApplePay.detail.oncouponcodechanged.onFailed(i),await SallaApplePay.recalculateTotal(),SallaApplePay.session.completeCouponCodeChange({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems(),errors:[new window.ApplePayError("couponCodeInvalid")]})}))),onCancel:(t={},i=null)=>{SallaApplePay.detail.onError(i||salla.lang.get("pages.checkout.payment_failed")),Salla.event.createAndDispatch("payments::apple-pay.canceled",t)},onPaymentAuthorized:async t=>{salla.logger.log("🍏 Pay: onPaymentAuthorized",t.payment),await Ft(SallaApplePay,t.payment.shippingContact,!0),Salla.event.dispatch("payments::apple-pay.authorized.init",t),Ot.post(SallaApplePay.detail.authorized.url.replace("{id}",SallaApplePay.id),{payment_method:"apple_pay",applepay_token:JSON.stringify(t.payment)},(({data:t})=>{Salla.event.dispatch("payments::apple-pay.authorized.success",t),SallaApplePay.session.completePayment(ApplePaySession.STATUS_SUCCESS),"function"==typeof SallaApplePay.detail.authorized.onSuccess&&SallaApplePay.detail.authorized.onSuccess(t)}),(t=>{let i=t?.response;Salla.event.dispatch("payments::apple-pay.authorized.failed",i),SallaApplePay.session.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[new ApplePayError("unknown",void 0,i?.data?.error?.message||i?.data?.error?.code||"Failed to parse authorized response")]}),"function"==typeof SallaApplePay.detail.authorized.onFailed&&SallaApplePay.detail.authorized.onFailed(i)}))},onValidateMerchant:async t=>{try{Salla.event.dispatch("payments::apple-pay.validate-merchant.init",t);const{data:i}=await Ot.post(SallaApplePay.detail.validateMerchant.url.replace("{id}",SallaApplePay.id),{validation_url:t.validationURL});Salla.event.dispatch("payments::apple-pay.validate-merchant.success",i);const e=t=>{SallaApplePay.session.completeMerchantValidation(t)};if("function"==typeof SallaApplePay.detail.validateMerchant.onSuccess){const t=await SallaApplePay.detail.validateMerchant.onSuccess(i);if(t?.redirect)return window.location=t.redirect,SallaApplePay.abortValidateMerchant(t)}e(i.data)}catch(t){console.error(t),SallaApplePay.abortValidateMerchant(t?.response)}},abortValidateMerchant:(t=null)=>{SallaApplePay.abortSession(),Salla.event.dispatch("payments::apple-pay.validate-merchant.failed",t),"function"==typeof SallaApplePay.detail.validateMerchant.onFailed&&SallaApplePay.detail.validateMerchant.onFailed(t)},onShippingContactSelected:async t=>{salla.logger.log("🍏 Pay: onShippingContactSelected",t.shippingContact),Ft(SallaApplePay,t.shippingContact)},onShippingMethodSelected:async t=>{salla.logger.log(t);let i=t.shippingMethod.identifier.split(",");try{await SallaApplePay.selectApplePayShippingMethod(i[0],void 0===i[1]?null:i[1]),await SallaApplePay.recalculateTotal(),SallaApplePay.session.completeShippingMethodSelection({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()})}catch(t){salla.logger.warn("🍏 Pay: Failed set the shipping details to api",t),SallaApplePay.abortSession()}},abortSession:()=>{SallaApplePay.session&&SallaApplePay.session.abort()},getApplePaySessionVersion:()=>{if("sallapp"===(navigator.userAgent||navigator.vendor||window.opera))return 5;let t=Ht.init(),i=parseFloat(t.os.version);if("Macintosh"===t.os.name){if(i<10.142)return 1}else if(i<12.11)return 1;return 5},recalculateTotal:()=>(salla.logger.log("Recalculate Total"),Ot.requestWithSupportAjax(SallaApplePay.detail.recalculateTotal.url.replace("{id}",SallaApplePay.id),{},"get").then((t=>{let i=t.data.initial_data?.cart||t.data.cart;return SallaApplePay.detail.amount=i.total,SallaApplePay.detail.items=(i.totals||i.items).map((t=>({label:t.title,amount:"مجاني"===t.amount||"Free"===t.amount?0:t.amount.toString().replace("+","")}))),SallaApplePay.detail.items.pop(),t})).catch((t=>(salla.logger.warn("🍏 Pay: recalculate total failed",t),t?.response?.data?.message)))),selectApplePayShippingMethod:(t,i)=>{salla.logger.log("🍏 Pay: select shipping method ","company_id : "+t,"private_company_id: "+i);const e={address_id:SallaApplePay.address_id,company_id:t,private_company_id:i,payment_method:"apple_pay"},s=SallaApplePay.shipping_methods?.find((i=>i.company===t||i.ship_id===t));return s?.route_id&&(e.shipping_route_id=s.route_id,e.type=s.type),Ot.requestWithSupportAjax(SallaApplePay.detail.shippingMethodSelected.url.replace("{id}",SallaApplePay.id),e,"post").then((()=>("function"==typeof SallaApplePay.detail.shippingMethodSelected.onSuccess&&SallaApplePay.detail.shippingMethodSelected.onSuccess(data),!0))).catch((t=>{salla.logger.warn("🍏 Pay: Set shipping method failed",t),"function"==typeof SallaApplePay.detail.shippingMethodSelected.onFailed&&SallaApplePay.detail.shippingMethodSelected.onFailed(t);let i=t?.response?.data?.error;return i?.data?.fields?.address_id?i?.data?.fields?.address_id[0]:i?.data?.message}))},mappingShippingMethods:t=>t.map((t=>({label:t.shipping_title,amount:t.enable_free_shipping?0:t.ship_cost,detail:"",identifier:t.ship_id.toString()+(t.private_ship_id?","+t.private_ship_id.toString():"")})))},window.ApplePaySession?.canMakePayments()?SallaApplePay.init():document.querySelectorAll("data-show-if-apple-pay-supported").forEach((t=>t.style.display="none"));const Et=class{constructor(i){t(this,i),this.type="buy",this.options={},this.quickBuy=salla.lang.get("pages.products.buy_now"),salla.lang.onLoaded((()=>{this.quickBuy=salla.lang.get("pages.products.buy_now")}))}async quickBuyHandler(){if(salla.config.isGuest()){let t="salla-quick-buy::user.logged-in";return salla.event.on(t,(()=>this.settlePayment())),salla.api.auth.setAfterLoginEvent(t),salla.auth.event.dispatch("login::open",{withoutReload:!0})}await this.settlePayment()}async settlePayment(){let t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);if(t&&!await t.reportValidity())return salla.error(salla.lang.get("common.messages.required_fields"));let i=this.host.getElementSallaData();if(!this.isApplePayActive)return salla.api.request("checkout/quick-purchase/"+this.productId,i,"post").then((t=>(t.data.redirect&&(window.location.href=t.data.redirect),t)));i.is_applepay=!0,"append"in i&&i.append("is_applepay",!0),salla.event.dispatch("payments::apple-pay.start-transaction",{amount:this.amount,currency:this.currency||"SAR",requiredShippingContactFields:this.isRequireShipping?["postalAddress"]:void 0,shippingMethods:this.isRequireShipping?[]:void 0,supportedNetworks:salla.config.get("store.settings.buy_now.networks"),supportedCountries:salla.config.get("store.settings.buy_now.countries"),countryCode:salla.config.get("store.store_country")||"SA",validateMerchant:{url:salla.url.get("checkout/applepay/validate"),onSuccess:t=>this.applePayOnly&&!this.productId?this.cartId?(window.SallaApplePay.id=this.cartId,salla.log("🍏 Pay: create checkout success: with id #"+this.cartId),Promise.resolve(t)):(salla.logger.warn("🍏 Pay: trying to create applePay transaction without cartId/ProductId !"),Promise.resolve(t)):salla.api.request("checkout/quick-purchase/"+this.productId,"object"==typeof i?i:void 0,"post",{}).then((t=>t?.data?.redirect?(salla.log("🍏 Pay: create checkout success: redirect exits, go to checkout page"),window.location.href=t.data.redirect.url,t):t?.data?.id?(window.SallaApplePay.id=t.data.id,void salla.log("🍏 Pay: create checkout success: with id #"+window.SallaApplePay.id)):(salla.logger.warn("🍏 Pay: create checkout success: No id, or redirect"),t)))},authorized:{url:salla.url.get("checkout/{id}/payments/submit"),onFailed:t=>{window.SallaApplePay.onCancel({},t?.data?.error?.message||t?.data?.error?.code||salla.lang.get("pages.checkout.payment_failed"))},onSuccess:t=>{window.location.href=t.redirect.url,salla.log("🍏 Pay: authorized Success:: redirect to thank you page, order placed")}},shippingMethodSelected:this.isRequireShipping?{url:salla.url.get("checkout/{id}/shipping/details")}:void 0,shippingContactSelected:this.isRequireShipping?{url:salla.url.get("checkout/{id}/address/add")}:void 0,oncouponcodechanged:{url:salla.url.get("checkout/{id}/coupons")},recalculateTotal:{url:salla.url.get("checkout/{id}/payments/recalculate?payment_method=apple_pay")},onError:function(t){salla.log(t),salla.notify.error(t)}})}componentWillLoad(){return console.log("🍏 Pay: Quick Buy Component Loaded"),new Promise(((t,i)=>{salla.onReady((async()=>{if(this.currency||(this.currency=salla.config.get("user.currency_code")),!this.productId&&salla.config.get("page.id")&&(this.productId=salla.config.get("page.id")),!this.applePayOnly&&!this.productId)return salla.logger.warn("🍏 Pay: Failed load the quick buy, the product id is missing"),i();this.amount&&this.isRequireShipping||!this.productId||await salla.product.getDetails(this.productId,[]).then((t=>{this.amount=t.data.price,this.isRequireShipping=t?.data?.is_require_shipping||!1})).catch((t=>(salla.logger.warn("🍏 Pay: Failed load the quick buy, get the product details failed: ",t),i()))),"donate"==this.type?salla.event.on("product-options::donation-changed",(t=>{String(t.id)===String(this.productId)&&(this.amount=t.price)})):salla.url.is_page("product.single")&&salla.product.event?.onPriceUpdated((t=>{this.amount=t.data.price})),this.isApplePayActive=salla.helpers.hasApplePay()&&salla.config.get("store.settings.payments")?.includes("apple_pay")&&salla.config.get("store.settings.is_salla_gateway",!1);let e=document.getElementById("apple-pay-sdk");if(e||!this.isApplePayActive)return salla.logger.warn("🍏 Pay: Skipped load apple pay because "+(e?"already loaded":"is not available in the browser")),void t(!0);const s=document.createElement("script");s.src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js",s.setAttribute("id","apple-pay-sdk"),s.async=!0,document.body.appendChild(s),t(!0)}))}))}render(){return i(e,{key:"e6440de17b7c8185dbd0636d0c009a04014ae215"},this.quickBuyButton())}quickBuyButton(){return i("apple-pay-button",{locale:salla.config.get("user.language_code"),onClick:()=>this.quickBuyHandler(),"data-quick-purchase":"applepay",class:"s-quick-buy-apple-pay","data-is-applepay":"1",buttonstyle:"black",type:this.type})}get host(){return s(this)}};Et.style=".s-quick-buy-button .s-button-text{display:flex}apple-pay-button{--apple-pay-button-width:100%;--apple-pay-button-height:40px;--apple-pay-button-border-radius:.75rem;--apple-pay-button-box-sizing:content-box}";const Rt=class{constructor(i){t(this,i),this.quickOrderSubmited=a(this,"quickOrderSubmited"),this.quickOrderTitle="ليش تنتظر؟",this.subTitle="احصل على المنتج مباشرة الآن",this.payButtonTitle="اطلب المنتج",this.confirmPayButtonTitle="اشتر الآن",this.agreementText=salla.lang.get("pages.checkout.show_full_agreement"),this.isEmailRequired=!1,this.quickOrderStyle="default",this.isAvailable=!1,this.oneClick=!1,this.expanded=!1,this.isTermsRequired=!1,this.countryCode=salla.config.get("user.country_code","SA")||"SA",this.submitSucess=!1,this.placeHolderEmail=salla.lang.get("common.elements.email"),this.emailOptional=salla.lang.get("common.elements.optional"),this.agreementShowText=salla.lang.get("pages.checkout.show_full_agreement"),this.agreementModalHead=salla.lang.get("pages.checkout.full_agreement"),this.userNameLabel=salla.lang.get("pages.products.your_name"),this.termsChecked=!1,salla.onReady((()=>{this.productId=this.productId||salla.config.get("page.id")})),salla.lang.onLoaded((()=>{this.placeHolderEmail=salla.lang.get("common.elements.email"),this.emailOptional=salla.lang.get("common.elements.optional"),this.agreementShowText=salla.lang.get("pages.checkout.show_full_agreement"),this.agreementModalHead=salla.lang.get("pages.checkout.full_agreement"),this.userNameLabel=salla.lang.get("pages.products.your_name")}))}getBtnColor(){return"default"===this.quickOrderStyle?"light":"primary"}getErrorMessage(t,i){return"terms"==i?salla.lang.get("pages.checkout.check_agreement"):salla.lang.get(`common.errors.${t}`,{attribute:"name"==i?this.userNameLabel:this.placeHolderEmail})}handleInvalidInput(t){let i,e=t.target,s=e.validity;s.valueMissing?(i=this.getErrorMessage("field_required",e.name),console.log(this.getErrorMessage("field_required",e.name))):s.typeMismatch&&(i=this.getErrorMessage("invalid_value",e.name)),e.setCustomValidity(i)}async setWrapperHeight(){let t=this.host.querySelector(".s-quick-order-expandable");setTimeout((()=>{t.style.maxHeight=t.style.maxHeight||this.oneClick?null:t.scrollHeight+"px"}),50)}getDarkOrLight(){return"default"===this.quickOrderStyle&&salla.config.get("theme.color.is_dark")?"dark":"light"}getStyleColor(){return{gray:"#f3f3f3",white:"#ffffff",default:salla.config.get("theme.color.primary")}[this.quickOrderStyle]||"#f3f3f3"}async submit(t,i=!1){return t.preventDefault(),i&&!this.oneClick?(this.expanded=!this.expanded,void this.setWrapperHeight()):this.submitBtn.load().then((()=>this.getPayload())).then((t=>salla.api.cart.createQuickOrder(t))).then((()=>{setTimeout((()=>{this.submitBtn.stop(),this.submitSucess=!0,this.quickOrderSubmited.emit()}),200)})).catch((t=>t&&(console.error(t),this.submitBtn.stop())))}async getPayload(){return this.oneClick?{product_ids:[this.productId],agreement:!0}:{product_ids:[this.productId],email:this.emailInput?.value,phone:Number((await(this.phoneInput?.getValues()))?.phone),country_code:(await(this.phoneInput?.getValues()))?.countryCode||this.countryCode,name:this.nameInput?.value,agreement:this.termsChecked}}formatAgreementText(t,i=150){return t?t.length<=i?t:(new DOMParser).parseFromString(t,"text/html").documentElement.innerText.substring(0,i)+"...":""}loadQuickOrderSettings(){let t=salla.config.get("store.settings.quick_order");return t?(this.user=salla.config.get("user")||salla.storage.get("user")||{},this.countryCode=this.user?.country_code||this.countryCode,this.isEmailRequired=!this.user?.email&&this.isEmailRequired,this.oneClick=this.user?.email,this.initComponentData(t),Promise.resolve()):Promise.resolve()}initComponentData(t){this.quickOrderTitle=t.title,this.subTitle=t.sub_title,this.payButtonTitle=t.order_now_button,this.isEmailRequired=t.is_email_required,this.isTermsRequired=t.show_agreement,this.agreementText=t.agreement,this.confirmPayButtonTitle=t.confirm_button,this.thanksMessage=t.thanks_message,this.quickOrderStyle=t.style,this.isAvailable=!0,this.oneClick=this.oneClick&&!this.isTermsRequired}componentWillLoad(){return new Promise((t=>salla.onReady((()=>this.loadQuickOrderSettings().then(t)))))}render(){if(this.isAvailable)return this.submitSucess?i(e,{class:"s-quick-order"},i("div",{class:"s-quick-order-confirm",style:{backgroundColor:salla.config.get("theme.color.primary")+"10",borderColor:salla.config.get("theme.color.primary")+"10",color:salla.config.get("theme.color.primary")}},i("i",{innerHTML:'\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>party-horn</title>\n<path fill="currentColor" d="M5.333 4.013c0.736 0 1.333-0.596 1.333-1.333v-0.013c0-0.737-0.597-1.327-1.333-1.327s-1.333 0.603-1.333 1.34 0.597 1.333 1.333 1.333zM11.333 10c0.341 0 0.683-0.131 0.943-0.391 1.541-1.54 2.391-3.589 2.391-5.771v-2.505c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.505c0 1.468-0.572 2.848-1.609 3.885-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391zM18.667 9.993c0.319 0 0.639-0.115 0.895-0.345 0.383-0.347 0.684-0.325 1.497-0.22 0.923 0.124 2.319 0.307 3.636-0.887 1.293-1.172 1.303-2.54 1.308-3.539 0.005-0.887 0.043-1.228 0.432-1.581 0.361-0.327 0.621-0.335 1.493-0.216 0.923 0.12 2.317 0.307 3.635-0.884 0.545-0.495 0.587-1.337 0.093-1.883-0.493-0.547-1.336-0.589-1.884-0.093-0.361 0.325-0.621 0.333-1.493 0.216-0.921-0.119-2.317-0.305-3.635 0.884-1.293 1.173-1.303 2.541-1.308 3.54-0.005 0.885-0.043 1.227-0.432 1.58-0.383 0.348-0.683 0.327-1.497 0.22-0.924-0.124-2.32-0.305-3.636 0.887-0.545 0.495-0.587 1.339-0.092 1.884 0.264 0.291 0.625 0.437 0.988 0.437zM18.667 16.013c0.736 0 1.333-0.596 1.333-1.333v-0.013c0-0.737-0.597-1.327-1.333-1.327s-1.333 0.603-1.333 1.34 0.597 1.333 1.333 1.333zM30.667 17.333h-2.505c-2.179 0-4.228 0.849-5.771 2.391-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.603 0.391 0.944 0.391s0.683-0.131 0.943-0.391c1.023-1.023 2.439-1.609 3.884-1.609h2.505c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM30.667 10.66c-0.736 0-1.333 0.603-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM29.333 26.66c-0.736 0-1.333 0.603-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM7.456 11.057c-0.327-0.327-0.799-0.46-1.249-0.356-0.449 0.107-0.812 0.439-0.959 0.876l-5.036 15.113c-0.487 1.457-0.113 3.037 0.973 4.125 0.772 0.771 1.792 1.183 2.84 1.183 0.428 0 0.861-0.068 1.284-0.209l15.112-5.037c0.439-0.145 0.769-0.508 0.876-0.959 0.107-0.449-0.028-0.921-0.355-1.249zM4.467 29.259c-0.503 0.163-1.023 0.043-1.395-0.329-0.373-0.373-0.497-0.896-0.329-1.396l4.355-13.065 10.436 10.435z"></path>\n</svg>\n'}),i("span",null,this.thanksMessage))):i(e,{class:`s-quick-order s-quick-order-${this.getDarkOrLight()}`},i("div",{class:`s-quick-order-container s-quick-order-${this.quickOrderStyle}`,style:{backgroundColor:this.getStyleColor()}},i("div",{class:"s-quick-order-button-cont"},i("div",null,i("h3",null,this.quickOrderTitle),i("p",null,this.subTitle)),i("salla-button",{class:this.expanded?"s-quick-order-btn-close":"",onClick:t=>this.submit(t,!0),color:this.getBtnColor()},this.oneClick?this.confirmPayButtonTitle:this.expanded?i("i",{innerHTML:Q}):this.confirmPayButtonTitle)),i("form",{onSubmit:t=>this.submit(t),class:"s-quick-order-expandable "+(this.expanded?"s-quick-order-shown":"")},Salla.config.isGuest()&&[i("div",{class:"s-form-group"},i("span",{innerHTML:'\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>portrait</title>\n<path d="M24 1.333h-16c-3.676 0-6.667 2.991-6.667 6.667v16c0 3.028 2.041 5.561 4.811 6.371 0.004 0.001 0.008 0.003 0.012 0.004 0.591 0.172 1.2 0.292 1.844 0.292h16c0.644 0 1.253-0.12 1.843-0.292 0.004-0.001 0.008-0.003 0.012-0.004 2.771-0.809 4.812-3.343 4.812-6.371v-16c0-3.676-2.991-6.667-6.667-6.667zM8.012 28c0.121-1.915 3.363-4 7.988-4s7.868 2.085 7.988 4zM28 24c0 1.24-0.579 2.335-1.467 3.069-0.768-3.288-5.112-5.736-10.533-5.736s-9.765 2.448-10.533 5.736c-0.888-0.735-1.467-1.829-1.467-3.069v-16c0-2.205 1.795-4 4-4h16c2.205 0 4 1.795 4 4zM16 6.667c-3.308 0-6 2.692-6 6s2.692 6 6 6 6-2.692 6-6-2.692-6-6-6zM16 16c-1.839 0-3.333-1.495-3.333-3.333s1.495-3.333 3.333-3.333 3.333 1.495 3.333 3.333-1.495 3.333-3.333 3.333z"></path>\n</svg>\n'}),i("input",{type:"text",required:!0,class:"s-form-control s-quick-order-phone-field",name:"name",placeholder:this.userNameLabel,ref:t=>this.nameInput=t})),i("div",{class:"s-quick-order-flex-input"},i("div",{class:"s-form-group"},i("span",{innerHTML:'\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>iphone-x</title>\n<path d="M24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.597 1.333-1.333 1.333h-16c-0.736 0-1.333-0.597-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h4c0 1.471 1.196 2.667 2.667 2.667h2.667c1.471 0 2.667-1.196 2.667-2.667h4c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n'}),i("salla-tel-input",{ref:t=>this.phoneInput=t})),i("div",{class:"s-form-group"},i("span",{innerHTML:b}),i("input",{type:"email",class:"s-form-control s-quick-order-email-field",name:"email",required:this.isEmailRequired,placeholder:this.placeHolderEmail+" "+(this.isEmailRequired?"":this.emailOptional),ref:t=>this.emailInput=t})))],this.isTermsRequired&&i("label",{htmlFor:"terms",class:"s-quick-order-terms"},i("input",{type:"checkbox",required:!0,name:"terms",id:"terms",ref:t=>this.termsInput=t,onChange:()=>this.termsChecked=this.termsInput.checked,class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",i("div",{innerHTML:this.formatAgreementText(this.agreementText,150)},this.agreementText.length>150&&i("salla-button",{shape:"link",onClick:()=>this.agreementModal.open()},this.agreementShowText))," ")),i("salla-button",{type:"submit",color:this.getBtnColor(),width:"wide",ref:t=>this.submitBtn=t},this.payButtonTitle)),i("salla-modal",{"modal-title":this.agreementModalHead,ref:t=>this.agreementModal=t},i("article",{innerHTML:this.agreementText}))))}componentDidLoad(){this.host.querySelectorAll("input").forEach((t=>{t.addEventListener("invalid",(t=>{this.handleInvalidInput(t)})),t.addEventListener("input",(()=>{t.setCustomValidity(""),t.reportValidity()}))}))}get host(){return s(this)}};Rt.style=".s-quick-order-expandable:not(.s-quick-order-shown){overflow:hidden}";var jt='\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>star</title>\n<path d="M31.819 12.077c-0.367-0.883-1.209-1.411-2.259-1.411h-8.437l-2.681-8.871c-0.347-1.075-1.329-1.796-2.443-1.796s-2.096 0.721-2.447 1.805l-2.788 8.861h-8.275c-1.076 0-1.939 0.533-2.308 1.427-0.375 0.904-0.159 2.012 0.525 2.693 0.044 0.044 0.092 0.085 0.141 0.124l6.811 5.101-2.773 8.567c-0.344 1.063 0.019 2.228 0.899 2.899 0.459 0.351 1.001 0.527 1.544 0.527 0.528 0 1.056-0.165 1.511-0.499l7.159-5.267 7.161 5.268c0.896 0.659 2.168 0.645 3.051-0.028 0.884-0.671 1.245-1.836 0.901-2.9l-2.773-8.567 6.811-5.101c0.051-0.037 0.099-0.080 0.143-0.124 0.687-0.687 0.904-1.8 0.528-2.709zM21.976 18.448c-0.456 0.343-0.644 0.936-0.469 1.477l3.044 9.293-7.763-5.711c-0.235-0.173-0.513-0.259-0.791-0.259s-0.556 0.085-0.791 0.259l-7.713 5.676 2.997-9.257c0.175-0.541-0.013-1.136-0.469-1.477l-6.829-5.116h8.551c0.583 0 1.097-0.377 1.272-0.933l2.981-9.479 2.861 9.465c0.169 0.561 0.688 0.947 1.276 0.947h8.672z"></path>\n</svg>\n',qt='\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>shipping-fast</title>\n<path d="M10.667 14.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h8c0.736 0 1.333-0.596 1.333-1.333zM9.333 18.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM9.333 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM1.333 10.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.123 13.103l-3.147-3.935c-1.273-1.589-3.171-2.501-5.205-2.501h-1.437c0-2.205-1.795-4-4-4h-13.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v1.333c0 0.248 0.087 0.468 0.204 0.667-0.117 0.199-0.204 0.419-0.204 0.667v5.333c0 0.737 0.597 1.333 1.333 1.333h9.333v6.667h-1.333c-0.063 0-0.117 0.028-0.179 0.036-0.583-2.313-2.664-4.036-5.155-4.036-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c2.491 0 4.572-1.723 5.155-4.036 0.061 0.008 0.116 0.036 0.179 0.036h2.667c0.736 0 1.333-0.596 1.333-1.333v-8.399c0-0.905-0.311-1.792-0.877-2.499zM21.333 13.333v-4h1.437c1.221 0 2.36 0.547 3.124 1.501l1.997 2.499zM22.667 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n';const Nt=class{constructor(i){t(this,i),this.hasError=!1,this.showContactWidget=!0,this.images=[],this.productImages={},this.editItemImages=[],this.contact_body=(t,i,e)=>salla.lang.get("pages.rating.contact_subject",{store:t,id:i,customer:e}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.allowContactSupport=salla.config.get("store.settings.rating.allow_contact_support"),this.contentRefs=[],this.hiddenInputs=[],this.isOpen=[],this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.MAX_UPLOAD_LIMIT=3,this.onOpen=t=>new Promise((i=>{r({targets:this.contentRefs[t],duration:100,height:this.contentRefs[t].scrollHeight,opacity:[0,1],easing:"easeOutQuart",complete:()=>i()})})),this.onClose=t=>new Promise((i=>{r({targets:this.contentRefs[t],duration:100,height:0,opacity:[1,0],easing:"easeOutQuart",complete:()=>i()})})),this.toggleUploader=async t=>{this.isOpen[t]=!this.isOpen[t],p.toggleElementClassIf(this.contentRefs[t],"is-closed","is-opened",(()=>!this.isOpen[t])),await(this.isOpen[t]?this.onOpen(t):this.onClose(t)),await new Promise((t=>setTimeout(t,101))),this.body&&this.currentTab&&setTimeout((()=>this.body.setAttribute("style",`height:${this.currentTab.offsetHeight+(this.editMode?60:0)}px`)))},salla.onReady((()=>{this.orderId=salla.config.get("page.id")})),salla.lang.onLoaded((()=>{this.contactUsLabel=salla.lang.get("blocks.footer.social");const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));(async()=>{await t("ar.trans","common.uploader.drag_and_drop_files","اسحب الملفات وأفلتها هنا"),await t("en.trans","common.uploader.drag_and_drop_files","Drag and drop files here"),await t("ar.trans","common.uploader.allowed_images_types"," .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة"),await t("en.trans","common.uploader.allowed_images_types","Images in jpg, jpeg, or png format are allowed."),await t("ar.trans","pages.rating.add_images","اضافة صور"),await t("en.trans","pages.rating.add_images","Add Images"),await t("ar.trans","pages.rating.edit_images","تعديل الصور"),await t("en.trans","pages.rating.edit_images","Edit Images"),await t("ar.trans","pages.rating.edit_review","تعديل التقييم"),await t("en.trans","pages.rating.edit_review","Edit review"),await t("ar.trans","pages.rating.confirm_deletion","تأكيد حذف التقييم"),await t("en.trans","pages.rating.confirm_deletion","Confirm review deletion"),await t("ar.trans","pages.rating.are_you_sure_you_want_to_delete_review","هل أنت متأكد من حذف تقييمك؟"),await t("en.trans","pages.rating.are_you_sure_you_want_to_delete_review","Are you sure you want to delete your review?"),await t("ar.trans","pages.rating.review_updated_successfully","تم تعديل التقييم بنجاح"),await t("en.trans","pages.rating.review_updated_successfully","The review has been successfully updated."),await t("ar.trans","pages.rating.review_deleted_successfully","تم حذف التقييم بنجاح"),await t("en.trans","pages.rating.review_deleted_successfully","The review has been successfully deleted."),await t("ar.trans","pages.rating.images_count","الصور ( :current من أصل :total )"),await t("en.trans","pages.rating.images_count","Images ( :current of :total )"),await t("ar.trans","common.uploader.max_three_images",`.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`),await t("en.trans","common.uploader.max_three_images",`Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`),await t("ar.trans","common.elements.confirm_delete","تأكيد الحذف"),await t("en.trans","common.elements.confirm_delete","Confirm deletion"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.contact_body=(t,i,e)=>salla.lang.get("pages.rating.contact_body",{store:t,id:i,customer:e})})()}))}async open(){return this.defaultMode=!0,new Promise((t=>{setTimeout((()=>{this.modal.open().then((()=>this.order||salla.api.withoutNotifier((()=>salla.rating.api.order(this.orderId?this.orderId:salla.config.get("page.id")))).then((t=>this.order=t.data)))).then((()=>this.modal.setTitle(`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order.id})</span>`))).then((()=>{const t={};if(this.order?.products)for(const i of this.order.products)t[i.product.id]=[];this.productImages=t})).then((()=>this.modal.stopLoading())).then((()=>this.stepsCount=[this.order.testimonials_enabled,this.order.products_enabled,this.order.shipping_enabled].filter((t=>t)).length)).then((()=>setTimeout((()=>this.handleWizard()),100))).catch((i=>{t(!1),this.hasError=!0,this.errorMessage=i.response?.data?.error?.message||i.response?.data,this.modal.stopLoading()})),t(!0)}),50)}))}async openEditModal(t){this.defaultMode=!1,this.editMode=!0,this.editType=t.type,this.editFeedbackId=t.feedback_id;try{await this.fetchEditItem(t.feedback_id),this.editModal.open()}catch(t){this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data}}async fetchEditItem(t){const i=`rating/${t}/show`,e=await salla.api.request(i);this.editItem=e.data,this.allowAttachImages&&"product"==this.editType&&this.editItem.images.length&&(this.editItemImages=this.editItem.images.map((t=>({id:`${Math.floor(100+900*Math.random())}`,url:t}))))}async editReview(){const t={};this.editModal.querySelectorAll("[name]").forEach((i=>{const e=salla.helpers.inputData(i.name,i.value,t);t[e.name]=e.value})),t.images&&(t.images=t.images.split(","));const i=`rating/${this.editFeedbackId}`;await salla.api.request(i,t,"put").then((t=>{this.editModal.close(),salla.notify.success(t.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(t){return this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=t.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((t=>{setTimeout((()=>{this.deleteModal.open().then((()=>t(!0)))}),50)}))}async deleteReview(){const t=`rating/${this.deleteFeedbackId}`;await salla.api.request(t,null,"delete").then((()=>{this.deleteModal.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.modal.close()}handleWizard(){this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"),this.showActiveStep()}showActiveStep(t=null){this.currentTab=t||this.steps[this.currentIndex],p.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(t=>t!=this.dots[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(t=>t==this.currentTab)),0!==this.currentIndex&&(p.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>p.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const i=this.steps[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(i?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${i}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.body?.setAttribute("style",`height:${this.currentTab?.offsetHeight}px`)))}previousTab(){this.currentIndex>0&&this.currentIndex--,p.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}submit(){this.submittedBefore()||this.validate(),salla.config.canLeave=!1,this.nextBtn.load().then((()=>this.submittedBefore()||this.sendFeedback())).then((()=>this.currentTab.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((t=>t.setAttribute("disabled",""))))).then((()=>this.currentIndex<this.stepsCount&&this.currentIndex++)).then((()=>this.showActiveStep())).then((()=>p.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)))).finally((()=>{this.nextBtn.stop(),salla.config.canLeave=!0,this.currentIndex==this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}))}submittedBefore(){return this.submitted.includes(this.currentIndex)}validate(t=null,i=null){if(!t&&"products"===this.currentTab.dataset.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));const e=(t=t||this.currentTab).querySelector(".rating_hidden_input").value,s=t.querySelector(".s-rating-modal-validation-msg");if(i=i||t.dataset.type,!e)throw s.innerHTML=salla.lang.get(`pages.rating.rate_${i}_stars`).replace(" (:item)",""),new Error(s.innerHTML);s.innerHTML=""}sendFeedback(){const t={};if(this.currentTab.querySelectorAll("[name]").forEach((i=>{const e=salla.helpers.inputData(i.name,i.value,t);t[e.name]=e.value})),this.allowAttachImages&&t.products)for(let i in t.products)t.products[i].images&&(t.products[i].images=t.products[i].images.split(","));if(0!=Object.keys(t).length)return t.order_id=this.orderId,t.type=this.currentTab.dataset.type,this.submitted.push(this.currentIndex),salla.rating.api[this.currentTab.dataset.type](t)}showThankYou(){let t=10,i=setInterval((()=>{this.thanksTime.innerHTML="00:0"+t--,t>0||(clearInterval(i),this.thanksTime.remove(),this.close().then((()=>window.location.reload())))}),1e3);this.modal.querySelector(".s-rating-modal-footer").classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${I}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}handleSendEmail(){const t=`${this.contactSubjectLabel} #${this.order.id}`,i=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),e=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(i)}`;window.open(e,"_blank")}handleSendWhatsApp(){const t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),i=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(t)}`;window.open(i,"_blank")}resetData(t){t.detail||(this.modal?.close(),this.editItem=null,this.editItemImages=[],this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.deleteFeedbackId=null,this.editFeedbackId=null,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1)}getDeleteModal(){return i("salla-modal",{ref:t=>this.deleteModal=t,width:"xs",onModalVisibilityChanged:t=>this.resetData(t)},i("div",{class:"s-rating-modal-delete-wrapper",ref:t=>this.body=t},i("h3",null,this.confirmDeletionLabel),i("p",null,this.areYouSureLabel),i("div",{class:"s-rating-modal-delete-actions"},i("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),i("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal.close()},this.cancelLabel))))}renderUploadedImagesCount(t){const e=this.editMode?this.editItemImages.length:(this.productImages[t]||[]).length;return i("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",e,{current:e,total:this.MAX_UPLOAD_LIMIT}))}getEditModal(){return i("salla-modal",{ref:t=>this.editModal=t,width:"md",onModalVisibilityChanged:t=>this.resetData(t)},i("div",{class:"s-rating-modal-edit-wrapper",ref:t=>this.body=t},"store"===this.editType&&this.editItem?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:t=>this.currentTab=t},i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),i("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),i("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:t=>this.currentTab=t},this.editItem.shipping.logo?i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):i("span",{class:"s-rating-modal-icon",innerHTML:qt}),i("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),i("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?i("section",{class:"s-rating-modal-step","data-type":"products",ref:t=>this.currentTab=t},i("div",{class:"s-rating-modal-product"},i("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},i("div",{class:"s-rating-modal-product-img-wrap"},i("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),i("div",{class:"s-rating-modal-product-details"},i("div",{class:"s-rating-modal-product-details-main"},i("div",null,i("h3",{class:"s-rating-modal-product-title"}," ",this.editItem.product.name),i("div",{class:"s-rating-modal-stars-product"},i("salla-rating-stars",{withLabel:!0,size:"small",editable:!0,value:this.editItem.stars}))),this.allowAttachImages&&i("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(1)},i("span",null,this.editItemImages.length?this.editImagesLabel:this.addImagesLabel),i("span",{innerHTML:I}))),i("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"content",class:"s-rating-modal-comment"}),i("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&i("div",{class:"s-rating-modal-uploader is-closed",ref:t=>this.contentRefs[1]=t},i("salla-file-upload",{name:"images",allowMultiple:!0,maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,filePosterHeight:117,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:t=>{this.editItemImages=[...this.editItemImages,t.detail],this.hiddenInputs[1].value=this.editItemImages.map((t=>t.url)).join()},onRemoved:t=>{const i=t.detail;i&&(this.editItemImages=this.editItemImages.filter((t=>t.id!==i)),this.hiddenInputs[1].value=this.editItemImages.map((t=>t.url)).join())},labelIdle:this.getFilepondPlaceholder()}),i("input",{type:"hidden",name:"images",value:this.editItem.images.join(","),ref:t=>this.hiddenInputs[1]=t}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,i("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},i("salla-button",{"loader-position":"center",onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.deleteMode?i(e,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?i(e,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?i(e,{class:"s-rating-modal"},i("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:t=>this.resetData(t),isLoading:!0,width:"md",ref:t=>this.modal=t},i("div",{slot:"loading"},i("div",{class:"s-rating-modal-skeleton"},i("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),i("salla-skeleton",{height:"15px",width:"60%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((t=>i("div",{key:t,innerHTML:jt})))),i("salla-skeleton",{height:"100px",width:"100%"}),i("div",{class:"s-rating-modal-skeleton-footer"},i("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[i("div",{class:"s-rating-modal-wrapper",ref:t=>this.body=t},this.order?.testimonials_enabled?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),i("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large"})),i("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):"",this.order.products_enabled?i("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products"},this.order.products.map(((t,e)=>i("div",{class:"s-rating-modal-product",key:e},i("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},i("div",{class:"s-rating-modal-product-img-wrap"},i("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),i("div",{class:"s-rating-modal-product-details"},i("div",{class:"s-rating-modal-product-details-main"},i("div",null,i("h3",{class:"s-rating-modal-product-title"}," ",t.product.name),i("div",{class:"s-rating-modal-stars-product"},i("salla-rating-stars",{withLabel:!0,size:"small",name:`products[${e}][rating]`}))),this.allowAttachImages&&i("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(e)},i("span",null,this.addImagesLabel),i("span",{innerHTML:I}))),i("input",{type:"hidden",name:`products[${e}][product_id]`,value:t.product.id}),i("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:`products[${e}][comment]`,class:"s-rating-modal-comment"}),i("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&i("div",{class:"s-rating-modal-uploader is-closed",ref:t=>this.contentRefs[e]=t},i("salla-file-upload",{name:"image",maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${t.product.id}`,title:t.product.name,allowMultiple:!0,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:i=>{this.productImages={...this.productImages,[t.product.id]:[...this.productImages[t.product.id]||[],i.detail]},this.hiddenInputs[e].value=this.productImages[t.product.id].map((t=>t.url)).join(",")},onRemoved:i=>{const s=i.detail;s&&this.productImages[t.product.id]&&(this.productImages={...this.productImages,[t.product.id]:this.productImages[t.product.id].filter((t=>t.id!==s))},this.hiddenInputs[e].value=this.productImages[t.product.id].map((t=>t.url)).join(","))},labelIdle:this.getFilepondPlaceholder()}),i("input",{type:"hidden",name:`products[${e}][images]`,value:(this.productImages[t.product.id]||[]).map((t=>t.url)).join(","),ref:t=>this.hiddenInputs[e]=t}),this.renderUploadedImagesCount(t.product.id)))))):"",this.order.shipping_enabled&&this.order.shipping?.company?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},i("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):i("span",{class:"s-rating-modal-icon",innerHTML:qt}),i("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large"})),i("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):"",i("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>this.thanksTab=t},i("span",{class:"s-rating-modal-icon",innerHTML:X}),i("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),i("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),i("time",{class:"s-rating-modal-thanks-time",ref:t=>this.thanksTime=t}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?i("div",{class:"s-rating-modal-contact"},i("p",null,this.contactUsLabel),i("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&i("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:w}),salla.config.get("store.contacts.email")&&i("span",{onClick:()=>this.handleSendEmail(),innerHTML:b}))):"",i("div",{class:"s-rating-modal-footer"},i("button",{ref:t=>this.backBtn=t,onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?i("ul",{class:"s-rating-modal-dots"},[0,1,2].slice(0,this.stepsCount).map((t=>i("li",{key:t,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",i("salla-button",{"loader-position":"center",ref:t=>this.nextBtn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:i("salla-placeholder",{alignment:"center"}))):void 0}componentWillLoad(){salla.event.on("rating::open",(()=>this.open())),salla.event.on("rating::edit",(t=>this.openEditModal(t))),salla.event.on("rating::delete",(t=>this.openDeleteModal(t)))}componentDidLoad(){salla.event.dispatch("rating::ready",this)}get host(){return s(this)}};Nt.style="";const Gt=class{constructor(i){t(this,i),this.translationsLoaded=!1,this.labels=[],this.reviewLabel="",this.selectedStar=0,this.name="rating",this.size="medium",this.reviews=0,this.editable=!1}async componentWillLoad(){await new Promise((t=>{salla.lang.onLoaded((()=>{this.labels=[salla.lang.get("pages.rating.poor"),salla.lang.get("pages.rating.average"),salla.lang.get("pages.rating.good"),salla.lang.get("pages.rating.very_good"),salla.lang.get("pages.rating.excellent")],this.value&&this.withLabel&&(this.reviewLabel=this.labels[this.value-1]),this.reviewsElement&&(this.reviewsElement.innerText=`(${salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews))})`),this.translationsLoaded=!0,t()}))}))}initiateRating(){this.host.addEventListener("click",this.handleRating.bind(this))}handleRating(){if(!this.starsElem)return;let t=this.starsElem.querySelectorAll(".s-rating-stars-hovered"),i=t[t.length-1];if(!i)return;let e=parseInt(i.getAttribute("data-star"));this.starsElem.querySelector(".rating_hidden_input").value=e.toString(),this.starsElem.querySelectorAll(".s-rating-stars-btn-star").forEach(((t,i)=>p.toggleElementClassIf(t,"s-rating-stars-selected","s-rating-stars-unselected",(()=>i<e)))),this.starsElem.querySelectorAll("[aria-pressed]").forEach((t=>t.removeAttribute("aria-pressed"))),i.setAttribute("aria-pressed","true"),this.selectedStar=e,this.withLabel&&(this.reviewLabel=this.labels[e-1])}triggerRatingProgrammatically(t){if(!this.starsElem)return;const i=this.starsElem.querySelectorAll(".s-rating-stars-btn-star");i&&t>=0&&t<=i.length&&(i.forEach(((i,e)=>{i.classList.toggle("s-rating-stars-hovered",e<=t)})),this.handleRating())}highlightSelectedStars(){let t="s-rating-stars-hovered",i=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");i?.forEach(((e,s)=>{e.addEventListener("mouseover",(()=>{for(let e=0;e<=s;e++)i[e].classList.add(t);this.withLabel&&(this.reviewLabel=this.labels[s])})),e.addEventListener("mouseout",(()=>{e.classList.remove(t),this.withLabel&&(this.reviewLabel=this.selectedStar?this.labels[this.selectedStar-1]:"")}))})),this.starsElem?.addEventListener("mouseout",(()=>i.forEach((i=>i.classList.remove(t)))))}createStars(t){let e=[];for(let s=0;s<5;s++)e.push(i("span",{class:{"s-rating-stars-btn-star":!0,["s-rating-stars-"+this.size]:!0,"s-rating-stars-selected":s<t},innerHTML:ct}));return this.reviews>0&&e.push(i("span",{class:"s-rating-stars-reviews",ref:t=>this.reviewsElement=t},"(",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews)),")")),e}render(){return this.translationsLoaded?this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":i(e,null,i("div",{class:"s-rating-stars-wrapper"},!this.value&&0!=this.value||this.editable?i("div",{class:"s-rating-stars-element",ref:t=>this.starsElem=t},i("input",{type:"hidden",class:"rating_hidden_input",name:this.name,value:""}),[1,2,3,4,5].map((t=>i("button",{class:"s-rating-stars-btn-star s-rating-stars-"+this.size,"data-star":t},i("span",{innerHTML:ct}))))):this.createStars(this.value),this.withLabel&&this.reviewLabel?i("span",{class:"s-rating-stars-label"},this.reviewLabel):"")):i(e,null)}componentDidLoad(){if(this.initiateRating(),this.highlightSelectedStars(),this.value&&this.editable){const t=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");t&&this.value>=0&&this.value<=t.length&&this.triggerRatingProgrammatically(this.value-1)}}get host(){return s(this)}};Gt.style="";const Wt=class{constructor(i){t(this,i),this.canRender=!1,this.showRatingSummary=!1,this.recommendationOnly=!1,this.showRecommendation=!1}async componentWillLoad(){try{await salla.onReady(),this.initializeLanguages(),this.loadConfig(),(this.showRatingSummary||this.showRecommendation)&&await this.loadSummary()}catch(t){console.error("Failed to initialize reviews summary component:",t)}}async loadConfig(){this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary"),this.showRecommendation=salla.config.get("store.settings.rating.show_recommendation"),this.recommendationOnly=this.showRecommendation&&!this.showRatingSummary}initializeLanguages(){return Salla.lang.onLoaded((()=>{Salla.lang.addBulk({"blocks.comments.based_on":{ar:"بناءً على",en:"Based on"},"blocks.comments.recommended":{ar:"أوصوا بالمنتج",en:"Recommended"}}),this.basedOnLabel=salla.lang.get("blocks.comments.based_on"),this.recommendedLabel=salla.lang.get("blocks.comments.recommended")}))}async loadSummary(){if(!this.itemId)return console.error("Error loading reviews summary: itemId is not defined"),this.canRender=!1;try{const t=await salla.api.request(`rating/summary/${this.itemId}`);if(!t?.data||Array.isArray(t.data.reviews)&&!t.data.reviews.length)return this.canRender=!1,void(this.data=null);this.data=t.data,this.canRender=!0}catch(t){this.canRender=!1,this.data=null,console.error("Error loading reviews summary:",t)}}renderRecommendation(){return this.showRecommendation&&this.data?.recommendation?i("div",{class:("s-reviews-summary-header-section "+(this.recommendationOnly?"s-reviews-summary-recommendation-only":"")).trim()},i("h4",{class:"s-reviews-summary-recommendation-percentage"},"%",this.data?.recommendation),i("p",{class:"s-reviews-summary-count"},this.recommendedLabel)):null}render(){if(!this.canRender)return null;if(this.recommendationOnly)return this.renderRecommendation();const t={1:0,2:0,3:0,4:0,5:0,...this.data.reviews},s=Object.keys(t).reverse().map((e=>{const s=t[e];return i("div",{key:e,class:"s-reviews-summary-row"},i("div",{class:"s-reviews-summary-row-rate"},e," ",i("span",{innerHTML:ct})),i("salla-progress-bar",{class:"s-reviews-summary-progress",value:s,target:100,hideUnits:!0,height:"16px"}),i("span",{class:"s-reviews-summary-percentage"},s,"%"))}));return i(e,{class:"s-reviews-summary-wrapper"},i("div",{class:"s-reviews-summary-header"},i("div",{class:"s-reviews-summary-header-section"},i("h3",{class:"s-reviews-summary-average"},this.data.rating),i("div",null,i("salla-rating-stars",{size:"large",value:this.data.rating}),i("p",{class:"s-reviews-summary-count"},this.basedOnLabel," ",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.data.count))))),this.renderRecommendation()),i("div",{class:"s-reviews-summary-rows"},s))}};Wt.style=":host{display:block}";var Ut,Yt='\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>search</title>\n<path d="M30.276 28.391l-7.576-7.576c1.644-2.053 2.633-4.652 2.633-7.481 0-6.616-5.384-12-12-12s-12 5.384-12 12 5.384 12 12 12c2.829 0 5.428-0.989 7.481-2.633l7.576 7.576c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM13.333 22.667c-5.147 0-9.333-4.187-9.333-9.333s4.187-9.333 9.333-9.333 9.333 4.187 9.333 9.333-4.187 9.333-9.333 9.333z"></path>\n</svg>\n';!function(t){t.DEFAULT="default",t.AVAILABILITY="availability"}(Ut||(Ut={}));const Zt=class{constructor(i){t(this,i),this.loadedScopes={[Ut.DEFAULT]:null,[Ut.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=Ut.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{if(this.originalScopesList?.length<2)return"";const t=salla.config.get("store.features")?.includes("multi-countries");return this.mode===Ut.DEFAULT?salla.lang.get(t?"blocks.scope.shopping_from_another_market":"blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:t=null,product_id:i=null})=>{this.open(t,i)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}async close(){return await(this.modal?.close())}async open(t=Ut.DEFAULT,i=null){return this.hasError=!1,this.mode=[Ut.AVAILABILITY,Ut.DEFAULT].includes(t)?t:Ut.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>t==Ut.AVAILABILITY?salla.scope.getProductAvailability(i):salla.scope.get())).then((i=>{if(t==Ut.AVAILABILITY)return this.setScopeValues(this.loadedScopes[Ut.AVAILABILITY]=i.data);this.setScopeValues(this.loadedScopes[this.mode]=i.data.scopes)})).catch((t=>{console.log(t),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading())}async handleSubmit(){let t={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(t).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),salla.cart.reset(),window.location.replace(salla.helpers.addParamToUrl("scope",this.current_scope.id))})).catch((t=>console.log(t))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(t){this.scopes=t,this.originalScopesList=t,1==t?.length?(this.current_scope=t[0],this.selected_scope=t[0],this.scopes=[t[0]]):(this.current_scope=t?.find((t=>t.selected)),this.selected_scope=t?.find((t=>t.selected)))}handleSearchFieldTyping(t){let i=t.target.value.toLocaleLowerCase();this.scopes=i?this.originalScopesList.filter((t=>t.name.toLowerCase().includes(i))):this.originalScopesList}handleScopeSelection(t){this.current_scope=this.scopes?.find((i=>i.id==t.target.value))}placeholderContent(){return i("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},i("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),i("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[i("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((t=>i("div",{class:"s-scopes-input-wrap","data-selection":this.selection},i("input",{id:`${this.selection} + '_scope_' + ${t.id}`,name:"lang",type:"radio",value:t.id,onChange:t=>this.handleScopeSelection(t),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==t.id}),i("label",{htmlFor:`${this.selection} + '_scope_' + ${t.id}`,class:"s-scopes-label s-scopes-clickable"},i("span",null,t.name)))))),this.footerContent()]}availabilityContent(){return i("div",{class:"s-scopes-container"},this.scopes?.map((t=>i("div",{class:"s-scopes-input-wrap","data-selection":this.selection},i("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===Ut.DEFAULT}},i("span",null,t.name)),i("h2",{style:{color:t?.availability?.color},class:`s-scopes-${t?.availability?.key}`},t?.availability?.label)))))}footerContent(){return i("div",{class:"s-scopes-footer"},i("slot",{name:"footer"},i("salla-button",{ref:t=>this.changeBtn=t,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}componentWillLoad(){return salla.onReady()}render(){return i(e,{key:"eb070775cb835b58f2ca5d38d1b47c0e4c1efa8b"},i("salla-modal",{key:"a9ef86c5a4bc3db4353047163ce1cb794ca84345",ref:t=>this.modal=t,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?i("div",{slot:"loading"},i("div",{class:"s-scopes-skeleton"},i("salla-list-tile",{class:"s-scopes-header"},i("div",{slot:"icon",class:"s-scopes-header-icon"},i("salla-skeleton",{type:"circle"})),i("div",{slot:"title",class:"s-scopes-header-title mb-5"},i("salla-skeleton",{height:"15px",width:"50%"})),i("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},i("salla-skeleton",{height:"10px"}),i("salla-skeleton",{height:"10px",width:"75%"}))),i("div",{class:"s-scopes-skeleton-search"},i("salla-skeleton",{height:"10px",width:"50%"}),i("salla-skeleton",{height:"30px",width:"100%"})),i("div",{class:"s-scopes-skeleton-scopes"},i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"})),i("div",{class:"s-scopes-skeleton-btn"},i("salla-skeleton",{height:"40px",width:"100%"})))):[i("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},i("div",{slot:"icon",class:"s-scopes-header-icon",innerHTML:'\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>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),i("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),i("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),i("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&i("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?i("div",{class:"s-scopes-search-wrapper"},i("div",{class:"s-scopes-search-icon",innerHTML:Yt}),i("input",{type:"text",class:"s-scopes-search-input",onInput:t=>this.handleSearchFieldTyping(t),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||!this.originalScopesList?.length&&this.mode!==Ut.AVAILABILITY?this.placeholderContent():this.mode===Ut.DEFAULT?this.defaultContent():this.availabilityContent())]))}componentDidLoad(){this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};Zt.style=".s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}";const Vt=class{constructor(i){t(this,i),this.inputValue="",this.translationLoaded=!1,this.loading=!1,this.typing=!1,this.debounce=setTimeout((()=>""),1e3),this.inline=!1,this.oval=!1,this.height=60,this.maxWords=5,this.showAction=!1,this.productSlot=this.host.querySelector('[slot="product"]')?.innerHTML||this.getDefaultProductSlot(),salla.event.on("search::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),salla.event.on("modalClosed",(()=>this.onModalClose()))}async open(){this.inline||await this.modal.open().then((()=>setTimeout((()=>this.searchInput.focus()),300)))}onModalClose(){this.searchInput.value="",this.results=void 0,this.afterSearching(),this.container.classList.remove("s-search-no-results")}handleKeyDown(t){"Enter"===t.key&&this.search_term?.length&&(window.location.href=salla.url.get("search?q="+encodeURI(this.search_term)))}getDefaultProductSlot(){return'<div class="s-search-product-image-container"> <img class="s-search-product-image" src="{image}" alt="{name}"/></div><div class="s-search-product-details"> <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div></div>'}debounceSearch(t){this.typing=!0,clearTimeout(this.debounce),this.debounce=setTimeout((()=>{this.typing=!1,this.search_term=t.target.value}),700)}limitWordsAndSearch(t){const i=t.target.value.trim().split(/\s+/);if(i.length>this.maxWords){const t=i.slice(0,this.maxWords).join(" ");this.searchInput.value=t}this.debounceSearch(t)}getQueryParam(t){return new URLSearchParams(window.location.search).get(t)}handleActionClick(){if(this.search_term&&this.search_term.length>2)return this.search(this.search_term)}handleSearch(t){this.inputValue=t,t.length>2?this.search(t):(this.results=void 0,this.afterSearching())}search(t){this.noResults.style.display="none",this.loading=!0,salla.product.fetch({source:"search",source_value:t}).then((i=>{this.results=i,salla.event.emit("Products Searched",t)})).catch((t=>"Query is same as previous one!"!==t?this.results=void 0:null)).finally((()=>this.afterSearching(!1)))}afterSearching(t=!0){this.noResults.style.display=t||this.results?.data.length>0?"none":"block",p.toggleElementClassIf(this.container,"s-search-container-open","s-search-no-results",(()=>this.results?.data.length)),this.loading=!1,salla.product.api.previousQuery="",this.inputValue.length<3&&this.container.classList.remove("s-search-no-results")}render(){const t=i("div",{key:"64b8dccb734fee6d08cec74f87d7fb8486f0da00",class:{"s-search-container":!0,"s-search-inline":this.inline},ref:t=>this.container=t},i("div",{key:"aef0ccb76aebff05b167dfe05a95ae19daa383ec",class:"s-search-input-wrapper"},i("span",{key:"ac7cb6699f2c6b09fb9da9e57cfe8e724c29e358",class:"s-search-icon-wrap"},i("span",{key:"68f7207dafca4f6a337c2629338f84f29ccec3ef",class:"s-search-icon",innerHTML:this.loading?'<i class="s-search-spinner-loader"/>':Yt})),i("input",{key:"e182fff8d2f4d98cea7fd0a4c22b5fab5cff7dd2",type:"search",enterkeyhint:"search",autocomplete:"off",class:"s-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder"),onInput:t=>this.limitWordsAndSearch(t),onKeyDown:t=>this.handleKeyDown(t),ref:t=>this.searchInput=t,style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}),this.showAction?i("salla-button",{loading:this.loading,class:{"s-search-action":!0,"s-search-action-oval":this.oval},onClick:()=>this.handleActionClick()},!this.loading&&i("span",{innerHTML:Yt})):null),i("div",{key:"a72889d16dc8949b3a42375f4377cda74f8de01a",class:"s-search-results"},this.results?.data.map((t=>i("a",{href:t.url+"?from=search-bar",class:{"s-search-product":!0,"s-search-product-not-available":!t.is_available},innerHTML:this.productSlot.replace(/\{name\}/g,t.name).replace(/\{price\}/g,t.price?salla.money(t.price):"").replace(/\{regular_price\}/g,t.is_on_sale&&t.regular_price?salla.money(t.regular_price):"").replace(/\{image\}/g,t.image.url)}))),i("p",{key:"63ae4b78f510b2a013813a544b240ac0cc7a8c69",ref:t=>this.noResults=t,class:"s-search-no-results-placeholder"},salla.lang.get("common.elements.no_options"))));return this.inline?i("div",{class:"s-search-modal"},t):i("salla-modal",{position:"top",class:"s-search-modal",ref:t=>this.modal=t},t)}componentDidLoad(){this.afterSearching(),this.searchInput.value=this.getQueryParam("q")}get host(){return s(this)}static get watchers(){return{search_term:["handleSearch"]}}};Vt.style="";const Jt=class{constructor(i){t(this,i),this.type="normal",this.width="100%",this.height="100%"}render(){return i(e,{key:"64e0a58754b26fcca6cbc93d636c1c4d4f895a53",class:"s-skeleton-wrapper",style:{width:this.width,height:this.height}},i("div",{key:"1e19620023d4dfc07d343e47bd2a0126db3f034a",class:{"s-skeleton-item":!0,"s-skeleton-item-circular":"circle"==this.type}}," "))}};Jt.style=":host{display:block}";const Qt=class{constructor(i){t(this,i),this.afterInit=a(this,"afterInit"),this.slideChange=a(this,"slideChange"),this.reachBeginning=a(this,"reachBeginning"),this.reachEnd=a(this,"reachEnd"),this.slideChangeTransitionEnd=a(this,"slideChangeTransitionEnd"),this.slideChangeTransitionStart=a(this,"slideChangeTransitionStart"),this.slideNextTransitionEnd=a(this,"slideNextTransitionEnd"),this.slideNextTransitionStart=a(this,"slideNextTransitionStart"),this.slidePrevTransitionEnd=a(this,"slidePrevTransitionEnd"),this.slidePrevTransitionStart=a(this,"slidePrevTransitionStart"),this.sliderMove=a(this,"sliderMove"),this.touchSliderEnd=a(this,"touchSliderEnd"),this.touchSliderMove=a(this,"touchSliderMove"),this.touchSliderStart=a(this,"touchSliderStart"),this.sliderTransitionEnd=a(this,"sliderTransitionEnd"),this.sliderTransitionStart=a(this,"sliderTransitionStart"),this.blockTitle="",this.listenToThumbnailsOption=!1,this.blockSubtitle="",this.displayAllUrl="",this.arrowsCentered=!1,this.verticalThumbs=!1,this.gridThumbs=!1,this.vertical=!1,this.autoHeight=!1,this.showControls=!0,this.controlsOuter=!1,this.showThumbsControls=!0,this.autoPlay=!1,this.slidesPerView="auto",this.pagination=!1,this.centered=!1,this.loop=!1,this.type="",this.currentIndex=void 0,this.isEnd=!1,this.isBeginning=!0,this.windowWidth=window.innerWidth,this.hasThumbSlot=!1,this.pre_defined_config={carousel:{speed:300,slidesPerView:"auto",spaceBetween:0},fullwidth:{speed:750,parallax:!0},fullscreen:{speed:1e3,parallax:!0,direction:"vertical",followFinger:!1,touchReleaseOnEdges:!0,lazy:!0,mousewheel:{}},testimonials:{draggable:!0,slidesPerView:1,breakpoints:{1024:{slidesPerView:2}}},blog:{parallax:!0,speed:800,loop:!0,slidesPerView:1,centeredSlides:!0,spaceBetween:30,breakpoints:{320:{spaceBetween:10},768:{spaceBetween:15},980:{paceBetween:30}}},thumbs:{slidesPerView:1,spaceBetween:30}},this.direction=this.direction||document.documentElement.dir}async sliderInstance(){return this.slider}async slideTo(t,i,e){return this.slider.slideTo(t,i,e)}async slideNext(t,i){this.slider?.slideNext(t,i)}async slidePrev(t,i){this.slider?.slidePrev(t,i)}async slideToLoop(t,i,e){this.slider.slideToLoop(t,i,e)}async slideNextLoop(t,i){this.slider.slideNextLoop(t,i)}async slidePrevLoop(t,i){this.slider.slidePrevLoop(t,i)}async slideReset(t,i){this.slider.slideReset(t,i)}async slideToClosest(t,i){this.slider.slideToClosest(t,i)}async update(){this.slider.update()}async updateAutoHeight(t){this.slider.updateAutoHeight(t)}async updateSlides(){this.slider.updateSlides()}async updateProgress(){this.slider.updateProgress()}async updateSlidesClasses(){this.slider.updateSlidesClasses()}async getSlides(){return await(this.slider?.slides)}async updateSize(){return await this.slider.updateSize()}async sliderInit(){return await this.slider.init()}async thumbsSliderInstance(){return await this.thumbsSlider}async thumbsSliderInit(){return await this.thumbsSlider.init()}async thumbsSliderUpdate(){return await this.thumbsSlider.update()}async thumbsSliderUpdateSlides(){return await this.thumbsSlider.updateSlides()}async getThumbsUpdateSize(){return await(this.thumbsSlider?.updateSize())}async thumbsSlideTo(t,i,e){return this.thumbsSlider.slideTo(t,i,e)}async getThumbsSlides(){return await(this.thumbsSlider?.slides)}componentWillLoad(){return salla.lang.onLoaded((()=>{this.displayAllTitle=salla.lang.get("blocks.home.display_all")})),this.hasThumbSlot=!!this.host.querySelector('[slot="thumbs"]'),this.listenToThumbnailsOption&&salla.event.on("product-options::change",(t=>{if("thumbnail"==t.option.type){const i=this.sliderWrapper.querySelector(`[data-img-id="${t.detail.option_value}"]`)?.getAttribute("data-slid-index");i&&this.slideTo(parseInt(i),300,!1)}})),new Promise(((t,i)=>{if("undefined"!=typeof Swiper)return t(!0);if(document.getElementById("swiper-script")){let i=setInterval((()=>{"undefined"!=typeof Swiper&&(clearInterval(i),t(!0))}),5)}else this.swiperScript=document.createElement("script"),this.swiperScript.onload=()=>{t(!0),salla.event.emit("swiper::loaded")},this.swiperScript.onerror=t=>{salla.logger.warn("failed load swiper bundle",t),i(!0)},this.swiperScript.src="https://cdn.salla.network/js/swiper@8.js",this.swiperScript.setAttribute("id","swiper-script"),document.body.appendChild(this.swiperScript)}))}getSwiperConfig(){let t=this.autoPlay;t&&"object"!=typeof t&&(t={delay:1e4});let i={loop:this.loop,autoplay:t,centeredSlides:this.centered,slidesPerView:this.slidesPerView,autoHeight:this.autoHeight,lazy:!0,on:{afterInit:t=>{this.afterInit.emit(t),document.lazyLoadInstance?.update(),this.loop&&t.slides.map((t=>{t.classList.contains("swiper-slide-duplicate")&&t.querySelectorAll("img.lazy:not(.loaded)").forEach((t=>t.classList.add("loaded")))}))}},pagination:!!this.pagination&&{el:this.host.id?`#${this.host.id} .swiper-pagination`:"",clickable:!0},navigation:!!this.showControls&&{nextEl:this.host.id?`#${this.host.id} .s-slider-next`:"",prevEl:this.host.id?`#${this.host.id} .s-slider-prev`:""},breakpoints:{768:{direction:this.vertical?"vertical":"horizontal"}}},e={freeMode:!1,watchSlidesProgress:!0,slidesPerView:4,spaceBetween:10,watchOverflow:!0,watchSlidesVisibility:!0,breakpoints:{768:{direction:this.verticalThumbs?"vertical":"horizontal",spaceBetween:16}},navigation:!!this.showThumbsControls&&{nextEl:this.host.id?`#${this.host.id} .s-slider-thumbs-next`:"",prevEl:this.host.id?`#${this.host.id} .s-slider-thumbs-prev`:""}};if(this.pre_defined_config.fullscreen.mousewheel={releaseOnEdges:!(this.host.querySelectorAll(".swiper-slide").length>1)},i={...i,...this.pre_defined_config[this.type]||{}},"thumbs"==this.type&&this.thumbsSliderWrapper){for(const t of this.thumbsSliderWrapper.children)t.classList.add("swiper-slide");if(this.hasThumbSlot&&this.thumbsConfig)try{e={...e,..."string"==typeof this.thumbsConfig?JSON.parse(this.thumbsConfig):this.thumbsConfig}}catch(t){salla.logger.warn("Failed to parse thumbs slider config:",t)}this.thumbsSlider=new Swiper(this.thumbsSliderContainer,e),i.thumbs={swiper:this.thumbsSlider}}if(i={...i},this.sliderConfig)try{i={...i,..."string"==typeof this.sliderConfig?JSON.parse(this.sliderConfig):this.sliderConfig}}catch(t){salla.logger.warn("Failed to parse slider config:",t)}return i}getThumbsDirection(){const{verticalThumbs:t,windowWidth:i,direction:e}=this;return t&&i<768&&"rtl"===e?"rtl":t&&i>768&&"rtl"===e?"ltr":e}initSlider(){for(const t of this.sliderWrapper.children)t.classList.add("swiper-slide");this.slider=new Swiper(this.sliderContainer,this.getSwiperConfig()),this.slider.on("slideChange",(t=>{this.isBeginning=t.isBeginning,this.isEnd=t.isEnd,this.slideChange.emit(t)})),this.slider.on("reachBeginning",(t=>this.reachBeginning.emit(t))),this.slider.on("reachEnd",(t=>this.reachEnd.emit(t))),this.slider.on("slideChangeTransitionEnd",(t=>{if("fullscreen"==this.type){const i=t.activeIndex;t.params.mousewheel.releaseOnEdges=0===i||i===t.slides.length-1}this.slideChangeTransitionEnd.emit(t)})),this.slider.on("slideChangeTransitionStart",(t=>this.slideChangeTransitionStart.emit(t))),this.slider.on("slideNextTransitionEnd",(t=>this.slideNextTransitionEnd.emit(t))),this.slider.on("slideNextTransitionStart",(t=>this.slideNextTransitionStart.emit(t))),this.slider.on("slidePrevTransitionEnd",(t=>this.slidePrevTransitionEnd.emit(t))),this.slider.on("slidePrevTransitionStart",(t=>this.slidePrevTransitionStart.emit(t))),this.slider.on("sliderMove",(t=>this.sliderMove.emit(t))),this.slider.on("touchEnd",(t=>this.touchSliderEnd.emit(t))),this.slider.on("touchMove",(t=>this.touchSliderMove.emit(t))),this.slider.on("touchStart",(t=>this.touchSliderStart.emit(t))),this.slider.on("transitionEnd",(t=>this.sliderTransitionEnd.emit(t))),this.slider.on("transitionStart",(t=>this.sliderTransitionStart.emit(t)))}render(){let t=this.type?this.type+"-slider ":"";return t+=this.controlsOuter?" s-slider-controls-outer ":"",t+=""==this.blockTitle?" s-slider-has-notitle s-slider-v-centered ":"",t+=this.verticalThumbs?" s-slider-vertical ":" s-slider-horizontal ",t+=this.arrowsCentered?" s-slider-v-centered ":"",t+=this.gridThumbs?" s-slider-with-grid-thumbs ":"",i(e,{key:"f252a63bd425f788d31328179372fa365385a85c",class:"s-slider-wrapper "+t},this.blockTitle||this.showControls?i("div",{class:"s-slider-block__title"},this.blockTitle?i("div",{class:"s-slider-block__title-right"},i("h2",null,this.blockTitle),this.blockSubtitle?i("p",{innerHTML:this.blockSubtitle}):""):"",i("div",{class:"s-slider-block__title-left"},this.displayAllUrl?i("a",{href:this.displayAllUrl,class:"s-slider-block__display-all"},this.displayAllTitle):"",this.showControls?i("div",{class:"s-slider-block__title-nav",dir:"rtl"},i("button",{"aria-label":"Previous Slide",class:"s-slider-prev s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?B:D})),i("button",{"aria-label":"Next Slide",class:"s-slider-next s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?D:B}))):"")):"",i("div",{key:"e84fedf7c982d9c15a2b43631123ae42ecf98ab8",class:"swiper s-slider-container",ref:t=>this.sliderContainer=t,dir:this.vertical?"ltr":this.direction},i("slot",{key:"b91356832a6d5e19134073400f19046c3372b403"}),i("div",{key:"21d21f8ec73eb27016a199272e4193456e2e3823",class:"swiper-wrapper s-slider-swiper-wrapper",ref:t=>this.sliderWrapper=t},i("slot",{key:"e18cdeba693a383a75523836c761f33bbc5e115e",name:"items"})),this.pagination?i("div",{class:"swiper-pagination"}):""),"thumbs"==this.type&&this.hasThumbSlot?i("div",{class:"s-slider-thumbs"},i("div",{class:"swiper s-slider-thumbs-container",dir:this.getThumbsDirection(),ref:t=>this.thumbsSliderContainer=t},i("div",{class:{"s-slider-swiper-wrapper swiper-wrapper":!0,"s-slider-grid-thumbs":this.gridThumbs},ref:t=>this.thumbsSliderWrapper=t},i("slot",{name:"thumbs"})),this.showThumbsControls?i("div",{class:"s-slider-thumbs-nav",dir:"rtl"},i("button",{"aria-label":"Previous Slide",class:"s-slider-thumbs-prev s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?B:D})),i("button",{"aria-label":"Next Slide",class:"s-slider-thumbs-next s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?D:B}))):null)):null)}componentDidLoad(){let t=this.sliderWrapper.querySelector('div[slot="items"]');if(t&&t.replaceWith(...t.children),"thumbs"==this.type&&this.hasThumbSlot){let t=this.thumbsSliderWrapper.querySelector('div[slot="thumbs"]');t&&t.replaceWith(...t.children)}"undefined"==typeof Swiper?salla.event.once("swiper::loaded",(()=>this.initSlider())):this.initSlider()}get host(){return s(this)}};var Kt;Qt.style='@font-face{font-family:"swiper-icons";src:url("data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA") format("woff");font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{transform:translate3d(0px, 0, 0)}.swiper-pointer-events{touch-action:pan-y}.swiper-pointer-events.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform, height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);backface-visibility:hidden}.swiper-3d,.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0, 0, 0, 0.15)}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:"";flex-shrink:0;order:9999}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;height:var(--swiper-centered-offset-after)}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}:root{}.swiper-pagination{position:absolute;text-align:center;transition:300ms opacity;transform:translate3d(0, 0, 0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none !important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(0.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:50%;background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, 0.2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none !important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:10px;top:50%;transform:translate3d(0px, -50%, 0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:200ms transform, 200ms top}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:200ms transform, 200ms left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:200ms transform, 200ms right}.swiper-pagination-progressbar{background:rgba(0, 0, 0, 0.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:4px;height:100%;left:0;top:0}.swiper-pagination-lock{display:none}:root{--swiper-navigation-size:44px;}.swiper-button-prev,.swiper-button-next{position:absolute;top:50%;width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - var(--swiper-navigation-size) / 2);z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:0.35;cursor:auto;pointer-events:none}.swiper-button-prev.swiper-button-hidden,.swiper-button-next.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-prev,.swiper-navigation-disabled .swiper-button-next{display:none !important}.swiper-button-prev:after,.swiper-button-next:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none !important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:10px;right:auto}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:"prev"}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:10px;left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:"next"}.swiper-button-lock{display:none}',function(t){t.FACEBOOK="facebook",t.TWITTER="twitter",t.WHATSAPP="whatsapp",t.EMAIL="email",t.COPY_LINK="copy_link"}(Kt||(Kt={}));const Xt=class{constructor(i){t(this,i),this.opened=!1,this.allPlatforms=[Kt.WHATSAPP,Kt.FACEBOOK,Kt.TWITTER,Kt.EMAIL,Kt.COPY_LINK],this.platformIcons=[{icon:'\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>whatsapp</title>\n<path d="M16 32c-0.008 0-0.018 0-0.028 0-3.1 0-5.993-0.887-8.439-2.421l0.066 0.039-7.2 2.3 2.336-6.964c-1.713-2.492-2.736-5.575-2.736-8.897 0-0.020 0-0.040 0-0.060v0.003c0.009-8.833 7.167-15.991 15.999-16h0.001c8.837 0 16 7.163 16 16s-7.163 16-16 16v0zM7.906 27.424l0.4 0.264c2.169 1.449 4.837 2.312 7.707 2.312 7.732 0 14-6.268 14-14s-6.268-14-14-14c-0.004 0-0.009 0-0.013 0h0.001c-7.729 0.008-13.992 6.271-14 13.999v0.001c-0 0.010-0 0.021-0 0.032 0 3.072 1 5.909 2.693 8.206l-0.027-0.038 0.304 0.416-1.4 4.2zM20.716 24.958c-1.684-0.131-3.237-0.574-4.641-1.271l0.073 0.033c-3.098-1.456-5.634-3.668-7.438-6.405l-0.042-0.067c-1.102-1.357-1.819-3.067-1.962-4.938l-0.002-0.030c-0.001-0.036-0.001-0.078-0.001-0.12 0-1.575 0.66-2.995 1.719-4l0.002-0.002c0.547-0.52 1.289-0.839 2.105-0.839 0.033 0 0.066 0.001 0.099 0.002l-0.005-0c0.2 0 0.378 0 0.542 0.018 0.016-0.001 0.035-0.001 0.054-0.001 0.815 0 1.502 0.549 1.711 1.298l0.003 0.012 0.324 0.782c0.376 0.906 0.858 2.068 0.942 2.244 0.144 0.251 0.23 0.552 0.23 0.873 0 0.286-0.068 0.557-0.188 0.797l0.005-0.010c-0.149 0.307-0.332 0.57-0.55 0.802l0.002-0.002c-0.148 0.168-0.248 0.274-0.346 0.378s-0.172 0.18-0.26 0.284c0.575 0.92 1.237 1.713 1.992 2.406l0.008 0.008c0.829 0.758 1.802 1.373 2.872 1.8l0.064 0.022c0.369-0.266 0.672-0.6 0.896-0.985l0.008-0.015 0.174-0.232c0.328-0.484 0.875-0.798 1.495-0.798 0.249 0 0.487 0.051 0.703 0.142l-0.012-0.004c0.492 0.168 2.922 1.372 2.946 1.384l0.228 0.11c0.415 0.149 0.758 0.417 0.996 0.763l0.004 0.007c0.107 0.349 0.169 0.75 0.169 1.166 0 0.591-0.125 1.153-0.349 1.661l0.010-0.026c-0.702 1.368-1.983 2.353-3.511 2.637l-0.031 0.005c-0.309 0.071-0.663 0.112-1.028 0.112-0.004 0-0.007 0-0.011 0h0.001zM10.632 9.318c-0.028-0.002-0.062-0.004-0.095-0.004-0.245 0-0.472 0.076-0.659 0.206l0.004-0.002c-0.726 0.651-1.18 1.591-1.18 2.638 0 0.044 0.001 0.087 0.002 0.13l-0-0.006c0.122 1.404 0.662 2.662 1.495 3.671l-0.009-0.011 0.12 0.168c1.627 2.491 3.865 4.46 6.504 5.723l0.096 0.041c3.136 1.288 3.916 1.124 4.426 1.014 0.87-0.159 1.601-0.656 2.067-1.347l0.007-0.011c0.12-0.316 0.204-0.682 0.237-1.063l0.001-0.015-0.040-0.018-0.256-0.124c-0.8-0.4-2.46-1.2-2.734-1.292l-0.058 0.184c-0.346 0.501-0.684 0.934-1.045 1.347l0.015-0.017c-0.344 0.349-0.821 0.565-1.349 0.565-0.28 0-0.546-0.061-0.785-0.17l0.012 0.005c-1.403-0.547-2.609-1.301-3.646-2.239l0.010 0.009c-0.975-0.891-1.81-1.912-2.486-3.039l-0.034-0.061c-0.152-0.244-0.242-0.54-0.242-0.857 0-0.463 0.191-0.88 0.499-1.178l0-0c0.13-0.162 0.264-0.302 0.4-0.444l0.236-0.256c0.091-0.096 0.177-0.201 0.254-0.311l0.006-0.009c-0.158-0.36-0.622-1.472-0.988-2.352l-0.322-0.772-0.038-0.086c-0.188-0.010-0.302-0.016-0.426-0.016zM12.462 12.442v0.012z"></path>\n</svg>\n',name:Kt.WHATSAPP},{icon:y,name:Kt.FACEBOOK},{icon:_,name:Kt.TWITTER},{icon:b,name:Kt.EMAIL},{icon:'\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>link</title>\n<path d="M19.247 23.019l-4.189 4.189c-2.831 2.831-7.435 2.831-10.265 0-1.371-1.372-2.125-3.193-2.125-5.132s0.755-3.761 2.125-5.133l4.189-4.191c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-4.189 4.191c-1.875 1.875-2.907 4.367-2.907 7.019s1.032 5.143 2.907 7.017 4.368 2.907 7.019 2.907 5.143-1.032 7.017-2.908l4.189-4.189c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.52-1.885 0.001zM22.276 9.724c-0.521-0.521-1.364-0.521-1.885 0l-10.667 10.667c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l10.667-10.667c0.521-0.521 0.521-1.364 0-1.885zM29.093 2.908c-1.875-1.876-4.368-2.908-7.019-2.908s-5.143 1.032-7.017 2.908l-4.189 4.188c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l4.189-4.189c2.831-2.831 7.435-2.831 10.265 0 1.371 1.372 2.125 3.193 2.125 5.132s-0.755 3.761-2.125 5.133l-4.189 4.191c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l4.189-4.191c1.875-1.875 2.907-4.367 2.907-7.019s-1.032-5.143-2.907-7.016z"></path>\n</svg>\n',name:Kt.COPY_LINK}],this.convertedPlatforms=[],this.url="",this.urlName="",this.platforms="facebook,twitter,whatsapp,email,copy_link"}componentWillLoad(){if(document.getElementById("a2a-script"))return;const t=document.createElement("script");t.src="https://static.addtoany.com/menu/page.js",t.setAttribute("id","a2a-script"),t.async=!0,t.onload=function(){window.a2a_config.locale=salla.config.get("user.language_code",salla.lang.getLocale()),window.a2a_config.callbacks=window.a2a_config.callbacks||[],window.a2a_config.callbacks.push({share:t=>{const i={share_via:t.service.toLowerCase(),url:t.url,title:t.title};salla.event.emit("share-element",i)}})},document.body.appendChild(t)}async open(){const t=(new r.timeline).add({targets:this.shareMenu,translateY:[-50,0],opacity:[0,1],duration:300,podding:"0",easing:"easeInOutSine"});t.add({targets:this.shareMenu.children,translateZ:0,translateY:[-30,0],scaleY:[0,1],opacity:[0,1],duration:1400,delay:r.stagger(100)},"-=200"),this.opened=!this.opened,this.opened?this.shareMenu.classList.add("opened"):(t.pause(),t.seek(0),this.shareMenu.classList.remove("opened"))}async refresh(){window.a2a?.init("page")}render(){return i("div",{key:"dcba2bc3344b69f395379ac57b849d02013cd778",class:"s-social-share-wrapper"},i("slot",{key:"ce23f2263042bd09d1233570739756d8aa133145",name:"widget"},i("salla-button",{key:"f76f0c7af4c6f717634575efae944e11fc5403d7","aria-label":"Share",onClick:()=>this.open(),class:"s-social-share-btn",shape:"icon",fill:"outline",color:"light"},i("span",{key:"b6c190caf3f9ab6dbf930e62caed60f0c5cb6a39",innerHTML:this.opened?Q:'\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>share-alt</title>\n<path d="M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.941 0 5.333-2.392 5.333-5.333s-2.392-5.333-5.333-5.333-5.333 2.392-5.333 5.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM26.667 29.333c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}))),i("ul",{key:"5eee0092e3596e384690b3ab3f2fb74a0fc22e66",ref:t=>this.shareMenu=t,class:"s-social-share-list a2a_kit share","data-a2a-url":this.url?this.url:window.location.href,"data-a2a-title":this.urlName?this.urlName:document.title},this.platforms.split(",").map((t=>i("li",null,i("a",{class:`a2a_button_${t}`,"aria-label":`Share Via ${t}`},this.platformIcons.map((e=>{if(e.name===t)return i("span",{class:"s-social-share-icon",innerHTML:e.icon})}))))))))}};Xt.style="";const ti=class{constructor(i){t(this,i),this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}render(){return i("div",{key:"9e1a20d0877a9c3ca6b376fe22bfb52e93c8f873",class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},i("slot",{key:"f5b0593c4c9b8d808901ca79e3c6fd28c2a64f36"}))}};ti.style="";const ii=class{constructor(i){t(this,i),this.tabSelected=a(this,"tabSelected"),this.id=Math.random().toString(36).slice(2,10),this.activeClass=void 0,this.height=void 0,this.centered=!1,this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name,id:this.id}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}onClick(){this.getChild().then((t=>{this.tabSelected.emit(t)}))}render(){return[i("div",{key:"7e9e75c995226ca1b23a9a185c8be46206362b61",class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},i("slot",{key:"6ed7bf434cf6b1af235e2251f6d3f385cbbbcf0b"}))]}};ii.style="";const ei=class{constructor(i){t(this,i),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[t]=this.tabGroup;this.selectGroup(t)}))}onSelectedTab(t){const i=this.tabGroup.find((i=>i.header.id===t.detail.id));this.selectGroup(i)}async createGroup(){const t=Array.from(this.host.querySelectorAll("salla-tab-header"));this.tabsHeader=await Promise.all(t.map((async t=>await t.getChild())));const i=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(i.map((async t=>await t.getChild()))),this.tabGroup=this.tabsHeader.map((t=>{const i=this.tabsContent.find((i=>i.name===t.name));return{header:t,content:i}}))}selectGroup(t){this.tabGroup.map((t=>{t.header.unselect(),t.content.unselect()})),t.header.selected(),t.content.selected()}render(){return[i("div",{key:"a82184132426d8d221c31160f48f129b0cb43a0f",class:"s-tabs"},i("div",{key:"199285e8eef1f8e825b174af3b6df06ffe1ffc6e",class:"s-tabs-header"},i("slot",{key:"80f789aa0dec2dc44c15f269bb554a63e325c7be",name:"header"})),i("div",{key:"1c4fec4e20bab0302fd04a29ebfb2f2bb93380d0",class:"s-tabs-content-wrapper"},i("slot",{key:"491f2f5149acac667b3036fba9b92cf1fa027fc8",name:"content"})))]}get host(){return s(this)}};ei.style=".s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}";const si=class{async loadTelInput(){if(!this.TelInput)try{const t=await import("./p-CC2JlxEZ.js").then((function(t){return t.i}));this.TelInput=t.default}catch(t){throw console.error("Failed to load Tel Input:",t),salla.notify?.error?.("Failed to load phone input. Please refresh the page."),t}}constructor(i){t(this,i),this.phoneEntered=a(this,"phoneEntered"),this.name="phone",this.disabled=!1,this.countryCode=salla.config.get("user.country_code","SA")||"SA",this.countryCodeLabel=salla.lang.get("common.country_code"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.tooShort=salla.lang.get("common.errors.too_short",{attribute:this.mobileLabel}),this.tooLong=salla.lang.get("common.errors.too_long",{attribute:this.mobileLabel}),this.invalidCountryCode=salla.lang.get("common.errors.invalid_value",{attribute:this.countryCodeLabel}),this.invalidNumber=salla.lang.get("common.errors.invalid_value",{attribute:this.mobileLabel}),this.errorMap=[this.invalidNumber,this.invalidCountryCode,this.tooShort,this.tooLong,this.invalidNumber],salla.lang.onLoaded((()=>{this.mobileLabel=salla.lang.get("common.elements.mobile"),this.countryCodeLabel=salla.lang.get("common.elements.country_code"),this.invalidNumber=salla.lang.get("common.errors.invalid_value",{attribute:this.mobileLabel}),this.invalidCountryCode=salla.lang.get("common.errors.invalid_value",{attribute:this.countryCodeLabel}),this.tooShort=salla.lang.get("common.errors.too_short",{attribute:this.mobileLabel}),this.tooLong=salla.lang.get("common.errors.too_long",{attribute:this.mobileLabel}),this.mobileRequired=salla.lang.get("common.errors.field_required",{attribute:this.mobileLabel}),this.errorMap=[this.invalidNumber,this.invalidCountryCode,this.tooShort,this.tooLong,this.invalidNumber]}))}async getValues(){return{[this.name]:this.phone=this.phoneInput.value,countryCode:this.countryCode=this.countryCodeInput.value,countryKey:this.host.querySelector(".iti__selected-dial-code").innerText}}async isValid(){if(this.reset(),this.iti.isValidNumber())return!0;if(!this.phoneInput.value.trim())return this.phoneInput.classList.add("s-has-error"),void(this.errorMsg.innerText=this.mobileRequired||"The mobile is required");this.phoneInput.classList.add("s-has-error");let t=this.iti.getValidationError();return this.errorMsg.innerText=this.errorMap[t]||"",salla.logger.info("Phone number ("+this.countryCode+" - "+this.phone+") is not valid, error code "+t),!1}async initTelInput(){await this.loadTelInput(),salla.helpers.inputDigitsOnly(this.phoneInput),this.iti=this.TelInput(this.phoneInput,{initialCountry:this.countryCode?.toLowerCase()||"sa",preferredCountries:["sa","ae","kw","bh","qa","iq","om","ye","eg","jo","ps","sd","lb","dz","tn","ma","ly"],excludeCountries:["sy","ir","cu","kp"],formatOnDisplay:!1,separateDialCode:!0,autoPlaceholder:"aggressive",utilsScript:"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/21.2.7/js/utils.min.js",dropdownContainer:this.host}),this.autofocus&&this.phoneInput.focus(),this.phoneInput.addEventListener("countrychange",(()=>{let t=this.iti.getSelectedCountryData().iso2.toUpperCase();this.countryCodeInput.value=t,this.countryCode=t,this.phoneEntered.emit({number:this.phone,country_code:t})})),this.phoneInput.addEventListener("input",(t=>{salla.helpers.inputDigitsOnly(t.target),this.reset(),this.phoneEntered.emit({number:t.target.value,country_code:this.countryCode})}))}reset(){this.phoneInput.classList.remove("s-has-error"),this.errorMsg.innerHTML=""}handleCountryInput(t){this.phone&&this.phoneEntered.emit({number:t.target.value,country_code:this.countryCode})}render(){return i(e,{key:"f16ad5846d12d5ecef7b30e3409cd57be9bb9763",class:"s-tel-input"},i("input",{key:"08a876233bba3f7878bb9dc9668f60fd16d04903",type:"tel",disabled:this.disabled,name:this.name,value:this.phone,onChange:t=>this.handleCountryInput(t),ref:t=>this.phoneInput=t,enterkeyhint:"next",autocomplete:"tel",class:"s-tel-input-control tel-input s-ltr"}),i("span",{key:"f02fa5d196bb959f6a281fa0dc9ff2c352b97e88",class:"s-tel-input-error-msg",ref:t=>this.errorMsg=t}),i("input",{key:"fd0f6dcf6aba98356f7be85422918ff745dc2078",type:"hidden",name:"country_code",value:this.countryCode,ref:t=>this.countryCodeInput=t,class:"country_code"}))}componentDidLoad(){this.initTelInput()}get host(){return s(this)}};si.style='.iti{width:100%;position:relative;display:inline-block}.iti *{box-sizing:border-box;-moz-box-sizing:border-box}.iti__hide{display:none}.iti__v-hide{visibility:hidden}.iti input,.iti input[type=text],.iti input[type=tel]{position:relative;z-index:0;direction:ltr !important;margin-top:0 !important;margin-bottom:0 !important;padding-left:95px !important;padding-right:15px !important;margin-left:0 !important}.iti__flag-container{width:100%;position:absolute;top:0;bottom:0;left:0;padding:1px}.iti__selected-flag{width:80px;z-index:1;position:relative;display:flex;align-items:center;height:100%;float:left;padding:0 15px;box-shadow:none !important;outline:none !important}.ltr .iti__selected-flag{justify-content:flex-end}.iti__selected-flag:before{content:"";display:block;width:1px;height:70%;background:#eee;position:absolute;top:15%;right:0}.iti__selected-flag .iti__flag{display:none}.iti__arrow{width:15px;height:15px;line-height:15px;position:absolute;left:10px;top:50%;transform:translateY(-50%)}.iti__arrow:after{content:url("data:image/svg+xml,<svg version=\'1.1\' xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 32 32\'><title>keyboard_arrow_down</title><path d=\'M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z\'></path></svg>");font-size:16px;color:#999;opacity:0.65}.iti__arrow--up:after{transform:rotate(180deg)}.iti__country-list{width:100%;max-height:160px;position:absolute;top:100%;left:0;z-index:2;list-style:none;margin:0;padding:0;margin:5px 0 0 0;border-radius:5px;box-shadow:0px 2px 4px 2px rgba(0, 0, 0, 0.05);border:1px solid #f5f7f9;background-color:white;white-space:nowrap;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.iti__country-list::-webkit-scrollbar{width:4px}.dark .iti__country-list{background-color:rgb(82, 82, 91);border-color:rgb(82, 82, 91)}.iti__country-list li{display:flex;align-items:center;justify-content:flex-start;flex-direction:row;padding:8px 10px;transition:background-color 0.3s}.iti__country-list li span{font-size:12px}.iti__country-list li:hover,.iti__country-list li.highlighted{background-color:rgba(0, 0, 0, 0.05)}.iti__country-list--dropup{bottom:100%;top:unset;margin:0 0 5px 0}@media (max-width: 500px){.iti__country-list{white-space:normal}}.iti__flag-box{display:inline-block;width:20px;margin:0 0 0 5px}.iti__divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #eee}.iti__country{padding:5px 10px;outline:none}.iti__dial-code{font-family:Arial;color:#999;unicode-bidi:plaintext;letter-spacing:1px}.iti__country.iti__highlight{background-color:rgba(0, 0, 0, 0.05)}.iti__flag-box,.iti__country-name,.iti__dial-code{vertical-align:middle}.iti__country-name{flex:auto;margin:0;padding:0 10px;white-space:normal;line-height:1.3}.iti--allow-dropdown .iti__flag-container,.iti--separate-dial-code .iti__flag-container{left:0}.iti--allow-dropdown .iti__flag-container:hover{cursor:pointer}.iti--allow-dropdown input[disabled]+.iti__flag-container:hover,.iti--allow-dropdown input[readonly]+.iti__flag-container:hover{cursor:default}.iti--allow-dropdown input[disabled]+.iti__flag-container:hover .iti__selected-flag,.iti--allow-dropdown input[readonly]+.iti__flag-container:hover .iti__selected-flag{background-color:transparent}.iti--separate-dial-code .iti__selected-dial-code{unicode-bidi:plaintext;direction:ltr;letter-spacing:1px;font-family:"Arial", serif;font-size:13px}.iti--container{top:-18px !important;left:0 !important;padding:1px}.iti--container:hover{cursor:pointer}.iti-mobile .iti--container{inset:0;margin:20px;width:calc(100% - 40px);position:fixed;z-index:9999}.iti-mobile .iti__country-list{max-height:100%;width:100%;inset:0}.iti-mobile .iti__country{padding:10px 10px;line-height:1.5em}.iti__flag{width:20px}.iti__flag.iti__be{width:18px}.iti__flag.iti__ch{width:15px}.iti__flag.iti__mc{width:19px}.iti__flag.iti__ne{width:18px}.iti__flag.iti__np{width:13px}.iti__flag.iti__va{width:15px}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-size:5652px 15px}}.iti__flag.iti__ac{height:10px;background-position:0px 0px}.iti__flag.iti__ad{height:14px;background-position:-22px 0px}.iti__flag.iti__ae{height:10px;background-position:-44px 0px}.iti__flag.iti__af{height:14px;background-position:-66px 0px}.iti__flag.iti__ag{height:14px;background-position:-88px 0px}.iti__flag.iti__ai{height:10px;background-position:-110px 0px}.iti__flag.iti__al{height:15px;background-position:-132px 0px}.iti__flag.iti__am{height:10px;background-position:-154px 0px}.iti__flag.iti__ao{height:14px;background-position:-176px 0px}.iti__flag.iti__aq{height:14px;background-position:-198px 0px}.iti__flag.iti__ar{height:13px;background-position:-220px 0px}.iti__flag.iti__as{height:10px;background-position:-242px 0px}.iti__flag.iti__at{height:14px;background-position:-264px 0px}.iti__flag.iti__au{height:10px;background-position:-286px 0px}.iti__flag.iti__aw{height:14px;background-position:-308px 0px}.iti__flag.iti__ax{height:13px;background-position:-330px 0px}.iti__flag.iti__az{height:10px;background-position:-352px 0px}.iti__flag.iti__ba{height:10px;background-position:-374px 0px}.iti__flag.iti__bb{height:14px;background-position:-396px 0px}.iti__flag.iti__bd{height:12px;background-position:-418px 0px}.iti__flag.iti__be{height:15px;background-position:-440px 0px}.iti__flag.iti__bf{height:14px;background-position:-460px 0px}.iti__flag.iti__bg{height:12px;background-position:-482px 0px}.iti__flag.iti__bh{height:12px;background-position:-504px 0px}.iti__flag.iti__bi{height:12px;background-position:-526px 0px}.iti__flag.iti__bj{height:14px;background-position:-548px 0px}.iti__flag.iti__bl{height:14px;background-position:-570px 0px}.iti__flag.iti__bm{height:10px;background-position:-592px 0px}.iti__flag.iti__bn{height:10px;background-position:-614px 0px}.iti__flag.iti__bo{height:14px;background-position:-636px 0px}.iti__flag.iti__bq{height:14px;background-position:-658px 0px}.iti__flag.iti__br{height:14px;background-position:-680px 0px}.iti__flag.iti__bs{height:10px;background-position:-702px 0px}.iti__flag.iti__bt{height:14px;background-position:-724px 0px}.iti__flag.iti__bv{height:15px;background-position:-746px 0px}.iti__flag.iti__bw{height:14px;background-position:-768px 0px}.iti__flag.iti__by{height:10px;background-position:-790px 0px}.iti__flag.iti__bz{height:14px;background-position:-812px 0px}.iti__flag.iti__ca{height:10px;background-position:-834px 0px}.iti__flag.iti__cc{height:10px;background-position:-856px 0px}.iti__flag.iti__cd{height:15px;background-position:-878px 0px}.iti__flag.iti__cf{height:14px;background-position:-900px 0px}.iti__flag.iti__cg{height:14px;background-position:-922px 0px}.iti__flag.iti__ch{height:15px;background-position:-944px 0px}.iti__flag.iti__ci{height:14px;background-position:-961px 0px}.iti__flag.iti__ck{height:10px;background-position:-983px 0px}.iti__flag.iti__cl{height:14px;background-position:-1005px 0px}.iti__flag.iti__cm{height:14px;background-position:-1027px 0px}.iti__flag.iti__cn{height:14px;background-position:-1049px 0px}.iti__flag.iti__co{height:14px;background-position:-1071px 0px}.iti__flag.iti__cp{height:14px;background-position:-1093px 0px}.iti__flag.iti__cr{height:12px;background-position:-1115px 0px}.iti__flag.iti__cu{height:10px;background-position:-1137px 0px}.iti__flag.iti__cv{height:12px;background-position:-1159px 0px}.iti__flag.iti__cw{height:14px;background-position:-1181px 0px}.iti__flag.iti__cx{height:10px;background-position:-1203px 0px}.iti__flag.iti__cy{height:14px;background-position:-1225px 0px}.iti__flag.iti__cz{height:14px;background-position:-1247px 0px}.iti__flag.iti__de{height:12px;background-position:-1269px 0px}.iti__flag.iti__dg{height:10px;background-position:-1291px 0px}.iti__flag.iti__dj{height:14px;background-position:-1313px 0px}.iti__flag.iti__dk{height:15px;background-position:-1335px 0px}.iti__flag.iti__dm{height:10px;background-position:-1357px 0px}.iti__flag.iti__do{height:14px;background-position:-1379px 0px}.iti__flag.iti__dz{height:14px;background-position:-1401px 0px}.iti__flag.iti__ea{height:14px;background-position:-1423px 0px}.iti__flag.iti__ec{height:14px;background-position:-1445px 0px}.iti__flag.iti__ee{height:13px;background-position:-1467px 0px}.iti__flag.iti__eg{height:14px;background-position:-1489px 0px}.iti__flag.iti__eh{height:10px;background-position:-1511px 0px}.iti__flag.iti__er{height:10px;background-position:-1533px 0px}.iti__flag.iti__es{height:14px;background-position:-1555px 0px}.iti__flag.iti__et{height:10px;background-position:-1577px 0px}.iti__flag.iti__eu{height:14px;background-position:-1599px 0px}.iti__flag.iti__fi{height:12px;background-position:-1621px 0px}.iti__flag.iti__fj{height:10px;background-position:-1643px 0px}.iti__flag.iti__fk{height:10px;background-position:-1665px 0px}.iti__flag.iti__fm{height:11px;background-position:-1687px 0px}.iti__flag.iti__fo{height:15px;background-position:-1709px 0px}.iti__flag.iti__fr{height:14px;background-position:-1731px 0px}.iti__flag.iti__ga{height:15px;background-position:-1753px 0px}.iti__flag.iti__gb{height:10px;background-position:-1775px 0px}.iti__flag.iti__gd{height:12px;background-position:-1797px 0px}.iti__flag.iti__ge{height:14px;background-position:-1819px 0px}.iti__flag.iti__gf{height:14px;background-position:-1841px 0px}.iti__flag.iti__gg{height:14px;background-position:-1863px 0px}.iti__flag.iti__gh{height:14px;background-position:-1885px 0px}.iti__flag.iti__gi{height:10px;background-position:-1907px 0px}.iti__flag.iti__gl{height:14px;background-position:-1929px 0px}.iti__flag.iti__gm{height:14px;background-position:-1951px 0px}.iti__flag.iti__gn{height:14px;background-position:-1973px 0px}.iti__flag.iti__gp{height:14px;background-position:-1995px 0px}.iti__flag.iti__gq{height:14px;background-position:-2017px 0px}.iti__flag.iti__gr{height:14px;background-position:-2039px 0px}.iti__flag.iti__gs{height:10px;background-position:-2061px 0px}.iti__flag.iti__gt{height:13px;background-position:-2083px 0px}.iti__flag.iti__gu{height:11px;background-position:-2105px 0px}.iti__flag.iti__gw{height:10px;background-position:-2127px 0px}.iti__flag.iti__gy{height:12px;background-position:-2149px 0px}.iti__flag.iti__hk{height:14px;background-position:-2171px 0px}.iti__flag.iti__hm{height:10px;background-position:-2193px 0px}.iti__flag.iti__hn{height:10px;background-position:-2215px 0px}.iti__flag.iti__hr{height:10px;background-position:-2237px 0px}.iti__flag.iti__ht{height:12px;background-position:-2259px 0px}.iti__flag.iti__hu{height:10px;background-position:-2281px 0px}.iti__flag.iti__ic{height:14px;background-position:-2303px 0px}.iti__flag.iti__id{height:14px;background-position:-2325px 0px}.iti__flag.iti__ie{height:10px;background-position:-2347px 0px}.iti__flag.iti__il{height:15px;background-position:-2369px 0px}.iti__flag.iti__im{height:10px;background-position:-2391px 0px}.iti__flag.iti__in{height:14px;background-position:-2413px 0px}.iti__flag.iti__io{height:10px;background-position:-2435px 0px}.iti__flag.iti__iq{height:14px;background-position:-2457px 0px}.iti__flag.iti__ir{height:12px;background-position:-2479px 0px}.iti__flag.iti__is{height:15px;background-position:-2501px 0px}.iti__flag.iti__it{height:14px;background-position:-2523px 0px}.iti__flag.iti__je{height:12px;background-position:-2545px 0px}.iti__flag.iti__jm{height:10px;background-position:-2567px 0px}.iti__flag.iti__jo{height:10px;background-position:-2589px 0px}.iti__flag.iti__jp{height:14px;background-position:-2611px 0px}.iti__flag.iti__ke{height:14px;background-position:-2633px 0px}.iti__flag.iti__kg{height:12px;background-position:-2655px 0px}.iti__flag.iti__kh{height:13px;background-position:-2677px 0px}.iti__flag.iti__ki{height:10px;background-position:-2699px 0px}.iti__flag.iti__km{height:12px;background-position:-2721px 0px}.iti__flag.iti__kn{height:14px;background-position:-2743px 0px}.iti__flag.iti__kp{height:10px;background-position:-2765px 0px}.iti__flag.iti__kr{height:14px;background-position:-2787px 0px}.iti__flag.iti__kw{height:10px;background-position:-2809px 0px}.iti__flag.iti__ky{height:10px;background-position:-2831px 0px}.iti__flag.iti__kz{height:10px;background-position:-2853px 0px}.iti__flag.iti__la{height:14px;background-position:-2875px 0px}.iti__flag.iti__lb{height:14px;background-position:-2897px 0px}.iti__flag.iti__lc{height:10px;background-position:-2919px 0px}.iti__flag.iti__li{height:12px;background-position:-2941px 0px}.iti__flag.iti__lk{height:10px;background-position:-2963px 0px}.iti__flag.iti__lr{height:11px;background-position:-2985px 0px}.iti__flag.iti__ls{height:14px;background-position:-3007px 0px}.iti__flag.iti__lt{height:12px;background-position:-3029px 0px}.iti__flag.iti__lu{height:12px;background-position:-3051px 0px}.iti__flag.iti__lv{height:10px;background-position:-3073px 0px}.iti__flag.iti__ly{height:10px;background-position:-3095px 0px}.iti__flag.iti__ma{height:14px;background-position:-3117px 0px}.iti__flag.iti__mc{height:15px;background-position:-3139px 0px}.iti__flag.iti__md{height:10px;background-position:-3160px 0px}.iti__flag.iti__me{height:10px;background-position:-3182px 0px}.iti__flag.iti__mf{height:14px;background-position:-3204px 0px}.iti__flag.iti__mg{height:14px;background-position:-3226px 0px}.iti__flag.iti__mh{height:11px;background-position:-3248px 0px}.iti__flag.iti__mk{height:10px;background-position:-3270px 0px}.iti__flag.iti__ml{height:14px;background-position:-3292px 0px}.iti__flag.iti__mm{height:14px;background-position:-3314px 0px}.iti__flag.iti__mn{height:10px;background-position:-3336px 0px}.iti__flag.iti__mo{height:14px;background-position:-3358px 0px}.iti__flag.iti__mp{height:10px;background-position:-3380px 0px}.iti__flag.iti__mq{height:14px;background-position:-3402px 0px}.iti__flag.iti__mr{height:14px;background-position:-3424px 0px}.iti__flag.iti__ms{height:10px;background-position:-3446px 0px}.iti__flag.iti__mt{height:14px;background-position:-3468px 0px}.iti__flag.iti__mu{height:14px;background-position:-3490px 0px}.iti__flag.iti__mv{height:14px;background-position:-3512px 0px}.iti__flag.iti__mw{height:14px;background-position:-3534px 0px}.iti__flag.iti__mx{height:12px;background-position:-3556px 0px}.iti__flag.iti__my{height:10px;background-position:-3578px 0px}.iti__flag.iti__mz{height:14px;background-position:-3600px 0px}.iti__flag.iti__na{height:14px;background-position:-3622px 0px}.iti__flag.iti__nc{height:10px;background-position:-3644px 0px}.iti__flag.iti__ne{height:15px;background-position:-3666px 0px}.iti__flag.iti__nf{height:10px;background-position:-3686px 0px}.iti__flag.iti__ng{height:10px;background-position:-3708px 0px}.iti__flag.iti__ni{height:12px;background-position:-3730px 0px}.iti__flag.iti__nl{height:14px;background-position:-3752px 0px}.iti__flag.iti__no{height:15px;background-position:-3774px 0px}.iti__flag.iti__np{height:15px;background-position:-3796px 0px}.iti__flag.iti__nr{height:10px;background-position:-3811px 0px}.iti__flag.iti__nu{height:10px;background-position:-3833px 0px}.iti__flag.iti__nz{height:10px;background-position:-3855px 0px}.iti__flag.iti__om{height:10px;background-position:-3877px 0px}.iti__flag.iti__pa{height:14px;background-position:-3899px 0px}.iti__flag.iti__pe{height:14px;background-position:-3921px 0px}.iti__flag.iti__pf{height:14px;background-position:-3943px 0px}.iti__flag.iti__pg{height:15px;background-position:-3965px 0px}.iti__flag.iti__ph{height:10px;background-position:-3987px 0px}.iti__flag.iti__pk{height:14px;background-position:-4009px 0px}.iti__flag.iti__pl{height:13px;background-position:-4031px 0px}.iti__flag.iti__pm{height:14px;background-position:-4053px 0px}.iti__flag.iti__pn{height:10px;background-position:-4075px 0px}.iti__flag.iti__pr{height:14px;background-position:-4097px 0px}.iti__flag.iti__ps{height:10px;background-position:-4119px 0px}.iti__flag.iti__pt{height:14px;background-position:-4141px 0px}.iti__flag.iti__pw{height:13px;background-position:-4163px 0px}.iti__flag.iti__py{height:11px;background-position:-4185px 0px}.iti__flag.iti__qa{height:8px;background-position:-4207px 0px}.iti__flag.iti__re{height:14px;background-position:-4229px 0px}.iti__flag.iti__ro{height:14px;background-position:-4251px 0px}.iti__flag.iti__rs{height:14px;background-position:-4273px 0px}.iti__flag.iti__ru{height:14px;background-position:-4295px 0px}.iti__flag.iti__rw{height:14px;background-position:-4317px 0px}.iti__flag.iti__sa{height:14px;background-position:-4339px 0px}.iti__flag.iti__sb{height:10px;background-position:-4361px 0px}.iti__flag.iti__sc{height:10px;background-position:-4383px 0px}.iti__flag.iti__sd{height:10px;background-position:-4405px 0px}.iti__flag.iti__se{height:13px;background-position:-4427px 0px}.iti__flag.iti__sg{height:14px;background-position:-4449px 0px}.iti__flag.iti__sh{height:10px;background-position:-4471px 0px}.iti__flag.iti__si{height:10px;background-position:-4493px 0px}.iti__flag.iti__sj{height:15px;background-position:-4515px 0px}.iti__flag.iti__sk{height:14px;background-position:-4537px 0px}.iti__flag.iti__sl{height:14px;background-position:-4559px 0px}.iti__flag.iti__sm{height:15px;background-position:-4581px 0px}.iti__flag.iti__sn{height:14px;background-position:-4603px 0px}.iti__flag.iti__so{height:14px;background-position:-4625px 0px}.iti__flag.iti__sr{height:14px;background-position:-4647px 0px}.iti__flag.iti__ss{height:10px;background-position:-4669px 0px}.iti__flag.iti__st{height:10px;background-position:-4691px 0px}.iti__flag.iti__sv{height:12px;background-position:-4713px 0px}.iti__flag.iti__sx{height:14px;background-position:-4735px 0px}.iti__flag.iti__sy{height:14px;background-position:-4757px 0px}.iti__flag.iti__sz{height:14px;background-position:-4779px 0px}.iti__flag.iti__ta{height:10px;background-position:-4801px 0px}.iti__flag.iti__tc{height:10px;background-position:-4823px 0px}.iti__flag.iti__td{height:14px;background-position:-4845px 0px}.iti__flag.iti__tf{height:14px;background-position:-4867px 0px}.iti__flag.iti__tg{height:13px;background-position:-4889px 0px}.iti__flag.iti__th{height:14px;background-position:-4911px 0px}.iti__flag.iti__tj{height:10px;background-position:-4933px 0px}.iti__flag.iti__tk{height:10px;background-position:-4955px 0px}.iti__flag.iti__tl{height:10px;background-position:-4977px 0px}.iti__flag.iti__tm{height:14px;background-position:-4999px 0px}.iti__flag.iti__tn{height:14px;background-position:-5021px 0px}.iti__flag.iti__to{height:10px;background-position:-5043px 0px}.iti__flag.iti__tr{height:14px;background-position:-5065px 0px}.iti__flag.iti__tt{height:12px;background-position:-5087px 0px}.iti__flag.iti__tv{height:10px;background-position:-5109px 0px}.iti__flag.iti__tw{height:14px;background-position:-5131px 0px}.iti__flag.iti__tz{height:14px;background-position:-5153px 0px}.iti__flag.iti__ua{height:14px;background-position:-5175px 0px}.iti__flag.iti__ug{height:14px;background-position:-5197px 0px}.iti__flag.iti__um{height:11px;background-position:-5219px 0px}.iti__flag.iti__un{height:14px;background-position:-5241px 0px}.iti__flag.iti__us{height:11px;background-position:-5263px 0px}.iti__flag.iti__uy{height:14px;background-position:-5285px 0px}.iti__flag.iti__uz{height:10px;background-position:-5307px 0px}.iti__flag.iti__va{height:15px;background-position:-5329px 0px}.iti__flag.iti__vc{height:14px;background-position:-5346px 0px}.iti__flag.iti__ve{height:14px;background-position:-5368px 0px}.iti__flag.iti__vg{height:10px;background-position:-5390px 0px}.iti__flag.iti__vi{height:14px;background-position:-5412px 0px}.iti__flag.iti__vn{height:14px;background-position:-5434px 0px}.iti__flag.iti__vu{height:12px;background-position:-5456px 0px}.iti__flag.iti__wf{height:14px;background-position:-5478px 0px}.iti__flag.iti__ws{height:10px;background-position:-5500px 0px}.iti__flag.iti__xk{height:15px;background-position:-5522px 0px}.iti__flag.iti__ye{height:14px;background-position:-5544px 0px}.iti__flag.iti__yt{height:14px;background-position:-5566px 0px}.iti__flag.iti__za{height:14px;background-position:-5588px 0px}.iti__flag.iti__zm{height:14px;background-position:-5610px 0px}.iti__flag.iti__zw{height:10px;background-position:-5632px 0px}.iti__flag{height:15px;box-shadow:0px 0px 1px 0px #888;background-image:url("https://cdn.salla.network/images/flags.png");background-repeat:no-repeat;background-color:#f5f7f9;background-position:20px 0}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-image:url("https://cdn.salla.network/images/flags@2x.png")}}.iti__flag.iti__np{background-color:transparent}';var ai='\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>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n';const li=class{constructor(i){t(this,i),this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_program=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png",40,40),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.sallaAccountEnabled=!1,this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,this.items={notifications:At,orders:'\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>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:S,wishlist:jt,wallet:'\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>wallet</title>\n<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>\n</svg>\n',loyalty_program:v,profile:ai,...this.sallaAccountEnabled?{settings:'\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>settings</title>\n<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}:{}},salla.lang.onLoaded((()=>{this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.hello=salla.lang.get("pages.checkout.hello"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_program=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout")})),this.host.hasAttribute("with-rating")&&(this.items.rating=ct),this.items.logout='\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>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n',salla.onReady((()=>{salla.config.isGuest()||(this.is_loggedIn=!0,!this.inline&&(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)?this.fetchFreshProfile():salla.event.on("profile::info.fetched",(t=>{this.updateProfileState(t)})))}))}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.profileUrl=`${salla.config.get("account.url","https://accounts.salla.com")}/${salla.config.get("user.language_code")}/user?store=${salla.config.get("store.id")}&info=${salla.storage.get("token")}`;const t=this.host.querySelector('[slot="trigger"]');this.triggerSlot='<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',t&&(this.triggerSlot=t.innerHTML,t.innerHTML=this.replaceParams(t.innerHTML))}fetchFreshProfile(){salla.api.token?salla.profile.api.info().then((t=>{this.updateProfileState(t)})):salla.log("trying to fetchFreshProfile before injected the token!!")}updateProfileState(t){this.badges={notifications:salla.helpers.number(t.data.notifications||0),pending_orders:salla.helpers.number(t.data.pending_orders||0)},this.hasBadges=Number(t.data.pending_orders)>0||Number(t.data.notifications)>0,this.first_name=t.data.first_name,this.last_name=t.data.last_name,this.avatar=t.data.avatar||salla.url.cdn("images/avatar.png",40,40)}async open(t){this.opened=!this.opened,t.stopPropagation(),this.opened&&window.addEventListener("click",this.onClickOutside)}menuItemClicked(t,i){"logout"===i&&(t.preventDefault(),salla.auth.logout("sall-user-menu"))}replaceParams(t){return t.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,c)}getTheHeader(){return i("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:t=>this.open(t),onKeyUp:t=>this.open(t),innerHTML:this.replaceParams(this.triggerSlot)})}getItemAnchorLinkAttrs(t){return"profile"===t&&this.profileUrl&&this.sallaAccountEnabled?{href:this.profileUrl,target:"_blank",rel:"noopener noreferrer"}:{href:Salla.url.get("loyalty_program"===t?"loyalty":t)}}getMenuItem([t,e],s){if(("wallet"!==t||window.can_access_wallet)&&("loyalty_program"!==t||Salla.config.get("store.features").includes("loyalty-system")))return i("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":s+1===Object.entries(this.items).length}},i("a",{...this.getItemAnchorLinkAttrs(t),class:"s-user-menu-dropdown-item-link",onClick:i=>this.menuItemClicked(i,t)},i("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:e}),i("span",{class:"s-user-menu-dropdown-item-title"},this[t]),["٠","0",void 0].includes(this.badges[t])?"":i("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[t])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return i(e,null,this.is_loggedIn?this.inline?i("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((t,i)=>this.getMenuItem(t,i)))):i("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),i("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},i("div",{class:"s-user-menu-dropdown",onClick:t=>t.stopPropagation(),onKeyUp:t=>t.stopPropagation()},this.showHeader?i("div",{class:"s-user-menu-dropdown-header"},i("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),i("div",{class:"s-user-menu-dropdown-header-content"},i("span",null,this.hello),i("p",null,this.first_name," ",this.last_name)),i("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:Q,onClick:()=>{this.opened=!1}})):"",i("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((t,i)=>this.getMenuItem(t,i))))))):i("slot",{name:"login-btn"},i("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:ai})))}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}get host(){return s(this)}};li.style="";const oi=class{constructor(i){t(this,i),this.minAge=10,this.isEditable=!0,this.disableAction=!1,this.isLoading=!0,this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"}),salla.lang.onLoaded((()=>{this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"})}))}phoneNumberFieldEventHandler(t){t.detail.number?(this.userData.phone.number=Number.parseInt(t.detail.number),this.userData.phone.country=t.detail.country_code,this.disableAction=!1):this.disableAction=!0}handleFieldChange(t,i,e=!1){i.target.value?(this.userData[t]=i.target.value,this.disableAction=!1):e&&(this.disableAction=!0)}handleEmailInput(t,i){const e=document.getElementById("email-error"),s=i.target.value;if(!s)return this.disableAction=!0,void(e.textContent=this.email_required_trans);/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(s)||(this.disableAction=!0,e.textContent=this.invalid_email_trans),e.textContent="",this.userData[t]=s,this.disableAction=!1}submitForm(t){t.preventDefault(),this.disableAction=!0;const i=Object.assign({},this.userData);i.phone=void 0,i.phone=this.userData.phone.number,i.country_code=this.userData.phone.country,salla.api.profile.update(i).finally((()=>{this.disableAction=!1}))}getBirthDateRestriction(){const t=new Date,i=t.getFullYear()-this.minAge;return t.setFullYear(i),t}fetchData(){return salla.api.profile.info().then((t=>{this.userData=t.data})).finally((()=>{this.isLoading=!1,this.isEditable=!Salla.config.get("store.features").includes("sso-login")}))}renderLoadingSection(){return i("div",{class:"s-user-profile-skeleton-wrapper"},Array.from({length:6},((t,e)=>i("salla-skeleton",{class:"skeleton-item",width:"100%",height:"50px",key:e}))))}componentWillLoad(){Salla.onReady().then((()=>this.fetchData()))}render(){return this.isLoading?this.renderLoadingSection():i("form",{onSubmit:t=>this.submitForm(t)},i("div",{class:"s-user-profile-wrapper"},i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"first-name",class:"s-user-profile-field-label"},this.first_name_trans),i("input",{disabled:!this.isEditable,type:"text",name:"first_name",value:this.userData.first_name,id:"first-name",required:!0,autocomplete:"first_name",class:"form-input",onChange:t=>this.handleFieldChange("first_name",t)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"last-name",class:"s-user-profile-field-label"},this.last_name_trans),i("input",{disabled:!this.isEditable,type:"text",name:"last_name",value:this.userData.last_name,id:"last-name",required:!0,autocomplete:"last_name",class:"form-input",onChange:t=>this.handleFieldChange("last_name",t)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"birthday",class:"s-user-profile-field-label"},this.birthday_trans),i("salla-datetime-picker",{disabled:!this.isEditable,dateFormat:"Y-m-d",value:this.userData.birthday,placeholder:this.birthday_placeholder_trans,required:!0,maxDate:this.getBirthDateRestriction(),name:"birthday",onPicked:t=>this.handleFieldChange("birthday",t)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"gender",class:"s-user-profile-field-label"},this.gender_trans),i("select",{disabled:!this.isEditable,class:"form-input",name:"gender",required:!0,onChange:t=>this.handleFieldChange("gender",t)},i("option",{value:""},this.gender_placeholder_trans),i("option",{value:m.Male,selected:this.userData.gender===m.Male},this.male_trans),i("option",{value:m.Female,selected:this.userData.gender===m.Female},this.female_trans))),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"email",class:"s-user-profile-field-label"},this.email_trans),i("input",{disabled:!this.isEditable,type:"email",name:"email",value:this.userData.email,id:"email",class:"form-input",required:!0,onInput:t=>this.handleEmailInput("email",t)}),i("p",{id:"email-error",class:"s-user-profile-field-error"})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"international-mobile",class:"s-user-profile-field-label"},this.mobile_trans),i("salla-tel-input",{disabled:!this.isEditable,name:"international-mobile","country-code":this.userData.phone.country,phone:`${this.userData.phone.number}`,onPhoneEntered:t=>this.phoneNumberFieldEventHandler(t)}))),i("salla-button",{type:"submit",loading:this.disableAction,disabled:this.disableAction||!this.isEditable,"loader-position":"end",class:"s-user-profile-submit"},this.save_btn_trans))}};oi.style=":host{display:block}";var ni='\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>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';const ri=class{constructor(i){t(this,i),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),salla.onReady((()=>{this.isHiddenName=salla.config.get("user.is_hidden_name"),this.isNotifiable=salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.isNotifiable&&this.isHiddenName||salla.event.on("profile::info.fetched",(t=>{this.isHiddenName=t.data.is_hidden_name,this.isNotifiable=t.data.is_notifiable}))})),salla.lang.onLoaded((()=>{this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description"),this.warningText=salla.lang.get("pages.profile.warning_for_deactivate"),this.sorryForLeavingText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account")}))}toggleSetting(t,i){salla.profile.updateSettings({name:t,value:i.target.checked})}capitalizeText(t){return t.charAt(0).toUpperCase()+t.slice(1)}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async deleteAccount(){await salla.profile.delete().finally((()=>this.confirmationModal.close()))}render(){return i(e,{key:"33752e10e70ffbf01efb75b31d4849edef0a22ca",class:"s-user-settings-wrapper"},this.canHideName&&i("div",{key:"93d51db7a7034bd47afa1743046e7ed1f723f60c",class:"s-user-settings-section"},i("salla-list-tile",{key:"a5a516cd1fae2a592ce52d9eb4d406116b961d54"},i("div",{key:"84810dc0921a67f0506796fef48e4e0bdd6065ac",slot:"icon",class:"s-user-settings-section-icon"},i("span",{key:"6e9ec2538288787753b39b9eab5e73085fd77af2",innerHTML:'\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>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),i("div",{key:"ea4b1e3a1a7f0335041e6bf6f1ee17bf7c10df8d",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),i("div",{key:"05c29800a9f48ec42a8681e44e65c347b635c02e",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),i("div",{key:"14a925b8253d160fc13ba73eedc8dbc8cb950f89",slot:"action",class:"s-user-settings-section-action"},i("label",{key:"cdf006b150c126d25ae01254f142bad8a20dd553",class:"s-toggle"},i("input",{key:"d22dbe40daf8ba763b24d3456161ac24b4d59ec3",class:"s-toggle-input",checked:this.isHiddenName,onChange:t=>this.toggleSetting("is_hidden_name",t),type:"checkbox"}),i("div",{key:"73831affe4a191d6cc2c7eb3ea360a01f0287eee",class:"s-toggle-switcher"}))))),i("div",{key:"891e04a67ad6d20da94947e8cfa2d6edf9c7bb84",class:"s-user-settings-section"},i("salla-list-tile",{key:"206fe63e42899c9a8c7efffabd6feb49b6bcb917"},i("div",{key:"5d93ddd0678238418b4edd4e59352fea431a1ca3",slot:"icon",class:"s-user-settings-section-icon"},i("span",{key:"f58c73c740186085c5091139dad0270c18e96759",innerHTML:'\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>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),i("div",{key:"b6cf780f0cfe38a6fb5dc63cb2d4857f4b909c58",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),i("div",{key:"8e8a6d47fffa6b833b4047054d22faffac042936",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),i("div",{key:"2599fbfb496b0a9ce58e6c8dea53a8535cac5204",slot:"action",class:"s-user-settings-section-action"},i("label",{key:"0fbcb6ff94aeef953750fb8f8d22ece4b75c99b1",class:"s-toggle"},i("input",{key:"859c64fd37986ce5615bfeaacf22cfeb4aff9c6c",class:"s-toggle-input",checked:this.isNotifiable,onChange:t=>this.toggleSetting("is_notifiable",t),type:"checkbox"}),i("div",{key:"e1f46d025760d058516036757b47c847bef54600",class:"s-toggle-switcher"}))))),i("div",{key:"fee3c156efc03e2b7c3306f1399a862d7f42bfbb",class:"s-user-settings-section s-user-settings-section-deactivate-user"},i("salla-list-tile",{key:"494c6b20eff0df5c1733c649b6383735589550d8"},i("div",{key:"33f6dda6763b824e08071055bae7a993e54d82d7",slot:"icon",class:"s-user-settings-section-icon"},i("span",{key:"fb7a0899c926b2be7b4ea03e8079c0f755a3a724",innerHTML:ni})),i("div",{key:"91a27cfb2b9e19bbb1fdedbac04cac60f783fa8a",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),i("div",{key:"fa780dd1c2a71d180eaaeec517e3195add641011",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),i("div",{key:"fe97d9c07fd65ae7469551cf9d0ae4451167943e",slot:"action",class:"s-user-settings-section-action"},i("salla-button",{key:"c656e8800d73c813d4e00c6078ed3c53a1ce788f",fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),i("salla-modal",{key:"fa19e38a8ba2de3571045be2072097477e9ca797",width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:t=>this.confirmationModal=t},i("span",{key:"0d4eced0174ed3c4f13fddd61b711cd9d73dac47",slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:ni}),i("div",{key:"38be1edb34805de488c648e8312807e2d49a6733",class:"s-user-settings-confirmation"},i("div",{key:"949a75940d5065c4bd412e49ebc18fc9f3d39c21",class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),i("div",{key:"09403f1c85cc9bbc941dcd04bfa88b99aa0ac7c6",class:"s-user-settings-confirmation-actions"},i("salla-button",{key:"ccb531ffa8af9e47e758b591b9d98d980a498611",width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),i("salla-button",{key:"9783256bdabfab9dcb0452580748d4efd2ca0f88",fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.deleteAccount()},this.capitalizeText(this.deactivateAccount))))))}};ri.style="";export{k as salla_accordion,x as salla_accordion_body,z as salla_accordion_head,C as salla_add_product_button,T as salla_alert,P as salla_booking_field,L as salla_bottom_alert,O as salla_breadcrumb,H as salla_button,F as salla_cart_summary,N as salla_color_picker,G as salla_comment_form,W as salla_comment_item,Y as salla_comments,Z as salla_conditional_fields,V as salla_count_down,J as salla_datetime_picker,tt as salla_drawer,it as salla_file_upload,st as salla_gifting,at as salla_infinite_scroll,lt as salla_list_tile,ot as salla_loading,nt as salla_localization_modal,rt as salla_login_modal,ht as salla_loyalty,dt as salla_maintenance_alert,gt as salla_map,mt as salla_menu,ft as salla_modal,bt as salla_multiple_bundle_product,wt as salla_multiple_bundle_product_cart,yt as salla_multiple_bundle_product_details,_t as salla_multiple_bundle_product_options_modal,vt as salla_multiple_bundle_product_slider,kt as salla_offer_modal,xt as salla_placeholder,Mt as salla_product_availability,St as salla_product_card,Pt as salla_product_options,It as salla_product_size_guide,Lt as salla_products_list,$t as salla_products_slider,Dt as salla_progress_bar,Bt as salla_quantity_input,Et as salla_quick_buy,Rt as salla_quick_order,Nt as salla_rating_modal,Gt as salla_rating_stars,Wt as salla_reviews_summary,Zt as salla_scopes,Vt as salla_search,Jt as salla_skeleton,Qt as salla_slider,Xt as salla_social_share,ti as salla_tab_content,ii as salla_tab_header,ei as salla_tabs,si as salla_tel_input,li as salla_user_menu,oi as salla_user_profile,ri as salla_user_settings}
11
+ */const N=class{constructor(i){t(this,i),this.colorChanged=a(this,"colorChanged"),this.invalidInput=a(this,"invalidInput"),this.submitted=a(this,"submitted"),this.popupOpened=a(this,"popupOpened"),this.popupClosed=a(this,"popupClosed"),this.name="color",this.required=!1,this.format="hex",this.showCancelButton=!1,this.showTextField=!0,this.enableAlpha=!1}colorChangeHandler(t){this.colorInput.value=t.hex,this.colorChanged.emit(t)}submittedHandler(t){this.setColorValue(t.rgbaString,!0),this.canvas.style.backgroundColor=t.rgbString,this.colorInput.value=t.hex,this.colorInput.dispatchEvent(new window.Event("change",{bubbles:!0})),this.submitted.emit(t)}popupOpenedHandler(t){this.setPopInPosition(),this.popupOpened.emit(t)}popupClosedHandler(t){this.popupClosed.emit(t)}async setPickerOption(t){this.picker.setOptions(t)}async movePopUp(t,i){this.picker.movePopup(t,i)}async setColorValue(t,i){this.picker.setColor(t,i)}async openPicker(){this.picker.show()}async closePicker(){this.picker.hide()}async destroyPicker(){this.picker.destroy()}componentWillLoad(){salla.onReady((()=>{this.color=this.color?this.color:salla.config.get("theme.color.primary","#5dd5c4")}))}setPopInPosition(){const t=this.host.querySelector(".picker_wrapper"),i=this.host.querySelector(".s-color-picker-widget").getBoundingClientRect(),e=window.innerWidth/2-i.width/2,s=e>i.x,a=e<i.x,l=e===i.x,o=window.innerWidth<768;o&&s&&(t.style.left="0"),o&&a&&(t.style.left="auto"),(!o||o&&(!a&&!s||l))&&(t.style.left="-95px")}initColorPicker(){this.picker=new q({parent:this.host,color:this.color,popup:"bottom",alpha:this.enableAlpha,editor:this.showTextField,editorFormat:this.format,cancelButton:this.showCancelButton,onChange:t=>this.colorChangeHandler(t),onDone:t=>this.submittedHandler(t),onOpen:t=>this.popupOpenedHandler(t),onClose:t=>this.popupClosedHandler(t)})}render(){return i(e,{key:"8ed135a77f4664ae0820fe116c115ecde8600630",class:"s-color-picker-main"},i("slot",{key:"9c03d6effac021a15f380b58e912556c8506df77",name:"widget"},i("div",{key:"079346b844adf30b07ce387fd0a0ea553d6f6c3a",class:"s-color-picker-widget"},i("div",{key:"b585d7bb86c1e66ecf624f985482594e250f5337",class:"s-color-picker-widget-canvas",ref:t=>this.canvas=t}),i("span",{key:"9a3029a2d447d5bcd7eeb17f4772b0c70ff6e1a5",innerHTML:c}))),i("input",{key:"9ceac07e6277a096b1a7070d3d9ba2def7aa0839",class:"s-hidden",name:this.name,required:this.required,value:this.color,ref:t=>this.colorInput=t}))}componentDidLoad(){this.canvas.style.backgroundColor=this.color,this.initColorPicker(),this.colorInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.colorInput.addEventListener("input",(()=>{this.colorInput.setCustomValidity(""),this.colorInput.reportValidity()}))}get host(){return s(this)}};N.style="";const G=class{constructor(i){t(this,i),this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit"),salla.lang.onLoaded((()=>{this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit")})),salla.onReady((()=>{this.canComment=salla.config.get("user.can_comment"),this.itemId=salla.config.get("page.id"),this.type=salla.url.is_page("page-single")?"page":salla.url.is_page("blog.single")?"blog":"product"}))}submit(){this.commentForm.reportValidity()?this.submitBtn.load().then((()=>salla.comment.add({id:this.itemId,comment:this.commentField.value,type:this.type}))).finally((()=>this.submitBtn.stop)):salla.log("CommentForm:: validation error!")}render(){return i(e,{key:"fbea28507c188a338ee066b5198bcf93de2fbda2"},this.canComment?i("form",{ref:t=>this.commentForm=t},i("div",{class:"s-comment-form-wrapper"},this.showAvatar?i("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",i("div",{class:"s-comment-form-content"},i("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:t=>this.commentField=t,placeholder:this.placeholder,class:"s-comment-form-input",required:!0}),i("br",null),i("div",{class:"s-comment-form-action"},i("salla-button",{ref:t=>this.submitBtn=t,"loader-position":"center",onClick:()=>this.submit()},this.submitText))))):"")}};G.style=":host{display:block}";const U=class{constructor(i){t(this,i),this.has_bought_trans=salla.lang.get("blocks.comments.has_bought"),this.rated_trans=salla.lang.get("pages.rating.rated"),this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval"),this.has_order_trans=salla.lang.get("blocks.comments.has_order"),this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد"),this.likesCount=0,this.likedComments=[],salla.lang.onLoaded((()=>{const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));this.has_bought_trans=salla.lang.get("blocks.comments.has_bought"),this.rated_trans=salla.lang.get("pages.rating.rated"),this.waiting_approval_trans=salla.lang.get("blocks.comments.waiting_approval"),this.has_order_trans=salla.lang.get("blocks.comments.has_order"),(async()=>{await t("ar.trans","blocks.comments.helpful","مفيد"),await t("en.trans","blocks.comments.helpful","Helpful"),this.helpfulLabel=salla.lang.getWithDefault("blocks.comments.helpful","مفيد")})()}))}componentDidLoad(){this.likesCount=this.comment.likes_count;try{this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),this.likedComments.includes(this.comment.id)&&(this.likeBtn.classList.add("liked"),this.likeBtn.fill="solid")}catch{salla.log("Bad json for liked_comments")}}getReplies(){return Array.isArray(this.comment.replies)?this.comment.replies:[this.comment.replies]}getDate(t){const[i]=t.split(" "),[e,s,a]=i.split("-");return`${parseInt(a,10)}/${parseInt(s,10)}/${parseInt(e,10)}`}getTime(t){const[,i]=t.split(" "),[e,s]=i.split(":");return`${parseInt(e,10)}:${parseInt(s,10)}`}async toggleLike(){if(salla.config.isGuest())return salla.notify.error(salla.lang.get("common.messages.must_login"));this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]");const t=this.likedComments.includes(this.comment.id);try{const i=t?`rating/${this.comment.id}/unlike`:`rating/${this.comment.id}/like`,e=await salla.api.request(i,"","put");salla.log(e.message),t?(this.likeBtn.classList.remove("liked"),this.likeBtn.fill="outline",this.updateLikedComments(this.comment.id,!1),this.likesCount--):(this.likeBtn.classList.add("liked"),this.likeBtn.fill="solid",this.updateLikedComments(this.comment.id,!0),this.likesCount++)}catch(t){409==t.response.status&&(this.likeBtn.classList.contains("liked")?(this.likeBtn.fill="outline",this.likeBtn.classList.remove("liked"),this.updateLikedComments(this.comment.id,!1),this.likesCount--):(this.likeBtn.fill="solid",this.likeBtn.classList.add("liked"),salla.logger.warn("Like already exists"),this.updateLikedComments(this.comment.id,!0)))}}updateLikedComments(t,i){this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),i?this.likedComments.includes(t)||this.likedComments.push(t):this.likedComments=this.likedComments.filter((i=>i!==t)),localStorage.setItem("liked_comments",JSON.stringify(this.likedComments))}render(){let t="admin"==this.comment.type;return i(e,{key:"23f7ca8136164177f5cf8f96b91193ff511e4fbb",class:t?"s-comments-item-admin":"s-comments-item"},i("div",{key:"dfbc3e5b58ddbcce247e1de767b477bab1eab2e3",class:{"s-comments-item-wrapper":!t,"s-comments-item-admin-wrapper":t},id:`s-comments-item-${this.comment.id}`},i("div",{key:"b6c77afa13d1ede6145bd85942dca414414e4e9c",class:"s-comments-item-inner s-comments-flex-1"},t&&i("span",{key:"cd8515e5bbe6b71ae23857cb7c3dca069b685475",class:"s-comments-item-reply-icon",innerHTML:'\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>reply</title>\n<path d="M20 14.667h-12.609l9.401-6.927c0.592-0.436 0.72-1.271 0.283-1.863-0.439-0.595-1.273-0.72-1.864-0.283l-12.667 9.333c-0.343 0.251-0.544 0.649-0.544 1.072s0.201 0.821 0.543 1.073l12.667 9.333c0.237 0.176 0.515 0.26 0.789 0.26 0.409 0 0.813-0.188 1.075-0.543 0.437-0.592 0.309-1.427-0.283-1.863l-9.4-6.928h12.609c4.412 0 8 3.588 8 8 0 0.737 0.597 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-5.881-4.785-10.667-10.667-10.667z"></path>\n</svg>\n'}),i("div",{key:"b12ce64b8afc4f1c77d20ac4e76c25e02ecd2f4b",class:"s-comments-item-avatar"},i("img",{key:"fd554e59e550c22618249ef76ef784bc380bba22","data-src":this.comment?.avatar,alt:this.comment?.name,src:this.comment?.avatar,class:"s-comments-item-avatar-img lazy"})),i("div",{key:"2e6c9beb412773bd117372768f67c28ac024a9c4",class:"s-comments-flex-1"},i("div",{key:"a4ea92bb3416fc603fcbe98a163ed506b1c43a49",class:"s-comments-item-user-wrapper"},i("div",{key:"22c882510812ba6f0ac51818015e7863c27c16d3",class:"s-comments-item-user-info"},i("h3",{key:"b69e6dec2c1000b91fa112cbdefe0d173d975a45",class:"s-comments-item-user-info-name"},this.comment?.name),!this.comment.has_order&&!this.comment.rating||this.comment.is_pending||this.hideBought?null:i("div",{class:"s-comments-flex"},this.comment.has_order?[i("span",{class:"s-comments-item-has-order-check-icon",innerHTML:d}),i("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,this.comment.rating?i("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null)),i("p",{key:"cc89bf414f7cd2f512fac82312f412abc38a022a",class:"s-comments-item-timestamp s-ltr"}," ",this.getDate(this.comment.created_at?.date)," ",i("span",{key:"ccc1a1c62a1584a25f165db0366d9c30dca54e4b",class:"s-comments-item-time"}," - ",this.getTime(this.comment.created_at?.date)," ")),this.comment.rating||this.comment.stars?i("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating||this.comment.stars}):null),i("div",{key:"c8de0a5afdb23c5c3cf78f0e0bee2f90e4222424",class:"s-comments-item-content"},i("p",{key:"a56d8cd320200f11b546f85729aac9c8e36a28e1",innerHTML:this.comment.content}),this.allowAttachImages&&i("div",{key:"b693e349105bb69a3f411f1ffcf84b700ac6aef5",class:"s-comments-item-images"},this.comment.images.map(((t,e)=>i("img",{key:e,src:t,alt:"",onClick:()=>this.modal.open()}))),i("salla-modal",{key:"cd57384d102f513beb82a8004663af1067a5b119",ref:t=>this.modal=t,width:"sm"},i("salla-slider",{key:"07e998f014edf222aab402ba8a0a7e0d05d19f53",id:`s-comments-item-${this.comment.id}-images`,class:"s-comments-item-images-slider",type:"thumbs","auto-height":!0,showControls:this.comment.images.length>1,"show-thumbs-controls":"false"},i("div",{key:"95edb3475172c8262eb98d32d5750b2dbdc866fc",slot:"items"},this.comment.images.map(((t,e)=>i("img",{key:e,src:t,alt:""})))),i("div",{key:"1c8b6d610fe47c20bd2f41fae5df1c069c0f8894",slot:"thumbs"},this.comment.images.map(((t,e)=>i("div",{class:"s-comments-item-images-slider-thumb"},i("img",{key:e,src:t,alt:""})))))))),this.allowLikes&&!t&&salla.url.is_page("product.single")?i("salla-button",{ref:t=>this.likeBtn=t,class:"s-comments-item-like-btn "+(this.likedComments.includes(this.comment.id)?"liked":""),loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleLike()},i("span",null,this.helpfulLabel," ",this.likesCount>0?`(${this.likesCount})`:""),i("span",{innerHTML:'\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>thumbs-up</title>\n<path d="M26.667 10.667h-8.261l1.279-3.38c0.723-1.911 0.087-4.051-1.549-5.203-0.909-0.639-2.004-0.881-3.085-0.684-1.101 0.203-2.061 0.837-2.703 1.787l-5.452 8.067c-0.148 0.22-0.228 0.48-0.228 0.747v12c0 3.676 2.991 6.667 6.667 6.667h8.688c2.535 0 4.817-1.407 5.955-3.671l2.548-5.063c0.093-0.187 0.143-0.392 0.143-0.6v-6.667c0-2.205-1.795-4-4-4zM28 21.017l-2.405 4.78c-0.683 1.359-2.052 2.203-3.573 2.203h-8.688c-2.205 0-4-1.795-4-4v-11.592l5.223-7.728c0.237-0.352 0.584-0.585 0.975-0.657 0.367-0.067 0.749 0.017 1.068 0.241 0.631 0.444 0.879 1.317 0.591 2.079l-1.963 5.185c-0.156 0.409-0.099 0.869 0.149 1.229s0.66 0.576 1.099 0.576h10.192c0.735 0 1.333 0.599 1.333 1.333zM2.667 10.667c-0.736 0-1.333 0.597-1.333 1.333v16c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-16c0-0.736-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'})):"",this.comment.is_pending?i("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),this.getReplies().length&&!t?this.getReplies().map((t=>i("div",null,i("salla-comment-item",{comment:t})))):null))}get host(){return s(this)}};var W;U.style=":host{display:block}",function(t){t.PAGE="page",t.PRODUCT="product",t.BLOG="blog"}(W||(W={}));const Y=class{constructor(i){t(this,i),this.type=W.PAGE,this.showFormAvatar=!1,this.hideBought=!1,this.testimonials=!1,this.noComments=salla.lang.get("blocks.comments.no_comments"),this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary"),this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),salla.onReady((()=>{this.allowLikes=salla.config.get("store.settings.rating.allow_likes"),this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})),salla.lang.onLoaded((()=>{this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.noComments=salla.lang.get("pages.rating.no_ratings");const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));(async()=>{await t("ar.trans","blocks.comments.most_helpful","الأكثر إفادة"),await t("en.trans","blocks.comments.most_helpful","Most helpful"),this.mostHelpfulLabel=salla.lang.get("blocks.comments.most_helpful"),this.comment_title=salla.lang.get("blocks.comments.title"),this.comment_name=salla.lang.get("blocks.comments.comment"),this.noComments=salla.lang.get("pages.rating.no_ratings")})()}))}pluralize(t,i){const e=t.split("|"),s=[{condition:0===i,index:0},{condition:1===i,index:1},{condition:2===i,index:2},{condition:i>2&&i<=10,index:3},{condition:i>=11,index:4}],{index:a}=s.find((({condition:t})=>t))||{index:e.length-1};return e[a].replace(":count",salla.helpers.number(i.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")}wrapConsoleError(){Salla.infiniteScroll.errorWrapped||((()=>{const t=console.error.bind(console);console.error=(...i)=>{const e=i[0];return"string"==typeof e&&e.toLowerCase().replace(/\s/g,"").includes("infinitescroll")?console.log(...i):t(...i)}})(),Salla.infiniteScroll.errorWrapped=!0)}initiateInfiniteScroll(){this.wrapper?(this.wrapConsoleError(),this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(t=>{this.pagination=t.pagination,this.nextPage="object"==typeof t.pagination.links&&t.pagination.links.next?t.pagination.links.next:null;for(const i of this.handleResponse(t))this.wrapper.append(i);const i=this.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");this.animateItems(i),this.loading(!1)})),this.infiniteScroll?.on("error",(t=>{salla.console.error("Error loading more comments:",t)}))):console.error("Wrapper is undefined. Cannot initiate infinite scroll.")}loading(t=!0){const i=this.status?.querySelector(".s-button-text");i&&(p.toggleElementClassIf(i,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}animateItems(t){r({targets:t,opacity:[0,1],duration:1200,translateY:[20,0],delay:(t,i)=>100*i,easing:"easeOutExpo",complete:()=>{for(const i of t)i.classList.add("animated")}})}async reload(){if(this.showPlaceholder=!1,this.wrapper){this.wrapper.innerHTML="";const t=document.createElement("salla-loading");this.wrapper.append(t)}this.nextPage=null,this.loadInitialData()}getCommentHTML(t){const i=document.createElement("salla-comment-item");return i.comment=t,i.hideBought=this.hideBought,i}handleResponse(t){return t.data?.map((t=>this.getCommentHTML(t)))||[]}componentWillLoad(){return salla.onReady().then((()=>{this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary")})).then((()=>this.loading())).then((()=>(this.hideTitle=this.hideTitle||this.testimonials,this.hideForm=this.hideForm||this.testimonials,this.loadInitialData())))}async loadInitialData(){try{let t={data:[],pagination:{}};const i=new URLSearchParams(window.location.search);if(i.has("sort")&&(this.sort=i.get("sort")),this.testimonials){const i={sort:this.sort,type:"store"};t=await salla.api.request("reviews",{params:i},"get")}else t=await salla.api.comment.getComments(this.type,this.itemId,1,5,this.sort);if(!t.data||!t.data.length)return this.showPlaceholder=!1,void this.loading(!1);if(this.wrapper&&(this.wrapper.innerHTML=""),this.comments=t.data,this.pagination=t.pagination,this.total=t.pagination.total,this.nextPage="object"==typeof t.pagination.links&&t.pagination.links.next?t.pagination.links.next:null,this.nextPage&&this.sort)try{const t=new URL(this.nextPage,window.location.origin);t.searchParams.get("sort")||(t.searchParams.set("sort",this.sort),this.nextPage=t.toString())}catch(t){const i=this.nextPage.includes("?");/[?&]sort=/.test(this.nextPage)||(this.nextPage=this.nextPage+(i?"&":"?")+`sort=${this.sort}`)}setTimeout((()=>{for(const i of this.handleResponse(t))this.wrapper.append(i);this.initiateInfiniteScroll();const i=this.wrapper.querySelectorAll("salla-comment-item:not(.animated)");this.animateItems(i)}),100)}catch(t){console.error("Error loading initial data:",t),this.showPlaceholder=!0,this.loading(!1)}}async loadMore(){this.infiniteScroll?.loadNextPage()}render(){return this.showPlaceholder?i("div",null,this.total&&!this.hideTitle?i("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",this.hideForm||this.testimonials?"":i("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),i("div",{class:"s-comments-placeholder"},i("span",{innerHTML:'\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>chat-bubbles</title>\n<path d="M15.333 17.333c4.779 0 8.667-3.888 8.667-8.667s-3.888-8.667-8.667-8.667h-6.667c-4.779 0-8.667 3.888-8.667 8.667 0 2.985 1.513 5.712 4 7.297v4.703c0 0.497 0.277 0.953 0.717 1.183 0.195 0.1 0.405 0.151 0.616 0.151 0.269 0 0.536-0.081 0.764-0.241l6.323-4.425zM11.236 14.908l-4.569 3.199v-2.913c0-0.5-0.28-0.959-0.725-1.187-2.020-1.035-3.275-3.080-3.275-5.34 0-3.308 2.692-6 6-6h6.667c3.308 0 6 2.692 6 6s-2.692 6-6 6h-3.333c-0.273 0-0.54 0.084-0.764 0.241zM29.196 12.964c-0.543-0.5-1.388-0.464-1.884 0.077-0.5 0.541-0.465 1.385 0.077 1.884 1.253 1.156 1.944 2.72 1.944 4.408 0 2.26-1.255 4.305-3.275 5.339-0.445 0.228-0.725 0.687-0.725 1.188v2.572l-5.441-2.939c-0.195-0.104-0.412-0.16-0.633-0.16h-2.592c-1.688 0-3.309-0.724-4.451-1.988-0.492-0.545-1.335-0.591-1.883-0.096-0.547 0.493-0.589 1.336-0.096 1.883 1.644 1.823 3.988 2.868 6.429 2.868h2.255l7.111 3.84c0.199 0.107 0.417 0.16 0.635 0.16 0.236 0 0.472-0.063 0.683-0.188 0.404-0.241 0.651-0.676 0.651-1.145v-4.036c2.487-1.585 4-4.311 4-7.297 0-2.407-1.023-4.727-2.804-6.369z"></path>\n</svg>\n'}),i("p",null,this.noComments))):i("div",{class:`s-comments s-comments-${this.testimonials?"testimonials":this.type}`},i("div",{class:this.type===W.PAGE?"s-comments-page-container":"s-comments-container"},this.total&&!this.hideTitle?i("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&i("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),salla.url.is_page("product.single")?i("salla-reviews-summary",{itemId:this.itemId}):"",i("div",{class:"s-comments-header "+(this.total?"has-total":"")},!!this.total&&i("span",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),this.total&&!this.testimonials&&this.type!==W.BLOG?i("div",{class:"s-comments-filter-wrapper"},i("label",{class:"s-comments-filter-label",htmlFor:"comments-filter"},salla.lang.get("pages.categories.sorting")),i("select",{id:"comments-filter",class:"s-form-control s-comments-sort-input",onChange:t=>{this.sort=t.target.value,this.reload()}},i("option",{value:"latest",selected:!0},salla.lang.get("pages.testimonials.sort_by_date_desc")),i("option",{value:"oldest"},salla.lang.get("pages.testimonials.sort_by_date_asc")),this.allowLikes&&i("option",{value:"most_helpful"},this.mostHelpfulLabel))):""),i("div",{ref:t=>{this.wrapper=t}}),this.nextPage&&i("div",{class:"s-infinite-scroll-wrapper",ref:t=>{this.status=t}},i("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary",type:"button"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>{this.btnLoader=t},style:{display:"none"}})))))}get host(){return s(this)}};Y.style=":host{display:block}";const V=class{constructor(i){t(this,i)}hideAllOptions(t){this.host.querySelectorAll(`[data-show-when^="options[${t}"]`).forEach((t=>{t.classList.add("hidden"),this.hideAllOptions(t.dataset.optionId),this.disableInputs(t)}))}disableInputs(t){t.querySelectorAll("[name]").forEach((t=>{t.setAttribute("disabled",""),t.removeAttribute("required"),"select"===t?.tagName?.toLowerCase()&&(t.value=""),["checkbox"].includes(t.getAttribute("type"))&&t.hasOwnProperty("checked")&&(t.checked=!1)}))}changeHandler(t){if(salla.event.emit("salla-onditional-fields::change",t),salla.log("Received the change/input event: ",t),t.target&&(["SELECT","INPUT","TEXTAREA"].includes(t.target.tagName)||["checkbox","radio","text"].includes(t.target.getAttribute("type"))))return!["INPUT","TEXTAREA"].includes(t.target.tagName)||t.target.getAttribute("type")&&"text"!==t.target.getAttribute("type")||"input"!==t.type?void this.processConditionalFields(t):(clearTimeout(this.debounceTimeout),void(this.debounceTimeout=setTimeout((()=>{this.processConditionalFields(t)}),300)));salla.log("Ignore the event because is not a supported input: "+(t?.target?.tagName||"N/A"))}processConditionalFields(t){let i=t.target.name.replace("[]",""),e="checkbox"===t.target.getAttribute("type"),s="radio"===t.target.getAttribute("type"),a=["INPUT","TEXTAREA"].includes(t.target.tagName)&&(!t.target.getAttribute("type")||"text"===t.target.getAttribute("type"));salla.log("Trying to find all elements with condition:",`[data-show-when^="${i}"]`),this.host.querySelectorAll(`[data-show-when^="${i}"]`).forEach((i=>{let l,o=!i?.dataset.showWhen.includes("!="),n=i?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();l=e?Array.from(this.host.querySelectorAll(`input[name="${t.target.name}"]:checked`),(t=>t?.value)).includes(n.toString()):s?t.target.checked&&t.target.value===n:a?n===t.target.value||"true"===n.toLowerCase()&&""!==t.target.value.trim():n===t.target.value,salla.log("The input is ",e?"Multiple":s?"Radio":a?"Text":"Single"," value:",l),o&&l||!o&&!l?(i.classList.remove("hidden"),i.querySelectorAll("[name]").forEach((t=>{if(t.removeAttribute("disabled"),"true"===t.closest(".s-product-options-option").dataset.optionRequired&&t.setAttribute("required",""),"checkbox"===t.getAttribute("type")){const i=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${t.getAttribute("name")}"]`));i.some((t=>t.checked))&&i.forEach((t=>{t.removeAttribute("required")}))}}))):(this.hideAllOptions(i.dataset.optionId),i.classList.add("hidden"),this.disableInputs(i))}))}componentDidRender(){this.host.querySelectorAll("[data-show-when]").forEach((t=>{let i=t?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();i&&this.changeHandler({target:this.host.querySelector('[name^="'+i+'"]')})}))}render(){return i(e,{key:"af75ffed0725edefeb9e6fcd2f95bf9209f63dd0"},i("slot",{key:"b28f91555071a31d967d85ba7d693e16266bcc6c"}))}get host(){return s(this)}},Z=class{constructor(i){t(this,i),this.size="md",this.color="dark",this.digits="auto",this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.offerEnded=!1,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0),salla.lang.onLoaded((()=>{this.daysLabel=salla.lang.getWithDefault("pages.checkout.day","يوم"),this.hoursLabel=salla.lang.getWithDefault("pages.checkout.hour","ساعة"),this.minutesLabel=salla.lang.getWithDefault("pages.checkout.minute","دقيقة"),this.invalidDate=salla.lang.getWithDefault("blocks.buy_as_gift.incorrect_date","الرجاء إدخال الموعد بشكل صحيح"),this.secondsLabel=salla.lang.getWithDefault("pages.checkout.second","ثانية"),this.endLabel=salla.lang.getWithDefault("pages.checkout.offer_ended","انتهت مدة العرض")})),this.date&&this.isValidDate(this.date)&&this.startCountDown()}async endCountDown(){clearInterval(this.countInterval),this.offerEnded=!0,this.days=this.number(0),this.hours=this.number(0),this.minutes=this.number(0),this.seconds=this.number(0)}componentWillLoad(){if("string"==typeof this.preOrder)try{this.normalizedPreOrder=JSON.parse(this.preOrder)}catch{this.normalizedPreOrder=void 0}else this.normalizedPreOrder=this.preOrder;this.normalizedPreOrder?.end_date&&(this.date=this.normalizedPreOrder.end_date,this.date&&this.isValidDate(this.date)&&this.startCountDown())}isValidDate(t){let i,e=t.includes("-"),s=t.split(" ");return i=e?s[0].replace(/-/g,"/"):s[0],!isNaN(Date.parse(i))}number(t){return salla.helpers.number(t,"en"===this.digits)}startCountDown(){let t=new Date(this.date.replace(/-/g,"/"));(this.endOfDay||1===this.date.split(" ").length)&&t.setHours(23,59,59,999);let i=t.getTime();this.countInterval=setInterval((()=>{let t=(new Date).getTime(),e=i-t;this.days=this.number(Math.floor(e/864e5)),this.hours=this.number(Math.floor(e%864e5/36e5)),this.minutes=this.number(Math.floor(e%36e5/6e4)),this.seconds=this.number(Math.floor(e%6e4/1e3)),e<0&&this.endCountDown()}),1e3)}renderCountDown(){return i("ul",{class:`s-count-down-list ${this.boxed?"s-count-down-boxed":""} ${this.offerEnded?"s-count-down-ended":""} s-count-down-${this.size} s-count-down-${this.color}`},i("li",{class:"s-count-down-item"},i("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&i("div",{class:"s-count-down-item-label"},this.secondsLabel)),i("li",{class:"s-count-down-item"},i("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&i("div",{class:"s-count-down-item-label"},this.minutesLabel)),i("li",{class:"s-count-down-item"},i("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&i("div",{class:"s-count-down-item-label"},this.hoursLabel)),i("li",{class:"s-count-down-item"},i("div",{class:"s-count-down-item-value"},this.days),this.labeled&&i("div",{class:"s-count-down-item-label"},this.daysLabel)))}renderInvalidDate(){return i("div",{class:"s-count-down-text-center"},this.invalidDate)}renderOfferEnded(){return i("div",{class:"s-count-down-end-text"},this.endText?this.endText:this.endLabel)}renderPreOrderToBeAvailableOn(){return this.normalizedPreOrder?.availability_date&&this.isValidDate(this.normalizedPreOrder?.availability_date)?i("div",{class:"s-count-down-info-message"},i("i",{class:"sicon-info"}),i("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),i("span",null,new Date(this.normalizedPreOrder?.availability_date).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))):null}renderPreOrderCountDown(){return this.normalizedPreOrder?.activate_countdown?i("div",{class:"s-count-down-pre-order-container"},i("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown()):null}renderPreOrder(){return i("div",null,"object"==typeof this.normalizedPreOrder&&this.normalizedPreOrder?.availability_date&&this.renderPreOrderToBeAvailableOn(),this.renderPreOrderCountDown())}renderContent(){return this.date?this.isValidDate(this.date)?this.preOrder?this.renderPreOrder():this.renderCountDown():this.renderInvalidDate():null}render(){return i(e,{key:"96bba6312e710673e1f249cabecfc8756fac5c0e",class:"s-count-down-wrapper "+(this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":"")},this.renderContent(),this.offerEnded&&this.renderOfferEnded())}};Z.style="";const J=class{constructor(i){t(this,i),this.picked=a(this,"picked"),this.invalidInput=a(this,"invalidInput"),this.value=null,this.placeholder=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.allowInput=!0,this.allowInvalidPreload=!1,this.altFormat="F j, Y",this.altInput=!1,this.appendTo=void 0,this.ariaDateFormat="F j, Y",this.autoFillDefaultTime=!0,this.clickOpens=!0,this.closeOnSelect=!0,this.dateFormat="Y-m-d",this.defaultHour=12,this.defaultMinute=0,this.defaultSeconds=0,this.disable=[],this.disableMobile=!1,this.enable=[()=>!0],this.enableSeconds=!1,this.enableTime=!1,this.hourIncrement=1,this.inline=!1,this.locale="en",this.maxDate=null,this.maxTime=null,this.minDate=null,this.minTime=null,this.minuteIncrement=5,this.mode="single",this.monthSelectorType="dropdown",this.nextArrow='<span class="sicon-keyboard_arrow_right"></span>',this.noCalendar=!1,this.position="auto",this.prevArrow='<span class="sicon-keyboard_arrow_left"></span>',this.shorthandCurrentMonth=!1,this.static=!1,this.showMonths=1,this.time_24hr=!1,this.weekNumbers=!1,this.wrap=!1,this.disabled=!1}async loadFlatpickr(){if(!this.flatpickr)try{const t=await import("./p-D-twzdLJ.js");if(this.flatpickr=t.default,this.locale&&"en"!==this.locale)try{await import(`flatpickr/dist/l10n/${this.locale}.js`)}catch(t){console.warn(`Flatpickr locale ${this.locale} not found, using default`)}}catch(t){throw console.error("Failed to load Flatpickr:",t),salla.notify?.error?.("Failed to load date picker. Please refresh the page."),t}}render(){return i("div",{key:"f619b5fa5fdb68b3cc8562be43496dabb1d78f37",class:"s-datetime-picker"},i("input",{key:"dc9b5d0680cd31109a2b82fcf435b8b68d5fbb8d",type:"datetime",name:this.name,value:this.value,required:this.required,disabled:this.disabled,placeholder:this.placeholder,class:"s-datetime-picker-input",ref:t=>this.dateInput=t}))}async componentDidLoad(){await this.loadFlatpickr();let t={allowInput:this.allowInput,allowInvalidPreload:this.allowInvalidPreload,altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,appendTo:this.appendTo,ariaDateFormat:this.ariaDateFormat,autoFillDefaultTime:this.autoFillDefaultTime,clickOpens:this.clickOpens,closeOnSelect:this.closeOnSelect,conjunction:this.conjunction,dateFormat:this.dateFormat,defaultDate:this.value?Date.parse(this.value):this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,defaultSeconds:this.defaultSeconds,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableSeconds:this.enableSeconds,enableTime:this.enableTime,formatDate:this.formatDate,hourIncrement:this.hourIncrement,inline:this.inline,locale:this.locale,maxDate:this.maxDate,maxTime:this.maxTime,minDate:this.minDate,minTime:this.minTime,minuteIncrement:this.minuteIncrement,mode:this.mode,monthSelectorType:this.monthSelectorType,nextArrow:this.nextArrow,noCalendar:this.noCalendar,parseDate:this.dateParser,position:this.position,positionElement:this.positionElement,prevArrow:this.prevArrow,shorthandCurrentMonth:this.shorthandCurrentMonth,static:this.static,showMonths:this.showMonths,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,onChange:(t,i)=>this.picked.emit(this.value=i)};this.flatpickr(this.dateInput,t),this.dateInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.dateInput.addEventListener("input",(()=>{this.dateInput.setCustomValidity(""),this.dateInput.reportValidity()}))}};J.style='.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:\'\';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}';var Q='\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>cancel</title>\n<path d="M17.885 16l7.057-7.057c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-7.057 7.057-7.057-7.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l7.057 7.057-7.057 7.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l7.057-7.057 7.057 7.057c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n',X='\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>alert-engine</title>\n<path d="M16 18.673c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM2.667 16c0-3.092 1.083-6.105 3.047-8.484 0.469-0.568 0.389-1.408-0.179-1.877-0.568-0.468-1.408-0.388-1.877 0.179-2.359 2.857-3.657 6.473-3.657 10.183s1.299 7.325 3.657 10.183c0.264 0.319 0.645 0.484 1.029 0.484 0.299 0 0.6-0.1 0.848-0.305 0.568-0.469 0.648-1.309 0.179-1.877-1.964-2.379-3.047-5.392-3.047-8.484zM16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM28.343 5.817c-0.469-0.567-1.307-0.647-1.877-0.179-0.568 0.469-0.648 1.309-0.179 1.877 1.964 2.379 3.047 5.392 3.047 8.484s-1.083 6.105-3.047 8.484c-0.469 0.568-0.389 1.408 0.179 1.877 0.249 0.205 0.549 0.305 0.848 0.305 0.384 0 0.765-0.165 1.028-0.484 2.36-2.857 3.659-6.473 3.659-10.183s-1.299-7.325-3.657-10.183z"></path>\n</svg>\n',K='\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>check-circle2</title>\n<path d="M29.333 14.133c-0.8 0-1.333 0.533-1.333 1.333v1.2c0 6.667-5.333 12-12 12 0 0 0 0 0 0-6.667 0-12-5.333-12-12s5.333-12 12-12c0 0 0 0 0 0 1.733 0 3.333 0.4 4.933 1.067 0.667 0.267 1.467 0 1.733-0.667s0-1.467-0.667-1.733c-1.867-0.8-3.867-1.333-6-1.333 0 0 0 0 0 0-8.133 0-14.667 6.533-14.667 14.667s6.533 14.667 14.667 14.667c0 0 0 0 0 0 8.133 0 14.667-6.533 14.667-14.667v-1.2c0-0.8-0.533-1.333-1.333-1.333zM12.933 14.4c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l4 4c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4l13.333-13.333c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-12.4 12.4-3.067-3.067z"></path>\n</svg>\n';const tt=class{constructor(i){t(this,i),this.drawerVisibilityChanged=a(this,"drawerVisibilityChanged"),this.isClosable=!0,this.width="md",this.position="right",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("drawer::open",(t=>t==this.host.id&&this.open())),salla.event.on("drawer::close",(t=>t==this.host.id&&this.close())),this.drawerTitle=this.host.getAttribute("drawer-title")}handleVisible(t){if(!t)return this.drawerVisibilityChanged.emit(!1),void this.toggleDrawer(!1);this.drawerVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleDrawer(!0)))}handleKeyUp(t){"Escape"===t.key&&this.closeDrawer()}async open(){return this.host.setAttribute("visible",""),this.handleAutoFocus(),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(t){return this.drawerTitle=t,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}handleAutoFocus(){const t=this.host.querySelector("input, textarea, select");t&&setTimeout((()=>{t.focus()}),100)}toggleDrawer(t){const i=this.host.querySelector(".s-drawer-body");p.toggleElementClassIf(i,"s-drawer-entering","s-drawer-leaving",(()=>t)).toggleElementClassIf(this.overlay,"s-drawer-entering","s-drawer-overlay-leaving",(()=>t)).toggleElementClassIf(document.body,"drawer-is-open","drawer-is-closed",(()=>t)),t||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeDrawer(t){this.isClosable&&(salla.event.dispatch("drawer::close",{reason:t}),this.host.removeAttribute("visible"))}iconBlockClasses(){return{"s-drawer-icon":!0,"s-drawer-bg-error":"error"==this.iconStyle,"s-drawer-bg-success":"success"==this.iconStyle,"s-drawer-bg-normal":!this.iconStyle,"s-drawer-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-drawer",this.isLoading?i(e,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:t=>this.handleKeyUp(t)},i("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:t=>this.overlay=t,onClick:()=>this.closeDrawer("backdropClick")}),i("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},i("div",{class:"s-drawer-body flex justify-center s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},i("slot",{name:"loading"},i("salla-loading",null)),i("div",{class:"s-hidden"},i("slot",null))))):i(e,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog"},i("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:t=>this.overlay=t,onClick:()=>this.closeDrawer("backdropClick")}),i("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},i("div",{class:"s-drawer-body s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},i("div",{class:{"s-drawer-header":!0,"s-drawer-is-center":this.centered}},this.isClosable?i("button",{class:"s-drawer-close",onClick:()=>this.closeDrawer("closeButtonClick"),type:"button"},i("span",{innerHTML:Q})):"",this.drawerTitle||this.subTitle?i("div",{class:"s-drawer-header-inner"},i("slot",{name:"icon"},this.iconStyle?i("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?X:K}):""),i("div",{class:"s-drawer-header-content"},this.drawerTitle?i("div",{class:{"s-drawer-title":!0,"s-drawer-title-below":this.subTitleFirst},innerHTML:this.drawerTitle}):"",this.subTitle?i("p",{class:{"s-drawer-sub-title":!0},innerHTML:this.subTitle}):"")):""),i("slot",null),i("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return s(this)}static get watchers(){return{visible:["handleVisible"]}}};tt.style="";const it=class{async loadFilePond(){if(!this.filePondLoaded)try{const[t,i,e,s,a,l,o]=await Promise.all([import("./p-GC5QwqwX.js").then((function(t){return t.f})),import("./p-q3t2oiUx.js").then((function(t){return t.f})),import("./p-BftmF7A4.js").then((function(t){return t.f})),import("./p-DAiXY47w.js").then((function(t){return t.f})),import("./p-3aZYPmNi.js").then((function(t){return t.f})),import("./p-BNCAsdrU.js").then((function(t){return t.f})),import("./p-wxiLbf1Q.js").then((function(t){return t.f}))]);this.FilePond=t,this.FilePond.registerPlugin(s.default,e.default,i.default,a.default,l.default,o.default),this.filePondLoaded=!0}catch(t){throw console.error("Failed to load FilePond:",t),salla.notify?.error?.("Failed to load file uploader. Please refresh the page."),t}}constructor(i){t(this,i),this.added=a(this,"added"),this.invalidInput=a(this,"invalidInput"),this.uploaded=a(this,"uploaded"),this.removed=a(this,"removed"),this.filePondLoaded=!1,this.max_images_count=t=>salla.lang.get("common.uploader.max_images_count",{count:t}),this.max_count_hint=t=>salla.lang.get("common.uploader.max_count_hint",{count:t}),this.uploadedFiles=[],this.isListScrollerListenerAdded=!1,this.showMaxCountHint=!1,this.profileImage=!1,this.payloadParams={},this.accept="image/png, image/jpeg, image/jpg, image/gif",this.method="POST",this.formData="{}",this.allowDrop=!0,this.allowBrowse=!0,this.allowReplace=!0,this.allowRevert=!0,this.allowRemove=!0,this.allowImagePreview=!0,this.imagePreviewHeight=null,this.filePosterHeight=null,this.maxFilesCount=1,this.maxParallelUploads=3,this.itemInsertLocation="after",this.itemInsertInterval=75,this.dropOnElement=!0,this.ignoredFiles=[".ds_store","thumbs.db","desktop.ini"],this.chunkSize=5e6,this.chunkRetryDelays=[500,1e3,3e3],this.labelDecimalSeparator=void 0,this.labelThousandsSeparator=void 0,this.iconRemove="<svg>...</svg>",this.iconProcess="<svg>...</svg>",this.iconRetry="<svg>...</svg>",this.iconUndo="<svg>...</svg>",this.openFileBrowser=()=>{this.filepond.browse()},!this.url&&this.cartItemId&&(this.url=salla.cart.getUploadImageEndpoint(),this.instantUpload=!0),!this.url&&this.profileImage&&(this.url=salla.url.api("profile/update"),this.instantUpload=!0,this.host.hasAttribute("name")||(this.name="avatar")),this.name||(this.name="file"),salla.lang.onLoaded((()=>{this.host.querySelectorAll(".filepond--drop-label>label").forEach((t=>t.innerHTML=this.getLabel())),this.filepond&&(this.filepond.labelFileTypeNotAllowed=salla.lang.get("common.uploader.invalid_type"),this.filepond.labelMaxFileSizeExceeded=salla.lang.get("common.uploader.too_large"),this.filepond.labelFileSizeNotAvailable=salla.lang.get("common.uploader.size_not_available"),this.filepond.labelFileLoading=salla.lang.get("common.elements.loading"),this.filepond.labelFileLoadError=salla.lang.get("common.uploader.failed_to_load"),this.filepond.labelFileProcessingAborted=salla.lang.get("common.uploader.upload_cancelled"),this.filepond.labelTapToCancel=salla.lang.get("common.elements.cancel"),this.filepond.labelTapToRetry=salla.lang.get("common.elements.retry"),this.filepond.labelButtonRemoveItem=salla.lang.get("common.elements.remove"),this.filepond.labelButtonUndoItemProcessing=salla.lang.get("common.elements.undo"),this.filepond.labelButtonProcessItem=salla.lang.get("common.uploader.upload"),this.filepond.labelFileProcessingComplete=salla.lang.get("common.uploader.file_processing_complete"),this.filepond.labelTapToUndo=salla.lang.get("common.uploader.tap_to_undo"),this.filepond.labelFileProcessing=salla.lang.get("common.uploader.file_processing"),this.filepond.labelFileProcessingError=salla.lang.get("common.uploader.file_processing_error"));const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));this.max_count_hint=t=>salla.lang.get("common.uploader.max_count_hint",{count:t}),this.max_images_count=t=>salla.lang.get("common.uploader.max_images_count",{count:t}),(async()=>{await t("ar.trans","common.uploader.max_images_count",".أضف :count صور كحد أقصى"),await t("en.trans","common.uploader.max_images_count","Add up to :count images maximum."),await t("ar.trans","common.uploader.max_count_hint","يمكنك رفع حتى :count صور"),await t("en.trans","common.uploader.max_count_hint","You can upload up to :count images.")})()}))}addedHandler(t,i){if(this.added.emit({error:t,file:i}),this.host.querySelector(".filepond--root").classList.remove("s-file-upload-has-error"),t||!i.file.type)return void this.host.querySelector(".filepond--root").classList.add("s-file-upload-has-error");let e=new DataTransfer,s=this.getFormDataFileInput();e.items.add(i.file),s.type="file",s.files=e.files,s.dispatchEvent(new window.Event("change",{bubbles:!0}))}uploadedHandler(){let t=this.getFormDataFileInput();return t.type="hidden",t.value=this.value,this.hiddenInput.value=this.value,t.dispatchEvent(new window.Event("change",{bubbles:!0})),this.uploaded.emit(this.value)}removedHandler(t){let i=this.getFormDataFileInput();i.type="hidden",i.value="",this.host.closest(".s-product-options-option")?.removeAttribute("data-has-value"),salla.url.is_page("cart")&&t.getMetadata("id")&&salla.cart.api.deleteImage(t.getMetadata("id")),this.height&&setTimeout((()=>this.host.querySelector(".filepond--root").style.height=this.height),1e3),this.hiddenInput.value="",i.dispatchEvent(new window.Event("change",{bubbles:!0}));let e=this.allowMultiple?t.getMetadata("id"):t;return this.removed.emit(e)}async setOption(t,i){this.filepond[t]=i}getLabel(){return this.labelIdle?this.labelIdle.replace("common.uploader.drag_and_drop",salla.lang.get("common.uploader.drag_and_drop")).replace("common.uploader.browse",salla.lang.get("common.uploader.browse")):`${salla.lang.get("common.uploader.drag_and_drop")}<span class="filepond--label-action"> ${salla.lang.get("common.uploader.browse")} </span>`}getFileSize(t){let i=new XMLHttpRequest;return i.open("HEAD",t,!1),i.send(null),200===i.status?i.getResponseHeader("content-length"):""}getFormDataFileInput(){return this.host.querySelector(".filepond--data input")}getFiles(){if(!this.value&&!this.files)return[];try{let t=this.files?"string"==typeof this.files?JSON.parse(this.files):this.files:this.value.split(",").map((t=>({url:t})));return t.length&&this.host.closest(".s-product-options-option")?.setAttribute("data-has-value","true"),t.map((t=>({source:t.id?`${t.id}`:t.url,options:{type:"local",file:{name:t.url.substring(t.url.lastIndexOf("/")+1),size:this.getFileSize(t.url)},metadata:{poster:t.url,name:t.url,id:t.id}}})))}catch(t){salla.log("failed To get files from: "+(this.files||this.value))}return[]}async componentWillLoad(){await this.loadFilePond(),this.labelIdle||(this.labelIdle=this.host.innerHTML,this.host.innerHTML="")}render(){return i(e,{key:"45383bff9bc408ef0328e888751827e6fc70038d",class:{"s-file-upload":!0,"s-file-upload-profile-image":this.profileImage,"s-file-upload-multiple":this.allowMultiple}},i("input",{key:"323e469923868db4e322d67c1dd8a7efc245fe5f",type:"file",name:this.name,value:this.value,ref:t=>this.fileUploader=t,required:this.required,class:"s-file-upload-wrapper s-file-upload-input",accept:this.accept}),this.allowMultiple&&this.showMaxCountHint?i("div",{class:"s-file-upload-hint s-hidden"},this.max_count_hint(this.maxFilesCount)):"",i("input",{key:"42458ac28b13ba4e6c6dc80a30054e0e567a9366",class:"s-hidden",name:"hidden-"+this.name,required:this.required,value:this.value,ref:t=>this.hiddenInput=t}))}componentDidLoad(){let t=this.getFiles();this.filepond=this.FilePond.create(this.fileUploader,{name:this.payloadName||this.name,files:t,required:this.required,disabled:this.disabled,allowDrop:this.allowDrop,allowBrowse:this.allowBrowse,allowPaste:this.allowPaste,allowMultiple:this.allowMultiple,allowReplace:this.allowReplace,allowRevert:this.allowRevert,allowProcess:this.allowProcess,allowReorder:this.allowReorder,storeAsFile:this.storeAsFile,forceRevert:this.forceRevert,maxFiles:this.maxFilesCount,imagePreviewHeight:this.imagePreviewHeight,filePosterHeight:this.filePosterHeight,allowImagePreview:this.allowImagePreview,maxParallelUploads:this.maxParallelUploads,checkValidity:this.checkValidity,itemInsertLocation:this.itemInsertLocation,itemInsertInterval:this.itemInsertInterval,credits:this.credits,dropOnPage:this.dropOnPage,dropOnElement:this.dropOnElement,dropValidation:this.dropValidation,ignoredFiles:this.ignoredFiles,onaddfile:(t,i)=>this.addedHandler(t,i),onwarning:t=>{"Max files"===t.body&&salla.notify.error(this.max_images_count(this.maxFilesCount))},onprocessfile:(t,i)=>{if(this.allowMultiple&&!t){const t=i.serverId,e=this.uploadedFiles.find((i=>i.id===t));e&&(i.setMetadata("id",e.id,!0),i.setMetadata("url",e.url,!0),this.value={id:e.id,url:e.url},this.uploadedHandler())}},onupdatefiles:t=>{const i=this.host.querySelector(".filepond--drop-label"),e=this.host.querySelector(".filepond--list-scroller");this.allowMultiple&&(t.length>0?(i.classList.add("s-hidden"),!this.isListScrollerListenerAdded&&t.length<this.maxFilesCount&&(this.showMaxCountHint=!0,e.addEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!0)):(i.classList.remove("s-hidden"),this.isListScrollerListenerAdded&&(e.removeEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!1)),t.length===this.maxFilesCount&&this.isListScrollerListenerAdded&&(e.removeEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!1,this.showMaxCountHint=!1))},server:{url:this.url,method:this.method,revert:null,process:{onload:t=>{let i=JSON.parse(t).data;if((this.instantUpload||this.allowMultiple)&&Array.isArray(i)&&i.length>0){const t=`${this.host.id}-${Math.floor(100+900*Math.random())}`;return this.uploadedFiles.push({id:t,url:i[0]}),t}return this.value=i.filePath||i.url,this.uploadedHandler(),this.value},headers:salla.api.getHeaders(),onerror:t=>{try{let i=JSON.parse(t).error.fields;return i=i[this.payloadName||this.name],i&&i[0]||salla.lang.get("common.errors.error_occurred")}catch(t){return salla.log("FileUpload:: Error",t),salla.lang.get("common.errors.error_occurred")}},ondata:t=>{if(this.allowMultiple){const i=new FormData;return t.forEach((t=>{i.append("files[]",t)})),i.append("type",this.type),i}if(this.payloadName&&this.payloadName!=this.name&&!this.allowMultiple&&(t.append(this.payloadName,this.filepond.getFile(0).file),t.delete(this.name)),this.payloadParams)for(const[i,e]of Object.entries(this.payloadParams))t.append(i,e);this.cartItemId&&t.append("cart_item_id",this.cartItemId);try{Object.entries(JSON.parse(this.formData)).forEach((i=>i[1]&&t.append(i[0],i[1])))}catch(t){salla.log("Error to inject formData",t)}return t}}},instantUpload:this.instantUpload,chunkUploads:this.chunkUploads,chunkForce:this.chunkForce,chunkSize:this.chunkSize,chunkRetryDelays:this.chunkRetryDelays,labelDecimalSeparator:this.labelDecimalSeparator,labelThousandsSeparator:this.labelThousandsSeparator,labelIdle:this.getLabel(),acceptedFileTypes:this.accept.replace(/\s+/g,"").split(","),labelFileTypeNotAllowed:salla.lang.get("common.uploader.invalid_type"),labelFileProcessingComplete:salla.lang.get("common.uploader.file_processing_complete"),labelTapToUndo:salla.lang.get("common.uploader.tap_to_undo"),labelFileProcessing:salla.lang.get("common.uploader.file_processing"),labelFileProcessingError:salla.lang.get("common.uploader.file_processing_error"),fileValidateTypeLabelExpectedTypes:"{allButLastType}, {lastType}",labelMaxFileSizeExceeded:salla.lang.get("common.uploader.too_large"),labelMaxFileSize:"{filesize}",maxFileSize:`${salla.config.get("store.settings.upload_size")}KB`||this.maxFileSize,beforeRemoveFile:t=>new Promise((i=>{this.removedHandler(t),i(!0)}))}),this.hiddenInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.hiddenInput.addEventListener("change",(()=>{this.hiddenInput.setCustomValidity(""),this.hiddenInput.reportValidity()}))}get host(){return s(this)}};it.style="/*!\n * FilePond 4.32.8\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--data{position:absolute;width:0;height:0;padding:0;margin:0;border:none;visibility:hidden;pointer-events:none;contain:strict}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{-webkit-transform-origin:center center;transform-origin:center center;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;left:0;will-change:transform,opacity}.filepond--drop-label{right:0;margin:0;color:#4f4f4f;display:flex;justify-content:center;align-items:center;height:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--drop-label.filepond--drop-label label{display:block;margin:0;padding:.5em}.filepond--drop-label label{cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--root[data-disabled] .filepond--drop-label label{opacity:.5}.filepond--file-action-button.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;outline:none;will-change:transform,opacity}.filepond--file-action-button.filepond--file-action-button span{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file-action-button.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button.filepond--file-action-button:after{position:absolute;left:-.75em;right:-.75em;top:-.75em;bottom:-.75em;content:\"\"}.filepond--file-action-button{cursor:auto;color:#fff;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;box-shadow:0 0 0 0 hsla(0,0%,100%,0);transition:box-shadow .25s ease-in}.filepond--file-action-button:focus,.filepond--file-action-button:hover{box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-action-button[disabled]{color:hsla(0,0%,100%,.5);background-color:rgba(0,0,0,.25)}.filepond--file-action-button[hidden]{display:none}.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=center]{margin-left:-.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=bottom]{margin-bottom:-.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 .25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--file-info{position:static;display:flex;flex-direction:column;align-items:flex-start;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out;white-space:nowrap}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:flex;flex-direction:column;align-items:flex-end;flex-grow:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5;transition:opacity .25s ease-in-out}.filepond--file-wrapper.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:flex;height:100%;align-items:flex-start;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--processing-complete-indicator{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.filepond--file .filepond--file-action-button,.filepond--file .filepond--processing-complete-indicator,.filepond--file .filepond--progress-indicator{position:absolute}.filepond--file [data-align*=left]{left:.5625em}.filepond--file [data-align*=right]{right:.5625em}.filepond--file [data-align*=center]{left:calc(50% - .8125em)}.filepond--file [data-align*=bottom]{bottom:1.125em}.filepond--file [data-align=center]{top:calc(50% - .8125em)}.filepond--file .filepond--progress-indicator{margin-top:.1875em}.filepond--file .filepond--progress-indicator[data-align*=right]{margin-right:.1875em}.filepond--file .filepond--progress-indicator[data-align*=left]{margin-left:.1875em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state~=processing] .filepond--file-status-sub{opacity:0}[data-filepond-item-state~=processing] .filepond--action-abort-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-error] .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-error] .filepond--action-retry-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{-webkit-animation:fall .5s linear .125s both;animation:fall .5s linear .125s both}[data-filepond-item-state=processing-complete] .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--file-info-sub,[data-filepond-item-state=processing-complete] .filepond--processing-complete-indicator:not([style*=hidden])~.filepond--file-status .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing~.filepond--file-info .filepond--file-info-sub{opacity:.5}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{-webkit-animation:shake .65s linear both;animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@-webkit-keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--hopper[data-hopper-state=drag-over]:after{content:\"\";position:absolute;left:0;top:0;right:0;bottom:0;z-index:100}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;z-index:1;padding:0;margin:.25em;will-change:transform,opacity;touch-action:auto}.filepond--item>.filepond--panel{z-index:-1}.filepond--item>.filepond--panel .filepond--panel-bottom{box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper,.filepond--item>.filepond--panel{transition:opacity .15s ease-out}.filepond--item[data-drag-state]{cursor:-webkit-grab;cursor:grab}.filepond--item[data-drag-state]>.filepond--panel{transition:box-shadow .125s ease-in-out;box-shadow:0 0 0 transparent}.filepond--item[data-drag-state=drag]{cursor:-webkit-grabbing;cursor:grabbing}.filepond--item[data-drag-state=drag]>.filepond--panel{box-shadow:0 .125em .3125em rgba(0,0,0,.325)}.filepond--item[data-drag-state]:not([data-drag-state=idle]){z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:hidden;-webkit-overflow-scrolling:touch;-webkit-mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent);mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent)}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list.filepond--list{position:absolute;top:0;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--list{left:.75em;right:.75em}.filepond--root[data-style-panel-layout~=integrated]{width:100%;height:100%;max-width:none;margin:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root{border-radius:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root>*,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{bottom:0;height:auto;display:flex;justify-content:center;align-items:center;z-index:7}.filepond--root[data-style-panel-layout~=circle] .filepond--item-panel,.filepond--root[data-style-panel-layout~=integrated] .filepond--item-panel{display:none}.filepond--root[data-style-panel-layout~=compact] .filepond--list-scroller,.filepond--root[data-style-panel-layout~=integrated] .filepond--list-scroller{overflow:hidden;height:100%;margin-top:0;margin-bottom:0}.filepond--root[data-style-panel-layout~=compact] .filepond--list,.filepond--root[data-style-panel-layout~=integrated] .filepond--list{left:0;right:0;height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--item,.filepond--root[data-style-panel-layout~=integrated] .filepond--item{margin:0}.filepond--root[data-style-panel-layout~=compact] .filepond--file-wrapper,.filepond--root[data-style-panel-layout~=integrated] .filepond--file-wrapper{height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{z-index:7}.filepond--root[data-style-panel-layout~=circle]{border-radius:99999rem;overflow:hidden}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel{border-radius:inherit}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--file-info,.filepond--root[data-style-panel-layout~=circle] .filepond--file-status{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--action-edit-item{opacity:1!important;visibility:visible!important}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.filepond--root[data-style-panel-layout~=circle]{will-change:transform}}}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:100%!important;pointer-events:none}.filepond-panel:not([data-scalable=false]){height:auto!important}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel[data-scalable=true]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:\"\";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,.5em,0);transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:\"\";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%;vertical-align:top;transform-box:fill-box}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{box-sizing:border-box;position:relative;margin-bottom:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{box-sizing:inherit;line-height:inherit}.filepond--root :not(text){font-size:inherit}.filepond--root[data-disabled]{pointer-events:none}.filepond--root[data-disabled] .filepond--list-scroller{pointer-events:all}.filepond--root[data-disabled] .filepond--list{pointer-events:none}.filepond--root .filepond--drop-label{min-height:4.75em}.filepond--root .filepond--list-scroller{margin-top:1em;margin-bottom:1em}.filepond--root .filepond--credits{position:absolute;right:0;opacity:.4;line-height:.85;font-size:11px;color:inherit;text-decoration:none;z-index:3;bottom:-14px}.filepond--root .filepond--credits[style]{top:0;bottom:auto;margin-top:14px}/*!\n * FilePondPluginImagePreview 4.6.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--image-preview-markup{position:absolute;left:0;top:0}.filepond--image-preview-wrapper{z-index:2}.filepond--image-preview-overlay{display:block;position:absolute;left:0;top:0;width:100%;min-height:5rem;max-height:7rem;margin:0;opacity:0;z-index:2;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--image-preview-overlay svg{width:100%;height:auto;color:inherit;max-height:inherit}.filepond--image-preview-overlay-idle{mix-blend-mode:multiply;color:rgba(40, 40, 40, 0.85)}.filepond--image-preview-overlay-success{mix-blend-mode:normal;color:rgba(54, 151, 99, 1)}.filepond--image-preview-overlay-failure{mix-blend-mode:normal;color:rgba(196, 78, 71, 1)}@supports (-webkit-marquee-repetition: infinite) and\n ((-o-object-fit: fill) or (object-fit: fill)){.filepond--image-preview-overlay-idle{mix-blend-mode:normal}}.filepond--image-preview-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;left:0;top:0;right:0;height:100%;margin:0;border-radius:0.45em;overflow:hidden;background:rgba(0, 0, 0, 0.01)}.filepond--image-preview{position:absolute;left:0;top:0;z-index:1;display:flex;align-items:center;height:100%;width:100%;pointer-events:none;background:#222;will-change:transform, opacity}.filepond--image-clip{position:relative;overflow:hidden;margin:0 auto;}.filepond--image-clip[data-transparency-indicator='grid'] img,.filepond--image-clip[data-transparency-indicator='grid'] canvas{background-color:#fff;background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");background-size:1.25em 1.25em}.filepond--image-bitmap,.filepond--image-vector{position:absolute;left:0;top:0;will-change:transform}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview-wrapper{border-radius:0}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview{height:100%;display:flex;justify-content:center;align-items:center}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-wrapper{border-radius:99999rem}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-overlay{top:auto;bottom:0;-webkit-transform:scaleY(-1);transform:scaleY(-1)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']){margin-bottom:0.325em}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='left']{left:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='right']{right:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='right']{margin-bottom:calc(0.325em + 0.1875em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='center']{margin-top:0;margin-bottom:0.1875em;margin-left:0.1875em}/*!\n * FilePondPluginImageEdit 1.6.3\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='center']{margin-left:-0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='bottom']{margin-bottom:-0.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 0.25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--root[data-style-panel-layout~='circle'] .filepond--action-edit-item{opacity:1 !important;visibility:visible !important}.s-file-upload-wrapper .filepond--file-info-main{-webkit-line-clamp:1;display:-webkit-box;-webkit-box-orient:vertical}";var et='\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>gift-sharing</title>\n<path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>\n</svg>\n';const st=class{constructor(i){t(this,i),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.formSelector="form.product-form, form.form--product-options",salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const t=document.querySelector(".s-quantity-input-input");this.quantity=t?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const t=document.querySelector(this.formSelector);return t?new FormData(t):null}mergeObjectToFormData(t,i,e){for(let s in t){if(!t.hasOwnProperty(s)||null==t[s])continue;const a=e?`${e}[${s}]`:s;"object"!=typeof t[s]||null===t[s]||t[s]instanceof File?i.set(a,t[s]):this.mergeObjectToFormData(t[s],i,a)}return i}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});await this.modal.open();const t=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(t).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async setWrapperHeight(t=1,i=250,e=0,s=0){let a=document.querySelector(`#${this.hostId} .gift-step-${t}`);setTimeout((()=>{this.stepsWrapper.style.height=s?`${s}px`:a.offsetHeight+e+"px"}),i)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let i=t.target.children[t.target.selectedIndex].getAttribute("data-id"),e="custom"==i;this.showGiftText=e,i?(this.selectedGiftTextOption=i,this.selectedText=e?void 0:t.target.value,this.setWrapperHeight(1,150,5)):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0,this.setWrapperHeight(1,150,-15))}async goToStep2(){return this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect.classList.remove("s-form-has-error"),this.customTextArea.classList.remove("s-form-has-error"),this.setWrapperHeight(2,600,0),(new r.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:r.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:r.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),this.currentStep=2,void(this.parentClass=`is-current-step-${this.currentStep}`)):(this.textSelect.classList.remove("s-form-has-error"),void this.customTextArea.classList.add("s-form-has-error")):(this.textSelect.classList.add("s-form-has-error"),void this.customTextArea.classList.remove("s-form-has-error"))}goToStep1(t){t.preventDefault();let i=new r.timeline({autoplay:!1});i.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:r.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:r.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),i.play(),this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload?this.selectImageOrUpload:""}</p></div>`}setPreview(t){this.uploader?.classList.add("has-bg");var i=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");i.classList.add("filepond-bg"),i.classList.remove("s-hidden"),i.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(i),this.uploadedImage=t.url,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(`#${this.hostId} .filepond-bg`);t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea.classList.remove("s-form-has-error")}handleSenderName(t){this.senderName=t.target.value}handleReceiverName(t){this.receiverName=t.target.value}handleReceiverCity(t){this.receiverCity=t.target.value}async handleCountryChange(t){const i=t.target.value;this.selectedCountryId=i;const e=this.gift?.countries?.find((t=>t.id==i));if(this.selectedCountryCode=e?.country_code,!i||0===this.gift?.countries?.length)return this.gift={...this.gift,cities:[]},this.receiverCity=void 0,void(this.selectedCountryCode=void 0);this.loadingCities=!0,this.gift={...this.gift,cities:[]},this.receiverCity=void 0;try{const t=await salla.api.request(`shipping/cities?for_branch=0&country_id=${i}`);t&&t.data&&(this.gift={...this.gift,cities:t.data})}catch(t){console.error("Error fetching cities:",t)}finally{this.loadingCities=!1}}handleUploadImage(t){this.uploadedImage=t,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let i=t.detail;this.receiverMobile=i.number,this.receiverCountryCode=i.country_code}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const t=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");if(this.physicalProducts&&!this.selectedCountryId)return this.errors||(this.errors={}),this.errors["receiver.country"]=salla.lang.get("common.messages.required_field"),void this.setWrapperHeight(2,150,0);const i={text:this.selectedText,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:t||null,receiver:{name:this.receiverName,country_code:this.selectedCountryCode&&this.physicalProducts?this.selectedCountryCode:this.receiverCountryCode,mobile:this.receiverMobile,...this.receiverCity&&this.physicalProducts?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let e;this.productId&&this.formSelector&&(e=this.getFormDataFromForm()||new FormData,e=this.mergeObjectToFormData(i,e));const s=this.productId?()=>salla.product.addProductGiftToCart(this.productId,e,!0):()=>salla.cart.addCartGiftToCart(i,!0);return await s().then((()=>this.modal.close())).catch((t=>{t.response&&422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const t=document.querySelector(this.formSelector);if(!t)return void console.error("SallaGifting:: Form not found in the document!");if(!(t instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!t.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!t||await t.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[i("div",{key:"52ed7ef8e9908a42d1815aa021654557ac1eb77e"},i("salla-list-tile",{key:"d8732567c5d2fcf0a007679087af5bb4a6589649",class:this.generateClass()},i("div",{key:"2d0b7cedaaa7b3248151dfa28683984accfbf57a",slot:"title"},this.vertical?i("span",{innerHTML:et}):"",i("h3",{key:"0089f484e18cb2da81c6c55e931298f80fd97348"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),i("div",{key:"a5b6e824a20b10ec8d0b1b2e64ecb672799a0035",slot:"subtitle"},i("div",{key:"fb15018d2a456bac146dc1b3ad9c93ffe23bb8f8"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),i("div",{key:"7c10860a3881e933850ee7828d604c7a08b3700b",slot:"action"},i("salla-button",{key:"a9a4fc5c746c6e57851f9ea5bb6e026db92428e4",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},i("slot",{key:"2d94342daa320d9e374b7a9945860f1ba4b92abf",name:"widget-btn-content"},i("div",{key:"74d29e05b046fa4d3cdd3dab35934f879e942be6",class:"s-gifting-widget-action-content"},i("span",{key:"40818643fb4ca55a007cbecf1e94b26bbe3afbe3",innerHTML:et}),"  ",i("span",{key:"2bd1fbcb4c0bdedcf93f7c6f677fa177c088d8a4"},this.sectionBtnText)))))),i("salla-modal",{key:"3bc1fe8bb1260983aae3750154025b6d5ce661bb",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},i("div",{key:"1fbd87115bde6dfcdf3c7c2753b051de51afda55",slot:"loading"},i("div",{key:"47d7f1b00a4752192cfa42c2d725546194633e2f",class:"s-gifting-skeleton"},i("div",{key:"189a65f204bd067e31ecdc7814b5cde81409f824",class:"s-gifting-modal-header"},i("salla-skeleton",{key:"bfe75d37f7933b1632c891eb1930e5a0f3efd4ac",type:"circle",height:"5rem",width:"5rem"}),i("h2",{key:"2e5a16d86c0f0c79ec5d272f515ea64e52b07d83",class:"s-gifting-modal-title"},i("div",{key:"931982ea16ad7b099ddc6c33929f96cf15c05307",class:"s-gifting-modal-badge-wrapper"},i("salla-skeleton",{key:"724cb7f8e35c1319e974a53ac7de72090a71bf6a",height:"15px",width:"150px"})))),i("div",{key:"851f77aadad1f617129f03245bc8faa5eaf6f9f3",class:"s-gifting-skeleton-content"},i("salla-skeleton",{key:"d414c203fe82bc06c8fcaa596f3905e186757682",height:"10px",width:"150px"}),i("salla-skeleton",{key:"a0bea49d6eae8d7a5c41f72f147ce7b702502f20",height:"230px"}),i("salla-skeleton",{key:"8d7af7c14a8adad6cfbf17a185148ce7b9324756",height:"10px",width:"150px"}),i("salla-skeleton",{key:"0e78d2bbe2035fd2fe3f3ad295e5901bf2a0e556",height:"30px"}),i("salla-skeleton",{key:"0a64e92db6ee425d22b332d3ada5c25ca5277076",height:"40px"})))),i("slot",{key:"f79fa4c8d457619e77de8dc459f0a65c1078c8ef",name:"header"}),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),i("span",{slot:"description"}," ")):[i("div",{class:"s-gifting-modal-header"},i("span",{class:"s-gifting-modal-icon"},i("span",{innerHTML:et})),i("h2",{class:"s-gifting-modal-title"},i("div",{class:"s-gifting-modal-badge-wrapper"},i("div",{class:"s-gifting-modal-badge"},i("span",null,i("span",null,this.currentStep),"/2")),i("span",null,this.giftDetails)))),i("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},i("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},i("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),i("div",{class:"s-gifting-modal-uploader anime-item",ref:t=>this.uploader=t},i("span",{class:"s-gifting-remove-preview",onClick:()=>this.removePreview(),innerHTML:Q}),this.selectImageOrUpload&&i("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),i("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?i("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},i("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>i("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},i("img",{style:{width:"120px"},src:t.url,alt:`${t.id}`})))):"")):""),i("div",{class:"anime-item"},i("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},i("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},i("option",{"data-id":null,selected:!0},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>i("option",{"data-id":t.id,value:t.text,key:t.id},t.text))):"",i("option",{"data-id":"custom"},this.giftCustomText))),i("div",{class:this.showGiftText?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},i("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),i("div",{class:"mt-1"},i("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))),i("div",{class:"anime-item"},i("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2()},i("span",null,this.nextStep)))),i("div",{class:"s-gifting-step-two gift-step-2",ref:t=>this.step2Elems=t},i("div",{class:this.errors&&this.errors.sender_name?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),i("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?i("span",{class:"s-gifting-error"},this.errors.sender_name):""),i("div",{class:this.errors&&this.errors["receiver.name"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),i("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?i("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),i("div",{class:this.errors&&this.errors["receiver.mobile"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{class:"s-form-label"},this.receiverMobileFieldLabel),i("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.selectedCountryCode||this.receiverCountryCode,key:`tel-input-${this.selectedCountryCode||this.receiverCountryCode||"default"}`,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?i("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.physicalProducts&&i("div",null,i("div",{class:this.errors&&this.errors["receiver.country"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{class:"s-form-label"},this.receiverCountryFieldLabel),i("select",{name:"country",class:"s-form-control",onChange:t=>this.handleCountryChange(t),required:!0},i("option",{value:""},this.selectCountry),this.gift?.countries?.map((t=>i("option",{value:t.id},t.name)))),this.errors&&this.errors["receiver.country"]?i("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),i("div",{class:this.errors&&this.errors["receiver.city_id"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{class:"s-form-label"},this.receiverCityFieldLabel),i("select",{name:"city",class:"s-form-control",onChange:t=>this.handleReceiverCity(t),disabled:this.loadingCities},i("option",{value:"",selected:!0},this.loadingCities?salla.lang.get("common.elements.loading"):this.selectCity),this.gift?.cities?.map((t=>i("option",{value:t.id},t.name)))),this.errors&&this.errors["receiver.city_id"]?i("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),i("div",{class:"s-gifting-info anime-item opacity-0"},i("span",{innerHTML:'\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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),i("span",null,this.selectCityInfo))),!this.physicalProducts&&i("div",{class:"anime-item opacity-0"},i("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},i("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",this.sendLater," "))),i("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},i("label",{class:"s-form-label"},this.selectSendDateAndTime),i("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),i("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),i("div",{class:"s-gifting-step-two-footer anime-item opacity-0"},i("a",{href:"#!",innerHTML:u,onClick:t=>this.goToStep1(t)}),i("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},i("span",null,this.sendGift)))))],i("slot",{key:"3a0375eeb53c624d60601045e695d56ba6b92838",name:"footer"})))]}};st.style=".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}";const at=class{constructor(i){t(this,i),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.lang.onLoaded((()=>{this.status.querySelector(".s-button-text").innerHTML=this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(t=!0){let i=this.status.querySelector(".s-button-text");p.toggleElementClassIf(i,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none"}render(){return this.nextPage.length>1?i(e,{class:"s-infinite-scroll-container"},i("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let t=this,i=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return t.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==i.pageIndex&&i.option({loadOnScroll:!1}),3==i.pageIndex&&i.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return s(this)}};at.style="";const lt=class{constructor(i){t(this,i),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return i(e,{key:"b1b2a6bf65c40643d59f392e91cc76acaea5e89e"},i("a",{key:"4b2026fd739b243a41bfc37fcb55bc07a1a54636",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},i("div",{key:"bbc7a7133da0e471ad92a5466e9ec0481d74cdd7",class:"s-list-tile-item-icon"},i("slot",{key:"e4e338854bfc7e6843c4b87f419c9aa59970c77b",name:"icon"})),i("div",{key:"1b7b2e0a65193be521cdf6cccc314c83f853216d",class:"s-list-tile-item-content"},i("div",{key:"4e6a178d219827b1feef394ea5564769bf11ded2",class:"s-list-tile-item-title"},i("slot",{key:"75b036812aca3e00162fc8c40459b67d4db2cc6f",name:"title"})),i("div",{key:"ab0959a43214ae0eb4cf092ea3738c71ed987709",class:"s-list-tile-item-subtitle"},i("slot",{key:"e13f66fb2a0e1c5ab2a9081c808973c9f9ecca45",name:"subtitle"}))),i("div",{key:"78c7542367a41a1f8bc74bca73d2581f5c0b7bfd",class:"s-list-tile-item-action"},i("slot",{key:"14c8c0f31d29855d743b52f82d52a3bed300b25f",name:"action"}))))}};lt.style="";const ot=class{constructor(i){t(this,i),this.size=32,this.width=2,this.color=void 0,this.bgColor="#e5e7eb"}render(){return i(e,{key:"0f3796a2a8f9610f40e20eb01e4d60fb56e11a03",class:"s-loading-container"},i("svg",{key:"d9d98cfa05e5c7d188237a0a4833c4cd13c2855c","aria-hidden":"true",style:{width:`${this.size}px`,height:`${this.size}px`,fill:this.color,color:this.bgColor},class:"s-loading",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{key:"75ea4d6f86456c86249dab53f3e18d21cc0380ef",d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i("path",{key:"8bfd0b7ea965749ed9456742f36d2ffa28cff9f3",d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})))}};ot.style=".s-loading{animation:spin 1s linear infinite;fill:var(--color-primary)}.s-loading-container{display:flex;justify-content:center;align-items:center}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const nt=class{constructor(i){t(this,i),this.translationLoaded=!1,this.languages=[],this.currencies=[],this.hasError=!1,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),salla.event.on("localization::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),this.languageSlot=this.host.querySelector('[slot="language"]')?.innerHTML||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span></label>',this.currencySlot=this.host.querySelector('[slot="currency"]')?.innerHTML||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{code}</small></label>'}async open(){return this.modal.open(),await salla.api.withoutNotifier((()=>this.getLanguages())).then((()=>this.getCurrencies())).then((()=>{this.languages.length<2&&this.currencies.length<2&&this.modal.close()})).catch((t=>{console.log(t),this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async getLanguages(){return this.language=this.language||salla.config.get("user.language_code"),this.languages.length>1?null:await salla.config.languages().then((t=>this.languages=t))}async getCurrencies(){return this.currency=this.currency||salla.config.get("user.currency_code"),this.currencies.length>1?null:await salla.config.currencies().then((t=>this.currencies=Object.values(t||{})))}onChangeCurrency(t){this.currency=t.target.value}onChangeLanguage(t){this.language=t.target.value}async submit(){let t;this.btn.load().then((()=>{if(this.currency){if(this.currency!==salla.config.get("user.currency_code","SAR"))return t=window.location.href,salla.currency.api.change(this.currency)}else salla.log("There is no currency!")})).then((()=>{this.language!==salla.config.get("user.language_code","ar")&&(t=salla.helpers.addParamToUrl("lang",this.language))})).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>{t&&(window.location.href=t.replace(`/${salla.config.get("user.language_code")}/`,`/${this.language}/`))}))}render(){return i("salla-modal",{key:"becc5db6a4715b1ba69440492785847a254e23c9",isLoading:!0,class:"s-hidden",ref:t=>this.modal=t,width:"xs"},i("div",{key:"116cda532167f767b73728422d580cfa9e269304",slot:"loading"},i("div",{key:"a53bd0db8a838cc8b989a5566da7c6386de516ec",class:"s-localization-modal-skeleton"},i("salla-skeleton",{key:"63d7c34e3ae8fa5c402f0f3cd9925bdd144d672e",width:"25%",height:"15px"}),i("div",{key:"86d07e0c84a66db39d3748ebc888cdc914a40600",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>i("div",{class:"s-localization-modal-skeleton-item"},i("div",{class:"s-localization-modal-skeleton-item-flex"},i("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),i("salla-skeleton",{height:"10px",width:"100px"})),i("salla-skeleton",{height:"15px",width:"20px"}))))),i("salla-skeleton",{key:"b810e2ddedf6b55276a61a346810b22d6a9518ac",width:"25%",height:"15px"}),i("div",{key:"c7a66c2a609b8262b9eb0518d416939d80f4fed6",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>i("div",{class:"s-localization-modal-skeleton-item"},i("div",{class:"s-localization-modal-skeleton-item-flex"},i("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),i("salla-skeleton",{height:"10px",width:"100px"})),i("salla-skeleton",{height:"15px",width:"20px"}))))),i("salla-skeleton",{key:"9d1e030584e3465bc4fae2176f854891b18bb0a1",height:"40px",width:"100%"}))),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"description"},this.errorMessage)):i("div",{class:"s-localization-modal-inner"},this.languages.length>1?i("div",{class:"s-localization-modal-section"},i("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.language")),i("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((t=>i("div",{class:"s-localization-modal-item"},i("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==t.iso_code,onChange:()=>this.language=t.iso_code,name:"language",id:"lang-"+t.code.toLowerCase(),value:t.code}),i("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,t.name).replace(/\{code\}/g,t.code).replace(/\{country_code\}/g,t.country_code)})))):i("select",{class:"s-localization-modal-select",name:"language",onChange:t=>this.onChangeLanguage(t)},this.languages.map((t=>i("option",{value:t.code,selected:this.language==t.code},t.name)))))):"",this.currencies.length>1?i("div",{class:"s-localization-modal-section"},i("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.currency")),i("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((t=>i("div",{class:"s-localization-modal-item"},i("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==t.code,onChange:()=>this.currency=t.code,id:"currency-"+t.code,value:t.code}),i("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,t.name).replace(/\{code\}/g,t.code).replace(/\{country_code\}/g,t.country_code)})))):i("select",{class:"s-localization-modal-select",name:"currency",onChange:t=>this.onChangeCurrency(t)},this.currencies.map((t=>i("option",{value:t.code,selected:this.currency==t.code},t.name)))))):"",i("salla-button",{width:"wide",ref:t=>this.btn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.ok"))))}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#language-slot").forEach((t=>t.replaceWith(t.firstChild)))}get host(){return s(this)}},rt=class{constructor(i){t(this,i),this.isMobileAllowed=!0,this.isEmailRequired=!1,this.supportWebAuth=!0,this.withoutReload=!1,this.source="",this.htmlElement=document.documentElement,this.messages=[],this.isClosable=!0,this.iframeLoaded=!1,this.scrolling="no",this.direction=document.dir,this.canRenderIframe=!1,salla.event.on("login::open",(t=>{this.isEmailAllowed||this.isMobileAllowed?(this.source=t?.source??!1,this.withoutReload=t?.withoutReload??this.withoutReload,this.open(t),this.openModal()):salla.logger.warn("Please enable atleast one login type to use this component.")})),salla.event.on("modal::close",(t=>{this.iframe&&this.sendMessageToIframe({source:"login",type:"modal_closed",data:t})})),salla.onReady((()=>{this.api=salla.config.get("store.api"),this.storeId=salla.config.get("store.id")}))}componentDidLoad(){window.addEventListener("message",(t=>{if("login"!=t.data.source)return;if(!this.inline&&!this.canRenderIframe)return;salla.log("salla-account:: recived an event",t.data);let i=t.data?.type?.replace("iframe::",""),e=t.data.message;if("ready"==i)return e.isPasskeyPage?void this.createPassKey.postMessage({source:"login",type:"init_passkey_page",data:{token:salla.storage.get("token"),store_id:salla.config.get("store.id"),locale:salla.config.get("user.language_code"),redirect:salla.config.get("store.url")}},salla.config.get("login.url")):void this.handleIframeReadyAction();if("height"==i)return this.iframe.height=e?.height+"px";if("storage"==i)return this.handleIframeStorageAction(e);if("scrolling"==i)return this.scrolling=e,void(this.isClosable=!1);if("direction"==i)return document.dir=this.direction=e?"rtl":"ltr";if("notify"==i)return salla.notify[e.type](e.message);if("authenticated"==i||"authenticated_web_auth"==i)return!e?.withoutClose&&this.close(),salla.auth.api.handlAfterAuthenticatedResponse(e,this.supportWebAuth).then((()=>!(e?.withoutReload||this.withoutReload)&&setTimeout((()=>window.location.reload()),1e3)));if("dispatchEvent"!=i||"auth::verified"!=e.event){if("dispatchEvent"==i)return salla.event.emit(e.event,...e.payload);if("reload"==i)return e?.withClose&&this.modal.close(),window.location.reload();if("open_page"===i)return window.location.href=e.url;if("open_passkey_page"!==i)return"guest-checkout"===i?this.handleGuestCheckout():void("close"==i&&this.close());this.createPassKey=window.open(`${salla.config.get("login.url")}/create-passkey`)}else salla.log("Ignored dispatchEvent `auth::verified` from iframe")})),this.observeDarkModeChanges(),setTimeout((()=>Salla.event.emit("salla-login::ready")),1)}async open(t=null){return salla.config.isGuest()?this.modal.open():this.withoutReload?void 0:location.reload()}close(){Salla.event.emit("salla-login::closing"),this.modal.close(),this.iframeLoaded=!1,this.canRenderIframe=!1,this.host.dispatchEvent(new CustomEvent("salla-login:closed",{cancelable:!0,bubbles:!0,detail:null})),Salla.event.emit("salla-login::closed")}handleIframeReadyAction(){this.sendInitMessage(),this.sendMessageToIframe({source:"login",type:"width",data:document.body.clientWidth})}observeDarkModeChanges(){new MutationObserver((t=>{t.forEach((t=>{"class"===t.attributeName&&this.sendMessageToIframe({source:"login",type:"darkMode",data:{isDark:!!this.htmlElement.classList.contains("dark")}})}))})).observe(this.htmlElement,{attributes:!0})}async handleIframeStorageAction(t){let i,e=salla.storage.get("cart.user_id"),s=!1;if(Object.entries(t).filter((t=>!Salla.storage.get(t[0]))).forEach((([t,a])=>{salla.log("Shared storage from accounts domain",t,a);let l="string"==typeof a?a?.replace(/^"|"$/g,""):a;salla.storage.set(t,l),"token"===t&&(i=l),"user"===t&&e&&l.id!==e&&(s=!0)})),i){this.modal.close(),Salla.auth.event.tokenFetched(i);try{await Salla.api.cart.assign()}catch(t){Salla.log("Error on assign after handle iframe",t)}return s&&Salla.cart.reset(),!Salla.auth.api.isSessionless()&&await Salla.auth.api.request("auth/jwt"),void setTimeout((()=>window.location.reload()),100)}s&&Salla.cart.reset()}sendMessageToIframe(t){if(this.iframe)return this.iframe.contentWindow.postMessage(t,"*")}sendInitMessage(){let t=this.headers;try{t="string"==typeof t?JSON.parse(t):t}catch(i){console.error("Failed to parse headers!",this.headers,i),t=void 0}const i={user:salla.storage.get("user"),s_translations:salla.storage.get("s_translations"),token:salla.storage.get("token")};i.user||delete i.user,i.s_translations||delete i.s_translations,i.token||delete i.token,this.sendMessageToIframe({source:"login",type:"init",data:{id:this.storeId,lang:salla.lang.locale,isDark:!!this.htmlElement.classList.contains("dark"),apiUrl:this.api?.replace(/\/+$/,""),supportWebAuth:this.supportWebAuth,withoutReload:this.withoutReload,inline:this.inline,settings:salla.config.all(),headers:t,storage:i}})}async handleGuestCheckout(){if(this.modal.close(),salla.config.isGuest())return await salla.api.cart.syncGuestCart(),salla.cart.submit(!0)}openModal(){this.canRenderIframe||(this.canRenderIframe=!0),this.modal.open()}render(){return this.inline?this.getLoginDom():i("salla-modal",{class:"s-login-modal",ref:t=>this.modal=t,width:"xs"},this.getLoginDom())}getLoginDom(){if(this.canRenderIframe)return i(o,null,i("iframe",{src:`${salla.config.get("login.url","https://accounts.salla.com")}?src=${this.source}`,title:"Salla Login",class:"hide-scroll",loading:"lazy",ref:t=>{this.iframe=t},allow:"publickey-credentials-get; publickey-credentials-create",scrolling:this.scrolling,frameborder:"0",width:"100%"}))}get host(){return s(this)}};rt.style="iframe{-moz-transition:height 0.3s;-ms-transition:height 0.3s;-o-transition:height 0.3s;-webkit-transition:height 0.3s;transition:height 0.3s;width:100%}";var ct='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>star2</title>\n<path d="M29.714 11.839c0 0.321-0.232 0.625-0.464 0.857l-6.482 6.321 1.536 8.929c0.018 0.125 0.018 0.232 0.018 0.357 0 0.464-0.214 0.893-0.732 0.893-0.25 0-0.5-0.089-0.714-0.214l-8.018-4.214-8.018 4.214c-0.232 0.125-0.464 0.214-0.714 0.214-0.518 0-0.75-0.429-0.75-0.893 0-0.125 0.018-0.232 0.036-0.357l1.536-8.929-6.5-6.321c-0.214-0.232-0.446-0.536-0.446-0.857 0-0.536 0.554-0.75 1-0.821l8.964-1.304 4.018-8.125c0.161-0.339 0.464-0.732 0.875-0.732s0.714 0.393 0.875 0.732l4.018 8.125 8.964 1.304c0.429 0.071 1 0.286 1 0.821z"></path>\n</svg>\n';const ht=class{constructor(i){t(this,i),this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.event.on("loyalty::open",(()=>this.open())),salla.auth.event.onLoggedIn((()=>{this.is_loggedin=!0})),salla.onReady((()=>{this.is_loggedin=salla.config.isUser()})),salla.lang.onLoaded((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0})),salla.cart.event.onUpdated((t=>{this.prizePoints=t.loyalty.prize?.points,this.prizeTitle=t.loyalty.prize?.title,this.customerPoints=t.loyalty.customer_points||this.customerPoints}))}setSelectedPrizeItem(t){this.selectedItem=this.selectedItem&&this.selectedItem?.id==t.id?void 0:t}handleLongText(t){return t.length>150?t.substring(0,150)+"...":t}prizeItem(t){return i("div",{onClick:()=>this.setSelectedPrizeItem(t),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==t.id,"s-loyalty-prize-item":!0}},i("img",{class:"s-loyalty-prize-item-image",src:t.image,alt:t.name}),i("div",{class:"s-loyalty-prize-item-title"},t.name),i("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(t.description)),i("div",{class:"s-loyalty-prize-item-points"},t.cost_points," ",salla.lang.get("pages.loyalty_program.point"),i("div",{class:"s-loyalty-prize-item-check"},i("div",null))))}getConfirmationModal(){return[i("salla-placeholder",{alignment:"center",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">\n<title>star3</title>\n <defs>\n <style>\n .a {\n fill: none !important;\n }\n\n .b {\n fill: #ff9e01;\n }\n\n .c {\n fill: #fff;\n opacity: 0.1;\n }\n\n </style>\n </defs>\n <g transform="translate(-683 -269)">\n <rect class="a" width="80" height="80" transform="translate(683 269)" />\n <g transform="translate(684.539 261.216)">\n <path class="b"\n d="M110.117,37.062,90.024,35.2,82.043,16.665a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l17.351-10.3,17.351,10.3a1.61,1.61,0,0,0,2.393-1.739L95.871,53.192l15.16-13.318A1.61,1.61,0,0,0,110.117,37.062Z"\n transform="translate(-42.104 -4.011)" />\n <g transform="translate(0 10.971)">\n <path class="b"\n d="M93.54,12.016c1.024,1.423,3.915,7.533,5.568,11.094a.559.559,0,0,1-.891.641c-2.853-2.7-7.73-7.377-8.754-8.8a2.512,2.512,0,0,1,4.077-2.935Z"\n transform="translate(-75.621 -10.971)" />\n <path class="b"\n d="M360.909,12.016c-1.024,1.423-3.915,7.533-5.568,11.094a.559.559,0,0,0,.891.641c2.853-2.7,7.73-7.377,8.754-8.8a2.512,2.512,0,0,0-4.077-2.935Z"\n transform="translate(-301.908 -10.971)" />\n <path class="b"\n d="M427.538,284.659c-1.667-.543-8.366-1.441-12.261-1.934a.559.559,0,0,0-.34,1.044c3.436,1.9,9.377,5.123,11.044,5.666a2.512,2.512,0,0,0,1.558-4.776Z"\n transform="translate(-352.351 -241.894)" />\n <path class="b"\n d="M1.734,284.659c1.667-.543,8.366-1.441,12.261-1.934a.559.559,0,0,1,.34,1.044c-3.436,1.9-9.377,5.123-11.044,5.666a2.512,2.512,0,0,1-1.558-4.776Z"\n transform="translate(0 -241.894)" />\n <path class="b"\n d="M239.794,412.414c0-1.753,1.224-8.4,1.963-12.257a.559.559,0,0,1,1.1,0c.739,3.855,1.963,10.5,1.963,12.257a2.512,2.512,0,0,1-5.023,0Z"\n transform="translate(-203.768 -341.301)" />\n </g>\n <path class="c"\n d="M84.945,23.4l-2.9-6.74a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l2.309-1.371A125,125,0,0,1,84.945,23.4Z"\n transform="translate(-42.104 -4.011)" />\n </g>\n </g>\n</svg>\n',class:"s-loyalty-confirmation-modal-content"},i("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),i("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",i("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",i("strong",null,this.selectedItem?.name)," )")),i("div",{class:"s-loyalty-confirmation-actions"},i("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),i("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return i("slot",{name:"points-applied-widget"},i("salla-list-tile",{class:"s-loyalty-after-exchange"},i("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle,"   -   ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),i("div",{slot:"action",class:"s-loyalty-after-exchange-action"},i("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},i("span",{innerHTML:Q})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((t=>{this.loyaltyProgram=t.data})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal?.stopLoading()))):salla.event.dispatch("login::open")}async close(){return this.modal.close()}async resetExchange(){return await salla.loyalty.reset()}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((t=>console.log(t)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((t=>console.log(t)))}async exchangeLoyaltyPoint(){return this.buttonLoading=!0,await salla.loyalty.exchange(this.selectedItem?.id).then((()=>"FREE_PRODUCT"==this.selectedItem.key&&salla.url.is_page("cart")&&window.location.reload())).finally((()=>{this.buttonLoading=!1,this.cancelProcess()}))}render(){return this.prizePoints?this.getAfterExchangeUI():[i("slot",{name:"widget"},this.customerPoints?i("salla-list-tile",{class:"s-loyalty-widget"},i("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:ct}),i("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,i("salla-button",{shape:"link",color:"primary",onClick:()=>salla.event.dispatch("loyalty::open")},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_point_exchange_now"):salla.lang.get("blocks.header.login")))):""),i("salla-modal",{noPadding:!0,width:"sm",ref:t=>this.confirmationModal=t},this.getConfirmationModal()),i("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},i("div",{slot:"loading"},i("div",{class:"s-loyalty-skeleton"},i("salla-list-tile",{class:"s-loyalty-header"},i("div",{slot:"icon",class:"s-loyalty-header-icon"},i("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),i("div",{slot:"title",class:"s-loyalty-header-title mb-5"},i("salla-skeleton",{height:"15px",width:"50%"})),i("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},i("salla-skeleton",{height:"10px"}),i("salla-skeleton",{height:"10px",width:"75%"}))),i("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>i("div",{class:"s-loyalty-prize-item swiper-slide"},i("salla-skeleton",{height:"9rem"}),i("div",{class:"s-loyalty-prize-item-title"},i("salla-skeleton",{height:"15px",width:"75%"})),i("div",{class:"s-loyalty-prize-item-subtitle"},i("salla-skeleton",{height:"10px",width:"50%"}),i("salla-skeleton",{height:"10px",width:"25%"})),i("div",{class:"s-loyalty-prize-item-points"},i("salla-skeleton",{height:"15px",width:"100px"}),i("div",{class:"s-loyalty-prize-item-check"},i("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[i("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},i("div",{slot:"icon",class:"s-loyalty-header-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="54.079" height="53.191" viewBox="0 0 54.079 53.191"><defs><style>.a{fill:#ee9d0d;}.b{fill:#c7830b;}.c{fill:#ea2b2d;}.d{fill:#cb2527;}.e{fill:#6699ce;}.f{fill:#faa6b2;}.g{fill:#a6deff;}.h{fill:#eeb436;}.i{fill:#f72d2f;}</style></defs><path class="a" d="M40,248H77.3v25.88a2.1,2.1,0,0,1-2.1,2.1H42.1a2.1,2.1,0,0,1-2.1-2.1Z" transform="translate(-38.135 -222.787)"/><path class="b" d="M250.632,248.711v12.755L236.2,248h13.67Z" transform="translate(-211.463 -222.787)"/><path class="b" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="c" d="M226.194,32.048l-.5.185a5.035,5.035,0,0,0-3.072,3.292l-.468,1.585-.759.414a5.035,5.035,0,0,0-2.422,3l8.865,8.271,5.09-5.456.262-6.205a5.191,5.191,0,0,0-7-5.083Z" transform="translate(-196.246 -31.722)"/><path class="c" d="M358.628,175.48l-.15.509a5.034,5.034,0,0,1-3.072,3.292l-1.55.577-.359.785a5.034,5.034,0,0,1-2.822,2.624L341.81,175l5.09-5.455,6.172-.69a5.191,5.191,0,0,1,5.555,6.629Z" transform="translate(-304.761 -152.837)"/><path class="d" d="M168,248h7.461v27.978H168Z" transform="translate(-151.213 -222.787)"/><path class="c" d="M40,336H77.3v7.461H40Z" transform="translate(-38.135 -300.528)"/><path class="d" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="a" d="M2.1,0H40.8a2.1,2.1,0,0,1,2.1,2.1V9.326H0V2.1A2.1,2.1,0,0,1,2.1,0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 18.641, 4.976)"/><path class="d" d="M0,0H9.326V9.326H0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 30.912, 16.424)"/><path class="d" d="M286.857,79.389a.931.931,0,0,1-.74-.365l-.615-.8a12.516,12.516,0,0,1-2.528-9,.933.933,0,0,1,1.855.2,10.66,10.66,0,0,0,2.153,7.667l.615.8a.933.933,0,0,1-.739,1.5Z" transform="translate(-252.718 -64.113)"/><path class="c" d="M185.485,178.151l-.039.014a30.78,30.78,0,0,1-12.034,1.906l-2.381-.1,4.092,3.817-1.181,4,3.728-1.206a30.775,30.775,0,0,0,9.833-5.315l.71-.572Z" transform="translate(-153.891 -161.081)"/><path class="d" d="M363.834,194.779a12.51,12.51,0,0,1-6.93-2.1l-.843-.559a.933.933,0,1,1,1.031-1.554l.842.558a10.659,10.659,0,0,0,7.8,1.618.933.933,0,1,1,.328,1.836A12.663,12.663,0,0,1,363.834,194.779Z" transform="translate(-316.982 -171.914)"/><path class="c" d="M275,202.524l-.012.04a30.776,30.776,0,0,0-1.069,12.137l.265,2.369-4.092-3.817-3.909,1.455.945-3.8a30.776,30.776,0,0,1,4.622-10.177l.521-.748Z" transform="translate(-237.949 -180.364)"/><circle class="e" cx="1.865" cy="1.865" r="1.865" transform="translate(10.259 0.032)"/><circle class="f" cx="1.865" cy="1.865" r="1.865" transform="translate(0 21.482)"/><path class="g" d="M36.663,36.663a.933.933,0,0,1-.885-.638l-.048-.143a2.946,2.946,0,0,0-2.8-2.017.933.933,0,1,1,0-1.865A4.808,4.808,0,0,1,37.5,35.292l.048.143a.933.933,0,0,1-.885,1.228Z" transform="translate(-31.067 -31.968)"/><path class="g" d="M79.493,194.438a.929.929,0,0,1-.506-.15l-.185-.12a2.074,2.074,0,0,0-2.192-.047.933.933,0,0,1-.947-1.607,3.929,3.929,0,0,1,4.153.088l.185.12a.933.933,0,0,1-.508,1.716Z" transform="translate(-69.235 -173.283)"/><path class="h" d="M27.751,85.141l2.88,2.644,3.811-.874-1.624,3.556,2.008,3.354-3.884-.446-2.569,2.946L27.6,92.49,24,90.957l3.4-1.922Z" transform="translate(-24 -78.914)"/><path class="h" d="M82.174,227.375l-.959,3.772,2.564,2.928-3.884.254L77.9,237.673l-1.442-3.615-3.8-.862,2.993-2.488-.353-3.876,3.291,2.078Z" transform="translate(-66.992 -204.086)"/><path class="i" d="M300.471,141.9l-5.455-5.09,5.09-5.456a8.342,8.342,0,0,1,5.455,5.09Z" transform="translate(-263.422 -119.737)"/></svg>'}),i("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),i("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),i("salla-tabs",null,this.loyaltyProgram.prizes.map((t=>i("salla-tab-header",{slot:"header",name:t.title},i("span",null,t.title)))),this.loyaltyProgram.prizes.map(((t,e)=>i("salla-tab-content",{slot:"content",name:t.title},i("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+e,type:"carousel"},i("div",{slot:"items"},t.items.map((t=>this.prizeItem(t))))))))),i("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:i("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?i("span",{slot:"description"},this.errorMessage):""))]}};ht.style="";const dt=class{constructor(i){t(this,i)}componentWillLoad(){this.title=salla.config.get("maintenance_details.title"),this.message=salla.config.get("maintenance_details.message"),this.buttonTitle=window.innerWidth<=768?salla.config.get("maintenance_details.button_title"):salla.config.get("maintenance_details.button_full_title")}closeAlert(){salla.storage.set("hide_salla-maintenance-alert_at",Date.now()),this.host.style.display="none"}render(){return i(e,{key:"ec1f4c39f02624943122e444dce1a19bbea34a07",class:"s-maintenance-alert-wrapper"},i("button",{key:"db2892331f6addedc5b916e9c4c666023d6765b0",class:"s-maintenance-alert-close",innerHTML:Q,onClick:()=>this.closeAlert()}),i("div",{key:"2cc604e98eccd343eb0fbe07d6a030aeca28d142",class:"s-maintenance-alert-content"},i("div",{key:"563c647d3e73b40f8db1c51dc6b74f4333c8964e",class:"s-maintenance-alert-container"},i("div",{key:"662cb7f23d6fba70fa6f2025188e73fd7fad965d",class:"s-maintenance-alert-icon"},i("img",{key:"d5ce8780910ebefa6e16a720170d799974813816",src:salla.url.cdn("images/alert.png"),alt:"Alert"})),i("div",{key:"35f7d4d0a3af396e0ec2bd2f7362f4f1aa620523",class:"s-maintenance-alert-text"},i("h2",{key:"14edaba08f2a7f48c673c5d9e714b7e6507543a2"},this.title),i("p",{key:"5fd4831d78deebfc7c7b999c9a71225ab038ec14"},this.message))),i("div",{key:"f76912d23fe45cd1bd83a89faf646b3038402476"},i("a",{key:"39f2609417b1ff80ea6376a0346fa1a227828c99",class:"s-maintenance-alert-btn",href:salla.config.get("maintenance_details.button_url")},this.buttonTitle))))}componentDidLoad(){let t=salla.storage.get("hide_salla-maintenance-alert_at");t&&(Date.now()-t)/1e3/60<60&&this.closeAlert()}get host(){return s(this)}};dt.style=".s-maintenance-alert-wrapper{display:flex;min-height:40px;width:100%;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(26, 38, 61, var(--tw-bg-opacity));padding:0.25rem 0.5rem;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-wrapper a{transition:0.35s cubic-bezier(0.2, 1, 0.3, 1)}.s-maintenance-alert-wrapper *{color:inherit}@media (min-width: 640px){.s-maintenance-alert-wrapper{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-content{margin-top:1rem;margin-bottom:1rem;display:flex;width:100%;align-items:center;justify-content:space-between}@media (min-width: 640px){.s-maintenance-alert-content{padding-left:2rem;padding-right:2rem}}.s-maintenance-alert-container{display:flex;align-items:center}.s-maintenance-alert-icon{margin-right:1.25rem;display:none}@media (min-width: 640px){.s-maintenance-alert-icon{display:block}}.s-maintenance-alert-text h2{margin-bottom:0.5rem;font-size:0.875rem;font-weight:700;line-height:1.4}@media (min-width: 640px){.s-maintenance-alert-text h2{font-size:1.5rem;line-height:2rem}}.s-maintenance-alert-text p{margin:0px;text-align:right;font-size:10px;line-height:1.2}@media (min-width: 640px){.s-maintenance-alert-text p{text-align:center;font-size:0.75rem;line-height:1}}.s-maintenance-alert-btn{position:relative;margin-left:4px;margin-right:4px;display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;border-radius:0.125rem;border-width:1px;--tw-border-opacity:1;border-color:rgba(93, 213, 196, var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(93, 213, 196, var(--tw-bg-opacity));padding:0.5rem;text-align:center;vertical-align:middle;font-size:0.875rem;font-weight:400;line-height:1.4;--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity))}.s-maintenance-alert-btn:hover{--tw-bg-opacity:1;background-color:rgba(53, 203, 181, var(--tw-bg-opacity))}.s-maintenance-alert-btn *{pointer-events:none}[dir=rtl] .s-maintenance-alert-btn{margin-left:1.25rem;margin-right:0}@media (min-width: 640px){.s-maintenance-alert-btn{padding:0.5rem 1rem}}";var pt={light:[{featureType:"water",elementType:"geometry",stylers:[{color:"#e9e9e9"},{lightness:17}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:20}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#ffffff"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#ffffff"},{lightness:29},{weight:.2}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:16}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:21}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#dedede"},{lightness:21}]},{elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#ffffff"},{lightness:16}]},{elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#333333"},{lightness:40}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#f2f2f2"},{lightness:19}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#fefefe"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#fefefe"},{lightness:17},{weight:1.2}]}],dark:[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}]};class ut{constructor(t=null,i={}){if(this.apiKey=t,this.options=i,"undefined"==typeof window)throw new Error("google-maps is supported only in browser environment")}load(){return void 0!==this.api?Promise.resolve(this.api):void 0!==this.loader?this.loader:(window[ut.CALLBACK_NAME]=()=>{if(this.api=window.google,void 0===this.resolve)throw new Error("Should not happen");this.resolve(this.api)},window.gm_authFailure=()=>{if(void 0===this.reject)throw new Error("Should not happen");this.reject(new Error("google-maps: authentication error"))},this.loader=new Promise(((t,i)=>{this.resolve=t,this.reject=i;const e=document.createElement("script");e.src=this.createUrl(),e.async=!0,e.onerror=t=>i(t),document.head.appendChild(e)})))}createUrl(){const t=[`callback=${ut.CALLBACK_NAME}`];this.apiKey&&t.push(`key=${this.apiKey}`);for(let i in this.options)if(this.options.hasOwnProperty(i)){let e=this.options[i];"version"===i&&(i="v"),"libraries"===i&&(e=e.join(",")),t.push(`${i}=${e}`)}return`https://maps.googleapis.com/maps/api/js?${t.join("&")}`}}ut.CALLBACK_NAME="_dk_google_maps_loader_cb";const gt=class{constructor(i){t(this,i),this.selected=a(this,"selected"),this.mapClicked=a(this,"mapClicked"),this.currentLocationChanged=a(this,"currentLocationChanged"),this.invalidInput=a(this,"invalidInput"),this.defaultLat=21.419421,this.defaultLng=39.82553,this.modalActivityTitle=salla.lang.get("pages.checkout.select_your_address_from_map"),this.confirmButtonTitle=salla.lang.get("pages.checkout.confirm_address"),this.locateButtonTitle=salla.lang.get("pages.cart.detect_location"),this.locateButtonEdit=salla.lang.get("common.elements.edit"),this.searchPlaceholder=salla.lang.get("pages.checkout.search_for_address"),this.searchInputValue=null,this.formattedAddress="",this.geolocationError=!1,this.name="location",this.required=!1,this.readonly=!1,this.searchable=!1,this.zoom=10,this.theme="light",salla.lang.onLoaded((()=>{this.modalActivityTitle=salla.lang.get("pages.checkout.select_your_address_from_map"),this.confirmButtonTitle=salla.lang.get("pages.checkout.confirm_address"),this.locateButtonTitle=salla.lang.get("pages.cart.detect_location"),this.locateButtonEdit=salla.lang.get("common.elements.edit"),this.searchPlaceholder=salla.lang.get("pages.checkout.search_for_address")})),salla.onReady((()=>{this.apiKey=salla.config.get("store.settings.keys.maps","AIzaSyBFgFISAizDP3YVWj0y5rF8JKKNQ2vohdc")}))}formatAddress(t){return t.length>25?t.substring(0,25)+"...":t}getLatLng(){return this.selectedLat&&this.selectedLng?`${this.selectedLat}, ${this.selectedLng}`:null}getPositionAddress(t,i=!1){(new google.maps.Geocoder).geocode({location:t},((t,e)=>{e===google.maps.GeocoderStatus.OK&&(this.searchable&&(this.searchInputValue=t[0].formatted_address,this.searchInput.value=t[0].formatted_address),i&&(this.formattedAddress=t[0].formatted_address))}))}initGoogleMaps(t,i){new ut(this.apiKey,t).load().then((t=>{if(this.map=new t.maps.Map(i,{center:this.lat||this.lng?{lat:this.lat,lng:this.lng}:{lat:this.defaultLat,lng:this.defaultLng},zoom:this.zoom,zoomControl:!0,mapTypeControl:!1,scaleControl:!1,streetViewControl:!1,rotateControl:!1,fullscreenControl:!1,disableDefaultUI:!1}),this.map.setOptions({styles:"light"===this.theme?pt.light:pt.dark}),this.marker=new t.maps.Marker({position:this.map.getCenter(),map:this.map,icon:{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect width="36" height="36" rx="18" fill="#5CD5C4"/>\n<path d="M18 10C17.0104 10 16.1458 10.1771 15.4062 10.5312C14.6562 10.8854 14.026 11.3542 13.5156 11.9375C13.0156 12.5104 12.6406 13.1667 12.3906 13.9062C12.1302 14.6458 12 15.401 12 16.1719C12 16.8906 12.2604 17.7656 12.7812 18.7969C13.3021 19.8281 13.8854 20.8333 14.5312 21.8125C15.1875 22.7812 15.8073 23.6406 16.3906 24.3906C16.9844 25.1302 17.349 25.5885 17.4844 25.7656C17.5469 25.8385 17.625 25.8958 17.7188 25.9375C17.8125 25.9792 17.9062 26 18 26C18.1042 26 18.1979 25.9792 18.2812 25.9375C18.375 25.8958 18.4531 25.8385 18.5156 25.7656C18.651 25.5885 19.0156 25.1302 19.6094 24.3906C20.1927 23.6406 20.8073 22.7812 21.4531 21.8125C22.1094 20.8333 22.6979 19.8281 23.2188 18.7969C23.7396 17.7656 24 16.8906 24 16.1719C24 15.401 23.8698 14.6458 23.6094 13.9062C23.3594 13.1667 22.9792 12.5104 22.4688 11.9375C21.9688 11.3542 21.3438 10.8854 20.5938 10.5312C19.8542 10.1771 18.9896 10 18 10ZM18 24.2812C17.5833 23.75 17.1094 23.1198 16.5781 22.3906C16.0365 21.651 15.526 20.901 15.0469 20.1406C14.5677 19.3698 14.1615 18.6302 13.8281 17.9219C13.4948 17.2135 13.3281 16.6302 13.3281 16.1719C13.3281 15.5885 13.4219 15.0052 13.6094 14.4219C13.7969 13.849 14.0781 13.3333 14.4531 12.875C14.8385 12.4167 15.3281 12.0469 15.9219 11.7656C16.5052 11.474 17.1979 11.3281 18 11.3281C18.8021 11.3281 19.4948 11.474 20.0781 11.7656C20.6719 12.0469 21.1562 12.4167 21.5312 12.875C21.9167 13.3333 22.2031 13.849 22.3906 14.4219C22.5781 15.0052 22.6719 15.5885 22.6719 16.1719C22.6719 16.6302 22.5052 17.2135 22.1719 17.9219C21.8385 18.6302 21.4323 19.3698 20.9531 20.1406C20.474 20.901 19.9688 21.651 19.4375 22.3906C18.8958 23.1198 18.4167 23.75 18 24.2812ZM18 13.3281C17.2604 13.3281 16.6302 13.5885 16.1094 14.1094C15.5885 14.6302 15.3281 15.2604 15.3281 16C15.3281 16.7396 15.5885 17.3698 16.1094 17.8906C16.6302 18.4115 17.2604 18.6719 18 18.6719C18.7396 18.6719 19.3698 18.4115 19.8906 17.8906C20.4115 17.3698 20.6719 16.7396 20.6719 16C20.6719 15.2604 20.4115 14.6302 19.8906 14.1094C19.3698 13.5885 18.7396 13.3281 18 13.3281ZM18 17.3281C17.6354 17.3281 17.3229 17.1979 17.0625 16.9375C16.8021 16.6771 16.6719 16.3646 16.6719 16C16.6719 15.6354 16.8021 15.3229 17.0625 15.0625C17.3229 14.8021 17.6354 14.6719 18 14.6719C18.3646 14.6719 18.6771 14.8021 18.9375 15.0625C19.1979 15.3229 19.3281 15.6354 19.3281 16C19.3281 16.3646 19.1979 16.6771 18.9375 16.9375C18.6771 17.1979 18.3646 17.3281 18 17.3281Z" fill="white"/>\n</svg>\n'),scaledSize:new t.maps.Size(30,30)}}),this.searchable){const i=new t.maps.places.SearchBox(this.searchInput);t.maps.event.addListener(i,"places_changed",(()=>{const t=i.getPlaces();t.length>0&&this.map&&(this.map.setCenter(t[0].geometry.location),this.lat=t[0].geometry.location.lat(),this.lng=t[0].geometry.location.lng(),this.marker.setPosition(t[0].geometry.location),this.searchInputValue=t[0].formatted_address,this.formattedAddress=t[0].formatted_address)}))}t.maps.event.addListener(this.map,"click",(t=>{this.readonly||(this.marker.setPosition(t.latLng),this.lat=t.latLng.lat(),this.lng=t.latLng.lng(),this.getPositionAddress(t.latLng),this.mapClicked.emit({lat:t.latLng.lat(),lng:t.latLng.lng(),address:this.formattedAddress?this.formattedAddress:null}))})),this.lat||this.lng||(this.getCurrentLocation(),this.geolocationError&&(this.map.setCenter({lat:this.lat,lng:this.lng}),this.marker.setPosition({lat:this.lat,lng:this.lng})))}))}getCurrentLocation(){navigator.geolocation&&this.map?navigator.geolocation.getCurrentPosition((t=>{const i={center:new google.maps.LatLng(t.coords.latitude,t.coords.longitude),zoom:15};this.map.setOptions(i),this.marker.setPosition(i.center),this.getPositionAddress(i.center),this.lat=t.coords.latitude,this.lng=t.coords.longitude,this.currentLocationChanged.emit({lat:t.coords.latitude,lng:t.coords.longitude,address:this.formattedAddress?this.formattedAddress:null})}),this.handleLocationError.bind(this)):(salla.log("Geolocation is not supported by this browser."),this.geolocationError=!0)}handleLocationError(t){switch(this.geolocationError=!0,t.code){case t.PERMISSION_DENIED:salla.log("User denied the request for Geolocation.");break;case t.POSITION_UNAVAILABLE:salla.log("Location information is unavailable.");break;case t.TIMEOUT:salla.log("The request to get user location timed out.");break;case t.UNKNOWN_ERROR:salla.log("An unknown error occurred.")}}componentDidLoad(){this.lat&&this.lng&&fetch(`https://maps.googleapis.com/maps/api/geocode/json?latlng=${this.lat},${this.lng}&key=${this.apiKey}&language=${salla.config.get("user.language_code")||document.documentElement.lang||"ar"}`).then((t=>t.json())).then((t=>{"OK"===t.status&&(this.formattedAddress=t.results[0].formatted_address,this.searchInputValue=t.results[0].formatted_address,this.searchInput.value=t.results[0].formatted_address,this.selectedLng=this.lng,this.selectedLat=this.lat)})),this.mapInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.mapInput.addEventListener("input",(()=>{this.mapInput.setCustomValidity(""),this.mapInput.reportValidity()}))}async open(){return this.map||this.initGoogleMaps({libraries:this.searchable?["places","search"]:[],language:salla.config.get("user.language_code")||document.documentElement.lang||"ar"},this.mapElement),await this.locationModal.open()}getLocationModal(){return i("div",null,i("div",{class:"s-map-modal-title"},this.modalTitle?this.modalTitle:this.modalActivityTitle),i("div",{class:"s-map-modal-body"},i("div",{class:"s-map-element",ref:t=>this.mapElement=t}),this.readonly?"":[this.searchable&&i("div",{class:"s-map-search-wrapper"},i("input",{class:"s-map-search-input",ref:t=>this.searchInput=t,placeholder:this.searchPlaceholder})),i("salla-button",{class:"s-map-my-location-button",onClick:()=>{this.getCurrentLocation()},shape:"icon",color:"primary"},i("span",{innerHTML:'\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>location-target</title>\n<path d="M16 9.333c-3.676 0-6.667 2.991-6.667 6.667s2.991 6.667 6.667 6.667 6.667-2.991 6.667-6.667-2.991-6.667-6.667-6.667zM16 20c-2.205 0-4-1.795-4-4s1.795-4 4-4 4 1.795 4 4-1.795 4-4 4zM30.667 14.667h-1.401c-0.627-6.289-5.643-11.305-11.932-11.932v-1.401c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.401c-6.289 0.627-11.305 5.643-11.932 11.932h-1.401c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h1.401c0.628 6.289 5.643 11.305 11.932 11.932v1.401c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-1.401c6.289-0.628 11.305-5.643 11.932-11.932h1.401c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333zM16 26.667c-5.881 0-10.667-4.785-10.667-10.667s4.785-10.667 10.667-10.667 10.667 4.785 10.667 10.667-4.785 10.667-10.667 10.667z"></path>\n</svg>\n'})),i("salla-button",{class:"s-map-submit-button",color:"primary",width:"wide",onClick:()=>{let t={lat:this.lat,lng:this.lng,address:this.formattedAddress?this.formattedAddress:null};salla.event.emit("salla-map::selected",t),this.selected.emit(t),this.selectedLat=t.lat,this.selectedLng=t.lng,this.getPositionAddress(new google.maps.LatLng(t.lat,t.lng),!0),this.mapInput.value=this.selectedLat&&this.selectedLng?`${this.selectedLat}, ${this.selectedLng}`:null,this.mapInput.dispatchEvent(new window.Event("change",{bubbles:!0})),this.locationModal.close()}},this.confirmButtonTitle)]))}render(){return i(e,{key:"4493051dec9a6e1dfd97037f913832badb001588",class:"s-map-wrapper"},i("salla-modal",{key:"5e492140d308e80f3a0572906e26a2750affd7ea",class:"s-map-modal-wrapper",noPadding:!0,ref:t=>{this.locationModal=t}},this.getLocationModal()),i("slot",{key:"c631ddacaa4d957d35f224137769669645841ef4",name:"button"},i("salla-button",{key:"2e6f39c033be6327460362a80b9b6be8a99cce75",onClick:()=>{this.open()},color:"primary",class:"s-map-location-button"},i("span",{key:"88371c09fa3aece12575e6759470279267d828be",class:"s-map-location-icon",innerHTML:this.formattedAddress?'\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>edit</title>\n<path d="M30.583 1.417c-1.828-1.829-5.019-1.829-6.847 0l-13.396 13.396c-0.161 0.161-0.279 0.361-0.341 0.581l-1.949 6.911c-0.131 0.464 0 0.964 0.341 1.305 0.253 0.252 0.593 0.389 0.943 0.389 0.121 0 0.243-0.016 0.361-0.051l6.911-1.949c0.22-0.061 0.419-0.179 0.581-0.34l10.455-10.453s0 0 0 0l2.941-2.941c1.887-1.888 1.887-4.96 0-6.848zM15.547 19.528l-4.284 1.208 1.208-4.284 9.265-9.265 3.076 3.076zM28.696 6.38l-1.999 1.999-3.076-3.076 1.999-1.999c0.849-0.848 2.227-0.848 3.076 0 0.848 0.848 0.848 2.227 0 3.076zM24 20c-0.737 0-1.333 0.597-1.333 1.333v4c0 2.205-1.795 4-4 4h-12c-2.205 0-4-1.795-4-4v-12c0-2.205 1.795-4 4-4h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-4c-3.676 0-6.667 2.991-6.667 6.667v12c0 3.676 2.991 6.667 6.667 6.667h12c3.676 0 6.667-2.991 6.667-6.667v-4c0-0.736-0.596-1.333-1.333-1.333z"></path>\n</svg>\n':'\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>location</title>\n<path d="M16.001 0c-7.879 0-12.001 6.204-12.001 12.333 0 5.813 9.853 17.833 10.976 19.185 0.253 0.305 0.629 0.481 1.025 0.481s0.772-0.176 1.027-0.481c1.121-1.352 10.972-13.372 10.972-19.185 0-6.129-4.121-12.333-11.999-12.333zM16.001 28.549c-3.32-4.184-9.335-12.527-9.335-16.216 0-4.656 2.92-9.667 9.335-9.667 6.412 0 9.332 5.011 9.332 9.667 0 3.689-6.013 12.032-9.332 16.216zM16 6.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16 14.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}),this.formattedAddress?i("div",null,this.locateButtonEdit," | ",this.formatAddress(this.formattedAddress)):this.locateButtonTitle)),i("input",{key:"bae03eb7d7f756f3b92b5eee56c7dc0f366aee74",class:"s-hidden",name:this.name,required:this.required,value:this.getLatLng(),ref:t=>this.mapInput=t}))}get host(){return s(this)}};gt.style="";const mt=class{constructor(i){t(this,i),this.source="header",this.useReactLink=!1,this.menus=[]}async componentWillLoad(){return salla.onReady((()=>{if(this.displayAllText=salla.lang.get("blocks.home.display_all"),!this.sourceValue||"json"!==this.source)return this.getMenuItems();this.menus="string"==typeof this.sourceValue?JSON.parse(this.sourceValue):this.sourceValue||[]}))}getMenuItems(){return salla.api.component.getMenus(this.source).then((({data:t})=>{this.menus=t})).catch((t=>{salla.logger.error("salla-menu::Error fetching menus",t)}))}hasChildren(t){return t?.children?.length>0}hasProducts(t){return t?.products?.length>0}getDesktopClasses(t,i){return`!hidden lg:!block ${i?"root-level lg:!inline-block":"relative"} ${t.products?" mega-menu":""}\n ${this.hasChildren(t)?"has-children":""}`}getAttributes(t){return t.trim().split(" ").reduce(((t,i)=>{let[e,s]=i.split("=");return t[e]=s.replace(/"/g,""),t}),{})}getMobileMenu(t,e){const s=t.image?i("img",{src:t.image,class:"rounded-full",width:"48",height:"48",alt:t.title}):null;return i("li",{class:"lg:hidden text-sm font-bold",...this.getAttributes(t.attrs)},this.hasChildren(t)?i(o,null,i("span",{class:t.image?"!py-3":""},s,t.title),i("ul",null,i("li",{class:"text-sm font-bold"},i("a",{href:t.url,class:"text-gray-500"},e)),t.children.map((t=>this.getMobileMenu(t,e))))):i("a",{href:t.url,"aria-label":t.title||"category",class:"text-gray-500 "+(t.image?"!py-3":""),...this.getAttributes(t.link_attrs)},s,i("span",null,t.title||"")))}getDesktopMenu(t,e){return i("li",{class:this.getDesktopClasses(t,e),...this.getAttributes(t.attrs)},i("a",{href:t.url,"aria-label":t.title||"category",...this.getAttributes(t.link_attrs)},i("span",null,t.title)),this.hasChildren(t)?i("div",{class:"sub-menu shadow-default "+(this.hasProducts(t)?"w-full left-0 flex":"w-56")},i("ul",{class:this.hasProducts(t)?"w-56 shrink-0 m-8 rtl:ml-0 ltr:mr-0":""},t.children.map((t=>this.getDesktopMenu(t,!1)))),this.hasProducts(t)?i("salla-products-list",{source:"selected","shadow-on-hover":!0,"source-value":`[${t.products}]`}):null):null)}getFooterMenu(t){const e=this.topnav||this.limit?t.slice(0,this.limit||3):t;return i("div",null,i("div",{class:{"s-menu-footer-list":!this.topnav,"s-menu-topnav-list":this.topnav}},e.map((t=>i("a",{key:t.id,href:t.url,target:t.target,class:{"s-menu-footer-item":!this.topnav,"s-menu-topnav-item topnav-link-item right-side":this.topnav}},t.title)))))}getHeaderMenu(t){return t.map((t=>[this.getMobileMenu(t,this.displayAllText),this.getDesktopMenu(t,!0)]))}render(){return"footer"===this.source?this.getFooterMenu(this.menus):[i("nav",{key:"main-nav",id:"mobile-menu",class:"mobile-menu"},i("ul",{class:"main-menu"},this.getHeaderMenu(this.menus)),i("button",{class:"btn--close close-mobile-menu sicon-cancel lg:hidden"})),i("button",{key:"close-btn",class:"btn--close-sm close-mobile-menu sicon-cancel hidden"})]}};mt.style=":host{display:block}";const ft=class{constructor(i){t(this,i),this.modalVisibilityChanged=a(this,"modalVisibilityChanged"),this.isClosable=!0,this.width="md",this.position="middle",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("modal::open",(t=>t==this.host.id&&this.open())),salla.event.on("modal::close",(t=>t==this.host.id&&this.close())),this.modalTitle=this.host.getAttribute("modal-title")}handleVisible(t){if(!t)return this.modalVisibilityChanged.emit(!1),void this.toggleModal(!1);this.modalVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleModal(!0)))}handleKeyUp(t){"KeyUp"===t.key&&this.closeModal()}async open(){return this.host.setAttribute("visible",""),this.handleAutoFocus(),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(t){return this.modalTitle=t,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}handleAutoFocus(){const t=this.host.querySelector("input, textarea, select");t&&setTimeout((()=>{t.focus()}),100)}toggleModal(t){const i=this.host.querySelector(".s-modal-body");p.toggleElementClassIf(i,"s-modal-entering","s-modal-leaving",(()=>t)).toggleElementClassIf(this.overlay,"s-modal-entering","s-modal-overlay-leaving",(()=>t)).toggleElementClassIf(document.body,"modal-is-open","modal-is-closed",(()=>t)),t||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeModal(t){this.isClosable&&(salla.event.dispatch("modal::close",{reason:t}),this.host.removeAttribute("visible"))}iconBlockClasses(){return{"s-modal-icon":!0,"s-modal-bg-error":"error"==this.iconStyle,"s-modal-bg-success":"success"==this.iconStyle,"s-modal-bg-normal":!this.iconStyle,"s-modal-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-modal",this.isLoading?i(e,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:t=>this.handleKeyUp(t)},i("div",{class:"s-modal-overlay",ref:t=>this.overlay=t,onClick:()=>this.closeModal("backdropClick")}),i("div",{class:"s-modal-wrapper"},i("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),i("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},i("slot",{name:"loading"},i("salla-loading",null)),i("div",{class:"s-hidden"},i("slot",null))))):i(e,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog"},i("div",{class:"s-modal-overlay",ref:t=>this.overlay=t,onClick:()=>this.closeModal("backdropClick")}),i("div",{class:"s-modal-wrapper"},i("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),i("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},i("div",{class:{"s-modal-header":!0,"s-modal-is-center":this.centered}},this.isClosable?i("button",{class:"s-modal-close",onClick:()=>this.closeModal("closeButtonClick"),type:"button"},i("span",{innerHTML:Q})):"",this.modalTitle||this.subTitle?i("div",{class:"s-modal-header-inner"},i("slot",{name:"icon"},this.iconStyle?i("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?X:K}):""),i("div",{class:"s-modal-header-content"},this.modalTitle?i("div",{class:{"s-modal-title":!0,"s-modal-title-below":this.subTitleFirst},innerHTML:this.modalTitle}):"",this.subTitle?i("p",{class:{"s-modal-sub-title":!0},innerHTML:this.subTitle}):"")):""),i("slot",null),i("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return s(this)}static get watchers(){return{visible:["handleVisible"]}}};ft.style="@media screen and (max-width: 470px){.modal-is-open{position:fixed;width:100%}}";const bt=class{constructor(i){t(this,i),this.parsedSections=[]}parseProducts(t){let i=[];if("string"==typeof t)try{const e=JSON.parse(t);i=this.extractSections(e)}catch(e){console.error("Invalid JSON passed to bundleSections prop:",t),i=[]}else t&&(i=this.extractSections(t));this.parsedSections=i}extractSections(t){return t.bundle&&t.bundle.sections&&Array.isArray(t.bundle.sections)?t.bundle.sections:Array.isArray(t)?t:t.sections&&Array.isArray(t.sections)?t.sections:(console.warn("No valid sections found in data:",t),[])}isCartPage(){return salla.url.is_page("cart")}renderCartPage(){return i("salla-multiple-bundle-product-cart",{sections:this.parsedSections})}renderDetailsPage(){return i("salla-multiple-bundle-product-details",{sections:this.parsedSections})}componentWillLoad(){this.parseProducts(this.bundleSections)}render(){return i(e,{key:"e9b525af3c011566cd15247b5f1eaf274036cd98",class:"s-multiple-bundle-product-wrapper"},this.isCartPage()?this.renderCartPage():this.renderDetailsPage())}static get watchers(){return{bundleSections:["parseProducts"]}}};bt.style=":host{display:block}";const wt=class{constructor(i){t(this,i),this.sections=[],this.itemNumber=""}deleteItem(t,i){const e=this.host.closest("form");if(e){const s=e.getAttribute("id");if(s&&"string"==typeof s){const e=s.match(/item-(\d+)/)?.[1];this.itemNumber=e||"";const a=this.host.querySelector(`#accordion-${i.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${i.id}&section_id=${t}`).then((()=>a?.remove()))}}}renderRemoveButton(t,e,s=!1){return i("salla-button",{type:"button",shape:s?"btn":"icon",fill:s?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,e)},s?salla.lang.get("common.elements.delete"):i("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,e){const s=e?.options&&e?.options?.length>0;return i("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},i("div",{class:"s-multiple-bundle-product-cart-header "+(s?"":"s-multiple-bundle-product-cart-header-no-options")},i("div",{class:"s-multiple-bundle-product-cart-header-content"},i("a",{href:e?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},i("img",{src:e?.image?.url,alt:e?.image?.alt||e?.name,class:"s-multiple-bundle-product-cart-header-image"})),i("div",{class:"s-multiple-bundle-product-cart-header-content-details"},i("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},i("a",{href:e?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},e?.name)),i("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},i("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},i("span",{innerHTML:e?.price?salla.money(e?.price):""})),e?.sale_price>0&&i("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},i("span",{innerHTML:salla.money(e?.sale_price)}))),e?.quantity_in_group>0&&0!==e?.quantity&&i("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},i("span",null,salla.lang.get("pages.products.number_of_pieces")),i("span",null,e?.quantity_in_group)))),!s&&i("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,e,!1))))}render(){return i(e,{key:"38c6c9885f273f77ddffa9141f2274941f8a2e50",class:"s-multiple-bundle-product-wrapper"},i("div",{key:"8e26eb6d1c58d2d86ba7671b0cd0b7fbeccfa90f",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,e)=>t.products.map((s=>{const a={sectionId:t.id,sectionIndex:e,productId:s.id};return i("salla-accordion",{key:s.id,collapsed:!1,bordered:!0,collapsible:!!(s.options&&s.options.length>0),size:"sm",id:`accordion-${s.id}`},i("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),s)),s.options&&s.options.length>0&&i("salla-accordion-body",null,i("salla-product-options",{options:JSON.stringify(s.options),key:`${s.id}-persistent`,"product-id":s.id,"bundle-context":JSON.stringify(a)}),i("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),s,!0))))}))))))}get host(){return s(this)}};wt.style="";const yt=class{constructor(i){t(this,i),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,i)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const e=i.id,s=this.selectedProducts[t].has(e);s?(this.selectedProducts[t].delete(e),this.clearProductFormData(e,t),this.clearProductModalOptions(e,t)):this.selectedProducts[t].add(e),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:i.id,name:i.name,options:i.options,wasSelected:s,isSelected:!s})},this.ensureProductSelected=(t,i)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const e=i.id;this.selectedProducts[t].has(e)||(this.selectedProducts[t].add(e),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:i.id,name:i.name,options:i.options}))},this.onSelectProductOptions=(t,i)=>{const e=this.sections.findIndex((t=>t.id==i)),s=this.sections.find((t=>t.id==i)),a=s?.products?.findIndex((i=>i.id==t.id))??0;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:i,sectionIndex:e,productIndex:a})},this.handleBundleSliderProductSelected=t=>{const{product:i,sectionId:e}=t.detail;this.onSelectProduct(e,i)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:i,sectionId:e}=t.detail;this.onSelectProductOptions(i,e)}}clearProductFormData(t,i){const e=this.host.closest("form");if(i){const s=`bundle[${i}][`;Array.from(e.querySelectorAll("input")).filter((i=>i.getAttribute("data-product-id")===String(t)&&i.name&&i.name.startsWith(s))).forEach((t=>t.remove()))}else e.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,i){let e=null,s=null;if(null!=i&&(e=this.sections.findIndex((t=>t.id==i)),e>-1)){const i=this.sections[e];if(i){const e=i.products?.findIndex((i=>i.id==t));s="number"==typeof e&&e>-1?e:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:i,sectionIndex:e,productIndex:s})}renderAccordionHeader(t,e){return i(o,null,i("h2",{slot:"title"},t?.name),t?.obligatory_products?i("span",{slot:"note"},salla.lang.get("pages.products.obligatory_products",{count:t?.obligatory_products||0})):"",i("span",{slot:"progress"},e,"/",t?.products?.length||0))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:i,sectionId:e,product:s,fromModal:a}=t.detail;a?this.ensureProductSelected(e,s||{id:i}):this.onSelectProduct(e,s||{id:i})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return i(e,{key:"faef370736cdde4ad6b8d1bfce7a5ae80a807f3c",class:"s-multiple-bundle-product-wrapper"},i("div",{key:"66bfb5f5f5736cd7ea37b9e620079c0ec3399685",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,e)=>i("salla-accordion",{key:t.id,collapsed:0!==e},i("salla-accordion-head",null,this.renderAccordionHeader(t,this.selectedProducts[t.id]?.size||0)),i("salla-accordion-body",null,i("salla-multiple-bundle-product-slider",{section:t,sectionIndex:e,selectedProducts:this.selectedProducts,onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),i("salla-multiple-bundle-product-options-modal",{key:"ea258265b6cf53de022afcaeddf5f7c407706156"}))}get host(){return s(this)}};yt.style="";const _t=class{constructor(i){t(this,i),this.optionsSaved=a(this,"optionsSaved"),this.productSelected=a(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[]}generateCacheKey(t,i,e){return`${t||"unknown"}-${i||0}-${e||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const i=t.detail||t,{option:e,detail:s}=i,a=e||i.option_id&&this.product?.options?.find((t=>t.id===i.option_id||String(t.id)===String(i.option_id))),l=s||(i.id?i:null);this.product?.id&&a&&this.handleOptionChange(Number(this.product.id),a,l)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const i=t.target;if(i&&"checkbox"===i.type&&i.name&&i.name.includes("bundle[")&&i.name.includes("][id]")){const t=i.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!i.checked){const[,e,s]=t,a=i.value,l=this.host.closest("form");this.cleanupProductDeselection({sectionId:e,productIndex:parseInt(s,10),productId:a,form:l,uncheckedInput:i})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:i,productIndex:e,productId:s,form:a,uncheckedInput:l}=t;if(this.clearProductOptions(s,i,e),a){const t=`bundle[${i}][${e}]`;Array.from(a.querySelectorAll(`input[name^="${t}"]`)).forEach((i=>{if(i===l)return;const e="hidden"===i.type,a=i.getAttribute("data-product-id")===String(s)&&i.name?.startsWith(t);(e||a)&&i.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});a.dispatchEvent(t)}))}}generateFormInputName(t,i,e){return`bundle[${t}][${i}][options][${e}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,t),e=document.querySelector(`salla-product-options[product-id="${t}"]`);if(e)try{const t=await e.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[i]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,i,e){const s={...this.selectedOptions};if(null==i||null==e||Number.isNaN(e)){const i=`-${String(t)}`,e=[];Object.keys(s).forEach((t=>{t.endsWith(i)&&(delete s[t],e.push(t))})),e.forEach((t=>this.bumpOptionsResetToken(t)))}else{const a=this.generateCacheKey(i,e,t);delete s[a],this.bumpOptionsResetToken(a)}this.selectedOptions=s,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,i,e){const s=this.generateCacheKey(this.sectionId,this.productIndex,t),a=document.querySelector(`salla-product-options[product-id="${t}"]`);let l=[];if(a)try{l=await a.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(l.length>0)this.selectedOptions={...this.selectedOptions,[s]:l};else if(this.selectedOptions[s]&&this.selectedOptions[s].length>0){const t=[...this.selectedOptions[s]||[]],a=t.findIndex((t=>t.option_id===i.id));a>-1?e&&null!=e.id?t[a]={...e,option_id:i.id}:t.splice(a,1):e&&null!=e.id&&t.push({...e,option_id:i.id}),this.selectedOptions={...this.selectedOptions,[s]:t}}else e&&null!=e.id&&(this.selectedOptions={...this.selectedOptions,[s]:[{...e,option_id:i.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],i=this.product.id,e=this.generateCacheKey(this.sectionId,this.productIndex,i),s=document.querySelector(`salla-product-options[product-id="${i}"]`);let a=[];if(s)try{a=await s.getSelectedOptions()||[];const t=this.selectedOptions[e]||[];(t.length>a.length||0===a.length&&t.length>0)&&(a=t)}catch(t){a=this.selectedOptions[e]||[]}else a=this.selectedOptions[e]||[];return 0===a.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((i=>{i.required&&(a.some((t=>t.option_id==i.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:i.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const i=this.product?.id;if(!i)return;const e=this.generateCacheKey(this.sectionId,this.productIndex,i);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${i}"]`);let s=await(t?.getSelectedOptions());if((!s||0===s.length)&&this.selectedOptions[e]?.length>0&&(s=this.selectedOptions[e]),!s||0===s.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[e]:s};const a=this.host.closest("form");if(!a)return void(this.isLoading=!1);const l=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(a.querySelectorAll(`input[name^="${l}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(a.querySelectorAll(`[data-product-id="${i}"][name^="${l}"]`)).forEach((t=>t.remove()));const o=`bundle[${this.sectionId}][${this.productIndex}][id]`,n=document.getElementById(o);if(n)n.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(i),t.dataset.productId=String(i),a.appendChild(t)}s.forEach((t=>{const e=t.option_id,s=document.createElement("input");s.type="hidden",s.name=this.generateFormInputName(this.sectionId,this.productIndex??0,e),s.value=String(t.id),s.dataset.productId=String(i),a.appendChild(s)}));const r=new window.Event("change",{bubbles:!0});a.dispatchEvent(r),this.optionsSaved.emit({productId:Number(i),selectedOptions:s,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(i),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),i=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const e=i.some((i=>i.id===t.id));return{...t,is_selected:e}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),a=this.generateCacheKey(this.sectionId,this.productIndex,t),l=this.optionsResetTokens[a]||0,o=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return i(e,{key:"27c9b7b2698aede358cb8d1a01d774c625b7ead4"},i("salla-modal",{key:"c9ae157c9ee8f3b13a19cbfc601b4c8f717d8024",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"a2bf7d4eed854e89d314454294c84eaf43fef844",slot:"loading"},i("salla-skeleton",{key:"06bf42347a2c9f6ff5472a856ead808609bd6792",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"2c70545009d063b72b7ac0a20cdc7cc94ab4c43b",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesVisibility:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"8747d7510657f714da731f49e8b1e174be95bc66",slot:"items"},this.product?.images&&this.product?.images.map(((t,e)=>i("div",{key:e,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${e+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"61ca305d33f2b0f40e17c6ce3dc4fd571db7308c",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,e)=>i("div",{key:e,"data-caption":`${this.product?.name} - Image ${e+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${e+1}`,alt:t.alt||`${this.product?.name} - ${e+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${a}-reset-${l}`,"product-id":t,"unique-key":`${a}-reset-${l}`}),i("div",{key:"d79f6e9a2f753de6c9097bb3a8f095ed9bdde081",slot:"footer"},i("div",{key:"22f78a4c9b8ad8891cbcd9b5318c5a406258cea1",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"f17424c72c6e9d1b9cd0ef2602ac8b52002bc39a",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:o},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return s(this)}static get watchers(){return{product:["handleProductChange"]}}};_t.style=":host{display:block}";const vt=class{constructor(i){t(this,i),this.productSelected=a(this,"productSelected"),this.productOptionsSelected=a(this,"productOptionsSelected"),this.selectedProducts={},this.savedOptionsByInstance={},this.handleProductClick=(t,i)=>{const e=this.generateEventName(this.section.id,i),s=document.getElementById(e);if(s){if(s){const e=!s.checked;e||(this.dispatchClearOptionsEvent(t,i),this.clearSavedOptionsState(this.section.id,i)),s.checked=e,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});s.dispatchEvent(t)}))}this.productSelected.emit({product:t,sectionId:this.section.id})}},this.handleOptionsClick=t=>{this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getProductInstanceKey(t,i){return`${t}::${i}`}dispatchClearOptionsEvent(t,i){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:i})}handleOptionsSaved(t){const i=t.detail;if(!i)return;const{sectionId:e,productIndex:s,selectedOptions:a}=i;if(null==e||e!==this.section?.id)return;if(null==s||Number.isNaN(s))return;const l=this.getProductInstanceKey(e,s);if(a?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[l]:!0};else if(this.savedOptionsByInstance[l]){const t={...this.savedOptionsByInstance};delete t[l],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,i){const e=this.getProductInstanceKey(t,i);if(!this.savedOptionsByInstance[e])return;const s={...this.savedOptionsByInstance};delete s[e],this.savedOptionsByInstance=s}generateEventName(t,i){return`bundle[${t}][${i}][id]`}render(){return i(e,{key:"0aeceebde05ad98ab11016dda3bd65f118b656dc"},i("salla-slider",{key:"0834a28aa149f5ab1c62c173477e0db8936ee32f",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"635d79f8bfb386c60e93536197ad68e937842831",slot:"items"},this?.section?.products?.map(((t,e)=>{const s=this.selectedProducts[this.section.id]?.has(t.id)||!1,a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,e)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let l=salla.config.get("theme.is_rtl",!0)?D:B;return i("div",{class:"s-multiple-bundle-product-slide-one-third "+(0==t.quantity?"s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,e)},i("input",{id:this.generateEventName(this.section.id,e),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:s,name:this.generateEventName(this.section.id,e),value:t.id}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},t.name)),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.sale_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:l})))))})))))}get host(){return s(this)}};vt.style="";const kt=class{constructor(i){t(this,i),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(t=>this.open(t))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(t=>this.open(t))),salla.product.event.onOfferExisted((t=>{salla.storage.get("remember-offer-"+t.id)?salla.log("User selected to don't show this offer again."):this.open(t.product_id)}))}emitPromotionViewed(t){t&&salla.event.emit("promotion::viewed",[{id:t.id?.toString(),creative:t.message,name:t.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(t){t&&salla.event.emit("promotion::clicked",[{id:t.id?.toString(),creative:t.message,name:t.name,position:`${this.offer_type}_offer_modal`}])}async open(t){return this.productID=t,this.hasError=!1,this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.offers(t))).then((t=>this.showOffer(t.data[0]))).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>setTimeout((()=>this.modal.stopLoading()),1e3)))}async showOffer(t){this.offer=t,this.offer_name=t.name,this.offer_message=t.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length&&(this.offer_type="categories"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(t){salla.storage.set("remember-offer-"+this.offer.id,t.target.checked)}addToCart(t){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,t,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return i("div",{class:"s-offer-modal-discount-table"},i("table",null,i("tbody",null,this.offer.get.discounts_table?.map((t=>i("tr",null,i("td",null,t.text),i("td",{class:"s-offer-modal-discount-table-cell"},i("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(t.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const t=this.offer.get.products?.length||0,e={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,t),spaceBetween:16},1024:{slidesPerView:Math.min(3,t),spaceBetween:16}}};return i("salla-products-slider",{key:(this.offer.get.products?.map((t=>t.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((t=>t.id))||[]).join(",")}]`,"slider-config":JSON.stringify(e)})}return this.offer.get.categories?.length?i("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},i("div",{slot:"items"},this.offer.get.categories.map((t=>i("a",{href:t.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag</title>\n<path d="M28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n').replace(/\{name\}/g,t.name).replace(/\{url\}/g,t.urls.customer)}))))):void 0}render(){return i("salla-modal",{key:"b02cd6b8c4a1c04751c2de3a306141e3968763a0","has-skeleton":!0,"sub-title":this.offer_message,ref:t=>this.modal=t,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},i("div",{key:"c9b9e414107e0c07f67df5b58ffb805d27b97f47",slot:"loading"},i("div",{key:"f13f2d328f4e3e640c6f0e25bcd243b63674dede",class:"s-offer-modal-skeleton"},i("div",{key:"161a274876c65985d9fa60cee6d034c8b40e5bc6",class:"s-offer-modal-skeleton-header"},i("salla-skeleton",{key:"2f856e9c905b2cf79e91b48929598e9ac2a87447",type:"circle",height:"80px",width:"80px"}),i("salla-skeleton",{key:"a736af3fddd6dd8b747e7cc2d644d9b60821fcc1",height:"15px",width:"50%"}),i("salla-skeleton",{key:"f86ed33bdc4dd86dd2ecdef7eff2a9a9153ee84b",height:"10px",width:"30%"})),i("div",{key:"3a901c4c34503323d3401a63fb2ea321eb272240",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>i("div",{class:"s-offer-modal-skeleton-item"},i("salla-skeleton",{height:"9rem"}),i("div",{class:"s-offer-modal-skeleton-item-title"},i("salla-skeleton",{height:"15px",width:"100%"})),i("div",{class:"s-offer-modal-skeleton-item-subtitle"},i("salla-skeleton",{height:"9px",width:"50%"}),i("div",{innerHTML:'\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>cart2</title>\n<path d="M6.845 5.333l-1.905-5.333h-3.607c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333v0h1.727l5.72 16.012c0.569 1.56 2.039 2.654 3.765 2.655h12.133c0.001 0 0.002 0 0.003 0 1.825 0 3.364-1.222 3.845-2.892l0.007-0.028 3.161-13.080zM25.96 17.716c-0.167 0.554-0.672 0.951-1.27 0.951-0.002 0-0.005 0-0.007-0h-12.133c-0.575-0-1.065-0.364-1.252-0.875l-0.003-0.009-3.497-9.783h20.508zM13.333 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM13.333 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0zM24 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM24 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0z"></path>\n</svg>\n'})))))),i("div",{key:"db979f351fbddf7508064633f90b44e6df84b86c",class:"s-offer-modal-skeleton-footer"},i("salla-skeleton",{key:"c88fa86157d68be127fe67546bdb498cdf07fe6c",height:"15px",width:"50%"}),i("salla-skeleton",{key:"c30f40898e2c28e7de57fbb205be287740fe1aa2",height:"15px",width:"30%"})))),this.hasError||null===this.offer?i("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?i("span",{slot:"description"},this.errorMessage):""):[i("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:h}),this.getOfferContent(),i("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?i("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",i("label",{class:"s-offer-modal-remember-label"},i("input",{type:"checkbox",onChange:t=>this.rememberMe(t),class:"s-offer-modal-remember-input"}),"  ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return s(this)}};kt.style=".s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}";const xt=class{constructor(i){t(this,i),this.translationLoaded=!1,this.icon='\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>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return i(e,{key:"547b7d65011d9c7bd6e6869f5696a25f43ecf097",class:this.alignmentClass()},i("div",{key:"1de300f1452db30b4f01d9faaff0e65082405816",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),i("div",{key:"051acd85460d00197e8a262fb5ce1392568fed44",class:"s-placeholder-title"},i("slot",{key:"6ce6ce968005423d9da909a10a394baf2f216d5d",name:"title"},i("span",{key:"f5a25392b23919df87830a30cbee430a3c9bf4c8"},salla.lang.get("common.elements.no_options")))),i("div",{key:"29cb81f664c1d55d8d5e6d625b0252113ca438b8",class:"s-placeholder-description"},i("slot",{key:"bf16d9d8ddfc1c3674ce8068f1bb8016b819d0ba",name:"description"},i("span",{key:"07ec33e7aaf36b729adbc9f3f401e287fe18035c"},salla.lang.get("common.errors.empty_results")))))}};xt.style="";var At='\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>bell-ring</title>\n<path d="M2.667 13.333v-4c0-2.592 0.748-5.107 2.161-7.271 0.404-0.616 0.231-1.443-0.387-1.845-0.616-0.401-1.443-0.228-1.845 0.388-1.699 2.599-2.596 5.617-2.596 8.728v4c0 0.736 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333zM25.333 15.647v-6.313c0-5.147-4.188-9.333-9.333-9.333s-9.333 4.187-9.333 9.333v6.312l-5.157 9.027c-0.236 0.413-0.235 0.92 0.004 1.331 0.239 0.412 0.679 0.664 1.153 0.664h8c0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333h8c0.475 0 0.915-0.252 1.153-0.664 0.239-0.411 0.24-0.917 0.004-1.331zM16 29.333c-1.471 0-2.667-1.196-2.667-2.667h5.333c0 1.472-1.196 2.667-2.667 2.667zM4.965 24l4.193-7.339c0.113-0.2 0.175-0.429 0.175-0.661v-6.667c0-3.676 2.991-6.667 6.667-6.667s6.667 2.991 6.667 6.667v6.667c0 0.232 0.061 0.46 0.176 0.661l4.192 7.339zM29.403 0.603c-0.403-0.616-1.232-0.789-1.845-0.387-0.617 0.403-0.791 1.229-0.387 1.845 1.415 2.165 2.163 4.68 2.163 7.272v4c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-3.112-0.899-6.132-2.597-8.731z"></path>\n</svg>\n';const Mt=class{constructor(i){t(this,i),this.isUser=salla.config.isUser(),this.translationLoaded=!1,this.notifyOptionsAvailability=!1,this.isSubscribed=!1,this.handleSubmitOptions=async()=>{let t={id:this.productId};if(!this.notifyOptionsAvailability)return t;let i=document.querySelector(`salla-product-options[product-id="${this.productId}"]`),e=Object.values(await(i?.getSelectedOptionsData())||{});if(e.length&&!await(i?.reportValidity())){let t=salla.lang.get("common.messages.required_fields");throw salla.error(t),t}return t.options=[],e.forEach((i=>{i&&!isNaN(i)&&t.options.push(Number(i))})),t},this.typing=t=>{const i=t.target.nextElementSibling;t.target.classList.remove("s-has-error"),i?.classList.contains("s-product-availability-error-msg")&&(i.innerText=""),13===t.keyCode&&this.submit()},salla.lang.onLoaded((()=>{this.translationLoaded=!0,this.title_=this.host.title||salla.lang.get("pages.products.notify_availability_title"),this.modal?.setTitle(this.title_)})),this.productId||(this.productId=salla.config.get("page.id")),this.isUser||(this.channelsWatcher(this.channels),this.title_=this.host.title||salla.lang.get("pages.products.notify_availability_title"),this.host.removeAttribute("title"),this.isVisitorSubscribed=this.notifyOptionsAvailability?"":salla.storage.get(`product-${this.productId}-subscribed`))}channelsWatcher(t){this.channels_=t?t.split(","):[]}openModel(){this.handleSubmitOptions().then((t=>t?this.modal.open():null))}async submit(){let t=await this.handleSubmitOptions();if(this.isUser)return salla.api.product.availabilitySubscribe(t).then((()=>this.isSubscribed=!0));if(this.channels_.includes("sms")){let{phone:i,countryCode:e}=await this.mobileInput.getValues();t.country_code=e,t.phone=i}return this.channels_.includes("email")&&""!==this.email.value&&(t.email=this.email.value),await this.validateform(),this.btn.load().then((()=>this.btn.disable())).then((()=>salla.api.product.availabilitySubscribe(t))).then((()=>{if(!this.notifyOptionsAvailability)return salla.storage.set(`product-${this.productId}-subscribed`,!0),void(this.isSubscribed=!0);if(t.options.length){let i=salla.storage.get(`product-${this.productId}-subscribed-options`)||[],e=t.options.join(",");i.includes(e)?salla.log("already subscribed to this options"):(i.push(e),salla.storage.set(`product-${this.productId}-subscribed-options`,i),this.isSubscribed=!0)}})).then((()=>this.btn.stop())).then((()=>this.modal.close())).catch((()=>this.btn.stop()&&this.btn.enable()))}async validateform(){try{if(this.channels_.includes("email")){const t=p.isValidEmail(this.email.value);if(t)return;!t&&this.validateField(this.email,salla.lang.get("common.elements.email_is_valid"))}if(this.channels_.includes("sms")&&await this.mobileInput.isValid())return}catch(t){throw"Please insert required fields"}}validateField(t,i){t.classList.add("s-has-error"),t.nextElementSibling.innerText="* "+i}render(){return i(e,{key:"94979dc80347804a72904cb54f917070e0476489",class:"s-product-availability-wrap"},this.isSubscribed||this.isVisitorSubscribed?i("div",{class:"s-product-availability-subscribed"},i("span",{innerHTML:At,class:"s-product-availability-subs-icon"}),salla.lang.get("pages.products.notify_availability_success")):i("salla-button",{width:"wide",onClick:()=>this.isUser?this.submit():this.openModel()},salla.lang.get("pages.products.notify_availability")),this.isUser||this.isSubscribed||this.isVisitorSubscribed?"":this.renderModal())}renderModal(){return i("salla-modal",{ref:t=>this.modal=t,"modal-title":this.title_,subTitle:salla.lang.get("pages.products.notify_availability_subtitle"),width:"sm"},i("span",{slot:"icon",class:"s-product-availability-header-icon",innerHTML:At}),i("div",{class:"s-product-availability-body"},this.channels_.includes("email")?[i("label",{class:"s-product-availability-label"},salla.lang.get("common.elements.email")),i("input",{class:"s-product-availability-input",onKeyDown:t=>this.typing(t),placeholder:salla.lang.get("common.elements.email_placeholder")||"your@email.com",ref:t=>this.email=t,type:"email"}),i("span",{class:"s-product-availability-error-msg"})]:"",this.channels_.includes("sms")?[i("label",{class:"s-product-availability-label"},salla.lang.get("common.elements.mobile")),i("salla-tel-input",{ref:t=>this.mobileInput=t,onKeyDown:t=>this.typing(t)})]:""),i("div",{slot:"footer",class:"s-product-availability-footer"},i("salla-button",{class:"modal-cancel-btn",width:"wide",color:"light",fill:"outline",onClick:()=>this.modal.close()},salla.lang.get("common.elements.cancel")),i("salla-button",{class:"submit-btn","loader-position":"center",width:"wide",ref:t=>this.btn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.submit"))))}get host(){return s(this)}static get watchers(){return{channels:["channelsWatcher"]}}};Mt.style="";var zt='\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>heart</title>\n<path d="M23.333 2.267c-3.547 0-5.779 1.605-7.333 3.061-1.555-1.456-3.787-3.061-7.333-3.061-5.955 0-8.667 5.045-8.667 9.733 0 8.503 10.147 14.735 15.513 16.841 0.156 0.061 0.321 0.092 0.487 0.092s0.331-0.031 0.487-0.092c5.367-2.107 15.513-8.339 15.513-16.841 0-4.688-2.712-9.733-8.667-9.733zM16 26.161c-5.537-2.309-13.333-7.799-13.333-14.161 0-3.517 1.856-7.067 6-7.067 2.983 0 4.656 1.451 6.384 3.203 0.5 0.508 1.399 0.508 1.899 0 1.728-1.752 3.401-3.203 6.384-3.203 4.144 0 6 3.549 6 7.067 0 6.363-7.796 11.852-13.333 14.161z"></path>\n</svg>\n';const St=class{constructor(i){if(t(this,i),salla.onReady((()=>{this.fitImageHeight=salla.config.get("store.settings.product.fit_type"),salla.wishlist.event.onAdded(((t,i)=>this.toggleFavoriteIcon(!0,i))),salla.wishlist.event.onRemoved(((t,i)=>this.toggleFavoriteIcon(!1,i))),this.placeholder=salla.url.asset(salla.config.get("theme.settings.placeholder"))})),salla.lang.onLoaded((()=>{this.remained=salla.lang.get("pages.products.remained"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.startingPrice=salla.lang.get("pages.products.starting_price"),this.addToCart=salla.lang.get("pages.cart.add_to_cart"),this.outOfStock=salla.lang.get("pages.products.out_of_stock")})),this.product)try{this.productData="object"==typeof this.product?this.product:JSON.parse(this.product)}catch(t){salla.log("Bad json passed via product prop")}}initCircleBar(){let t=this.productData.quantity/(this.productData.quantity>100?2*this.productData.quantity:100)*100;this.pie.querySelector(".s-product-card-content-pie-svg-bar").style.strokeDashoffset=100-t}toggleFavoriteIcon(t=!0,i=null){i&&i!==this.productData.id||this.wishlistBtn?.classList.toggle("s-product-card-wishlist-added",t)}formatDate(t){let i=new Date(t);return`${i.getFullYear()}-${i.getMonth()+1}-${i.getDate()}`}getProductBadge(){return this.productData.promotion_title?i("div",{class:"s-product-card-promotion-title"},this.productData.promotion_title):this.showQuantity&&this.productData?.quantity?i("div",{class:"s-product-card-quantity"},this.remained," ",salla.helpers.number(this.productData?.quantity)):this.showQuantity&&this.productData?.is_out_of_stock?i("div",{class:"s-product-card-out-badge"},this.outOfStock):""}getPriceFormat(t){return t&&0!=t?salla.money(t):salla.config.get("store.settings.product.show_price_as_dash")?"-":""}getProductPrice(){return this.productData.is_on_sale?i("div",{class:"s-product-card-sale-price"},i("h4",{innerHTML:this.getPriceFormat(this.productData.sale_price)}),i("span",{innerHTML:this.getPriceFormat(this.productData?.regular_price)})):this.productData.starting_price?i("div",{class:"s-product-card-starting-price"},i("p",null,this.startingPrice),i("h4",{innerHTML:this.getPriceFormat(this.productData?.starting_price)})):i("h4",{class:"s-product-card-price",innerHTML:this.getPriceFormat(this.productData?.price)})}render(){const t={"s-product-card-entry":!0,"s-product-card-vertical":!this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-horizontal":this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-fit-height":this.fitImageHeight&&!this.isSpecial&&!this.fullImage&&!this.minimal,"s-product-card-special":this.isSpecial,"s-product-card-full-image":this.fullImage,"s-product-card-minimal":this.minimal,"s-product-card-donation":this.productData?.donation,"s-product-card-shadow":this.shadowOnHover,"s-product-card-out-of-stock":this.productData?.is_out_of_stock},s=this.productData?.url?{href:this.productData.url,title:`Learn more about ${this.productData?.name}`}:{};return i(e,{key:"55d26993163d8a0f02afb90bcd2e4775c0917377",id:`product-${this.productData?.id}`,class:t},i("div",{key:"e43d1bc58fa8108fd9472ca4887fab659a3eeccc",class:this.fullImage?"s-product-card-image-full":"s-product-card-image"},i("a",{key:"73d9499d8d61f834aa95278f061c9c891c1d590a",...s},i("img",{key:"be4520c090a16a81078615d6a62affd507da6dd0",class:`s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)?"contain":this.fitImageHeight?this.fitImageHeight:"cover"} lazy`,src:this.placeholder,alt:this.productData?.image?.alt||this.productData?.name,"data-src":this.productData?.image?.url||this.productData?.thumbnail}),this.fullImage||this.minimal?"":this.getProductBadge()),this.fullImage&&i("a",{key:"577b58ab0434c3b473ce2de3f28dc3e8b1c03f99",...s,class:"s-product-card-overlay"}),this.horizontal||this.fullImage?"":i("salla-button",{shape:"icon",fill:"none",color:"light","aria-label":"Add or remove to wishlist",ref:t=>this.wishlistBtn=t,class:"s-product-card-wishlist-btn animated",onClick:()=>salla.wishlist.toggle(this.productData.id)},i("span",{innerHTML:zt}))),i("div",{key:"1593d8c5336cc43e2aa1ba8d5ca7931b67fd9d46",class:"s-product-card-content"},this.isSpecial&&this.productData?.quantity?i("div",{class:"s-product-card-content-pie",ref:t=>this.pie=t},i("span",null,i("b",null,salla.helpers.number(this.productData?.quantity)),this.remained),i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -1 36 34",class:"s-product-card-content-pie-svg"},i("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-base"}),i("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-bar"}))):"",i("div",{key:"a0605f788b05342c259e3f2ad87c8cf48f6d88ee",class:{"s-product-card-content-main":!0,"s-product-card-content-extra-padding":this.isSpecial}},i("h3",{key:"fce73d249c7a0a82bd395d291716c5b96e6b4a5a",class:"s-product-card-content-title"},i("a",{key:"8610e37c9d8cb8cbb74578ae1fa9da3d59852d48",...s},this.productData?.name)),this.productData?.subtitle&&!this.minimal?i("p",{class:"s-product-card-content-subtitle"},this.productData?.subtitle):""),!this.productData?.donation||this.minimal||this.fullImage?"":[i("salla-progress-bar",{donation:this.productData?.donation}),i("div",{class:"s-product-card-donation-input"},this.productData?.donation?.can_donate?[i("label",{htmlFor:"donation-amount"},this.donationAmount," ",i("span",null,"*")),i("input",{type:"text",onInput:t=>{salla.helpers.inputDigitsOnly(t.target),this.addBtn.donatingAmount=t.target.value},id:"donation-amount",name:"donating_amount",class:"s-form-control",placeholder:this.donationAmount})]:"")],i("div",{key:"1d1f7f7eaa467b059f6776d1e6f15d981edd0106",class:{"s-product-card-content-sub":!0,"s-product-card-content-extra-padding":this.isSpecial}},this.getProductPrice(),this.productData?.rating?.stars&&!this.minimal?i("div",{class:"s-product-card-rating"},i("span",{innerHTML:ct}),i("span",null,this.productData.rating.stars)):""),this.isSpecial&&this.productData.discount_ends?i("salla-count-down",{date:this.formatDate(this.productData.discount_ends),"end-of-day":!0,boxed:!0,labeled:!0}):"",this.hideAddBtn?"":i("div",{class:"s-product-card-content-footer"},i("salla-add-product-button",{fill:"outline",width:"wide",ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type},i("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label)),this.horizontal||this.fullImage?i("salla-button",{shape:"icon",fill:"none",color:"light",ref:t=>this.wishlistBtn=t,"aria-label":"Add or remove to wishlist",class:"s-product-card-wishlist-btn animated",onClick:()=>salla.wishlist.toggle(this.productData.id),"data-id":"{{ product.id }}"},i("span",{class:"text-xl",innerHTML:zt})):"")))}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy")),this.productData?.quantity&&this.isSpecial&&this.initCircleBar(),!salla.config.isGuest()&&salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)&&this.toggleFavoriteIcon()}static get assetsDirs(){return["assets"]}get host(){return s(this)}};var Ct,Tt;St.style='.s-product-card-image::before{font-family:"sallaicons";content:"\\ec1f" !important}.s-product-card-content-pie-svg circle{transition:stroke-dashoffset 1s linear;-webkit-transition:stroke-dashoffset 1s linear;-moz-transition:stroke-dashoffset 1s linear;-ms-transition:stroke-dashoffset 1s linear;-o-transition:stroke-dashoffset 1s linear;stroke:#E8EDF2;stroke-width:2px;stroke-linecap:round;fill:none}.s-product-card-content-pie-svg-bar{stroke:var(--color-primary) !important;stroke-dasharray:100 100;stroke-dashoffset:100}',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"}(Ct||(Ct={})),function(t){t.Sar="SAR"}(Tt||(Tt={}));const Pt=class{constructor(e){if(t(this,e),this.changed=a(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=!1,this.selectedOptions=[],this.disableCardValue=!0,this.availableDigitalCardValues=[],this.userInitiatedValidation=!1,this.outSkus=[],this.ignoreDefaultCardValue=!1,this.productId=salla.config.get("page.id"),this.handleDonationOptions=(t,i,e)=>{if("custom"===i&&"input"===e)return salla.helpers.inputDigitsOnly(t.target),void salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});if(t.preventDefault(),t.stopPropagation(),this.isCustomDonation="custom"===t.target.value,this.donationInput){if("custom"===t.target.value?(this.donationInput.value="",this.donationInput.focus()):this.donationInput.value=t.target.value,"custom"===i)return;salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}},this.hideLabel=t=>!(t.type!==Ct.DONATION||!t.donation||t.donation.can_donate),this.getExpireDonationMessage=t=>{if(!t.donation)return;const e=t.donation.target_amount<=t.donation.collected_amount;return i("div",{class:{"s-product-options-donation-message":!0,"s-product-options-donation-completed":e,"s-product-options-donation-expired":!e}},i("p",null,t.donation.target_message),i("span",{innerHTML:e?salla.money(t.donation.target_amount):""}))},this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart"),salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع"),this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")})),this.options)try{return void this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options))}catch(t){salla.log("Bad json passed via options prop")}Array.isArray(this.optionsData)||(salla.log("Options is not an array[] ---\x3e ",this.optionsData),this.setOptionsData([])),this.productId&&!salla.url.is_page("cart")&&salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}async setOptionsData(t){this.optionsData=t;const i=this;this.optionsData[0]?.details?.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>i.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={},i=this.host.getElementSallaData(),e=void 0!==this.bundleContext?this.bundleContext:null;return i.forEach(((i,s)=>{if(e){if(s.startsWith("bundle[")&&s.includes("[options][")){const e=s.split("[options][")[1].replace("]","");t[e]=i}}else s.startsWith("options[")&&(t[s.replace("options[","").replace("]","")]=i)})),t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=!0;for(let e=0;e<t.length;e++)"reportValidity"in t[e]&&!t[e].reportValidity()&&(i=!1);return i}async hasOutOfStockOption(){return this.selectedOptions.some((t=>t.is_out))||this.selectedSkus?.length&&this.selectedSkus?.every((t=>this.outSkus.includes(t)))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const e=t.target.closest(".s-product-options-option");e.classList.contains("s-product-options-option-error")||e.classList.add("s-product-options-option-error"),this.userInitiatedValidation&&!salla.url.is_page("cart")&&this.host.querySelector(".s-product-options-option-error")===e&&this.scrollToElement(e)}scrollToElement(t){t&&t.scrollIntoView({behavior:"smooth",block:"center"})}changedHandler(t,i,e=!0){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const e=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=e}"country"===i.type&&this.handleCountryOptionChange(t,s.detail);const a=t.target.closest(".s-product-options-option");(t.target.value||(i.type===Ct.FILE||i.type===Ct.IMAGE)&&"added"===t.type||i.type===Ct.MAP&&"selected"===t.type&&t.target.lat&&t.target.lng)&&setTimeout((()=>{a.classList.remove("s-product-options-option-error")}),200),i.type===Ct.DONATION&&salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value}),this.setSelectedSkus(),this.handleRequiredMultipleOptions(i);const l=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===Ct.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>t.option_id===s.option.id&&t?.id===s.detail?.id));t>-1?this.selectedOptions.splice(t,1):this.selectedOptions.push({...s.detail,option_id:s.option.id})}else s.detail&&0!==Object.keys(s.detail).length?l>-1?this.selectedOptions[l]={...s.detail,option_id:s.option.id}:this.selectedOptions.push({...s.detail,option_id:s.option.id}):l>-1&&this.selectedOptions.splice(l,1);this.optionsData=this.optionsData.map((t=>t.id===s.option.id?{...t,details:t.details.map((t=>({...t,is_selected:s.option.type===Ct.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number(s.detail?.id),value:s.detail?.value})))}:t)),e&&(this.changed.emit(s),salla.event.emit("product-options::change",s))}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==Ct.MULTIPLE_OPTIONS||!t.required)return;const i=this.host.querySelector(`[data-option-id="${t.id}"]`),e=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!e)))}getLatLng(t,i){return t?t.split(",")["lat"===i?0:1]:""}getDisplayForType(t){return this[`${t.type}Option`]?this[`${t.type}Option`](t):t.type===Ct.COLOR_PICKER?this.colorPickerOption(t):t.type===Ct.MULTIPLE_OPTIONS?this.multipleOptions(t):t.type===Ct.SINGLE_OPTION?this.singleOption(t):t.type===Ct.RADIO?this.radioOption(t):t.type===Ct.DIGITAL_CARD_VALUE?this.digitalCardValuesOption(t):t.type===Ct.COUNTRY?this.countryOption(t):t.type===Ct.BOOKING&&salla.url.is_page("cart")?i("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value}):(salla.log(`Couldn't find options type(${t.type})😢`),"")}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>"digital-code-value"===t));if(!i)throw new Error("product-options:: No digital card options found");const e=Object.keys(t.skus_availability).filter((i=>!1===t.skus_availability[i]));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>e.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation(),this.ignoreDefaultCardValue=!0;const e=this.host.querySelector("input[data-code-value]:checked");if(e&&(e.checked=!1),!this.optionsData.find((({type:t})=>"digital-code-value"===t)))throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected)),e=t.details.find((t=>!!t.is_default))||t.details[0];if(["digital-code-value","country"].includes(t.type))return i||e}async componentWillLoad(){if(salla.url.is_page("cart")&&(this.disableCardValue=!1,this.fillSelectedOptions()),this.config)try{this.optionConfig="string"==typeof this.config?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}if(this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart")){const t=this.optionsData.find((t=>"country"===t.type)),i=t&&this.getSelectedDigitalCardOptions(t);i&&this.getAvailableDigitalCardSKUs(i)}return this.outOfStockText=salla.lang.get("pages.products.out_of_stock"),await salla.onReady(),document.addEventListener("paste",this.handlePaste.bind(this)),!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)))?salla.api.cart.getCurrentCartId(!1,"salla-product-options"):null}handlePaste(t){const i=t.target;if(!Salla.helpers.isAppleDevice()||!(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)||!i.classList.contains("s-form-control"))return;t.preventDefault();const e=t.clipboardData?.getData("text")||"",s=i.selectionStart,a=i.selectionEnd,l=i.value.slice(0,s)+e+i.value.slice(a);i.value=l,i.setSelectionRange(s+e.length,s+e.length);try{i.dispatchEvent(new window.Event("change",{bubbles:!0}))}catch(t){Salla.log("Error on change")}}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===Ct.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){if(0!==this.optionsData?.length)return i(e,{class:"s-product-options-wrapper"},i("salla-conditional-fields",null,this.optionsData.map((t=>i("div",{key:t.id,class:"s-product-options-option-container"+(t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""),"data-option-id":t.id,...this.getOptionShownWhen(t)},"splitter"===t.name?this.splitterOption():i("div",{class:{"s-product-options-option":!0,"s-product-options-option-booking":t.type===Ct.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},i("label",{htmlFor:this.generateInputName(t.id),class:"s-product-options-option-label "+(this.hideLabel(t)?"s-product-options-option-label-hidden":"")},i("b",null,t.name,t.required&&i("span",null," * ")," "),i("small",null,t.placeholder)),i("div",{class:"s-product-options-option-content "+(this.hideLabel(t)||t.type===Ct.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":"")},this.getDisplayForType(t))))))))}generateUniqueKey(t){const i=this.bundleContext;let e=this.uniqueKey?`${t}-${this.uniqueKey}`:t;if(i)try{const t="string"==typeof i?JSON.parse(i):i,{sectionId:s,productId:a}=t;e=`${e}-bundle-${s}-${a}`}catch(t){}return e}generateInputName(t){const i=this.bundleContext;if(i)try{const e="string"==typeof i?JSON.parse(i):i,{sectionId:s,productId:a}=e;return`bundle[${s}][${a}][options][${t}]`}catch(i){return`options[${t}]`}return`options[${t}]`}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const e=i.details.filter((t=>t.is_selected)).map((t=>({...t,option_id:i.id})));return t.concat(e)}),[])}componentDidLoad(){if(0===this.optionsData?.length&&!this.optionsData.some((t=>t.type===Ct.DONATION)))return;const t=this.optionsData.find((t=>t.type===Ct.DONATION))?.details.find((t=>t.is_selected));t&&setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.additional_price})}),1e3)}async enableUserInitiatedValidation(){this.userInitiatedValidation=!0}async validateAndScroll(){return await this.enableUserInitiatedValidation(),this.reportValidity()}donationOption(t,e){return i("div",{class:"s-product-options-donation-wrapper"},t.donation?.can_donate?[t.donation?i("div",{key:t.id,class:"s-product-options-donation-progress"},i("salla-progress-bar",{donation:t.donation})):"",t.details.length?[i("h4",{key:t.id},this.selectAmount),i("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((e,s)=>i("div",{key:t.id,class:"s-product-options-donation-options-item"},i("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:e.is_selected,value:e.additional_price,onChange:t=>this.handleDonationOptions(t,e,"option")}),i("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},i("span",{innerHTML:salla.money(e.name)}))))),t.donation?.custom_amount_enabled?i("div",{class:"s-product-options-donation-options-item"},i("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),i("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},i("span",null," ",this.selectDonationAmount," "))):"")]:"",i("div",{key:t.id,class:{"s-product-options-donation-input-group":!0,shown:!t.details.length||t.details.length&&this.isCustomDonation}},i("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),i("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,e=null){return i("salla-file-upload",{...e||{},"payload-name":"file",value:t.value,"instant-upload":!0,name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":!0,required:t.required}},i("div",{class:"s-product-options-filepond-placeholder"},i("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:e.accept?.split(",").every((t=>t.includes("image")))?g:'\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'}),i("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),i("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return i?.length?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return i("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:this.generateInputName(t.id),placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return i("div",{class:"s-product-options-splitter"})}textOption(t){return i("div",{class:"s-product-options-text"},i("input",{type:"text",value:t.value,maxLength:t?.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:this.generateInputName(t.id),placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return i("div",{class:"s-product-options-textarea"},i("div",{class:"mt-1"},i("textarea",{rows:4,value:t.value,maxLength:t?.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:this.generateUniqueKey(t.id.toString()),name:this.generateInputName(t.id),placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return i("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:this.generateInputName(t.id),searchable:!0,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return i("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return i("salla-datetime-picker",{noCalendar:!0,enableTime:!0,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:this.generateInputName(t.id),class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return i("div",{class:"s-product-options-date-element"},i("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:this.generateInputName(t.id),onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return i("div",{class:"s-product-options-datetime-element"},i("salla-datetime-picker",{enableTime:!0,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:this.generateInputName(t.id),maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=!0,e){let s;return e&&e===Ct.COLOR&&(s=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,!1)}) </p>`:"")),s||(s=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,!1)})`:"")),s.replace("<i class=sicon-sar></i>",salla.config.currency()?.symbol||"ر.س")}isOptionDetailOut(t){if(t.is_out||!t.skus_availability||!this.selectedSkus?.length)return t.is_out;const i=this.selectedOptions.filter((i=>i.id===t.id)).length;if(i&&1===this.selectedOptions.length)return!1;if(i){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,e,s,a,l,o){const n=this.generateUniqueKey(`${t}-${s.id}-${e.id}`),r=this.isOptionDetailOut(e);return i("label",{class:{"s-product-options-disabled":r}},i("input",{id:n,type:t,name:l,value:e.id,disabled:r,required:a,checked:e.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),i("div",{class:{"s-product-options-grid-mode-span":o,"s-product-options-disabled":r}},this.getOptionDetailName(e)))}renderOptionDetails(t,i,e,s=!1){const a=this.generateInputName(i.id),l="radio"===t?a:`${a}[]`;return i?.details.map((a=>this.renderInput(t,a,i,e,l,s)))}renderSelect(t){return i("div",null,i("select",{name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},i("option",{value:""},t.placeholder),t?.details.map((t=>i("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,e,s){return i("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,e,s,!0))}singleOption(t){return"button"===this.optionConfig?.["single-option"]?.type?this.renderButtonStyle("radio",t,!t.visibility_condition&&t.required):this.renderSelect(t)}multipleOptions(t){const e="button"===this.optionConfig?.["multiple-option"]?.type,s=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return e?this.renderButtonStyle("checkbox",t,s):i("div",{class:{"s-product-options-multiple-options-wrapper":!0,required:t.required}},this.renderOptionDetails("checkbox",t,s))}radioOption(t){return this.singleOption(t)}colorOption(t){return i("fieldset",{class:"s-product-options-colors-wrapper"},t?.details.map((e=>i("div",{class:"s-product-options-colors-item",key:e.id},i("input",{type:"radio",value:e.id,required:!t.visibility_condition&&t.required,checked:e.is_selected,name:this.generateInputName(t.id),disabled:this.canDisabled&&this.isOptionDetailOut(e),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${e.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),i("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${e.id}`)},i("span",{style:{backgroundColor:e.color}}),i("div",{innerHTML:this.getOptionDetailName(e,!0,t.type)}))))))}thumbnailOption(t){return i("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((e=>i("div",{key:e.id},i("input",{type:"radio",value:e.id,"data-itemid":e.id,required:!t.visibility_condition&&t.required,checked:e.is_selected,name:this.generateInputName(t.id),"data-img-id":e.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(e),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${e.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),i("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${e.id}`),"data-img-id":e.option_value,class:"go-to-slide"},i("img",{"data-src":e.image,src:e.image,title:e.name,alt:e.name}),i("span",{innerHTML:d,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(e)?[i("small",{key:e.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?i("div",{key:e.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),i("p",null,this.getOptionDetailName(e,!1)," ")))))}digitalCardValuesOption(t){return i("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((e=>{const s=String(e.id);return i("label",{htmlFor:this.generateUniqueKey(s.toString()),key:s,class:"s-product-options-digital-card-option"},i("input",{type:"radio","data-code-value":!0,class:"s-form-control s-product-options-digital-card-input",value:e.id,name:this.generateInputName(t.id),id:this.generateUniqueKey(s.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),...this.ignoreDefaultCardValue?{}:{defaultChecked:this.getSelectedDigitalCardOptions(t)?.id===e.id}}),i("span",null,e.name," ",salla.config?.currency()?.symbol))})):i("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return i("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((e=>i("label",{htmlFor:this.generateUniqueKey(e.id.toString()),key:e.id,class:{"s-product-options-digital-card-option":!0,"s-product-options-digital-card-option-stock-out":e.is_out}},i("input",{id:this.generateUniqueKey(e.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:e.id,name:this.generateInputName(t.id),disabled:e.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=!1},...salla.url.is_page("cart")?{defaultChecked:this.getSelectedDigitalCardOptions(t)?.id===e.id}:{}}),i("img",{loading:"lazy",alt:e.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(e.code).toLocaleLowerCase()}.svg`}),i("span",null,e.name)))))}get host(){return s(this)}};Pt.style="";const It=class{constructor(i){t(this,i),this.hasError=!1,salla.event.on("size-guide::open",(t=>this.open(t))),salla.lang.onLoaded((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}async open(t){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(t))).then((t=>{this.guides=t.data})).catch((t=>{console.log(t),this.hasError=!0,this.placeholder_description=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return i("salla-placeholder",{alignment:"center",iconSize:"xl"},i("div",{slot:"title"},this.placeholder_title),i("div",{slot:"description"},this.placeholder_description))}render(){return i("salla-modal",{key:"e1a4f46c6b2a3b9d06b2cd439a29dae3d3df1e2b",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},i("span",{key:"921988dcf15f88a4382244a710117a30466e51ec",slot:"icon",class:"s-product-size-guide-header-icon",innerHTML:'\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>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),i("div",{key:"7a74a5995882d1d597e3e3ca6594248e03225be9",slot:"loading"},i("div",{key:"c08eaeb646f503f14b1a6bc9e0132970b09c154c",class:"s-product-size-guide-skeleton"},i("salla-skeleton",{key:"b0319b0ac90388145e1db879571680eea3742722",height:"15px",width:"25%"}),i("div",{key:"4cb3620675a3f6ef49a33e35113fbac468578034",class:"s-product-size-guide-skeleton-header"},i("salla-skeleton",{key:"7413b92d0b53d179876bf9938f546819d190b01f",height:"40px"}),i("salla-skeleton",{key:"d4f211c5548045bb4faea5e1e832c784cc85d2d0",height:"40px"}),i("salla-skeleton",{key:"23cb9409fb9f4863e233fdbe86a7ddd89761e7ed",height:"40px"}),i("salla-skeleton",{key:"93f027dbf97b43bcffae29ebfdf5c15c7fa012bf",height:"40px"})),i("div",{key:"494ca32976d92c800c5be8e44f26cb972f8cf1e0",class:"s-product-size-guide-skeleton-content"},i("salla-skeleton",{key:"9889791d8bba3e58c6315e5d76b6536ef14ac29d",height:"15px",width:"25%"}),i("salla-skeleton",{key:"e607037bbcab29681ffe47424b9566fcf32e7a58",height:"10px",width:"75%"}),i("salla-skeleton",{key:"9eedac50c162985e5c49b6e5b56c4ad86e86c5a6",height:"10px",width:"50%"}),i("salla-skeleton",{key:"9b189d240da2d519a4b0586bb827fd79d9021e3e",height:"10px",width:"75%"}),i("salla-skeleton",{key:"b9341d1249c837d8b8a71b1c9c8793521c49808d",height:"10px",width:"100%"}),i("salla-skeleton",{key:"c57270b467abbdae57a1a1389b4df6853b2de586",height:"10px",width:"25%"}),i("salla-skeleton",{key:"e0d9e3646ffbd28ccf5c93fa99bb294b93f597e7",height:"10px",width:"60%"}),i("salla-skeleton",{key:"20bed29a322cfe01caf9b2c1c49c0d6b2be7afc5",height:"10px",width:"45%"}),i("salla-skeleton",{key:"132d3aee12bad2b3b84b769742c758854498a5b1",height:"10px",width:"30%"})))),i("slot",{key:"008b024c1d8daea0b17f184eda43eaab3d72069a",name:"header"}),!this.hasError&&this.guides?[i("salla-tabs",null,this.guides.map((t=>i("salla-tab-header",{slot:"header",name:t.name},i("span",null,t.name)))),this.guides.map((t=>i("salla-tab-content",{slot:"content",name:t.name},i("div",{innerHTML:t.description})))))]:this.showPlaceholder(),i("slot",{key:"6aedc0d9ac633fe98c6475d2375d59ef761cc64e",name:"footer"}))}get host(){return s(this)}};It.style="";const Lt=class{constructor(i){t(this,i),this.productsFetched=a(this,"productsFetched"),this.autoload=!1,this.productCardComponent="custom-salla-product-card",this.page=1,this.placeholderText=salla.lang.get("pages.categories.no_products"),this.endOfText=salla.lang.get("common.elements.end_of_content"),this.failedLoadMore=salla.lang.get("common.elements.failed_to_load_more"),this.currentPage=salla.config.get("page"),this.filtersSnapshot=[],this.lastViewedProductKey="lastViewedProductId",this.filtersKey="filters",this.infiniteScrollStateKey="infiniteScrollState",this.prevCategoryIdKey="prevCategoryId",this.isProcessing=!1,this.scrollTimeout=null,this.specialPagesWithoutIds={"product.index.latest":"latest","product.index.offers":"offers","product.index.search":"search","product.index.sales":"sales"},this.includes=p.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),p.setIncludes(this.includes),salla.lang.onLoaded((()=>{this.placeholderText=salla.lang.get("pages.categories.no_products"),this.endOfText=salla.lang.get("common.elements.end_of_content"),this.failedLoadMore=salla.lang.get("common.elements.failed_to_load_more"),this.currentPage=salla.config.get("page")}))}connectedCallback(){"scrollRestoration"in history&&(history.scrollRestoration="manual"),window.addEventListener("DOMContentLoaded",this.scrollToLastViewedProduct.bind(this)),salla.event.on("salla-filters::changed",(t=>this.setFilters(t)))}disconnectedCallback(){window.removeEventListener("DOMContentLoaded",this.scrollToLastViewedProduct)}async setFilters(t){if(t&&JSON.stringify(t)!==JSON.stringify(this.parsedFilters))return window.scrollTo({top:0,behavior:"smooth"}),this.parsedFilters=JSON.parse(JSON.stringify(t)),this.filtersSnapshot=this.parsedFilters,"product.index"==this.currentPage?.slug&&this.parsedFilters&&this.parsedFilters.category_id&&(this.currentCategoryIdFilter=[this.parsedFilters.category_id]),this.reload()}async reload(){!this.autoload&&this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="none"),this.hasInfiniteScroll&&salla.infiniteScroll.destroy(this.infiniteScroll),this.buildNextPageUrl(),this.wrapper.innerHTML="",this.hasInfiniteScroll?this.init():this.getInitialData(),this.showPlaceholder&&(this.showPlaceholder=!1,this.placeholderLoader=document.createElement("div"),this.placeholderLoader.classList.add("s-products-list-loading-wrapper"),this.placeholderLoader.style.display="inherit",this.placeholderLoader.innerHTML='<span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"></span>',this.host.insertAdjacentElement("afterend",this.placeholderLoader))}isFilterable(){return salla.config.get("store.settings.product.filters")&&this.filtersResults}isSourceWithoutValue(){return["offers","latest","sales","wishlist","top-rated","reorder"].includes(this.getSource())}animateItems(){r({targets:"salla-products-list salla-product-card",opacity:[0,1],duration:1200,translateY:[20,0],delay:function(t,i){return 100*i}})}initBaseNextPageUrl(t){this.nextPage=salla.url.api(`products?source=${t}`),this.includes?.length&&(this.nextPage+=`&includes[]=${this.includes.join("&includes[]=")}`),this.limit&&(this.nextPage+=`&per_page=${this.limit>32?32:this.limit}`),this.sortBy&&(this.nextPage+=`&sort=${this.sortBy}`),"preview"===salla.config.get("theme.mode")&&(this.nextPage+="&use_username_url=1"),this.nextPage+="&filterable=1";for(const[t,i]of Object.entries(this.parsedFilters||{}))if(["string","number"].includes(typeof i))this.nextPage+=`&filters[${encodeURIComponent(t)}]=${encodeURIComponent(i)}`;else if(Array.isArray(i))i.forEach((i=>this.nextPage+=`&filters[${encodeURIComponent(t)}][]=${encodeURIComponent(i)}`));else if("object"==typeof i)for(const[e,s]of Object.entries(i))this.nextPage+=`&filters[${encodeURIComponent(t)}][${encodeURIComponent(e)}]=${encodeURIComponent(s)}`}buildNextPageUrl(){let t=this.getSource();if("json"===t)return;const i=sessionStorage.getItem(this.infiniteScrollStateKey);if(i){const{nextPage:t}=JSON.parse(i);if(!t)return}if(this.initBaseNextPageUrl(t),!this.isSourceWithoutValue())if(["search","related","landing-page"].includes(t))this.nextPage+=`&source_value=${this.getSourceValue()}`;else try{this.nextPage+=`&source_value[]=${this.getSourceValue().join("&source_value[]=")}`}catch(i){salla.logger.warn(`source-value prop should be array of ids ex source-value="[1,2,3]" for the source [${t}]`),this.sourceValueIsValid=!1}}loading(t=!0,i=!1){if(t){let t=i&&!this.autoload?this.btnLoader:this.loader;t&&(t.style.display="inherit")}else this.autoload||this.btnLoader&&(this.btnLoader.style.display="none"),this.loader&&(this.loader.style.display="none")}getItemHTML(t){"landing-page"===this.getSource()&&(t.url="");const i=document.createElement(this.hasCustomComponent?this.productCardComponent:"salla-product-card");return i.product=t,this.applyLandingPageStyles(i),this.applyHorizontalCardStyles(i),i.addEventListener("click",(i=>{this.hasInfiniteScroll&&i.target.closest("a")&&(this.takeStateSnapshot(),sessionStorage.setItem(this.lastViewedProductKey,t.id))})),i}applyLandingPageStyles(t){"landing-page"!==this.getSource()||this.hasCustomComponent||(t.toggleAttribute("hide-add-btn",!0),t.classList.add("s-product-card-fit-height"))}applyHorizontalCardStyles(t){this.horizontalCards&&(t.setAttribute("horizontal",!0),this.hasCustomComponent||t.setAttribute("shadow-on-hover",!0))}waitForResizing(t){let i=null;return new Promise((e=>{const s=new ResizeObserver((()=>{clearTimeout(i),i=setTimeout((()=>{s.disconnect(),e(null)}),160)}));s.observe(t)}))}waitForLayoutStable(t){let i=null;return new Promise((e=>{const s=new MutationObserver((()=>{clearTimeout(i),i=setTimeout((()=>{s.disconnect(),e(null)}),160)}));s.observe(t,{childList:!0,subtree:!0,attributes:!0})}))}async waitForStableLayout(t){return await Promise.allSettled([this.waitForResizing(t),this.waitForLayoutStable(t)])}scrollToLastViewedProduct(){const t=sessionStorage.getItem(this.lastViewedProductKey);t&&!salla.url.is_page("product.single")&&this.isElementLoaded(`[id*="${t}"]`).then((()=>{const i=this.wrapper?.querySelector(`[id*="${t}"]`);if(!i)return;const e=()=>{const t=()=>{i.scrollIntoView({block:"start",behavior:"instant"});const t=matchMedia("(max-width: 1024px)").matches?"header .inner":"ul.main-menu",e=window?.header_is_sticky?document.querySelector(t)?.getBoundingClientRect()?.height??56:0,s=parseInt(getComputedStyle(this.wrapper).rowGap)??16;scrollBy({top:-1*(e+s),behavior:"instant"})};requestAnimationFrame(t),i.querySelectorAll("img.lazy").forEach((i=>{const e=i,s=()=>{requestAnimationFrame(t),e.onload=e.onerror=null};e.onload=s,e.onerror=s})),this.removeScrollRestorationSession()};this.waitForStableLayout(this.host).then((()=>requestAnimationFrame(e)))}))}isElementLoaded(t){return new Promise((i=>{const e=setInterval((()=>{if(document.querySelector(t))return clearInterval(e),i(document.querySelector(t))}),50)}))}takeStateSnapshot(){const t=[];for(let i=0;i<this.wrapper.children.length;i++){const e=this.wrapper.children?.[i];t.push(e.product)}const i={pageIndex:Math.max((this.infiniteScroll?.pageIndex??1)-1,1),nextPage:this.nextPage,currentPageData:t};if(this.isFilterable()){const t=sessionStorage.getItem(this.filtersKey);sessionStorage.setItem(this.filtersKey,t||JSON.stringify(this.filtersSnapshot))}sessionStorage.setItem(this.infiniteScrollStateKey,JSON.stringify(i));let e=salla.config.get("page.id");const s=Object.keys(this.specialPagesWithoutIds).find((t=>salla.url.is_page(t)));s?e=this.specialPagesWithoutIds[s]:null!==e&&(e=String(e)),sessionStorage.setItem(this.prevCategoryIdKey,e)}removeScrollRestorationSession(){this.isFilterable()||sessionStorage.removeItem(this.filtersKey),sessionStorage.removeItem(this.infiniteScrollStateKey),sessionStorage.removeItem(this.lastViewedProductKey),sessionStorage.removeItem(this.prevCategoryIdKey)}loadStoredScrollState(){const t=sessionStorage.getItem(this.infiniteScrollStateKey),i=sessionStorage.getItem(this.filtersKey),e=sessionStorage.getItem(this.prevCategoryIdKey),s=this.specialPagesWithoutIds[salla.config.get("page.slug")]||null,a=salla.config.get("page.id"),l=salla.url.is_page("index"),o=salla.url.is_page("product.single"),n=s?e!==s:e!==String(a);if(e&&n&&!l&&!o||l&&!this.hasInfiniteScroll)return this.removeScrollRestorationSession(),this.switchToNormalBehavior=!0,!1;if(o)return this.switchToNormalBehavior=!0,!1;if(t)try{const{pageIndex:e,nextPage:s,currentPageData:a}=JSON.parse(t);if("undefined"!==i){const t=JSON.parse(i);salla.event.emit("filters::fetched",{filters:t})}this.page=e,this.nextPage=s;for(let t=0;t<a.length;t++)this.wrapper.append(this.getItemHTML(a?.[t]));return!0}catch(t){console.error("Failed to load stored scroll state:",t),this.removeScrollRestorationSession()}return!1}getSource(){return p.getProductsSource(this.source)}getSourceValue(){return this.currentCategoryIdFilter?this.currentCategoryIdFilter:p.getProductsSourceValue(this.source,this.sourceValue)}appendDataLayer(t){"object"==typeof dataLayer&&Array.isArray(dataLayer)&&dataLayer.push({event:"impressions",ecommerce:{currencyCode:salla.config.currency().code,impressions:t.map(((t,i)=>({id:t.id,name:t.name,price:t.price,brand:t.brand?.name||"",quantity:t.quantity,categories:[{name:t.category?.name||salla.config.get("page.title"),id:salla.config.get("page.id")}],category:t.category?.name||salla.config.get("page.title"),position:i+1})))}})}initiateInfiniteScroll(){if(!this.hasInfiniteScroll)return;const t=this.autoload&&this.includes&&this.includes.length>0;this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!t&&!!this.autoload&&100,loadOnScroll:!t&&this.autoload},!0),this.infiniteScroll.pageIndex=this.page,this.infiniteScroll?.on("request",(()=>{this.loading(!0,!this.autoload)})),t&&window.addEventListener("scroll",this.handleScroll.bind(this)),this.infiniteScroll?.on("load",(async t=>{if(!this.isProcessing){this.isProcessing=!0;try{if(!t.data?.length&&2===this.infiniteScroll.pageIndex)return this.showPlaceholder=!0,salla.infiniteScroll.destroy(this.infiniteScroll),this.loading(!1),void(this.placeholderLoader&&this.placeholderLoader.remove());this.includes&&await this.injectAndProcessData(t);const i=this.handleResponse(t);this.infiniteScroll.appendItems(i),2===this.infiniteScroll.pageIndex&&(!this.autoload&&this.nextPage&&(this.loadMoreWrapper.style.display="block"),this.animateItems())}catch(t){console.error("Error during load:",t)}finally{this.isProcessing=!1}}})),this.infiniteScroll?.on("error",(()=>{console.log("Error occurred during request"),this.status.querySelector(".s-infinite-scroll-error").classList.remove("s-hidden"),this.placeholderLoader&&this.placeholderLoader.remove(),this.loading(!1),this.isProcessing=!1})),salla.onReady((()=>{sessionStorage.getItem(this.infiniteScrollStateKey)||this.manualLoadNextPage()}))}handleScroll(){this.isProcessing||this.scrollTimeout||(this.scrollTimeout=setTimeout((()=>{this.scrollTimeout=null;const t=this.wrapper.getBoundingClientRect(),i=window.innerHeight;t.bottom-i<=200&&!this.isProcessing&&this.nextPage&&this.manualLoadNextPage()}),200))}manualLoadNextPage(){this.nextPage&&this.infiniteScroll.loadNextPage()}async injectAndProcessData(t){try{await p.injectExtraFieldsToResponse(t)}catch(t){console.error("Error injecting data:",t)}}getInitialData(){return this.loading(),salla.product.api.fetch({source:this.getSource(),source_value:this.getSourceValue(),limit:this.limit}).then((async t=>t.data.length?(await p.injectExtraFieldsToResponse(t),this.firstPageResponse?void this.handleResponse(t).forEach((t=>this.wrapper.append(t))):(this.firstPageResponse=t,void(this.nextPage=t.cursor?t.cursor.next:this.nextPage))):(this.showPlaceholder=!0,this.placeholderLoader&&this.placeholderLoader.remove(),void this.loading(!1))))}async loadMore(){this.infiniteScroll?.loadNextPage()}componentWillLoad(){return salla.onReady().then((()=>{this.hasCustomComponent=!!customElements.get(this.productCardComponent),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.hasInfiniteScroll=!["json","selected","related","landing-page"].includes(this.getSource())&&!this.limit;let t=new URLSearchParams(window.location.search);try{this.sortBy=this.sortBy||t.get("sort")||t.get("by"),this.parsedFilters=p.extractFiltersFromUrl(t),this.parsedFilters&&this.parsedFilters.category_id&&(this.currentCategoryIdFilter=[this.parsedFilters.category_id])}catch(t){salla.logger.warn("failed to get filters from url",t.message)}if(this.buildNextPageUrl(),this.isReady=!0,!sessionStorage.getItem(this.infiniteScrollStateKey))if(this.sourceValueIsValid){if(!this.hasInfiniteScroll){if("json"===this.getSource())return this.getSourceValue().length?void setTimeout((()=>{this.getSourceValue().map((t=>this.wrapper.append(this.getItemHTML(t))))})):void(this.showPlaceholder=!0);if("selected"!==this.getSource()||this.getSourceValue().length)return this.getInitialData();this.showPlaceholder=!0}}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}async componentDidLoad(){this.hasInfiniteScroll&&this.init(),await Salla.hooks.registerComponent("salla-products-list",this),this.loadStoredScrollState()?(this.autoload?!this.nextPage&&this.loading(!1):this.nextPage?this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="block"):(this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="none"),this.status.querySelector(".s-infinite-scroll-last").classList.remove("s-hidden")),this.scrollToLastViewedProduct()):!this.firstPageResponse&&this.switchToNormalBehavior?this.getInitialData().then((()=>{this.firstPageResponse?(this.handleResponse(this.firstPageResponse,!1).forEach((t=>{this.wrapper.append(t)})),setTimeout((()=>{if(!this.autoload&&this.nextPage&&1==this.infiniteScroll.pageIndex){const t=this.host.querySelector(".s-infinite-scroll-wrapper");t&&(t.style.display="block")}}))):console.error("No response received after getInitialData.")})).catch((t=>{console.error("Error during initial data fetch:",t)})):this.firstPageResponse&&this.handleResponse(this.firstPageResponse,!1).forEach((t=>this.wrapper.append(t)))}canRender(){return this.sourceValueIsValid&&this.isReady}render(){return this.canRender()?this.showPlaceholder?i("div",{class:"s-products-list-placeholder"},i("span",{innerHTML:f}),i("p",null,this.placeholderText)):i(e,{class:"s-products-list"},i("div",{class:{"s-products-list-wrapper":!0,"s-products-list-horizontal-cards":this.horizontalCards&&!this.filtersResults,"s-products-list-vertical-cards":!this.horizontalCards&&!this.rowCards&&!this.filtersResults,"s-products-list-row-cards":this.rowCards,"s-products-list-filters-results":this.filtersResults},ref:t=>this.wrapper=t}),i("div",{class:"s-infinite-scroll-status",ref:t=>this.status=t},i("p",{class:"s-infinite-scroll-last infinite-scroll-last s-hidden"},this.endOfText),i("p",{class:"s-infinite-scroll-error infinite-scroll-error s-hidden"},this.failedLoadMore)),this.autoload&&i("div",{class:"s-products-list-loading-wrapper",style:{display:"none"},ref:t=>this.loader=t},i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"})),this.hasInfiniteScroll&&this.nextPage&&!this.autoload?i("div",{class:"s-infinite-scroll-wrapper",style:{display:"none"},ref:t=>this.loadMoreWrapper=t},i("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))):""):""}init(){this.initiateInfiniteScroll(),this.loading()}handleResponse(t,i=!0){if(!t)return[];let e=this.getSource(),s="";if(1===t.cursor?.current){s=p.getPageTitleForSource(e);try{if("search"===this.getSource())s=salla.lang.get("common.elements.search_about",{word:this.getSourceValue()});else if(!s){let i=this.parsedFilters.category_id||this.getSourceValue()[0];s=t.filters?.find((t=>"category_id"===t.key))?.values?.find((t=>t.key===i))?.value??"",this.filtersSnapshot=t.filters}s+=(s?" - ":"")+salla.lang.choice("blocks.header.products_count",t.data?.length),15===t.data.length&&(s=s.replace(t.data.length,salla.lang.get("common.elements.more_than")+" "+t.data.length)),t.title=s}catch(t){salla.logger.error("Error::falid to handle response",t)}p.generateProductSchema(t.data)}this.appendDataLayer(t.data),t.nextPage=this.nextPage,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-list::products.fetched",t),this.productsFetched.emit(t),t.filters&&this.isFilterable()?(this.filtersResults=!0,this.filtersSnapshot=JSON.parse(JSON.stringify(t.filters)),salla.event.emit("filters::fetched",{filters:t.filters})):this.isFilterable()&&salla.event.emit("filters::hidden"),i&&(this.nextPage=t.cursor?t.cursor.next:this.nextPage),this.loading(!1),this.placeholderLoader&&this.placeholderLoader.remove(),this.hasInfiniteScroll&&!this.nextPage&&(this.infiniteScroll.option({scrollThreshold:!1,loadOnScroll:!1}),this.status.querySelector(".s-infinite-scroll-last").classList.remove("s-hidden"));const a=[];for(let i=0;i<t.data.length;i++)a.push(this.getItemHTML(t.data?.[i]));return a}get host(){return s(this)}};Lt.style="";const $t=class{constructor(i){t(this,i),this.productCardComponent="custom-salla-product-card",this.apiUrl=""}componentWillLoad(){return salla.onReady().then((()=>{if(this.includes=p.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),p.setIncludes(this.includes),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.sourceValueIsValid){if(this.hasCustomComponent=!!customElements.get(this.productCardComponent),"json"===this.source)return this.productsData=this.getSourceValue(),void(this.isReady=!0);if("related"!=this.getSource()||salla.config.get("store.settings.product.related_products_enabled"))return salla.product.api.fetch({source:this.getSource(),source_value:this.getSourceValue(),limit:this.limit}).then((t=>p.injectExtraFieldsToResponse(t))).then((t=>{this.productsData=t.data,this.isReady=!0,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-slider::products.fetched",t.data)}));this.isReady=!1}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}componentDidRender(){let t=0;const i=setInterval((()=>{this.host.querySelectorAll('[loading="lazy"]')?.forEach((t=>t.removeAttribute("loading"))),t++,t>=10&&clearInterval(i)}),1e3)}isSourceWithoutValue(){return["offers","latest","sales","top-rated"].includes(this.getSource())}getItemHTML(t){if("landing-page"===this.getSource()&&(t.url=""),this.hasCustomComponent&&"custom-salla-product-card"==this.productCardComponent.toLowerCase())return i("div",{class:"s-products-slider-card"},i("custom-salla-product-card",{product:t,source:this.getSource(),"source-value":this.getSourceValue()}));if(this.hasCustomComponent){const e=document.createElement(this.productCardComponent);return e.setAttribute("product",JSON.stringify(t)),e.setAttribute("source",this.getSource()),e.setAttribute("source-value",this.getSourceValue()),i("div",{class:"s-products-slider-card",innerHTML:e.outerHTML})}return i("div",{class:"s-products-slider-card"},i("salla-product-card",{"show-quantity":"landing-page"==this.getSource(),"hide-add-btn":"landing-page"==this.getSource(),"shadow-on-hover":!0,product:t}))}canRender(){return this.sourceValueIsValid&&this.isReady}getSource(){return p.getProductsSource(this.source)}getSourceValue(){return p.getProductsSourceValue(this.source,this.sourceValue)}render(){if(this.canRender())return i(e,{class:"s-products-slider-wrapper"},i("salla-slider",{class:"s-products-slider-slider",id:this.sliderId||`s-products-slider-${Math.random().toString(36).substr(2,9)}`,"auto-play":this.autoplay,type:"carousel","block-title":this.blockTitle,"block-subTitle":this.subTitle,"display-all-url":this.displayAllUrl,sliderConfig:this.sliderConfig?this.sliderConfig:null},i("div",{slot:"items"},this.productsData?.map((t=>this.getItemHTML(t))))))}get host(){return s(this)}};$t.style="";const Dt=class{constructor(i){t(this,i),this.height="10px";try{if(this.donation){let t="string"==typeof this.donation?JSON.parse(this.donation):this.donation;t.can_donate&&t.target_amount?(t.target_end_date="0000-00-00"==t.target_end_date?null:t.target_end_date,this.value=t.collected_amount,this.target=t.target_amount,this.header=salla.lang.get("pages.products.target"),this.message=t.target_end_date?salla.lang.get("pages.products.donation_target_date")+" "+t.target_end_date:""):this.message=t.target_amount?t.target_message:""}}catch(t){salla.log("Wrong donation json")}salla.lang.onLoaded((()=>{this.header=this.header?.replace("pages.products.target",salla.lang.get("pages.products.target")),this.message=this.message?.replace("pages.products.donation_target_date",salla.lang.get("pages.products.donation_target_date"))})),salla.onReady((()=>{this.color=this.color||salla.config.get("theme.color.primary","#ffd5c4"),this.unit||(this.unit=salla.config.currency().symbol)}))}getPercentage(){return this.value/this.target*100}render(){return this.target||this.message?i("div",{class:"s-progress-bar-container"},this.header?i("div",{class:"s-progress-bar-header"},this.header):"",this.getProgressBar(),this.message?i("span",{class:"s-progress-bar-message"},this.message):""):""}getProgressBar(){return this.target?[this.hideUnits?null:i("div",{class:"s-progress-bar-target-section"},i("span",{innerHTML:`${salla.helpers.number(this.value)} ${this.unit}`}),i("span",{innerHTML:`${salla.helpers.number(this.target)} ${this.unit}`})),i("div",{class:"s-progress-bar-wrapper",style:{height:this.height}},i("div",{class:{"s-progress-bar-progress":!0,"s-progress-bar-progress-stripped":this.stripped},style:{width:`${this.getPercentage()}%`,backgroundColor:this.color}}))]:null}};Dt.style="";const Bt=class{constructor(i){t(this,i),this.hostAttributes={},this.hasIncrementSlot=!1,this.hasDecrementSlot=!1,this.didLoaded=!1,this.quantity=1,this.fireChangeEvent=!0}watchPropHandler(){this.didLoaded&&(this.fireChangeEvent?p.debounce((()=>{salla.document.event.fireEvent(this.textInput,"change",{bubbles:!0,detail:{productId:this.cartItemId,quantity:this.quantity}})})):this.fireChangeEvent=!0)}componentWillLoad(){this.quantity=parseInt(this.host.getAttribute("value"))||1,this.hasIncrementSlot=!!this.host.querySelector('[slot="increment-button"]'),this.hasDecrementSlot=!!this.host.querySelector('[slot="decrement-button"]')}componentDidLoad(){this.didLoaded=!0,this.textInput.addEventListener("input",(t=>salla.helpers.inputDigitsOnly(t.target)))}getInputAttributes(){for(let t=0;t<this.host.attributes.length;t++)["id","value","min","class"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes}async decrease(){return this.setValue(this.quantity-1)}async increase(){return this.setValue(Number(this.quantity)+1)}async setValue(t,i=!0){this.fireChangeEvent=i;let e=parseInt(this.host.getAttribute("max"));return e&&t>e&&(t=e),t<=1&&(t=1),this.quantity=t,this.host}render(){return i(e,{key:"38d9902bc9bec3bca5f00d171bd39e86270e8c48",class:"s-quantity-input"},i("div",{key:"20cb75636c55b09705a7a95857bc98d37b56e94c",class:"s-quantity-input-container"},i("button",{key:"59077c6462c02124fde23a180766fa130d9ceb92",onClick:()=>this.increase(),class:"s-quantity-input-increase-button s-quantity-input-button",type:"button"},this.hasIncrementSlot?"":i("span",{innerHTML:A}),i("slot",{key:"741be510b7b82a323be7a75d077bdb2e06dc4995",name:"increment-button"})),i("input",{key:"7d482864cf0e66d0d74c335f2b7e72302adaea47",class:"s-quantity-input-input",...this.getInputAttributes(),ref:t=>this.textInput=t,onInput:t=>this.setValue(t.target.value),min:"1",value:this.quantity}),i("button",{key:"9a1458df4fecee23827801e9b3e463e86f47d497",class:"s-quantity-input-decrease-button s-quantity-input-button",onClick:()=>this.decrease(),type:"button"},this.hasDecrementSlot?"":i("span",{innerHTML:M}),i("slot",{key:"3b5fabbb5a3792608921ee14b45bc48f4068d21c",name:"decrement-button"}))))}get host(){return s(this)}static get watchers(){return{quantity:["watchPropHandler"]}}};Bt.style="";var Ot={request:(t,i,e,s=null,a=null)=>n.request({url:i,data:e,method:t.toLowerCase(),responseType:"json"}).then(s).catch(a),get:(t,i=null,e=null,s)=>n.get(t,{params:s}).then(i).catch(e),post(t,i,e=null,s=null){return this.request("post",t,i,e,s)},put(t,i,e=null,s=null){return this.request("put",t,i,e,s)},delete(t,i,e=null,s=null){return this.request("delete",t,i,e,s)},requestWithSupportAjax(t,i,e="post"){return new Promise(((s,a)=>{if(!window?.isLegacyTheme)return this.request(e,t,i,(({data:t})=>s(t)),(({response:t})=>a(t)));$.ajax({url:t,method:e.toUpperCase(),data:i,async:!1,success:function({data:t}){return s(t)},error:function({response:t}){return a(t)}})}))}},Ht={options:[],header:[navigator.platform,navigator.userAgent,navigator.appVersion,navigator.vendor,window.opera],dataos:[{name:"Windows Phone",value:"Windows Phone",version:"OS"},{name:"Windows",value:"Win",version:"NT"},{name:"iPhone",value:"iPhone",version:"OS"},{name:"iPad",value:"iPad",version:"OS"},{name:"Kindle",value:"Silk",version:"Silk"},{name:"Android",value:"Android",version:"Android"},{name:"PlayBook",value:"PlayBook",version:"OS"},{name:"BlackBerry",value:"BlackBerry",version:"/"},{name:"Macintosh",value:"Mac",version:"OS X"},{name:"Linux",value:"Linux",version:"rv"},{name:"Palm",value:"Palm",version:"PalmOS"}],databrowser:[{name:"Chrome",value:"Chrome",version:"Chrome"},{name:"Firefox",value:"Firefox",version:"Firefox"},{name:"Safari",value:"Safari",version:"Version"},{name:"Internet Explorer",value:"MSIE",version:"MSIE"},{name:"Opera",value:"Opera",version:"Opera"},{name:"BlackBerry",value:"CLDC",version:"CLDC"},{name:"Mozilla",value:"Mozilla",version:"Mozilla"}],init:function(){var t=this.header.join(" ");return{os:this.matchItem(t,this.dataos),browser:this.matchItem(t,this.databrowser)}},matchItem:function(t,i){var e,s,a,l=0,o=0;for(l=0;l<i.length;l+=1)if(new RegExp(i[l].value,"i").test(t)){if(e=new RegExp(i[l].version+"[- /:;]([\\d._]+)","i"),a="",(s=t.match(e))&&s[1]&&(s=s[1]),s)for(s=s.split(/[._]+/),o=0;o<s.length;o+=1)a+=0===o?s[o]+".":s[o];else a="0";return{name:i[l].name,version:parseFloat(a)}}return{name:"unknown",version:0}}};function Ft(t,i,e=!1){if(console.log("mutateShipmentAddress called",i,e),t.detail.requiredShippingContactFields)return Ot.post(t.detail.shippingContactSelected.url.replace("{id}",t.id),{country:i.country,city:i.locality,local:i.subLocality,description:i.subAdministrativeArea,street:i.addressLines?.join(", ")||i.administrativeArea,country_code:i.countryCode,postal_code:i.postalCode,is_authorized:e},(async({data:i})=>{if(!e){if("function"==typeof t.detail.shippingContactSelected.onSuccess&&t.detail.shippingContactSelected.onSuccess(i),t.address_id=i.data.address_id,t.shipping_methods=i.data.shipping_methods,!t.shipping_methods||t.shipping_methods&&!t.shipping_methods.length)return salla.logger.warn("🍏 Pay: We dont found any supported methods",i),t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]});try{await t.selectApplePayShippingMethod(t.shipping_methods[0].ship_id,t.shipping_methods[0].private_ship_id)}catch(i){return salla.logger.warn("Failed set the shipping details to api",i),t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]})}try{await t.recalculateTotal()}catch(i){return salla.logger.warn("🍏 Pay: Failed recalculate total",i),t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]})}t.session.completeShippingContactSelection({newTotal:t.prepareTotal(),newLineItems:t.prepareLineItems(),newShippingMethods:t.mappingShippingMethods(t.shipping_methods)})}}),(({response:i})=>{salla.logger.warn("🍏 Pay: Failed add address via api",i),"function"==typeof t.detail.shippingContactSelected.onFailed&&t.detail.shippingContactSelected.onFailed(i);let e=i?.data?.error?.fields,s=[];e?.country_code&&s.push(new window.ApplePayError("shippingContactInvalid","countryCode",e?.country_code[0])),e?.city&&s.push(new window.ApplePayError("shippingContactInvalid","locality",e?.city[0])),e?.country&&s.push(new window.ApplePayError("shippingContactInvalid","country",e?.country[0])),0===s.length&&i?.data?.error?.message&&s.push(new window.ApplePayError("shippingContactInvalid","locality",i?.data?.error?.message)),t.session.completeShippingContactSelection({newTotal:t.prepareTotal(),newLineItems:t.prepareLineItems(),status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:s})}))}window.Salla=window.Salla||{},window.Salla.Payments=window.Salla.Payments||{},window.SallaApplePay={session:null,detail:null,address_id:null,shipping_methods:[],total:void 0,request:void 0,id:void 0,countryCode:null,init:function(){document.removeEventListener("payments::apple-pay.start-transaction",SallaApplePay.startSession),Salla.event.addEventListener("payments::apple-pay.start-transaction",SallaApplePay.startSession)},initDefault:function(){SallaApplePay.detail.onError||(SallaApplePay.detail.onError=function(t){salla.notify.error(t)}),SallaApplePay.detail.authorized.onFailed||(SallaApplePay.detail.authorized.onFailed=t=>{salla.logger.log(JSON.stringify(t)),salla.api.handleErrorResponse(t),SallaApplePay.onCancel({},t.data.error.message)}),SallaApplePay.detail.validateMerchant.onFailed||(SallaApplePay.detail.validateMerchant.onFailed=t=>{salla.logger.log(JSON.stringify(t)),salla.api.handleErrorResponse(t),SallaApplePay.onCancel({},t.data.error.message)}),SallaApplePay.detail.authorized.onSuccess||(SallaApplePay.detail.authorized.onSuccess=t=>{salla.logger.log(JSON.stringify(t)),salla.api.handleAfterResponseActions(t)})},prepareLineItems:function(){return SallaApplePay.detail?.items?.length||(SallaApplePay.detail.items=[{label:salla.lang.get("pages.cart.items_total"),amount:SallaApplePay.detail.amount}]),SallaApplePay.detail.items},prepareTotal:function(){return{label:window.location.hostname||"Salla",amount:SallaApplePay.detail.amount}},startSession:async function(t){SallaApplePay.detail=t.detail||t,salla.log("🍏 Pay: payments::apple-pay.start-transaction",SallaApplePay.detail),SallaApplePay.initDefault();let i=SallaApplePay.getApplePaySessionVersion(),e=SallaApplePay.detail.supportedNetworks||["masterCard","visa"];5===i&&e.push("mada"),SallaApplePay.request={countryCode:SallaApplePay.detail.countryCode||"SA",supportsCouponCode:!0,couponCode:"",currencyCode:SallaApplePay.detail.currency||"SAR",requiredShippingContactFields:SallaApplePay.detail.requiredShippingContactFields?SallaApplePay.detail.requiredShippingContactFields:[],merchantCapabilities:["supports3DS"],supportedNetworks:e,supportedCountries:SallaApplePay.detail.supportedCountries||["SA"],total:SallaApplePay.prepareTotal(),shippingContact:SallaApplePay.detail.shippingContact?SallaApplePay.detail.shippingContact:{},shippingMethods:SallaApplePay.detail.shippingMethods&&SallaApplePay.detail.shippingMethods.length?SallaApplePay.mappingShippingMethods(t.detail.shippingMethods):[],lineItems:SallaApplePay.prepareLineItems()},salla.log("🍏 Pay: init ",SallaApplePay.request),SallaApplePay.session=new ApplePaySession(i,SallaApplePay.request),SallaApplePay.session.onshippingcontactselected=SallaApplePay.onShippingContactSelected,SallaApplePay.session.onshippingmethodselected=SallaApplePay.onShippingMethodSelected,SallaApplePay.session.onvalidatemerchant=SallaApplePay.onValidateMerchant,SallaApplePay.session.onpaymentauthorized=SallaApplePay.onPaymentAuthorized,SallaApplePay.session.oncancel=SallaApplePay.onCancel,SallaApplePay.session.oncouponcodechanged=SallaApplePay.oncouponcodechanged,SallaApplePay.session.onpaymentmethodselected=SallaApplePay.onpaymentmethodselected,SallaApplePay.session.begin()},async onpaymentmethodselected(t){await SallaApplePay.recalculateTotal();const i={newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()};SallaApplePay.session.completePaymentMethodSelection(i)},oncouponcodechanged:t=>(Salla.event.dispatch("payments::apple-pay.coupon.change",t),Ot.post(SallaApplePay.detail.oncouponcodechanged.url.replace("{id}",SallaApplePay.id),{coupon:t.couponCode,payment_method:"apple_pay"},(async({data:t})=>{"function"==typeof SallaApplePay.detail.oncouponcodechanged.onSuccess&&SallaApplePay.detail.oncouponcodechanged.onSuccess(t),salla.log("🍏 Pay: Coupon applied success"),await SallaApplePay.recalculateTotal(),SallaApplePay.session.completeCouponCodeChange({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()})}),(async t=>{let i=t?.response;Salla.event.dispatch("payments::apple-pay.coupon.failed",i),"function"==typeof SallaApplePay.detail.oncouponcodechanged.onFailed&&SallaApplePay.detail.oncouponcodechanged.onFailed(i),await SallaApplePay.recalculateTotal(),SallaApplePay.session.completeCouponCodeChange({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems(),errors:[new window.ApplePayError("couponCodeInvalid")]})}))),onCancel:(t={},i=null)=>{SallaApplePay.detail.onError(i||salla.lang.get("pages.checkout.payment_failed")),Salla.event.createAndDispatch("payments::apple-pay.canceled",t)},onPaymentAuthorized:async t=>{salla.logger.log("🍏 Pay: onPaymentAuthorized",t.payment),await Ft(SallaApplePay,t.payment.shippingContact,!0),Salla.event.dispatch("payments::apple-pay.authorized.init",t),Ot.post(SallaApplePay.detail.authorized.url.replace("{id}",SallaApplePay.id),{payment_method:"apple_pay",applepay_token:JSON.stringify(t.payment)},(({data:t})=>{Salla.event.dispatch("payments::apple-pay.authorized.success",t),SallaApplePay.session.completePayment(ApplePaySession.STATUS_SUCCESS),"function"==typeof SallaApplePay.detail.authorized.onSuccess&&SallaApplePay.detail.authorized.onSuccess(t)}),(t=>{let i=t?.response;Salla.event.dispatch("payments::apple-pay.authorized.failed",i),SallaApplePay.session.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[new ApplePayError("unknown",void 0,i?.data?.error?.message||i?.data?.error?.code||"Failed to parse authorized response")]}),"function"==typeof SallaApplePay.detail.authorized.onFailed&&SallaApplePay.detail.authorized.onFailed(i)}))},onValidateMerchant:async t=>{try{Salla.event.dispatch("payments::apple-pay.validate-merchant.init",t);const{data:i}=await Ot.post(SallaApplePay.detail.validateMerchant.url.replace("{id}",SallaApplePay.id),{validation_url:t.validationURL});Salla.event.dispatch("payments::apple-pay.validate-merchant.success",i);const e=t=>{SallaApplePay.session.completeMerchantValidation(t)};if("function"==typeof SallaApplePay.detail.validateMerchant.onSuccess){const t=await SallaApplePay.detail.validateMerchant.onSuccess(i);if(t?.redirect)return window.location=t.redirect,SallaApplePay.abortValidateMerchant(t)}e(i.data)}catch(t){console.error(t),SallaApplePay.abortValidateMerchant(t?.response)}},abortValidateMerchant:(t=null)=>{SallaApplePay.abortSession(),Salla.event.dispatch("payments::apple-pay.validate-merchant.failed",t),"function"==typeof SallaApplePay.detail.validateMerchant.onFailed&&SallaApplePay.detail.validateMerchant.onFailed(t)},onShippingContactSelected:async t=>{salla.logger.log("🍏 Pay: onShippingContactSelected",t.shippingContact),Ft(SallaApplePay,t.shippingContact)},onShippingMethodSelected:async t=>{salla.logger.log(t);let i=t.shippingMethod.identifier.split(",");try{await SallaApplePay.selectApplePayShippingMethod(i[0],void 0===i[1]?null:i[1]),await SallaApplePay.recalculateTotal(),SallaApplePay.session.completeShippingMethodSelection({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()})}catch(t){salla.logger.warn("🍏 Pay: Failed set the shipping details to api",t),SallaApplePay.abortSession()}},abortSession:()=>{SallaApplePay.session&&SallaApplePay.session.abort()},getApplePaySessionVersion:()=>{if("sallapp"===(navigator.userAgent||navigator.vendor||window.opera))return 5;let t=Ht.init(),i=parseFloat(t.os.version);if("Macintosh"===t.os.name){if(i<10.142)return 1}else if(i<12.11)return 1;return 5},recalculateTotal:()=>(salla.logger.log("Recalculate Total"),Ot.requestWithSupportAjax(SallaApplePay.detail.recalculateTotal.url.replace("{id}",SallaApplePay.id),{},"get").then((t=>{let i=t.data.initial_data?.cart||t.data.cart;return SallaApplePay.detail.amount=i.total,SallaApplePay.detail.items=(i.totals||i.items).map((t=>({label:t.title,amount:"مجاني"===t.amount||"Free"===t.amount?0:t.amount.toString().replace("+","")}))),SallaApplePay.detail.items.pop(),t})).catch((t=>(salla.logger.warn("🍏 Pay: recalculate total failed",t),t?.response?.data?.message)))),selectApplePayShippingMethod:(t,i)=>{salla.logger.log("🍏 Pay: select shipping method ","company_id : "+t,"private_company_id: "+i);const e={address_id:SallaApplePay.address_id,company_id:t,private_company_id:i,payment_method:"apple_pay"},s=SallaApplePay.shipping_methods?.find((i=>i.company===t||i.ship_id===t));return s?.route_id&&(e.shipping_route_id=s.route_id,e.type=s.type),Ot.requestWithSupportAjax(SallaApplePay.detail.shippingMethodSelected.url.replace("{id}",SallaApplePay.id),e,"post").then((()=>("function"==typeof SallaApplePay.detail.shippingMethodSelected.onSuccess&&SallaApplePay.detail.shippingMethodSelected.onSuccess(data),!0))).catch((t=>{salla.logger.warn("🍏 Pay: Set shipping method failed",t),"function"==typeof SallaApplePay.detail.shippingMethodSelected.onFailed&&SallaApplePay.detail.shippingMethodSelected.onFailed(t);let i=t?.response?.data?.error;return i?.data?.fields?.address_id?i?.data?.fields?.address_id[0]:i?.data?.message}))},mappingShippingMethods:t=>t.map((t=>({label:t.shipping_title,amount:t.enable_free_shipping?0:t.ship_cost,detail:"",identifier:t.ship_id.toString()+(t.private_ship_id?","+t.private_ship_id.toString():"")})))},window.ApplePaySession?.canMakePayments()?SallaApplePay.init():document.querySelectorAll("data-show-if-apple-pay-supported").forEach((t=>t.style.display="none"));const Rt=class{constructor(i){t(this,i),this.type="buy",this.options={},this.quickBuy=salla.lang.get("pages.products.buy_now"),salla.lang.onLoaded((()=>{this.quickBuy=salla.lang.get("pages.products.buy_now")}))}async quickBuyHandler(){if(salla.config.isGuest()){let t="salla-quick-buy::user.logged-in";return salla.event.on(t,(()=>this.settlePayment())),salla.api.auth.setAfterLoginEvent(t),salla.auth.event.dispatch("login::open",{withoutReload:!0})}await this.settlePayment()}async settlePayment(){let t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);if(t&&!await t.reportValidity())return salla.error(salla.lang.get("common.messages.required_fields"));let i=this.host.getElementSallaData();if(!this.isApplePayActive)return salla.api.request("checkout/quick-purchase/"+this.productId,i,"post").then((t=>(t.data.redirect&&(window.location.href=t.data.redirect),t)));i.is_applepay=!0,"append"in i&&i.append("is_applepay",!0),salla.event.dispatch("payments::apple-pay.start-transaction",{amount:this.amount,currency:this.currency||"SAR",requiredShippingContactFields:this.isRequireShipping?["postalAddress"]:void 0,shippingMethods:this.isRequireShipping?[]:void 0,supportedNetworks:salla.config.get("store.settings.buy_now.networks"),supportedCountries:salla.config.get("store.settings.buy_now.countries"),countryCode:salla.config.get("store.store_country")||"SA",validateMerchant:{url:salla.url.get("checkout/applepay/validate"),onSuccess:t=>this.applePayOnly&&!this.productId?this.cartId?(window.SallaApplePay.id=this.cartId,salla.log("🍏 Pay: create checkout success: with id #"+this.cartId),Promise.resolve(t)):(salla.logger.warn("🍏 Pay: trying to create applePay transaction without cartId/ProductId !"),Promise.resolve(t)):salla.api.request("checkout/quick-purchase/"+this.productId,"object"==typeof i?i:void 0,"post",{}).then((t=>t?.data?.redirect?(salla.log("🍏 Pay: create checkout success: redirect exits, go to checkout page"),window.location.href=t.data.redirect.url,t):t?.data?.id?(window.SallaApplePay.id=t.data.id,void salla.log("🍏 Pay: create checkout success: with id #"+window.SallaApplePay.id)):(salla.logger.warn("🍏 Pay: create checkout success: No id, or redirect"),t)))},authorized:{url:salla.url.get("checkout/{id}/payments/submit"),onFailed:t=>{window.SallaApplePay.onCancel({},t?.data?.error?.message||t?.data?.error?.code||salla.lang.get("pages.checkout.payment_failed"))},onSuccess:t=>{window.location.href=t.redirect.url,salla.log("🍏 Pay: authorized Success:: redirect to thank you page, order placed")}},shippingMethodSelected:this.isRequireShipping?{url:salla.url.get("checkout/{id}/shipping/details")}:void 0,shippingContactSelected:this.isRequireShipping?{url:salla.url.get("checkout/{id}/address/add")}:void 0,oncouponcodechanged:{url:salla.url.get("checkout/{id}/coupons")},recalculateTotal:{url:salla.url.get("checkout/{id}/payments/recalculate?payment_method=apple_pay")},onError:function(t){salla.log(t),salla.notify.error(t)}})}componentWillLoad(){return console.log("🍏 Pay: Quick Buy Component Loaded"),new Promise(((t,i)=>{salla.onReady((async()=>{if(this.currency||(this.currency=salla.config.get("user.currency_code")),!this.productId&&salla.config.get("page.id")&&(this.productId=salla.config.get("page.id")),!this.applePayOnly&&!this.productId)return salla.logger.warn("🍏 Pay: Failed load the quick buy, the product id is missing"),i();this.amount&&this.isRequireShipping||!this.productId||await salla.product.getDetails(this.productId,[]).then((t=>{this.amount=t.data.price,this.isRequireShipping=t?.data?.is_require_shipping||!1})).catch((t=>(salla.logger.warn("🍏 Pay: Failed load the quick buy, get the product details failed: ",t),i()))),"donate"==this.type?salla.event.on("product-options::donation-changed",(t=>{String(t.id)===String(this.productId)&&(this.amount=t.price)})):salla.url.is_page("product.single")&&salla.product.event?.onPriceUpdated((t=>{this.amount=t.data.price})),this.isApplePayActive=salla.helpers.hasApplePay()&&salla.config.get("store.settings.payments")?.includes("apple_pay")&&salla.config.get("store.settings.is_salla_gateway",!1);let e=document.getElementById("apple-pay-sdk");if(e||!this.isApplePayActive)return salla.logger.warn("🍏 Pay: Skipped load apple pay because "+(e?"already loaded":"is not available in the browser")),void t(!0);const s=document.createElement("script");s.src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js",s.setAttribute("id","apple-pay-sdk"),s.async=!0,document.body.appendChild(s),t(!0)}))}))}render(){return i(e,{key:"e6440de17b7c8185dbd0636d0c009a04014ae215"},this.quickBuyButton())}quickBuyButton(){return i("apple-pay-button",{locale:salla.config.get("user.language_code"),onClick:()=>this.quickBuyHandler(),"data-quick-purchase":"applepay",class:"s-quick-buy-apple-pay","data-is-applepay":"1",buttonstyle:"black",type:this.type})}get host(){return s(this)}};Rt.style=".s-quick-buy-button .s-button-text{display:flex}apple-pay-button{--apple-pay-button-width:100%;--apple-pay-button-height:40px;--apple-pay-button-border-radius:.75rem;--apple-pay-button-box-sizing:content-box}";const Et=class{constructor(i){t(this,i),this.quickOrderSubmited=a(this,"quickOrderSubmited"),this.quickOrderTitle="ليش تنتظر؟",this.subTitle="احصل على المنتج مباشرة الآن",this.payButtonTitle="اطلب المنتج",this.confirmPayButtonTitle="اشتر الآن",this.agreementText=salla.lang.get("pages.checkout.show_full_agreement"),this.isEmailRequired=!1,this.quickOrderStyle="default",this.isAvailable=!1,this.oneClick=!1,this.expanded=!1,this.isTermsRequired=!1,this.countryCode=salla.config.get("user.country_code","SA")||"SA",this.submitSucess=!1,this.placeHolderEmail=salla.lang.get("common.elements.email"),this.emailOptional=salla.lang.get("common.elements.optional"),this.agreementShowText=salla.lang.get("pages.checkout.show_full_agreement"),this.agreementModalHead=salla.lang.get("pages.checkout.full_agreement"),this.userNameLabel=salla.lang.get("pages.products.your_name"),this.termsChecked=!1,salla.onReady((()=>{this.productId=this.productId||salla.config.get("page.id")})),salla.lang.onLoaded((()=>{this.placeHolderEmail=salla.lang.get("common.elements.email"),this.emailOptional=salla.lang.get("common.elements.optional"),this.agreementShowText=salla.lang.get("pages.checkout.show_full_agreement"),this.agreementModalHead=salla.lang.get("pages.checkout.full_agreement"),this.userNameLabel=salla.lang.get("pages.products.your_name")}))}getBtnColor(){return"default"===this.quickOrderStyle?"light":"primary"}getErrorMessage(t,i){return"terms"==i?salla.lang.get("pages.checkout.check_agreement"):salla.lang.get(`common.errors.${t}`,{attribute:"name"==i?this.userNameLabel:this.placeHolderEmail})}handleInvalidInput(t){let i,e=t.target,s=e.validity;s.valueMissing?(i=this.getErrorMessage("field_required",e.name),console.log(this.getErrorMessage("field_required",e.name))):s.typeMismatch&&(i=this.getErrorMessage("invalid_value",e.name)),e.setCustomValidity(i)}async setWrapperHeight(){let t=this.host.querySelector(".s-quick-order-expandable");setTimeout((()=>{t.style.maxHeight=t.style.maxHeight||this.oneClick?null:t.scrollHeight+"px"}),50)}getDarkOrLight(){return"default"===this.quickOrderStyle&&salla.config.get("theme.color.is_dark")?"dark":"light"}getStyleColor(){return{gray:"#f3f3f3",white:"#ffffff",default:salla.config.get("theme.color.primary")}[this.quickOrderStyle]||"#f3f3f3"}async submit(t,i=!1){return t.preventDefault(),i&&!this.oneClick?(this.expanded=!this.expanded,void this.setWrapperHeight()):this.submitBtn.load().then((()=>this.getPayload())).then((t=>salla.api.cart.createQuickOrder(t))).then((()=>{setTimeout((()=>{this.submitBtn.stop(),this.submitSucess=!0,this.quickOrderSubmited.emit()}),200)})).catch((t=>t&&(console.error(t),this.submitBtn.stop())))}async getPayload(){return this.oneClick?{product_ids:[this.productId],agreement:!0}:{product_ids:[this.productId],email:this.emailInput?.value,phone:Number((await(this.phoneInput?.getValues()))?.phone),country_code:(await(this.phoneInput?.getValues()))?.countryCode||this.countryCode,name:this.nameInput?.value,agreement:this.termsChecked}}formatAgreementText(t,i=150){return t?t.length<=i?t:(new DOMParser).parseFromString(t,"text/html").documentElement.innerText.substring(0,i)+"...":""}loadQuickOrderSettings(){let t=salla.config.get("store.settings.quick_order");return t?(this.user=salla.config.get("user")||salla.storage.get("user")||{},this.countryCode=this.user?.country_code||this.countryCode,this.isEmailRequired=!this.user?.email&&this.isEmailRequired,this.oneClick=this.user?.email,this.initComponentData(t),Promise.resolve()):Promise.resolve()}initComponentData(t){this.quickOrderTitle=t.title,this.subTitle=t.sub_title,this.payButtonTitle=t.order_now_button,this.isEmailRequired=t.is_email_required,this.isTermsRequired=t.show_agreement,this.agreementText=t.agreement,this.confirmPayButtonTitle=t.confirm_button,this.thanksMessage=t.thanks_message,this.quickOrderStyle=t.style,this.isAvailable=!0,this.oneClick=this.oneClick&&!this.isTermsRequired}componentWillLoad(){return new Promise((t=>salla.onReady((()=>this.loadQuickOrderSettings().then(t)))))}render(){if(this.isAvailable)return this.submitSucess?i(e,{class:"s-quick-order"},i("div",{class:"s-quick-order-confirm",style:{backgroundColor:salla.config.get("theme.color.primary")+"10",borderColor:salla.config.get("theme.color.primary")+"10",color:salla.config.get("theme.color.primary")}},i("i",{innerHTML:'\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>party-horn</title>\n<path fill="currentColor" d="M5.333 4.013c0.736 0 1.333-0.596 1.333-1.333v-0.013c0-0.737-0.597-1.327-1.333-1.327s-1.333 0.603-1.333 1.34 0.597 1.333 1.333 1.333zM11.333 10c0.341 0 0.683-0.131 0.943-0.391 1.541-1.54 2.391-3.589 2.391-5.771v-2.505c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.505c0 1.468-0.572 2.848-1.609 3.885-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391zM18.667 9.993c0.319 0 0.639-0.115 0.895-0.345 0.383-0.347 0.684-0.325 1.497-0.22 0.923 0.124 2.319 0.307 3.636-0.887 1.293-1.172 1.303-2.54 1.308-3.539 0.005-0.887 0.043-1.228 0.432-1.581 0.361-0.327 0.621-0.335 1.493-0.216 0.923 0.12 2.317 0.307 3.635-0.884 0.545-0.495 0.587-1.337 0.093-1.883-0.493-0.547-1.336-0.589-1.884-0.093-0.361 0.325-0.621 0.333-1.493 0.216-0.921-0.119-2.317-0.305-3.635 0.884-1.293 1.173-1.303 2.541-1.308 3.54-0.005 0.885-0.043 1.227-0.432 1.58-0.383 0.348-0.683 0.327-1.497 0.22-0.924-0.124-2.32-0.305-3.636 0.887-0.545 0.495-0.587 1.339-0.092 1.884 0.264 0.291 0.625 0.437 0.988 0.437zM18.667 16.013c0.736 0 1.333-0.596 1.333-1.333v-0.013c0-0.737-0.597-1.327-1.333-1.327s-1.333 0.603-1.333 1.34 0.597 1.333 1.333 1.333zM30.667 17.333h-2.505c-2.179 0-4.228 0.849-5.771 2.391-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.603 0.391 0.944 0.391s0.683-0.131 0.943-0.391c1.023-1.023 2.439-1.609 3.884-1.609h2.505c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM30.667 10.66c-0.736 0-1.333 0.603-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM29.333 26.66c-0.736 0-1.333 0.603-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM7.456 11.057c-0.327-0.327-0.799-0.46-1.249-0.356-0.449 0.107-0.812 0.439-0.959 0.876l-5.036 15.113c-0.487 1.457-0.113 3.037 0.973 4.125 0.772 0.771 1.792 1.183 2.84 1.183 0.428 0 0.861-0.068 1.284-0.209l15.112-5.037c0.439-0.145 0.769-0.508 0.876-0.959 0.107-0.449-0.028-0.921-0.355-1.249zM4.467 29.259c-0.503 0.163-1.023 0.043-1.395-0.329-0.373-0.373-0.497-0.896-0.329-1.396l4.355-13.065 10.436 10.435z"></path>\n</svg>\n'}),i("span",null,this.thanksMessage))):i(e,{class:`s-quick-order s-quick-order-${this.getDarkOrLight()}`},i("div",{class:`s-quick-order-container s-quick-order-${this.quickOrderStyle}`,style:{backgroundColor:this.getStyleColor()}},i("div",{class:"s-quick-order-button-cont"},i("div",null,i("h3",null,this.quickOrderTitle),i("p",null,this.subTitle)),i("salla-button",{class:this.expanded?"s-quick-order-btn-close":"",onClick:t=>this.submit(t,!0),color:this.getBtnColor()},this.oneClick?this.confirmPayButtonTitle:this.expanded?i("i",{innerHTML:Q}):this.confirmPayButtonTitle)),i("form",{onSubmit:t=>this.submit(t),class:"s-quick-order-expandable "+(this.expanded?"s-quick-order-shown":"")},Salla.config.isGuest()&&[i("div",{class:"s-form-group"},i("span",{innerHTML:'\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>portrait</title>\n<path d="M24 1.333h-16c-3.676 0-6.667 2.991-6.667 6.667v16c0 3.028 2.041 5.561 4.811 6.371 0.004 0.001 0.008 0.003 0.012 0.004 0.591 0.172 1.2 0.292 1.844 0.292h16c0.644 0 1.253-0.12 1.843-0.292 0.004-0.001 0.008-0.003 0.012-0.004 2.771-0.809 4.812-3.343 4.812-6.371v-16c0-3.676-2.991-6.667-6.667-6.667zM8.012 28c0.121-1.915 3.363-4 7.988-4s7.868 2.085 7.988 4zM28 24c0 1.24-0.579 2.335-1.467 3.069-0.768-3.288-5.112-5.736-10.533-5.736s-9.765 2.448-10.533 5.736c-0.888-0.735-1.467-1.829-1.467-3.069v-16c0-2.205 1.795-4 4-4h16c2.205 0 4 1.795 4 4zM16 6.667c-3.308 0-6 2.692-6 6s2.692 6 6 6 6-2.692 6-6-2.692-6-6-6zM16 16c-1.839 0-3.333-1.495-3.333-3.333s1.495-3.333 3.333-3.333 3.333 1.495 3.333 3.333-1.495 3.333-3.333 3.333z"></path>\n</svg>\n'}),i("input",{type:"text",required:!0,class:"s-form-control s-quick-order-phone-field",name:"name",placeholder:this.userNameLabel,ref:t=>this.nameInput=t})),i("div",{class:"s-quick-order-flex-input"},i("div",{class:"s-form-group"},i("span",{innerHTML:'\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>iphone-x</title>\n<path d="M24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.597 1.333-1.333 1.333h-16c-0.736 0-1.333-0.597-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h4c0 1.471 1.196 2.667 2.667 2.667h2.667c1.471 0 2.667-1.196 2.667-2.667h4c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n'}),i("salla-tel-input",{ref:t=>this.phoneInput=t})),i("div",{class:"s-form-group"},i("span",{innerHTML:b}),i("input",{type:"email",class:"s-form-control s-quick-order-email-field",name:"email",required:this.isEmailRequired,placeholder:this.placeHolderEmail+" "+(this.isEmailRequired?"":this.emailOptional),ref:t=>this.emailInput=t})))],this.isTermsRequired&&i("label",{htmlFor:"terms",class:"s-quick-order-terms"},i("input",{type:"checkbox",required:!0,name:"terms",id:"terms",ref:t=>this.termsInput=t,onChange:()=>this.termsChecked=this.termsInput.checked,class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",i("div",{innerHTML:this.formatAgreementText(this.agreementText,150)},this.agreementText.length>150&&i("salla-button",{shape:"link",onClick:()=>this.agreementModal.open()},this.agreementShowText))," ")),i("salla-button",{type:"submit",color:this.getBtnColor(),width:"wide",ref:t=>this.submitBtn=t},this.payButtonTitle)),i("salla-modal",{"modal-title":this.agreementModalHead,ref:t=>this.agreementModal=t},i("article",{innerHTML:this.agreementText}))))}componentDidLoad(){this.host.querySelectorAll("input").forEach((t=>{t.addEventListener("invalid",(t=>{this.handleInvalidInput(t)})),t.addEventListener("input",(()=>{t.setCustomValidity(""),t.reportValidity()}))}))}get host(){return s(this)}};Et.style=".s-quick-order-expandable:not(.s-quick-order-shown){overflow:hidden}";var jt='\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>star</title>\n<path d="M31.819 12.077c-0.367-0.883-1.209-1.411-2.259-1.411h-8.437l-2.681-8.871c-0.347-1.075-1.329-1.796-2.443-1.796s-2.096 0.721-2.447 1.805l-2.788 8.861h-8.275c-1.076 0-1.939 0.533-2.308 1.427-0.375 0.904-0.159 2.012 0.525 2.693 0.044 0.044 0.092 0.085 0.141 0.124l6.811 5.101-2.773 8.567c-0.344 1.063 0.019 2.228 0.899 2.899 0.459 0.351 1.001 0.527 1.544 0.527 0.528 0 1.056-0.165 1.511-0.499l7.159-5.267 7.161 5.268c0.896 0.659 2.168 0.645 3.051-0.028 0.884-0.671 1.245-1.836 0.901-2.9l-2.773-8.567 6.811-5.101c0.051-0.037 0.099-0.080 0.143-0.124 0.687-0.687 0.904-1.8 0.528-2.709zM21.976 18.448c-0.456 0.343-0.644 0.936-0.469 1.477l3.044 9.293-7.763-5.711c-0.235-0.173-0.513-0.259-0.791-0.259s-0.556 0.085-0.791 0.259l-7.713 5.676 2.997-9.257c0.175-0.541-0.013-1.136-0.469-1.477l-6.829-5.116h8.551c0.583 0 1.097-0.377 1.272-0.933l2.981-9.479 2.861 9.465c0.169 0.561 0.688 0.947 1.276 0.947h8.672z"></path>\n</svg>\n',qt='\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>shipping-fast</title>\n<path d="M10.667 14.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h8c0.736 0 1.333-0.596 1.333-1.333zM9.333 18.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM9.333 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM1.333 10.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.123 13.103l-3.147-3.935c-1.273-1.589-3.171-2.501-5.205-2.501h-1.437c0-2.205-1.795-4-4-4h-13.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v1.333c0 0.248 0.087 0.468 0.204 0.667-0.117 0.199-0.204 0.419-0.204 0.667v5.333c0 0.737 0.597 1.333 1.333 1.333h9.333v6.667h-1.333c-0.063 0-0.117 0.028-0.179 0.036-0.583-2.313-2.664-4.036-5.155-4.036-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c2.491 0 4.572-1.723 5.155-4.036 0.061 0.008 0.116 0.036 0.179 0.036h2.667c0.736 0 1.333-0.596 1.333-1.333v-8.399c0-0.905-0.311-1.792-0.877-2.499zM21.333 13.333v-4h1.437c1.221 0 2.36 0.547 3.124 1.501l1.997 2.499zM22.667 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n';const Nt=class{constructor(i){t(this,i),this.hasError=!1,this.showContactWidget=!0,this.images=[],this.productImages={},this.editItemImages=[],this.contact_body=(t,i,e)=>salla.lang.get("pages.rating.contact_subject",{store:t,id:i,customer:e}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.allowContactSupport=salla.config.get("store.settings.rating.allow_contact_support"),this.contentRefs=[],this.hiddenInputs=[],this.isOpen=[],this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.MAX_UPLOAD_LIMIT=3,this.onOpen=t=>new Promise((i=>{r({targets:this.contentRefs[t],duration:100,height:this.contentRefs[t].scrollHeight,opacity:[0,1],easing:"easeOutQuart",complete:()=>i()})})),this.onClose=t=>new Promise((i=>{r({targets:this.contentRefs[t],duration:100,height:0,opacity:[1,0],easing:"easeOutQuart",complete:()=>i()})})),this.toggleUploader=async t=>{this.isOpen[t]=!this.isOpen[t],p.toggleElementClassIf(this.contentRefs[t],"is-closed","is-opened",(()=>!this.isOpen[t])),await(this.isOpen[t]?this.onOpen(t):this.onClose(t)),await new Promise((t=>setTimeout(t,101))),this.body&&this.currentTab&&setTimeout((()=>this.body.setAttribute("style",`height:${this.currentTab.offsetHeight+(this.editMode?60:0)}px`)))},salla.onReady((()=>{this.orderId=salla.config.get("page.id")})),salla.lang.onLoaded((()=>{this.contactUsLabel=salla.lang.get("blocks.footer.social");const t=(t,i,e)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],i,e),s(!0)}));(async()=>{await t("ar.trans","common.uploader.drag_and_drop_files","اسحب الملفات وأفلتها هنا"),await t("en.trans","common.uploader.drag_and_drop_files","Drag and drop files here"),await t("ar.trans","common.uploader.allowed_images_types"," .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة"),await t("en.trans","common.uploader.allowed_images_types","Images in jpg, jpeg, or png format are allowed."),await t("ar.trans","pages.rating.add_images","اضافة صور"),await t("en.trans","pages.rating.add_images","Add Images"),await t("ar.trans","pages.rating.edit_images","تعديل الصور"),await t("en.trans","pages.rating.edit_images","Edit Images"),await t("ar.trans","pages.rating.edit_review","تعديل التقييم"),await t("en.trans","pages.rating.edit_review","Edit review"),await t("ar.trans","pages.rating.confirm_deletion","تأكيد حذف التقييم"),await t("en.trans","pages.rating.confirm_deletion","Confirm review deletion"),await t("ar.trans","pages.rating.are_you_sure_you_want_to_delete_review","هل أنت متأكد من حذف تقييمك؟"),await t("en.trans","pages.rating.are_you_sure_you_want_to_delete_review","Are you sure you want to delete your review?"),await t("ar.trans","pages.rating.review_updated_successfully","تم تعديل التقييم بنجاح"),await t("en.trans","pages.rating.review_updated_successfully","The review has been successfully updated."),await t("ar.trans","pages.rating.review_deleted_successfully","تم حذف التقييم بنجاح"),await t("en.trans","pages.rating.review_deleted_successfully","The review has been successfully deleted."),await t("ar.trans","pages.rating.images_count","الصور ( :current من أصل :total )"),await t("en.trans","pages.rating.images_count","Images ( :current of :total )"),await t("ar.trans","common.uploader.max_three_images",`.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`),await t("en.trans","common.uploader.max_three_images",`Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`),await t("ar.trans","common.elements.confirm_delete","تأكيد الحذف"),await t("en.trans","common.elements.confirm_delete","Confirm deletion"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.contact_body=(t,i,e)=>salla.lang.get("pages.rating.contact_body",{store:t,id:i,customer:e})})()}))}async open(){return this.defaultMode=!0,new Promise((t=>{setTimeout((()=>{this.modal.open().then((()=>this.order||salla.api.withoutNotifier((()=>salla.rating.api.order(this.orderId?this.orderId:salla.config.get("page.id")))).then((t=>this.order=t.data)))).then((()=>this.modal.setTitle(`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order.id})</span>`))).then((()=>{const t={};if(this.order?.products)for(const i of this.order.products)t[i.product.id]=[];this.productImages=t})).then((()=>this.modal.stopLoading())).then((()=>this.stepsCount=[this.order.testimonials_enabled,this.order.products_enabled,this.order.shipping_enabled].filter((t=>t)).length)).then((()=>setTimeout((()=>this.handleWizard()),100))).catch((i=>{t(!1),this.hasError=!0,this.errorMessage=i.response?.data?.error?.message||i.response?.data,this.modal.stopLoading()})),t(!0)}),50)}))}async openEditModal(t){this.defaultMode=!1,this.editMode=!0,this.editType=t.type,this.editFeedbackId=t.feedback_id;try{await this.fetchEditItem(t.feedback_id),this.editModal.open()}catch(t){this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data}}async fetchEditItem(t){const i=`rating/${t}/show`,e=await salla.api.request(i);this.editItem=e.data,this.allowAttachImages&&"product"==this.editType&&this.editItem.images.length&&(this.editItemImages=this.editItem.images.map((t=>({id:`${Math.floor(100+900*Math.random())}`,url:t}))))}async editReview(){const t={};this.editModal.querySelectorAll("[name]").forEach((i=>{const e=salla.helpers.inputData(i.name,i.value,t);t[e.name]=e.value})),t.images&&(t.images=t.images.split(","));const i=`rating/${this.editFeedbackId}`;await salla.api.request(i,t,"put").then((t=>{this.editModal.close(),salla.notify.success(t.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(t){return this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=t.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((t=>{setTimeout((()=>{this.deleteModal.open().then((()=>t(!0)))}),50)}))}async deleteReview(){const t=`rating/${this.deleteFeedbackId}`;await salla.api.request(t,null,"delete").then((()=>{this.deleteModal.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.modal.close()}handleWizard(){this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"),this.showActiveStep()}showActiveStep(t=null){this.currentTab=t||this.steps[this.currentIndex],p.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(t=>t!=this.dots[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(t=>t==this.currentTab)),0!==this.currentIndex&&(p.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>p.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const i=this.steps[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(i?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${i}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.body?.setAttribute("style",`height:${this.currentTab?.offsetHeight}px`)))}previousTab(){this.currentIndex>0&&this.currentIndex--,p.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}submit(){this.submittedBefore()||this.validate(),salla.config.canLeave=!1,this.nextBtn.load().then((()=>this.submittedBefore()||this.sendFeedback())).then((()=>this.currentTab.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((t=>t.setAttribute("disabled",""))))).then((()=>this.currentIndex<this.stepsCount&&this.currentIndex++)).then((()=>this.showActiveStep())).then((()=>p.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)))).finally((()=>{this.nextBtn.stop(),salla.config.canLeave=!0,this.currentIndex==this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}))}submittedBefore(){return this.submitted.includes(this.currentIndex)}validate(t=null,i=null){if(!t&&"products"===this.currentTab.dataset.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));const e=(t=t||this.currentTab).querySelector(".rating_hidden_input").value,s=t.querySelector(".s-rating-modal-validation-msg");if(i=i||t.dataset.type,!e)throw s.innerHTML=salla.lang.get(`pages.rating.rate_${i}_stars`).replace(" (:item)",""),new Error(s.innerHTML);s.innerHTML=""}sendFeedback(){const t={};if(this.currentTab.querySelectorAll("[name]").forEach((i=>{const e=salla.helpers.inputData(i.name,i.value,t);t[e.name]=e.value})),this.allowAttachImages&&t.products)for(let i in t.products)t.products[i].images&&(t.products[i].images=t.products[i].images.split(","));if(0!=Object.keys(t).length)return t.order_id=this.orderId,t.type=this.currentTab.dataset.type,this.submitted.push(this.currentIndex),salla.rating.api[this.currentTab.dataset.type](t)}showThankYou(){let t=10,i=setInterval((()=>{this.thanksTime.innerHTML="00:0"+t--,t>0||(clearInterval(i),this.thanksTime.remove(),this.close().then((()=>window.location.reload())))}),1e3);this.modal.querySelector(".s-rating-modal-footer").classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${I}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}handleSendEmail(){const t=`${this.contactSubjectLabel} #${this.order.id}`,i=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),e=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(i)}`;window.open(e,"_blank")}handleSendWhatsApp(){const t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),i=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(t)}`;window.open(i,"_blank")}resetData(t){t.detail||(this.modal?.close(),this.editItem=null,this.editItemImages=[],this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.deleteFeedbackId=null,this.editFeedbackId=null,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1)}getDeleteModal(){return i("salla-modal",{ref:t=>this.deleteModal=t,width:"xs",onModalVisibilityChanged:t=>this.resetData(t)},i("div",{class:"s-rating-modal-delete-wrapper",ref:t=>this.body=t},i("h3",null,this.confirmDeletionLabel),i("p",null,this.areYouSureLabel),i("div",{class:"s-rating-modal-delete-actions"},i("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),i("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal.close()},this.cancelLabel))))}renderUploadedImagesCount(t){const e=this.editMode?this.editItemImages.length:(this.productImages[t]||[]).length;return i("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",e,{current:e,total:this.MAX_UPLOAD_LIMIT}))}getEditModal(){return i("salla-modal",{ref:t=>this.editModal=t,width:"md",onModalVisibilityChanged:t=>this.resetData(t)},i("div",{class:"s-rating-modal-edit-wrapper",ref:t=>this.body=t},"store"===this.editType&&this.editItem?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:t=>this.currentTab=t},i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),i("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),i("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:t=>this.currentTab=t},this.editItem.shipping.logo?i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):i("span",{class:"s-rating-modal-icon",innerHTML:qt}),i("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),i("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?i("section",{class:"s-rating-modal-step","data-type":"products",ref:t=>this.currentTab=t},i("div",{class:"s-rating-modal-product"},i("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},i("div",{class:"s-rating-modal-product-img-wrap"},i("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),i("div",{class:"s-rating-modal-product-details"},i("div",{class:"s-rating-modal-product-details-main"},i("div",null,i("h3",{class:"s-rating-modal-product-title"}," ",this.editItem.product.name),i("div",{class:"s-rating-modal-stars-product"},i("salla-rating-stars",{withLabel:!0,size:"small",editable:!0,value:this.editItem.stars}))),this.allowAttachImages&&i("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(1)},i("span",null,this.editItemImages.length?this.editImagesLabel:this.addImagesLabel),i("span",{innerHTML:I}))),i("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"content",class:"s-rating-modal-comment"}),i("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&i("div",{class:"s-rating-modal-uploader is-closed",ref:t=>this.contentRefs[1]=t},i("salla-file-upload",{name:"images",allowMultiple:!0,maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,filePosterHeight:117,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:t=>{this.editItemImages=[...this.editItemImages,t.detail],this.hiddenInputs[1].value=this.editItemImages.map((t=>t.url)).join()},onRemoved:t=>{const i=t.detail;i&&(this.editItemImages=this.editItemImages.filter((t=>t.id!==i)),this.hiddenInputs[1].value=this.editItemImages.map((t=>t.url)).join())},labelIdle:this.getFilepondPlaceholder()}),i("input",{type:"hidden",name:"images",value:this.editItem.images.join(","),ref:t=>this.hiddenInputs[1]=t}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,i("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},i("salla-button",{"loader-position":"center",onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.deleteMode?i(e,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?i(e,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?i(e,{class:"s-rating-modal"},i("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:t=>this.resetData(t),isLoading:!0,width:"md",ref:t=>this.modal=t},i("div",{slot:"loading"},i("div",{class:"s-rating-modal-skeleton"},i("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),i("salla-skeleton",{height:"15px",width:"60%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((t=>i("div",{key:t,innerHTML:jt})))),i("salla-skeleton",{height:"100px",width:"100%"}),i("div",{class:"s-rating-modal-skeleton-footer"},i("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[i("div",{class:"s-rating-modal-wrapper",ref:t=>this.body=t},this.order?.testimonials_enabled?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),i("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large"})),i("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):"",this.order.products_enabled?i("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products"},this.order.products.map(((t,e)=>i("div",{class:"s-rating-modal-product",key:e},i("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},i("div",{class:"s-rating-modal-product-img-wrap"},i("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),i("div",{class:"s-rating-modal-product-details"},i("div",{class:"s-rating-modal-product-details-main"},i("div",null,i("h3",{class:"s-rating-modal-product-title"}," ",t.product.name),i("div",{class:"s-rating-modal-stars-product"},i("salla-rating-stars",{withLabel:!0,size:"small",name:`products[${e}][rating]`}))),this.allowAttachImages&&i("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(e)},i("span",null,this.addImagesLabel),i("span",{innerHTML:I}))),i("input",{type:"hidden",name:`products[${e}][product_id]`,value:t.product.id}),i("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:`products[${e}][comment]`,class:"s-rating-modal-comment"}),i("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&i("div",{class:"s-rating-modal-uploader is-closed",ref:t=>this.contentRefs[e]=t},i("salla-file-upload",{name:"image",maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${t.product.id}`,title:t.product.name,allowMultiple:!0,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:i=>{this.productImages={...this.productImages,[t.product.id]:[...this.productImages[t.product.id]||[],i.detail]},this.hiddenInputs[e].value=this.productImages[t.product.id].map((t=>t.url)).join(",")},onRemoved:i=>{const s=i.detail;s&&this.productImages[t.product.id]&&(this.productImages={...this.productImages,[t.product.id]:this.productImages[t.product.id].filter((t=>t.id!==s))},this.hiddenInputs[e].value=this.productImages[t.product.id].map((t=>t.url)).join(","))},labelIdle:this.getFilepondPlaceholder()}),i("input",{type:"hidden",name:`products[${e}][images]`,value:(this.productImages[t.product.id]||[]).map((t=>t.url)).join(","),ref:t=>this.hiddenInputs[e]=t}),this.renderUploadedImagesCount(t.product.id)))))):"",this.order.shipping_enabled&&this.order.shipping?.company?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},i("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):i("span",{class:"s-rating-modal-icon",innerHTML:qt}),i("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{withLabel:!0,size:"large"})),i("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):"",i("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>this.thanksTab=t},i("span",{class:"s-rating-modal-icon",innerHTML:K}),i("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),i("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),i("time",{class:"s-rating-modal-thanks-time",ref:t=>this.thanksTime=t}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?i("div",{class:"s-rating-modal-contact"},i("p",null,this.contactUsLabel),i("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&i("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:w}),salla.config.get("store.contacts.email")&&i("span",{onClick:()=>this.handleSendEmail(),innerHTML:b}))):"",i("div",{class:"s-rating-modal-footer"},i("button",{ref:t=>this.backBtn=t,onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?i("ul",{class:"s-rating-modal-dots"},[0,1,2].slice(0,this.stepsCount).map((t=>i("li",{key:t,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",i("salla-button",{"loader-position":"center",ref:t=>this.nextBtn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:i("salla-placeholder",{alignment:"center"}))):void 0}componentWillLoad(){salla.event.on("rating::open",(()=>this.open())),salla.event.on("rating::edit",(t=>this.openEditModal(t))),salla.event.on("rating::delete",(t=>this.openDeleteModal(t)))}componentDidLoad(){salla.event.dispatch("rating::ready",this)}get host(){return s(this)}};Nt.style="";const Gt=class{constructor(i){t(this,i),this.translationsLoaded=!1,this.labels=[],this.reviewLabel="",this.selectedStar=0,this.name="rating",this.size="medium",this.reviews=0,this.editable=!1}async componentWillLoad(){await new Promise((t=>{salla.lang.onLoaded((()=>{this.labels=[salla.lang.get("pages.rating.poor"),salla.lang.get("pages.rating.average"),salla.lang.get("pages.rating.good"),salla.lang.get("pages.rating.very_good"),salla.lang.get("pages.rating.excellent")],this.value&&this.withLabel&&(this.reviewLabel=this.labels[this.value-1]),this.reviewsElement&&(this.reviewsElement.innerText=`(${salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews))})`),this.translationsLoaded=!0,t()}))}))}initiateRating(){this.host.addEventListener("click",this.handleRating.bind(this))}handleRating(){if(!this.starsElem)return;let t=this.starsElem.querySelectorAll(".s-rating-stars-hovered"),i=t[t.length-1];if(!i)return;let e=parseInt(i.getAttribute("data-star"));this.starsElem.querySelector(".rating_hidden_input").value=e.toString(),this.starsElem.querySelectorAll(".s-rating-stars-btn-star").forEach(((t,i)=>p.toggleElementClassIf(t,"s-rating-stars-selected","s-rating-stars-unselected",(()=>i<e)))),this.starsElem.querySelectorAll("[aria-pressed]").forEach((t=>t.removeAttribute("aria-pressed"))),i.setAttribute("aria-pressed","true"),this.selectedStar=e,this.withLabel&&(this.reviewLabel=this.labels[e-1])}triggerRatingProgrammatically(t){if(!this.starsElem)return;const i=this.starsElem.querySelectorAll(".s-rating-stars-btn-star");i&&t>=0&&t<=i.length&&(i.forEach(((i,e)=>{i.classList.toggle("s-rating-stars-hovered",e<=t)})),this.handleRating())}highlightSelectedStars(){let t="s-rating-stars-hovered",i=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");i?.forEach(((e,s)=>{e.addEventListener("mouseover",(()=>{for(let e=0;e<=s;e++)i[e].classList.add(t);this.withLabel&&(this.reviewLabel=this.labels[s])})),e.addEventListener("mouseout",(()=>{e.classList.remove(t),this.withLabel&&(this.reviewLabel=this.selectedStar?this.labels[this.selectedStar-1]:"")}))})),this.starsElem?.addEventListener("mouseout",(()=>i.forEach((i=>i.classList.remove(t)))))}createStars(t){let e=[];for(let s=0;s<5;s++)e.push(i("span",{class:{"s-rating-stars-btn-star":!0,["s-rating-stars-"+this.size]:!0,"s-rating-stars-selected":s<t},innerHTML:ct}));return this.reviews>0&&e.push(i("span",{class:"s-rating-stars-reviews",ref:t=>this.reviewsElement=t},"(",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews)),")")),e}render(){return this.translationsLoaded?this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":i(e,null,i("div",{class:"s-rating-stars-wrapper"},!this.value&&0!=this.value||this.editable?i("div",{class:"s-rating-stars-element",ref:t=>this.starsElem=t},i("input",{type:"hidden",class:"rating_hidden_input",name:this.name,value:""}),[1,2,3,4,5].map((t=>i("button",{class:"s-rating-stars-btn-star s-rating-stars-"+this.size,"data-star":t},i("span",{innerHTML:ct}))))):this.createStars(this.value),this.withLabel&&this.reviewLabel?i("span",{class:"s-rating-stars-label"},this.reviewLabel):"")):i(e,null)}componentDidLoad(){if(this.initiateRating(),this.highlightSelectedStars(),this.value&&this.editable){const t=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");t&&this.value>=0&&this.value<=t.length&&this.triggerRatingProgrammatically(this.value-1)}}get host(){return s(this)}};Gt.style="";const Ut=class{constructor(i){t(this,i),this.canRender=!1,this.showRatingSummary=!1,this.recommendationOnly=!1,this.showRecommendation=!1}async componentWillLoad(){try{await salla.onReady(),this.initializeLanguages(),this.loadConfig(),(this.showRatingSummary||this.showRecommendation)&&await this.loadSummary()}catch(t){console.error("Failed to initialize reviews summary component:",t)}}async loadConfig(){this.showRatingSummary=salla.config.get("store.settings.rating.show_rating_summary"),this.showRecommendation=salla.config.get("store.settings.rating.show_recommendation"),this.recommendationOnly=this.showRecommendation&&!this.showRatingSummary}initializeLanguages(){return Salla.lang.onLoaded((()=>{Salla.lang.addBulk({"blocks.comments.based_on":{ar:"بناءً على",en:"Based on"},"blocks.comments.recommended":{ar:"أوصوا بالمنتج",en:"Recommended"}}),this.basedOnLabel=salla.lang.get("blocks.comments.based_on"),this.recommendedLabel=salla.lang.get("blocks.comments.recommended")}))}async loadSummary(){if(!this.itemId)return console.error("Error loading reviews summary: itemId is not defined"),this.canRender=!1;try{const t=await salla.api.request(`rating/summary/${this.itemId}`);if(!t?.data||Array.isArray(t.data.reviews)&&!t.data.reviews.length)return this.canRender=!1,void(this.data=null);this.data=t.data,this.canRender=!0}catch(t){this.canRender=!1,this.data=null,console.error("Error loading reviews summary:",t)}}renderRecommendation(){return this.showRecommendation&&this.data?.recommendation?i("div",{class:("s-reviews-summary-header-section "+(this.recommendationOnly?"s-reviews-summary-recommendation-only":"")).trim()},i("h4",{class:"s-reviews-summary-recommendation-percentage"},"%",this.data?.recommendation),i("p",{class:"s-reviews-summary-count"},this.recommendedLabel)):null}render(){if(!this.canRender)return null;if(this.recommendationOnly)return this.renderRecommendation();const t={1:0,2:0,3:0,4:0,5:0,...this.data.reviews},s=Object.keys(t).reverse().map((e=>{const s=t[e];return i("div",{key:e,class:"s-reviews-summary-row"},i("div",{class:"s-reviews-summary-row-rate"},e," ",i("span",{innerHTML:ct})),i("salla-progress-bar",{class:"s-reviews-summary-progress",value:s,target:100,hideUnits:!0,height:"16px"}),i("span",{class:"s-reviews-summary-percentage"},s,"%"))}));return i(e,{class:"s-reviews-summary-wrapper"},i("div",{class:"s-reviews-summary-header"},i("div",{class:"s-reviews-summary-header-section"},i("h3",{class:"s-reviews-summary-average"},this.data.rating),i("div",null,i("salla-rating-stars",{size:"large",value:this.data.rating}),i("p",{class:"s-reviews-summary-count"},this.basedOnLabel," ",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.data.count))))),this.renderRecommendation()),i("div",{class:"s-reviews-summary-rows"},s))}};Ut.style=":host{display:block}";var Wt,Yt='\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>search</title>\n<path d="M30.276 28.391l-7.576-7.576c1.644-2.053 2.633-4.652 2.633-7.481 0-6.616-5.384-12-12-12s-12 5.384-12 12 5.384 12 12 12c2.829 0 5.428-0.989 7.481-2.633l7.576 7.576c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM13.333 22.667c-5.147 0-9.333-4.187-9.333-9.333s4.187-9.333 9.333-9.333 9.333 4.187 9.333 9.333-4.187 9.333-9.333 9.333z"></path>\n</svg>\n';!function(t){t.DEFAULT="default",t.AVAILABILITY="availability"}(Wt||(Wt={}));const Vt=class{constructor(i){t(this,i),this.loadedScopes={[Wt.DEFAULT]:null,[Wt.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=Wt.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{if(this.originalScopesList?.length<2)return"";const t=salla.config.get("store.features")?.includes("multi-countries");return this.mode===Wt.DEFAULT?salla.lang.get(t?"blocks.scope.shopping_from_another_market":"blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:t=null,product_id:i=null})=>{this.open(t,i)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}async close(){return await(this.modal?.close())}async open(t=Wt.DEFAULT,i=null){return this.hasError=!1,this.mode=[Wt.AVAILABILITY,Wt.DEFAULT].includes(t)?t:Wt.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>t==Wt.AVAILABILITY?salla.scope.getProductAvailability(i):salla.scope.get())).then((i=>{if(t==Wt.AVAILABILITY)return this.setScopeValues(this.loadedScopes[Wt.AVAILABILITY]=i.data);this.setScopeValues(this.loadedScopes[this.mode]=i.data.scopes)})).catch((t=>{console.log(t),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading())}async handleSubmit(){let t={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(t).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),salla.cart.reset(),window.location.replace(salla.helpers.addParamToUrl("scope",this.current_scope.id))})).catch((t=>console.log(t))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(t){this.scopes=t,this.originalScopesList=t,1==t?.length?(this.current_scope=t[0],this.selected_scope=t[0],this.scopes=[t[0]]):(this.current_scope=t?.find((t=>t.selected)),this.selected_scope=t?.find((t=>t.selected)))}handleSearchFieldTyping(t){let i=t.target.value.toLocaleLowerCase();this.scopes=i?this.originalScopesList.filter((t=>t.name.toLowerCase().includes(i))):this.originalScopesList}handleScopeSelection(t){this.current_scope=this.scopes?.find((i=>i.id==t.target.value))}placeholderContent(){return i("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},i("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),i("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[i("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((t=>i("div",{class:"s-scopes-input-wrap","data-selection":this.selection},i("input",{id:`${this.selection} + '_scope_' + ${t.id}`,name:"lang",type:"radio",value:t.id,onChange:t=>this.handleScopeSelection(t),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==t.id}),i("label",{htmlFor:`${this.selection} + '_scope_' + ${t.id}`,class:"s-scopes-label s-scopes-clickable"},i("span",null,t.name)))))),this.footerContent()]}availabilityContent(){return i("div",{class:"s-scopes-container"},this.scopes?.map((t=>i("div",{class:"s-scopes-input-wrap","data-selection":this.selection},i("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===Wt.DEFAULT}},i("span",null,t.name)),i("h2",{style:{color:t?.availability?.color},class:`s-scopes-${t?.availability?.key}`},t?.availability?.label)))))}footerContent(){return i("div",{class:"s-scopes-footer"},i("slot",{name:"footer"},i("salla-button",{ref:t=>this.changeBtn=t,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}componentWillLoad(){return salla.onReady()}render(){return i(e,{key:"eb070775cb835b58f2ca5d38d1b47c0e4c1efa8b"},i("salla-modal",{key:"a9ef86c5a4bc3db4353047163ce1cb794ca84345",ref:t=>this.modal=t,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?i("div",{slot:"loading"},i("div",{class:"s-scopes-skeleton"},i("salla-list-tile",{class:"s-scopes-header"},i("div",{slot:"icon",class:"s-scopes-header-icon"},i("salla-skeleton",{type:"circle"})),i("div",{slot:"title",class:"s-scopes-header-title mb-5"},i("salla-skeleton",{height:"15px",width:"50%"})),i("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},i("salla-skeleton",{height:"10px"}),i("salla-skeleton",{height:"10px",width:"75%"}))),i("div",{class:"s-scopes-skeleton-search"},i("salla-skeleton",{height:"10px",width:"50%"}),i("salla-skeleton",{height:"30px",width:"100%"})),i("div",{class:"s-scopes-skeleton-scopes"},i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"})),i("div",{class:"s-scopes-skeleton-btn"},i("salla-skeleton",{height:"40px",width:"100%"})))):[i("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},i("div",{slot:"icon",class:"s-scopes-header-icon",innerHTML:'\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>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),i("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),i("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),i("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&i("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?i("div",{class:"s-scopes-search-wrapper"},i("div",{class:"s-scopes-search-icon",innerHTML:Yt}),i("input",{type:"text",class:"s-scopes-search-input",onInput:t=>this.handleSearchFieldTyping(t),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||!this.originalScopesList?.length&&this.mode!==Wt.AVAILABILITY?this.placeholderContent():this.mode===Wt.DEFAULT?this.defaultContent():this.availabilityContent())]))}componentDidLoad(){this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};Vt.style=".s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}";const Zt=class{constructor(i){t(this,i),this.inputValue="",this.translationLoaded=!1,this.loading=!1,this.typing=!1,this.debounce=setTimeout((()=>""),1e3),this.inline=!1,this.oval=!1,this.height=60,this.maxWords=5,this.showAction=!1,this.productSlot=this.host.querySelector('[slot="product"]')?.innerHTML||this.getDefaultProductSlot(),salla.event.on("search::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),salla.event.on("modalClosed",(()=>this.onModalClose()))}async open(){this.inline||await this.modal.open().then((()=>setTimeout((()=>this.searchInput.focus()),300)))}onModalClose(){this.searchInput.value="",this.results=void 0,this.afterSearching(),this.container.classList.remove("s-search-no-results")}handleKeyDown(t){"Enter"===t.key&&this.search_term?.length&&(window.location.href=salla.url.get("search?q="+encodeURI(this.search_term)))}getDefaultProductSlot(){return'<div class="s-search-product-image-container"> <img class="s-search-product-image" src="{image}" alt="{name}"/></div><div class="s-search-product-details"> <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div></div>'}debounceSearch(t){this.typing=!0,clearTimeout(this.debounce),this.debounce=setTimeout((()=>{this.typing=!1,this.search_term=t.target.value}),700)}limitWordsAndSearch(t){const i=t.target.value.trim().split(/\s+/);if(i.length>this.maxWords){const t=i.slice(0,this.maxWords).join(" ");this.searchInput.value=t}this.debounceSearch(t)}getQueryParam(t){return new URLSearchParams(window.location.search).get(t)}handleActionClick(){if(this.search_term&&this.search_term.length>2)return this.search(this.search_term)}handleSearch(t){this.inputValue=t,t.length>2?this.search(t):(this.results=void 0,this.afterSearching())}search(t){this.noResults.style.display="none",this.loading=!0,salla.product.fetch({source:"search",source_value:t}).then((i=>{this.results=i,salla.event.emit("Products Searched",t)})).catch((t=>"Query is same as previous one!"!==t?this.results=void 0:null)).finally((()=>this.afterSearching(!1)))}afterSearching(t=!0){this.noResults.style.display=t||this.results?.data.length>0?"none":"block",p.toggleElementClassIf(this.container,"s-search-container-open","s-search-no-results",(()=>this.results?.data.length)),this.loading=!1,salla.product.api.previousQuery="",this.inputValue.length<3&&this.container.classList.remove("s-search-no-results")}render(){const t=i("div",{key:"64b8dccb734fee6d08cec74f87d7fb8486f0da00",class:{"s-search-container":!0,"s-search-inline":this.inline},ref:t=>this.container=t},i("div",{key:"aef0ccb76aebff05b167dfe05a95ae19daa383ec",class:"s-search-input-wrapper"},i("span",{key:"ac7cb6699f2c6b09fb9da9e57cfe8e724c29e358",class:"s-search-icon-wrap"},i("span",{key:"68f7207dafca4f6a337c2629338f84f29ccec3ef",class:"s-search-icon",innerHTML:this.loading?'<i class="s-search-spinner-loader"/>':Yt})),i("input",{key:"e182fff8d2f4d98cea7fd0a4c22b5fab5cff7dd2",type:"search",enterkeyhint:"search",autocomplete:"off",class:"s-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder"),onInput:t=>this.limitWordsAndSearch(t),onKeyDown:t=>this.handleKeyDown(t),ref:t=>this.searchInput=t,style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}),this.showAction?i("salla-button",{loading:this.loading,class:{"s-search-action":!0,"s-search-action-oval":this.oval},onClick:()=>this.handleActionClick()},!this.loading&&i("span",{innerHTML:Yt})):null),i("div",{key:"a72889d16dc8949b3a42375f4377cda74f8de01a",class:"s-search-results"},this.results?.data.map((t=>i("a",{href:t.url+"?from=search-bar",class:{"s-search-product":!0,"s-search-product-not-available":!t.is_available},innerHTML:this.productSlot.replace(/\{name\}/g,t.name).replace(/\{price\}/g,t.price?salla.money(t.price):"").replace(/\{regular_price\}/g,t.is_on_sale&&t.regular_price?salla.money(t.regular_price):"").replace(/\{image\}/g,t.image.url)}))),i("p",{key:"63ae4b78f510b2a013813a544b240ac0cc7a8c69",ref:t=>this.noResults=t,class:"s-search-no-results-placeholder"},salla.lang.get("common.elements.no_options"))));return this.inline?i("div",{class:"s-search-modal"},t):i("salla-modal",{position:"top",class:"s-search-modal",ref:t=>this.modal=t},t)}componentDidLoad(){this.afterSearching(),this.searchInput.value=this.getQueryParam("q")}get host(){return s(this)}static get watchers(){return{search_term:["handleSearch"]}}};Zt.style="";const Jt=class{constructor(i){t(this,i),this.type="normal",this.width="100%",this.height="100%"}render(){return i(e,{key:"64e0a58754b26fcca6cbc93d636c1c4d4f895a53",class:"s-skeleton-wrapper",style:{width:this.width,height:this.height}},i("div",{key:"1e19620023d4dfc07d343e47bd2a0126db3f034a",class:{"s-skeleton-item":!0,"s-skeleton-item-circular":"circle"==this.type}}," "))}};Jt.style=":host{display:block}";const Qt=class{constructor(i){t(this,i),this.afterInit=a(this,"afterInit"),this.slideChange=a(this,"slideChange"),this.reachBeginning=a(this,"reachBeginning"),this.reachEnd=a(this,"reachEnd"),this.slideChangeTransitionEnd=a(this,"slideChangeTransitionEnd"),this.slideChangeTransitionStart=a(this,"slideChangeTransitionStart"),this.slideNextTransitionEnd=a(this,"slideNextTransitionEnd"),this.slideNextTransitionStart=a(this,"slideNextTransitionStart"),this.slidePrevTransitionEnd=a(this,"slidePrevTransitionEnd"),this.slidePrevTransitionStart=a(this,"slidePrevTransitionStart"),this.sliderMove=a(this,"sliderMove"),this.touchSliderEnd=a(this,"touchSliderEnd"),this.touchSliderMove=a(this,"touchSliderMove"),this.touchSliderStart=a(this,"touchSliderStart"),this.sliderTransitionEnd=a(this,"sliderTransitionEnd"),this.sliderTransitionStart=a(this,"sliderTransitionStart"),this.blockTitle="",this.listenToThumbnailsOption=!1,this.blockSubtitle="",this.displayAllUrl="",this.arrowsCentered=!1,this.verticalThumbs=!1,this.gridThumbs=!1,this.vertical=!1,this.autoHeight=!1,this.showControls=!0,this.controlsOuter=!1,this.showThumbsControls=!0,this.autoPlay=!1,this.slidesPerView="auto",this.pagination=!1,this.centered=!1,this.loop=!1,this.type="",this.currentIndex=void 0,this.isEnd=!1,this.isBeginning=!0,this.windowWidth=window.innerWidth,this.hasThumbSlot=!1,this.pre_defined_config={carousel:{speed:300,slidesPerView:"auto",spaceBetween:0},fullwidth:{speed:750,parallax:!0},fullscreen:{speed:1e3,parallax:!0,direction:"vertical",followFinger:!1,touchReleaseOnEdges:!0,lazy:!0,mousewheel:{}},testimonials:{draggable:!0,slidesPerView:1,breakpoints:{1024:{slidesPerView:2}}},blog:{parallax:!0,speed:800,loop:!0,slidesPerView:1,centeredSlides:!0,spaceBetween:30,breakpoints:{320:{spaceBetween:10},768:{spaceBetween:15},980:{paceBetween:30}}},thumbs:{slidesPerView:1,spaceBetween:30}},this.direction=this.direction||document.documentElement.dir}async sliderInstance(){return this.slider}async slideTo(t,i,e){return this.slider.slideTo(t,i,e)}async slideNext(t,i){this.slider?.slideNext(t,i)}async slidePrev(t,i){this.slider?.slidePrev(t,i)}async slideToLoop(t,i,e){this.slider.slideToLoop(t,i,e)}async slideNextLoop(t,i){this.slider.slideNextLoop(t,i)}async slidePrevLoop(t,i){this.slider.slidePrevLoop(t,i)}async slideReset(t,i){this.slider.slideReset(t,i)}async slideToClosest(t,i){this.slider.slideToClosest(t,i)}async update(){this.slider.update()}async updateAutoHeight(t){this.slider.updateAutoHeight(t)}async updateSlides(){this.slider.updateSlides()}async updateProgress(){this.slider.updateProgress()}async updateSlidesClasses(){this.slider.updateSlidesClasses()}async getSlides(){return await(this.slider?.slides)}async updateSize(){return await this.slider.updateSize()}async sliderInit(){return await this.slider.init()}async thumbsSliderInstance(){return await this.thumbsSlider}async thumbsSliderInit(){return await this.thumbsSlider.init()}async thumbsSliderUpdate(){return await this.thumbsSlider.update()}async thumbsSliderUpdateSlides(){return await this.thumbsSlider.updateSlides()}async getThumbsUpdateSize(){return await(this.thumbsSlider?.updateSize())}async thumbsSlideTo(t,i,e){return this.thumbsSlider.slideTo(t,i,e)}async getThumbsSlides(){return await(this.thumbsSlider?.slides)}componentWillLoad(){return salla.lang.onLoaded((()=>{this.displayAllTitle=salla.lang.get("blocks.home.display_all")})),this.hasThumbSlot=!!this.host.querySelector('[slot="thumbs"]'),this.listenToThumbnailsOption&&salla.event.on("product-options::change",(t=>{if("thumbnail"==t.option.type){const i=this.sliderWrapper.querySelector(`[data-img-id="${t.detail.option_value}"]`)?.getAttribute("data-slid-index");i&&this.slideTo(parseInt(i),300,!1)}})),new Promise(((t,i)=>{if("undefined"!=typeof Swiper)return t(!0);if(document.getElementById("swiper-script")){let i=setInterval((()=>{"undefined"!=typeof Swiper&&(clearInterval(i),t(!0))}),5)}else this.swiperScript=document.createElement("script"),this.swiperScript.onload=()=>{t(!0),salla.event.emit("swiper::loaded")},this.swiperScript.onerror=t=>{salla.logger.warn("failed load swiper bundle",t),i(!0)},this.swiperScript.src="https://cdn.salla.network/js/swiper@8.js",this.swiperScript.setAttribute("id","swiper-script"),document.body.appendChild(this.swiperScript)}))}getSwiperConfig(){let t=this.autoPlay;t&&"object"!=typeof t&&(t={delay:1e4});let i={loop:this.loop,autoplay:t,centeredSlides:this.centered,slidesPerView:this.slidesPerView,autoHeight:this.autoHeight,lazy:!0,on:{afterInit:t=>{this.afterInit.emit(t),document.lazyLoadInstance?.update(),this.loop&&t.slides.map((t=>{t.classList.contains("swiper-slide-duplicate")&&t.querySelectorAll("img.lazy:not(.loaded)").forEach((t=>t.classList.add("loaded")))}))}},pagination:!!this.pagination&&{el:this.host.id?`#${this.host.id} .swiper-pagination`:"",clickable:!0},navigation:!!this.showControls&&{nextEl:this.host.id?`#${this.host.id} .s-slider-next`:"",prevEl:this.host.id?`#${this.host.id} .s-slider-prev`:""},breakpoints:{768:{direction:this.vertical?"vertical":"horizontal"}}},e={freeMode:!1,watchSlidesProgress:!0,slidesPerView:4,spaceBetween:10,watchOverflow:!0,watchSlidesVisibility:!0,breakpoints:{768:{direction:this.verticalThumbs?"vertical":"horizontal",spaceBetween:16}},navigation:!!this.showThumbsControls&&{nextEl:this.host.id?`#${this.host.id} .s-slider-thumbs-next`:"",prevEl:this.host.id?`#${this.host.id} .s-slider-thumbs-prev`:""}};if(this.pre_defined_config.fullscreen.mousewheel={releaseOnEdges:!(this.host.querySelectorAll(".swiper-slide").length>1)},i={...i,...this.pre_defined_config[this.type]||{}},"thumbs"==this.type&&this.thumbsSliderWrapper){for(const t of this.thumbsSliderWrapper.children)t.classList.add("swiper-slide");if(this.hasThumbSlot&&this.thumbsConfig)try{e={...e,..."string"==typeof this.thumbsConfig?JSON.parse(this.thumbsConfig):this.thumbsConfig}}catch(t){salla.logger.warn("Failed to parse thumbs slider config:",t)}this.thumbsSlider=new Swiper(this.thumbsSliderContainer,e),i.thumbs={swiper:this.thumbsSlider}}if(i={...i},this.sliderConfig)try{i={...i,..."string"==typeof this.sliderConfig?JSON.parse(this.sliderConfig):this.sliderConfig}}catch(t){salla.logger.warn("Failed to parse slider config:",t)}return i}getThumbsDirection(){const{verticalThumbs:t,windowWidth:i,direction:e}=this;return t&&i<768&&"rtl"===e?"rtl":t&&i>768&&"rtl"===e?"ltr":e}initSlider(){for(const t of this.sliderWrapper.children)t.classList.add("swiper-slide");this.slider=new Swiper(this.sliderContainer,this.getSwiperConfig()),this.slider.on("slideChange",(t=>{this.isBeginning=t.isBeginning,this.isEnd=t.isEnd,this.slideChange.emit(t)})),this.slider.on("reachBeginning",(t=>this.reachBeginning.emit(t))),this.slider.on("reachEnd",(t=>this.reachEnd.emit(t))),this.slider.on("slideChangeTransitionEnd",(t=>{if("fullscreen"==this.type){const i=t.activeIndex;t.params.mousewheel.releaseOnEdges=0===i||i===t.slides.length-1}this.slideChangeTransitionEnd.emit(t)})),this.slider.on("slideChangeTransitionStart",(t=>this.slideChangeTransitionStart.emit(t))),this.slider.on("slideNextTransitionEnd",(t=>this.slideNextTransitionEnd.emit(t))),this.slider.on("slideNextTransitionStart",(t=>this.slideNextTransitionStart.emit(t))),this.slider.on("slidePrevTransitionEnd",(t=>this.slidePrevTransitionEnd.emit(t))),this.slider.on("slidePrevTransitionStart",(t=>this.slidePrevTransitionStart.emit(t))),this.slider.on("sliderMove",(t=>this.sliderMove.emit(t))),this.slider.on("touchEnd",(t=>this.touchSliderEnd.emit(t))),this.slider.on("touchMove",(t=>this.touchSliderMove.emit(t))),this.slider.on("touchStart",(t=>this.touchSliderStart.emit(t))),this.slider.on("transitionEnd",(t=>this.sliderTransitionEnd.emit(t))),this.slider.on("transitionStart",(t=>this.sliderTransitionStart.emit(t)))}render(){let t=this.type?this.type+"-slider ":"";return t+=this.controlsOuter?" s-slider-controls-outer ":"",t+=""==this.blockTitle?" s-slider-has-notitle s-slider-v-centered ":"",t+=this.verticalThumbs?" s-slider-vertical ":" s-slider-horizontal ",t+=this.arrowsCentered?" s-slider-v-centered ":"",t+=this.gridThumbs?" s-slider-with-grid-thumbs ":"",i(e,{key:"f252a63bd425f788d31328179372fa365385a85c",class:"s-slider-wrapper "+t},this.blockTitle||this.showControls?i("div",{class:"s-slider-block__title"},this.blockTitle?i("div",{class:"s-slider-block__title-right"},i("h2",null,this.blockTitle),this.blockSubtitle?i("p",{innerHTML:this.blockSubtitle}):""):"",i("div",{class:"s-slider-block__title-left"},this.displayAllUrl?i("a",{href:this.displayAllUrl,class:"s-slider-block__display-all"},this.displayAllTitle):"",this.showControls?i("div",{class:"s-slider-block__title-nav",dir:"rtl"},i("button",{"aria-label":"Previous Slide",class:"s-slider-prev s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?B:D})),i("button",{"aria-label":"Next Slide",class:"s-slider-next s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?D:B}))):"")):"",i("div",{key:"e84fedf7c982d9c15a2b43631123ae42ecf98ab8",class:"swiper s-slider-container",ref:t=>this.sliderContainer=t,dir:this.vertical?"ltr":this.direction},i("slot",{key:"b91356832a6d5e19134073400f19046c3372b403"}),i("div",{key:"21d21f8ec73eb27016a199272e4193456e2e3823",class:"swiper-wrapper s-slider-swiper-wrapper",ref:t=>this.sliderWrapper=t},i("slot",{key:"e18cdeba693a383a75523836c761f33bbc5e115e",name:"items"})),this.pagination?i("div",{class:"swiper-pagination"}):""),"thumbs"==this.type&&this.hasThumbSlot?i("div",{class:"s-slider-thumbs"},i("div",{class:"swiper s-slider-thumbs-container",dir:this.getThumbsDirection(),ref:t=>this.thumbsSliderContainer=t},i("div",{class:{"s-slider-swiper-wrapper swiper-wrapper":!0,"s-slider-grid-thumbs":this.gridThumbs},ref:t=>this.thumbsSliderWrapper=t},i("slot",{name:"thumbs"})),this.showThumbsControls?i("div",{class:"s-slider-thumbs-nav",dir:"rtl"},i("button",{"aria-label":"Previous Slide",class:"s-slider-thumbs-prev s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?B:D})),i("button",{"aria-label":"Next Slide",class:"s-slider-thumbs-next s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?D:B}))):null)):null)}componentDidLoad(){let t=this.sliderWrapper.querySelector('div[slot="items"]');if(t&&t.replaceWith(...t.children),"thumbs"==this.type&&this.hasThumbSlot){let t=this.thumbsSliderWrapper.querySelector('div[slot="thumbs"]');t&&t.replaceWith(...t.children)}"undefined"==typeof Swiper?salla.event.once("swiper::loaded",(()=>this.initSlider())):this.initSlider()}get host(){return s(this)}};var Xt;Qt.style='@font-face{font-family:"swiper-icons";src:url("data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA") format("woff");font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{transform:translate3d(0px, 0, 0)}.swiper-pointer-events{touch-action:pan-y}.swiper-pointer-events.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform, height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);backface-visibility:hidden}.swiper-3d,.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0, 0, 0, 0.15)}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:"";flex-shrink:0;order:9999}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;height:var(--swiper-centered-offset-after)}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}:root{}.swiper-pagination{position:absolute;text-align:center;transition:300ms opacity;transform:translate3d(0, 0, 0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none !important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(0.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:50%;background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, 0.2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none !important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:10px;top:50%;transform:translate3d(0px, -50%, 0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:200ms transform, 200ms top}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:200ms transform, 200ms left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:200ms transform, 200ms right}.swiper-pagination-progressbar{background:rgba(0, 0, 0, 0.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:4px;height:100%;left:0;top:0}.swiper-pagination-lock{display:none}:root{--swiper-navigation-size:44px;}.swiper-button-prev,.swiper-button-next{position:absolute;top:50%;width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - var(--swiper-navigation-size) / 2);z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:0.35;cursor:auto;pointer-events:none}.swiper-button-prev.swiper-button-hidden,.swiper-button-next.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-prev,.swiper-navigation-disabled .swiper-button-next{display:none !important}.swiper-button-prev:after,.swiper-button-next:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none !important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:10px;right:auto}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:"prev"}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:10px;left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:"next"}.swiper-button-lock{display:none}',function(t){t.FACEBOOK="facebook",t.TWITTER="twitter",t.WHATSAPP="whatsapp",t.EMAIL="email",t.COPY_LINK="copy_link"}(Xt||(Xt={}));const Kt=class{constructor(i){t(this,i),this.opened=!1,this.allPlatforms=[Xt.WHATSAPP,Xt.FACEBOOK,Xt.TWITTER,Xt.EMAIL,Xt.COPY_LINK],this.platformIcons=[{icon:'\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>whatsapp</title>\n<path d="M16 32c-0.008 0-0.018 0-0.028 0-3.1 0-5.993-0.887-8.439-2.421l0.066 0.039-7.2 2.3 2.336-6.964c-1.713-2.492-2.736-5.575-2.736-8.897 0-0.020 0-0.040 0-0.060v0.003c0.009-8.833 7.167-15.991 15.999-16h0.001c8.837 0 16 7.163 16 16s-7.163 16-16 16v0zM7.906 27.424l0.4 0.264c2.169 1.449 4.837 2.312 7.707 2.312 7.732 0 14-6.268 14-14s-6.268-14-14-14c-0.004 0-0.009 0-0.013 0h0.001c-7.729 0.008-13.992 6.271-14 13.999v0.001c-0 0.010-0 0.021-0 0.032 0 3.072 1 5.909 2.693 8.206l-0.027-0.038 0.304 0.416-1.4 4.2zM20.716 24.958c-1.684-0.131-3.237-0.574-4.641-1.271l0.073 0.033c-3.098-1.456-5.634-3.668-7.438-6.405l-0.042-0.067c-1.102-1.357-1.819-3.067-1.962-4.938l-0.002-0.030c-0.001-0.036-0.001-0.078-0.001-0.12 0-1.575 0.66-2.995 1.719-4l0.002-0.002c0.547-0.52 1.289-0.839 2.105-0.839 0.033 0 0.066 0.001 0.099 0.002l-0.005-0c0.2 0 0.378 0 0.542 0.018 0.016-0.001 0.035-0.001 0.054-0.001 0.815 0 1.502 0.549 1.711 1.298l0.003 0.012 0.324 0.782c0.376 0.906 0.858 2.068 0.942 2.244 0.144 0.251 0.23 0.552 0.23 0.873 0 0.286-0.068 0.557-0.188 0.797l0.005-0.010c-0.149 0.307-0.332 0.57-0.55 0.802l0.002-0.002c-0.148 0.168-0.248 0.274-0.346 0.378s-0.172 0.18-0.26 0.284c0.575 0.92 1.237 1.713 1.992 2.406l0.008 0.008c0.829 0.758 1.802 1.373 2.872 1.8l0.064 0.022c0.369-0.266 0.672-0.6 0.896-0.985l0.008-0.015 0.174-0.232c0.328-0.484 0.875-0.798 1.495-0.798 0.249 0 0.487 0.051 0.703 0.142l-0.012-0.004c0.492 0.168 2.922 1.372 2.946 1.384l0.228 0.11c0.415 0.149 0.758 0.417 0.996 0.763l0.004 0.007c0.107 0.349 0.169 0.75 0.169 1.166 0 0.591-0.125 1.153-0.349 1.661l0.010-0.026c-0.702 1.368-1.983 2.353-3.511 2.637l-0.031 0.005c-0.309 0.071-0.663 0.112-1.028 0.112-0.004 0-0.007 0-0.011 0h0.001zM10.632 9.318c-0.028-0.002-0.062-0.004-0.095-0.004-0.245 0-0.472 0.076-0.659 0.206l0.004-0.002c-0.726 0.651-1.18 1.591-1.18 2.638 0 0.044 0.001 0.087 0.002 0.13l-0-0.006c0.122 1.404 0.662 2.662 1.495 3.671l-0.009-0.011 0.12 0.168c1.627 2.491 3.865 4.46 6.504 5.723l0.096 0.041c3.136 1.288 3.916 1.124 4.426 1.014 0.87-0.159 1.601-0.656 2.067-1.347l0.007-0.011c0.12-0.316 0.204-0.682 0.237-1.063l0.001-0.015-0.040-0.018-0.256-0.124c-0.8-0.4-2.46-1.2-2.734-1.292l-0.058 0.184c-0.346 0.501-0.684 0.934-1.045 1.347l0.015-0.017c-0.344 0.349-0.821 0.565-1.349 0.565-0.28 0-0.546-0.061-0.785-0.17l0.012 0.005c-1.403-0.547-2.609-1.301-3.646-2.239l0.010 0.009c-0.975-0.891-1.81-1.912-2.486-3.039l-0.034-0.061c-0.152-0.244-0.242-0.54-0.242-0.857 0-0.463 0.191-0.88 0.499-1.178l0-0c0.13-0.162 0.264-0.302 0.4-0.444l0.236-0.256c0.091-0.096 0.177-0.201 0.254-0.311l0.006-0.009c-0.158-0.36-0.622-1.472-0.988-2.352l-0.322-0.772-0.038-0.086c-0.188-0.010-0.302-0.016-0.426-0.016zM12.462 12.442v0.012z"></path>\n</svg>\n',name:Xt.WHATSAPP},{icon:y,name:Xt.FACEBOOK},{icon:_,name:Xt.TWITTER},{icon:b,name:Xt.EMAIL},{icon:'\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>link</title>\n<path d="M19.247 23.019l-4.189 4.189c-2.831 2.831-7.435 2.831-10.265 0-1.371-1.372-2.125-3.193-2.125-5.132s0.755-3.761 2.125-5.133l4.189-4.191c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-4.189 4.191c-1.875 1.875-2.907 4.367-2.907 7.019s1.032 5.143 2.907 7.017 4.368 2.907 7.019 2.907 5.143-1.032 7.017-2.908l4.189-4.189c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.52-1.885 0.001zM22.276 9.724c-0.521-0.521-1.364-0.521-1.885 0l-10.667 10.667c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l10.667-10.667c0.521-0.521 0.521-1.364 0-1.885zM29.093 2.908c-1.875-1.876-4.368-2.908-7.019-2.908s-5.143 1.032-7.017 2.908l-4.189 4.188c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l4.189-4.189c2.831-2.831 7.435-2.831 10.265 0 1.371 1.372 2.125 3.193 2.125 5.132s-0.755 3.761-2.125 5.133l-4.189 4.191c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l4.189-4.191c1.875-1.875 2.907-4.367 2.907-7.019s-1.032-5.143-2.907-7.016z"></path>\n</svg>\n',name:Xt.COPY_LINK}],this.convertedPlatforms=[],this.url="",this.urlName="",this.platforms="facebook,twitter,whatsapp,email,copy_link"}componentWillLoad(){if(document.getElementById("a2a-script"))return;const t=document.createElement("script");t.src="https://static.addtoany.com/menu/page.js",t.setAttribute("id","a2a-script"),t.async=!0,t.onload=function(){window.a2a_config.locale=salla.config.get("user.language_code",salla.lang.getLocale()),window.a2a_config.callbacks=window.a2a_config.callbacks||[],window.a2a_config.callbacks.push({share:t=>{const i={share_via:t.service.toLowerCase(),url:t.url,title:t.title};salla.event.emit("share-element",i)}})},document.body.appendChild(t)}async open(){const t=(new r.timeline).add({targets:this.shareMenu,translateY:[-50,0],opacity:[0,1],duration:300,podding:"0",easing:"easeInOutSine"});t.add({targets:this.shareMenu.children,translateZ:0,translateY:[-30,0],scaleY:[0,1],opacity:[0,1],duration:1400,delay:r.stagger(100)},"-=200"),this.opened=!this.opened,this.opened?this.shareMenu.classList.add("opened"):(t.pause(),t.seek(0),this.shareMenu.classList.remove("opened"))}async refresh(){window.a2a?.init("page")}render(){return i("div",{key:"dcba2bc3344b69f395379ac57b849d02013cd778",class:"s-social-share-wrapper"},i("slot",{key:"ce23f2263042bd09d1233570739756d8aa133145",name:"widget"},i("salla-button",{key:"f76f0c7af4c6f717634575efae944e11fc5403d7","aria-label":"Share",onClick:()=>this.open(),class:"s-social-share-btn",shape:"icon",fill:"outline",color:"light"},i("span",{key:"b6c190caf3f9ab6dbf930e62caed60f0c5cb6a39",innerHTML:this.opened?Q:'\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>share-alt</title>\n<path d="M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.941 0 5.333-2.392 5.333-5.333s-2.392-5.333-5.333-5.333-5.333 2.392-5.333 5.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM26.667 29.333c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}))),i("ul",{key:"5eee0092e3596e384690b3ab3f2fb74a0fc22e66",ref:t=>this.shareMenu=t,class:"s-social-share-list a2a_kit share","data-a2a-url":this.url?this.url:window.location.href,"data-a2a-title":this.urlName?this.urlName:document.title},this.platforms.split(",").map((t=>i("li",null,i("a",{class:`a2a_button_${t}`,"aria-label":`Share Via ${t}`},this.platformIcons.map((e=>{if(e.name===t)return i("span",{class:"s-social-share-icon",innerHTML:e.icon})}))))))))}};Kt.style="";const ti=class{constructor(i){t(this,i),this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}render(){return i("div",{key:"9e1a20d0877a9c3ca6b376fe22bfb52e93c8f873",class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},i("slot",{key:"f5b0593c4c9b8d808901ca79e3c6fd28c2a64f36"}))}};ti.style="";const ii=class{constructor(i){t(this,i),this.tabSelected=a(this,"tabSelected"),this.id=Math.random().toString(36).slice(2,10),this.activeClass=void 0,this.height=void 0,this.centered=!1,this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name,id:this.id}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}onClick(){this.getChild().then((t=>{this.tabSelected.emit(t)}))}render(){return[i("div",{key:"7e9e75c995226ca1b23a9a185c8be46206362b61",class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},i("slot",{key:"6ed7bf434cf6b1af235e2251f6d3f385cbbbcf0b"}))]}};ii.style="";const ei=class{constructor(i){t(this,i),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[t]=this.tabGroup;this.selectGroup(t)}))}onSelectedTab(t){const i=this.tabGroup.find((i=>i.header.id===t.detail.id));this.selectGroup(i)}async createGroup(){const t=Array.from(this.host.querySelectorAll("salla-tab-header"));this.tabsHeader=await Promise.all(t.map((async t=>await t.getChild())));const i=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(i.map((async t=>await t.getChild()))),this.tabGroup=this.tabsHeader.map((t=>{const i=this.tabsContent.find((i=>i.name===t.name));return{header:t,content:i}}))}selectGroup(t){this.tabGroup.map((t=>{t.header.unselect(),t.content.unselect()})),t.header.selected(),t.content.selected()}render(){return[i("div",{key:"a82184132426d8d221c31160f48f129b0cb43a0f",class:"s-tabs"},i("div",{key:"199285e8eef1f8e825b174af3b6df06ffe1ffc6e",class:"s-tabs-header"},i("slot",{key:"80f789aa0dec2dc44c15f269bb554a63e325c7be",name:"header"})),i("div",{key:"1c4fec4e20bab0302fd04a29ebfb2f2bb93380d0",class:"s-tabs-content-wrapper"},i("slot",{key:"491f2f5149acac667b3036fba9b92cf1fa027fc8",name:"content"})))]}get host(){return s(this)}};ei.style=".s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}";const si=class{async loadTelInput(){if(!this.TelInput)try{const t=await import("./p-D64-sfKJ.js").then((function(t){return t.i}));this.TelInput=t.default}catch(t){throw console.error("Failed to load Tel Input:",t),salla.notify?.error?.("Failed to load phone input. Please refresh the page."),t}}constructor(i){t(this,i),this.phoneEntered=a(this,"phoneEntered"),this.name="phone",this.disabled=!1,this.countryCode=salla.config.get("user.country_code","SA")||"SA",this.countryCodeLabel=salla.lang.get("common.country_code"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.tooShort=salla.lang.get("common.errors.too_short",{attribute:this.mobileLabel}),this.tooLong=salla.lang.get("common.errors.too_long",{attribute:this.mobileLabel}),this.invalidCountryCode=salla.lang.get("common.errors.invalid_value",{attribute:this.countryCodeLabel}),this.invalidNumber=salla.lang.get("common.errors.invalid_value",{attribute:this.mobileLabel}),this.errorMap=[this.invalidNumber,this.invalidCountryCode,this.tooShort,this.tooLong,this.invalidNumber],salla.lang.onLoaded((()=>{this.mobileLabel=salla.lang.get("common.elements.mobile"),this.countryCodeLabel=salla.lang.get("common.elements.country_code"),this.invalidNumber=salla.lang.get("common.errors.invalid_value",{attribute:this.mobileLabel}),this.invalidCountryCode=salla.lang.get("common.errors.invalid_value",{attribute:this.countryCodeLabel}),this.tooShort=salla.lang.get("common.errors.too_short",{attribute:this.mobileLabel}),this.tooLong=salla.lang.get("common.errors.too_long",{attribute:this.mobileLabel}),this.mobileRequired=salla.lang.get("common.errors.field_required",{attribute:this.mobileLabel}),this.errorMap=[this.invalidNumber,this.invalidCountryCode,this.tooShort,this.tooLong,this.invalidNumber]}))}async getValues(){return{[this.name]:this.phone=this.phoneInput.value,countryCode:this.countryCode=this.countryCodeInput.value,countryKey:this.host.querySelector(".iti__selected-dial-code").innerText}}async isValid(){if(this.reset(),this.iti.isValidNumber())return!0;if(!this.phoneInput.value.trim())return this.phoneInput.classList.add("s-has-error"),void(this.errorMsg.innerText=this.mobileRequired||"The mobile is required");this.phoneInput.classList.add("s-has-error");let t=this.iti.getValidationError();return this.errorMsg.innerText=this.errorMap[t]||"",salla.logger.info("Phone number ("+this.countryCode+" - "+this.phone+") is not valid, error code "+t),!1}async initTelInput(){await this.loadTelInput(),salla.helpers.inputDigitsOnly(this.phoneInput),this.iti=this.TelInput(this.phoneInput,{initialCountry:this.countryCode?.toLowerCase()||"sa",preferredCountries:["sa","ae","kw","bh","qa","iq","om","ye","eg","jo","ps","sd","lb","dz","tn","ma","ly"],excludeCountries:["sy","ir","cu","kp"],formatOnDisplay:!1,separateDialCode:!0,autoPlaceholder:"aggressive",utilsScript:"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/21.2.7/js/utils.min.js",dropdownContainer:this.host}),this.autofocus&&this.phoneInput.focus(),this.phoneInput.addEventListener("countrychange",(()=>{let t=this.iti.getSelectedCountryData().iso2.toUpperCase();this.countryCodeInput.value=t,this.countryCode=t,this.phoneEntered.emit({number:this.phone,country_code:t})})),this.phoneInput.addEventListener("input",(t=>{salla.helpers.inputDigitsOnly(t.target),this.reset(),this.phoneEntered.emit({number:t.target.value,country_code:this.countryCode})}))}reset(){this.phoneInput.classList.remove("s-has-error"),this.errorMsg.innerHTML=""}handleCountryInput(t){this.phone&&this.phoneEntered.emit({number:t.target.value,country_code:this.countryCode})}render(){return i(e,{key:"f16ad5846d12d5ecef7b30e3409cd57be9bb9763",class:"s-tel-input"},i("input",{key:"08a876233bba3f7878bb9dc9668f60fd16d04903",type:"tel",disabled:this.disabled,name:this.name,value:this.phone,onChange:t=>this.handleCountryInput(t),ref:t=>this.phoneInput=t,enterkeyhint:"next",autocomplete:"tel",class:"s-tel-input-control tel-input s-ltr"}),i("span",{key:"f02fa5d196bb959f6a281fa0dc9ff2c352b97e88",class:"s-tel-input-error-msg",ref:t=>this.errorMsg=t}),i("input",{key:"fd0f6dcf6aba98356f7be85422918ff745dc2078",type:"hidden",name:"country_code",value:this.countryCode,ref:t=>this.countryCodeInput=t,class:"country_code"}))}componentDidLoad(){this.initTelInput()}get host(){return s(this)}};si.style='.iti{width:100%;position:relative;display:inline-block}.iti *{box-sizing:border-box;-moz-box-sizing:border-box}.iti__hide{display:none}.iti__v-hide{visibility:hidden}.iti input,.iti input[type=text],.iti input[type=tel]{position:relative;z-index:0;direction:ltr !important;margin-top:0 !important;margin-bottom:0 !important;padding-left:95px !important;padding-right:15px !important;margin-left:0 !important}.iti__flag-container{width:100%;position:absolute;top:0;bottom:0;left:0;padding:1px}.iti__selected-flag{width:80px;z-index:1;position:relative;display:flex;align-items:center;height:100%;float:left;padding:0 15px;box-shadow:none !important;outline:none !important}.ltr .iti__selected-flag{justify-content:flex-end}.iti__selected-flag:before{content:"";display:block;width:1px;height:70%;background:#eee;position:absolute;top:15%;right:0}.iti__selected-flag .iti__flag{display:none}.iti__arrow{width:15px;height:15px;line-height:15px;position:absolute;left:10px;top:50%;transform:translateY(-50%)}.iti__arrow:after{content:url("data:image/svg+xml,<svg version=\'1.1\' xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 32 32\'><title>keyboard_arrow_down</title><path d=\'M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z\'></path></svg>");font-size:16px;color:#999;opacity:0.65}.iti__arrow--up:after{transform:rotate(180deg)}.iti__country-list{width:100%;max-height:160px;position:absolute;top:100%;left:0;z-index:2;list-style:none;margin:0;padding:0;margin:5px 0 0 0;border-radius:5px;box-shadow:0px 2px 4px 2px rgba(0, 0, 0, 0.05);border:1px solid #f5f7f9;background-color:white;white-space:nowrap;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.iti__country-list::-webkit-scrollbar{width:4px}.dark .iti__country-list{background-color:rgb(82, 82, 91);border-color:rgb(82, 82, 91)}.iti__country-list li{display:flex;align-items:center;justify-content:flex-start;flex-direction:row;padding:8px 10px;transition:background-color 0.3s}.iti__country-list li span{font-size:12px}.iti__country-list li:hover,.iti__country-list li.highlighted{background-color:rgba(0, 0, 0, 0.05)}.iti__country-list--dropup{bottom:100%;top:unset;margin:0 0 5px 0}@media (max-width: 500px){.iti__country-list{white-space:normal}}.iti__flag-box{display:inline-block;width:20px;margin:0 0 0 5px}.iti__divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #eee}.iti__country{padding:5px 10px;outline:none}.iti__dial-code{font-family:Arial;color:#999;unicode-bidi:plaintext;letter-spacing:1px}.iti__country.iti__highlight{background-color:rgba(0, 0, 0, 0.05)}.iti__flag-box,.iti__country-name,.iti__dial-code{vertical-align:middle}.iti__country-name{flex:auto;margin:0;padding:0 10px;white-space:normal;line-height:1.3}.iti--allow-dropdown .iti__flag-container,.iti--separate-dial-code .iti__flag-container{left:0}.iti--allow-dropdown .iti__flag-container:hover{cursor:pointer}.iti--allow-dropdown input[disabled]+.iti__flag-container:hover,.iti--allow-dropdown input[readonly]+.iti__flag-container:hover{cursor:default}.iti--allow-dropdown input[disabled]+.iti__flag-container:hover .iti__selected-flag,.iti--allow-dropdown input[readonly]+.iti__flag-container:hover .iti__selected-flag{background-color:transparent}.iti--separate-dial-code .iti__selected-dial-code{unicode-bidi:plaintext;direction:ltr;letter-spacing:1px;font-family:"Arial", serif;font-size:13px}.iti--container{top:-18px !important;left:0 !important;padding:1px}.iti--container:hover{cursor:pointer}.iti-mobile .iti--container{inset:0;margin:20px;width:calc(100% - 40px);position:fixed;z-index:9999}.iti-mobile .iti__country-list{max-height:100%;width:100%;inset:0}.iti-mobile .iti__country{padding:10px 10px;line-height:1.5em}.iti__flag{width:20px}.iti__flag.iti__be{width:18px}.iti__flag.iti__ch{width:15px}.iti__flag.iti__mc{width:19px}.iti__flag.iti__ne{width:18px}.iti__flag.iti__np{width:13px}.iti__flag.iti__va{width:15px}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-size:5652px 15px}}.iti__flag.iti__ac{height:10px;background-position:0px 0px}.iti__flag.iti__ad{height:14px;background-position:-22px 0px}.iti__flag.iti__ae{height:10px;background-position:-44px 0px}.iti__flag.iti__af{height:14px;background-position:-66px 0px}.iti__flag.iti__ag{height:14px;background-position:-88px 0px}.iti__flag.iti__ai{height:10px;background-position:-110px 0px}.iti__flag.iti__al{height:15px;background-position:-132px 0px}.iti__flag.iti__am{height:10px;background-position:-154px 0px}.iti__flag.iti__ao{height:14px;background-position:-176px 0px}.iti__flag.iti__aq{height:14px;background-position:-198px 0px}.iti__flag.iti__ar{height:13px;background-position:-220px 0px}.iti__flag.iti__as{height:10px;background-position:-242px 0px}.iti__flag.iti__at{height:14px;background-position:-264px 0px}.iti__flag.iti__au{height:10px;background-position:-286px 0px}.iti__flag.iti__aw{height:14px;background-position:-308px 0px}.iti__flag.iti__ax{height:13px;background-position:-330px 0px}.iti__flag.iti__az{height:10px;background-position:-352px 0px}.iti__flag.iti__ba{height:10px;background-position:-374px 0px}.iti__flag.iti__bb{height:14px;background-position:-396px 0px}.iti__flag.iti__bd{height:12px;background-position:-418px 0px}.iti__flag.iti__be{height:15px;background-position:-440px 0px}.iti__flag.iti__bf{height:14px;background-position:-460px 0px}.iti__flag.iti__bg{height:12px;background-position:-482px 0px}.iti__flag.iti__bh{height:12px;background-position:-504px 0px}.iti__flag.iti__bi{height:12px;background-position:-526px 0px}.iti__flag.iti__bj{height:14px;background-position:-548px 0px}.iti__flag.iti__bl{height:14px;background-position:-570px 0px}.iti__flag.iti__bm{height:10px;background-position:-592px 0px}.iti__flag.iti__bn{height:10px;background-position:-614px 0px}.iti__flag.iti__bo{height:14px;background-position:-636px 0px}.iti__flag.iti__bq{height:14px;background-position:-658px 0px}.iti__flag.iti__br{height:14px;background-position:-680px 0px}.iti__flag.iti__bs{height:10px;background-position:-702px 0px}.iti__flag.iti__bt{height:14px;background-position:-724px 0px}.iti__flag.iti__bv{height:15px;background-position:-746px 0px}.iti__flag.iti__bw{height:14px;background-position:-768px 0px}.iti__flag.iti__by{height:10px;background-position:-790px 0px}.iti__flag.iti__bz{height:14px;background-position:-812px 0px}.iti__flag.iti__ca{height:10px;background-position:-834px 0px}.iti__flag.iti__cc{height:10px;background-position:-856px 0px}.iti__flag.iti__cd{height:15px;background-position:-878px 0px}.iti__flag.iti__cf{height:14px;background-position:-900px 0px}.iti__flag.iti__cg{height:14px;background-position:-922px 0px}.iti__flag.iti__ch{height:15px;background-position:-944px 0px}.iti__flag.iti__ci{height:14px;background-position:-961px 0px}.iti__flag.iti__ck{height:10px;background-position:-983px 0px}.iti__flag.iti__cl{height:14px;background-position:-1005px 0px}.iti__flag.iti__cm{height:14px;background-position:-1027px 0px}.iti__flag.iti__cn{height:14px;background-position:-1049px 0px}.iti__flag.iti__co{height:14px;background-position:-1071px 0px}.iti__flag.iti__cp{height:14px;background-position:-1093px 0px}.iti__flag.iti__cr{height:12px;background-position:-1115px 0px}.iti__flag.iti__cu{height:10px;background-position:-1137px 0px}.iti__flag.iti__cv{height:12px;background-position:-1159px 0px}.iti__flag.iti__cw{height:14px;background-position:-1181px 0px}.iti__flag.iti__cx{height:10px;background-position:-1203px 0px}.iti__flag.iti__cy{height:14px;background-position:-1225px 0px}.iti__flag.iti__cz{height:14px;background-position:-1247px 0px}.iti__flag.iti__de{height:12px;background-position:-1269px 0px}.iti__flag.iti__dg{height:10px;background-position:-1291px 0px}.iti__flag.iti__dj{height:14px;background-position:-1313px 0px}.iti__flag.iti__dk{height:15px;background-position:-1335px 0px}.iti__flag.iti__dm{height:10px;background-position:-1357px 0px}.iti__flag.iti__do{height:14px;background-position:-1379px 0px}.iti__flag.iti__dz{height:14px;background-position:-1401px 0px}.iti__flag.iti__ea{height:14px;background-position:-1423px 0px}.iti__flag.iti__ec{height:14px;background-position:-1445px 0px}.iti__flag.iti__ee{height:13px;background-position:-1467px 0px}.iti__flag.iti__eg{height:14px;background-position:-1489px 0px}.iti__flag.iti__eh{height:10px;background-position:-1511px 0px}.iti__flag.iti__er{height:10px;background-position:-1533px 0px}.iti__flag.iti__es{height:14px;background-position:-1555px 0px}.iti__flag.iti__et{height:10px;background-position:-1577px 0px}.iti__flag.iti__eu{height:14px;background-position:-1599px 0px}.iti__flag.iti__fi{height:12px;background-position:-1621px 0px}.iti__flag.iti__fj{height:10px;background-position:-1643px 0px}.iti__flag.iti__fk{height:10px;background-position:-1665px 0px}.iti__flag.iti__fm{height:11px;background-position:-1687px 0px}.iti__flag.iti__fo{height:15px;background-position:-1709px 0px}.iti__flag.iti__fr{height:14px;background-position:-1731px 0px}.iti__flag.iti__ga{height:15px;background-position:-1753px 0px}.iti__flag.iti__gb{height:10px;background-position:-1775px 0px}.iti__flag.iti__gd{height:12px;background-position:-1797px 0px}.iti__flag.iti__ge{height:14px;background-position:-1819px 0px}.iti__flag.iti__gf{height:14px;background-position:-1841px 0px}.iti__flag.iti__gg{height:14px;background-position:-1863px 0px}.iti__flag.iti__gh{height:14px;background-position:-1885px 0px}.iti__flag.iti__gi{height:10px;background-position:-1907px 0px}.iti__flag.iti__gl{height:14px;background-position:-1929px 0px}.iti__flag.iti__gm{height:14px;background-position:-1951px 0px}.iti__flag.iti__gn{height:14px;background-position:-1973px 0px}.iti__flag.iti__gp{height:14px;background-position:-1995px 0px}.iti__flag.iti__gq{height:14px;background-position:-2017px 0px}.iti__flag.iti__gr{height:14px;background-position:-2039px 0px}.iti__flag.iti__gs{height:10px;background-position:-2061px 0px}.iti__flag.iti__gt{height:13px;background-position:-2083px 0px}.iti__flag.iti__gu{height:11px;background-position:-2105px 0px}.iti__flag.iti__gw{height:10px;background-position:-2127px 0px}.iti__flag.iti__gy{height:12px;background-position:-2149px 0px}.iti__flag.iti__hk{height:14px;background-position:-2171px 0px}.iti__flag.iti__hm{height:10px;background-position:-2193px 0px}.iti__flag.iti__hn{height:10px;background-position:-2215px 0px}.iti__flag.iti__hr{height:10px;background-position:-2237px 0px}.iti__flag.iti__ht{height:12px;background-position:-2259px 0px}.iti__flag.iti__hu{height:10px;background-position:-2281px 0px}.iti__flag.iti__ic{height:14px;background-position:-2303px 0px}.iti__flag.iti__id{height:14px;background-position:-2325px 0px}.iti__flag.iti__ie{height:10px;background-position:-2347px 0px}.iti__flag.iti__il{height:15px;background-position:-2369px 0px}.iti__flag.iti__im{height:10px;background-position:-2391px 0px}.iti__flag.iti__in{height:14px;background-position:-2413px 0px}.iti__flag.iti__io{height:10px;background-position:-2435px 0px}.iti__flag.iti__iq{height:14px;background-position:-2457px 0px}.iti__flag.iti__ir{height:12px;background-position:-2479px 0px}.iti__flag.iti__is{height:15px;background-position:-2501px 0px}.iti__flag.iti__it{height:14px;background-position:-2523px 0px}.iti__flag.iti__je{height:12px;background-position:-2545px 0px}.iti__flag.iti__jm{height:10px;background-position:-2567px 0px}.iti__flag.iti__jo{height:10px;background-position:-2589px 0px}.iti__flag.iti__jp{height:14px;background-position:-2611px 0px}.iti__flag.iti__ke{height:14px;background-position:-2633px 0px}.iti__flag.iti__kg{height:12px;background-position:-2655px 0px}.iti__flag.iti__kh{height:13px;background-position:-2677px 0px}.iti__flag.iti__ki{height:10px;background-position:-2699px 0px}.iti__flag.iti__km{height:12px;background-position:-2721px 0px}.iti__flag.iti__kn{height:14px;background-position:-2743px 0px}.iti__flag.iti__kp{height:10px;background-position:-2765px 0px}.iti__flag.iti__kr{height:14px;background-position:-2787px 0px}.iti__flag.iti__kw{height:10px;background-position:-2809px 0px}.iti__flag.iti__ky{height:10px;background-position:-2831px 0px}.iti__flag.iti__kz{height:10px;background-position:-2853px 0px}.iti__flag.iti__la{height:14px;background-position:-2875px 0px}.iti__flag.iti__lb{height:14px;background-position:-2897px 0px}.iti__flag.iti__lc{height:10px;background-position:-2919px 0px}.iti__flag.iti__li{height:12px;background-position:-2941px 0px}.iti__flag.iti__lk{height:10px;background-position:-2963px 0px}.iti__flag.iti__lr{height:11px;background-position:-2985px 0px}.iti__flag.iti__ls{height:14px;background-position:-3007px 0px}.iti__flag.iti__lt{height:12px;background-position:-3029px 0px}.iti__flag.iti__lu{height:12px;background-position:-3051px 0px}.iti__flag.iti__lv{height:10px;background-position:-3073px 0px}.iti__flag.iti__ly{height:10px;background-position:-3095px 0px}.iti__flag.iti__ma{height:14px;background-position:-3117px 0px}.iti__flag.iti__mc{height:15px;background-position:-3139px 0px}.iti__flag.iti__md{height:10px;background-position:-3160px 0px}.iti__flag.iti__me{height:10px;background-position:-3182px 0px}.iti__flag.iti__mf{height:14px;background-position:-3204px 0px}.iti__flag.iti__mg{height:14px;background-position:-3226px 0px}.iti__flag.iti__mh{height:11px;background-position:-3248px 0px}.iti__flag.iti__mk{height:10px;background-position:-3270px 0px}.iti__flag.iti__ml{height:14px;background-position:-3292px 0px}.iti__flag.iti__mm{height:14px;background-position:-3314px 0px}.iti__flag.iti__mn{height:10px;background-position:-3336px 0px}.iti__flag.iti__mo{height:14px;background-position:-3358px 0px}.iti__flag.iti__mp{height:10px;background-position:-3380px 0px}.iti__flag.iti__mq{height:14px;background-position:-3402px 0px}.iti__flag.iti__mr{height:14px;background-position:-3424px 0px}.iti__flag.iti__ms{height:10px;background-position:-3446px 0px}.iti__flag.iti__mt{height:14px;background-position:-3468px 0px}.iti__flag.iti__mu{height:14px;background-position:-3490px 0px}.iti__flag.iti__mv{height:14px;background-position:-3512px 0px}.iti__flag.iti__mw{height:14px;background-position:-3534px 0px}.iti__flag.iti__mx{height:12px;background-position:-3556px 0px}.iti__flag.iti__my{height:10px;background-position:-3578px 0px}.iti__flag.iti__mz{height:14px;background-position:-3600px 0px}.iti__flag.iti__na{height:14px;background-position:-3622px 0px}.iti__flag.iti__nc{height:10px;background-position:-3644px 0px}.iti__flag.iti__ne{height:15px;background-position:-3666px 0px}.iti__flag.iti__nf{height:10px;background-position:-3686px 0px}.iti__flag.iti__ng{height:10px;background-position:-3708px 0px}.iti__flag.iti__ni{height:12px;background-position:-3730px 0px}.iti__flag.iti__nl{height:14px;background-position:-3752px 0px}.iti__flag.iti__no{height:15px;background-position:-3774px 0px}.iti__flag.iti__np{height:15px;background-position:-3796px 0px}.iti__flag.iti__nr{height:10px;background-position:-3811px 0px}.iti__flag.iti__nu{height:10px;background-position:-3833px 0px}.iti__flag.iti__nz{height:10px;background-position:-3855px 0px}.iti__flag.iti__om{height:10px;background-position:-3877px 0px}.iti__flag.iti__pa{height:14px;background-position:-3899px 0px}.iti__flag.iti__pe{height:14px;background-position:-3921px 0px}.iti__flag.iti__pf{height:14px;background-position:-3943px 0px}.iti__flag.iti__pg{height:15px;background-position:-3965px 0px}.iti__flag.iti__ph{height:10px;background-position:-3987px 0px}.iti__flag.iti__pk{height:14px;background-position:-4009px 0px}.iti__flag.iti__pl{height:13px;background-position:-4031px 0px}.iti__flag.iti__pm{height:14px;background-position:-4053px 0px}.iti__flag.iti__pn{height:10px;background-position:-4075px 0px}.iti__flag.iti__pr{height:14px;background-position:-4097px 0px}.iti__flag.iti__ps{height:10px;background-position:-4119px 0px}.iti__flag.iti__pt{height:14px;background-position:-4141px 0px}.iti__flag.iti__pw{height:13px;background-position:-4163px 0px}.iti__flag.iti__py{height:11px;background-position:-4185px 0px}.iti__flag.iti__qa{height:8px;background-position:-4207px 0px}.iti__flag.iti__re{height:14px;background-position:-4229px 0px}.iti__flag.iti__ro{height:14px;background-position:-4251px 0px}.iti__flag.iti__rs{height:14px;background-position:-4273px 0px}.iti__flag.iti__ru{height:14px;background-position:-4295px 0px}.iti__flag.iti__rw{height:14px;background-position:-4317px 0px}.iti__flag.iti__sa{height:14px;background-position:-4339px 0px}.iti__flag.iti__sb{height:10px;background-position:-4361px 0px}.iti__flag.iti__sc{height:10px;background-position:-4383px 0px}.iti__flag.iti__sd{height:10px;background-position:-4405px 0px}.iti__flag.iti__se{height:13px;background-position:-4427px 0px}.iti__flag.iti__sg{height:14px;background-position:-4449px 0px}.iti__flag.iti__sh{height:10px;background-position:-4471px 0px}.iti__flag.iti__si{height:10px;background-position:-4493px 0px}.iti__flag.iti__sj{height:15px;background-position:-4515px 0px}.iti__flag.iti__sk{height:14px;background-position:-4537px 0px}.iti__flag.iti__sl{height:14px;background-position:-4559px 0px}.iti__flag.iti__sm{height:15px;background-position:-4581px 0px}.iti__flag.iti__sn{height:14px;background-position:-4603px 0px}.iti__flag.iti__so{height:14px;background-position:-4625px 0px}.iti__flag.iti__sr{height:14px;background-position:-4647px 0px}.iti__flag.iti__ss{height:10px;background-position:-4669px 0px}.iti__flag.iti__st{height:10px;background-position:-4691px 0px}.iti__flag.iti__sv{height:12px;background-position:-4713px 0px}.iti__flag.iti__sx{height:14px;background-position:-4735px 0px}.iti__flag.iti__sy{height:14px;background-position:-4757px 0px}.iti__flag.iti__sz{height:14px;background-position:-4779px 0px}.iti__flag.iti__ta{height:10px;background-position:-4801px 0px}.iti__flag.iti__tc{height:10px;background-position:-4823px 0px}.iti__flag.iti__td{height:14px;background-position:-4845px 0px}.iti__flag.iti__tf{height:14px;background-position:-4867px 0px}.iti__flag.iti__tg{height:13px;background-position:-4889px 0px}.iti__flag.iti__th{height:14px;background-position:-4911px 0px}.iti__flag.iti__tj{height:10px;background-position:-4933px 0px}.iti__flag.iti__tk{height:10px;background-position:-4955px 0px}.iti__flag.iti__tl{height:10px;background-position:-4977px 0px}.iti__flag.iti__tm{height:14px;background-position:-4999px 0px}.iti__flag.iti__tn{height:14px;background-position:-5021px 0px}.iti__flag.iti__to{height:10px;background-position:-5043px 0px}.iti__flag.iti__tr{height:14px;background-position:-5065px 0px}.iti__flag.iti__tt{height:12px;background-position:-5087px 0px}.iti__flag.iti__tv{height:10px;background-position:-5109px 0px}.iti__flag.iti__tw{height:14px;background-position:-5131px 0px}.iti__flag.iti__tz{height:14px;background-position:-5153px 0px}.iti__flag.iti__ua{height:14px;background-position:-5175px 0px}.iti__flag.iti__ug{height:14px;background-position:-5197px 0px}.iti__flag.iti__um{height:11px;background-position:-5219px 0px}.iti__flag.iti__un{height:14px;background-position:-5241px 0px}.iti__flag.iti__us{height:11px;background-position:-5263px 0px}.iti__flag.iti__uy{height:14px;background-position:-5285px 0px}.iti__flag.iti__uz{height:10px;background-position:-5307px 0px}.iti__flag.iti__va{height:15px;background-position:-5329px 0px}.iti__flag.iti__vc{height:14px;background-position:-5346px 0px}.iti__flag.iti__ve{height:14px;background-position:-5368px 0px}.iti__flag.iti__vg{height:10px;background-position:-5390px 0px}.iti__flag.iti__vi{height:14px;background-position:-5412px 0px}.iti__flag.iti__vn{height:14px;background-position:-5434px 0px}.iti__flag.iti__vu{height:12px;background-position:-5456px 0px}.iti__flag.iti__wf{height:14px;background-position:-5478px 0px}.iti__flag.iti__ws{height:10px;background-position:-5500px 0px}.iti__flag.iti__xk{height:15px;background-position:-5522px 0px}.iti__flag.iti__ye{height:14px;background-position:-5544px 0px}.iti__flag.iti__yt{height:14px;background-position:-5566px 0px}.iti__flag.iti__za{height:14px;background-position:-5588px 0px}.iti__flag.iti__zm{height:14px;background-position:-5610px 0px}.iti__flag.iti__zw{height:10px;background-position:-5632px 0px}.iti__flag{height:15px;box-shadow:0px 0px 1px 0px #888;background-image:url("https://cdn.salla.network/images/flags.png");background-repeat:no-repeat;background-color:#f5f7f9;background-position:20px 0}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-image:url("https://cdn.salla.network/images/flags@2x.png")}}.iti__flag.iti__np{background-color:transparent}';var ai='\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>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n';const li=class{constructor(i){t(this,i),this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_program=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png",40,40),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.sallaAccountEnabled=!1,this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,this.items={notifications:At,orders:'\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>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:S,wishlist:jt,wallet:'\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>wallet</title>\n<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>\n</svg>\n',loyalty_program:v,profile:ai,...this.sallaAccountEnabled?{settings:'\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>settings</title>\n<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}:{}},salla.lang.onLoaded((()=>{this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.hello=salla.lang.get("pages.checkout.hello"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_program=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout")})),this.host.hasAttribute("with-rating")&&(this.items.rating=ct),this.items.logout='\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>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n',salla.onReady((()=>{salla.config.isGuest()||(this.is_loggedIn=!0,!this.inline&&(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)?this.fetchFreshProfile():salla.event.on("profile::info.fetched",(t=>{this.updateProfileState(t)})))}))}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.profileUrl=`${salla.config.get("account.url","https://accounts.salla.com")}/${Salla.config.get("user.language_code")}/user?store=${Salla.config.get("store.id")}&info=${encodeURIComponent(Salla.storage.get("token"))}`;const t=this.host.querySelector('[slot="trigger"]');this.triggerSlot='<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',t&&(this.triggerSlot=t.innerHTML,t.innerHTML=this.replaceParams(t.innerHTML))}fetchFreshProfile(){salla.api.token?salla.profile.api.info().then((t=>{this.updateProfileState(t)})):salla.log("trying to fetchFreshProfile before injected the token!!")}updateProfileState(t){this.badges={notifications:salla.helpers.number(t.data.notifications||0),pending_orders:salla.helpers.number(t.data.pending_orders||0)},this.hasBadges=Number(t.data.pending_orders)>0||Number(t.data.notifications)>0,this.first_name=t.data.first_name,this.last_name=t.data.last_name,this.avatar=t.data.avatar||salla.url.cdn("images/avatar.png",40,40)}async open(t){this.opened=!this.opened,t.stopPropagation(),this.opened&&window.addEventListener("click",this.onClickOutside)}menuItemClicked(t,i){"logout"===i&&(t.preventDefault(),salla.auth.logout("sall-user-menu"))}replaceParams(t){return t.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,c)}getTheHeader(){return i("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:t=>this.open(t),onKeyUp:t=>this.open(t),innerHTML:this.replaceParams(this.triggerSlot)})}getItemAnchorLinkAttrs(t){return"profile"===t&&this.profileUrl&&this.sallaAccountEnabled?{href:this.profileUrl,target:"_blank",rel:"noopener noreferrer"}:{href:Salla.url.get("loyalty_program"===t?"loyalty":t)}}getMenuItem([t,e],s){if(("wallet"!==t||window.can_access_wallet)&&("loyalty_program"!==t||Salla.config.get("store.features").includes("loyalty-system")))return i("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":s+1===Object.entries(this.items).length}},i("a",{...this.getItemAnchorLinkAttrs(t),class:"s-user-menu-dropdown-item-link",onClick:i=>this.menuItemClicked(i,t)},i("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:e}),i("span",{class:"s-user-menu-dropdown-item-title"},this[t]),["٠","0",void 0].includes(this.badges[t])?"":i("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[t])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return i(e,null,this.is_loggedIn?this.inline?i("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((t,i)=>this.getMenuItem(t,i)))):i("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),i("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},i("div",{class:"s-user-menu-dropdown",onClick:t=>t.stopPropagation(),onKeyUp:t=>t.stopPropagation()},this.showHeader?i("div",{class:"s-user-menu-dropdown-header"},i("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),i("div",{class:"s-user-menu-dropdown-header-content"},i("span",null,this.hello),i("p",null,this.first_name," ",this.last_name)),i("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:Q,onClick:()=>{this.opened=!1}})):"",i("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((t,i)=>this.getMenuItem(t,i))))))):i("slot",{name:"login-btn"},i("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:ai})))}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}get host(){return s(this)}};li.style="";const oi=class{constructor(i){t(this,i),this.minAge=10,this.isEditable=!0,this.disableAction=!1,this.isLoading=!0,this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"}),salla.lang.onLoaded((()=>{this.first_name_trans=salla.lang.get("pages.profile.first_name"),this.last_name_trans=salla.lang.get("pages.profile.last_name"),this.birthday_trans=salla.lang.get("pages.profile.birthday"),this.birthday_placeholder_trans=salla.lang.get("pages.profile.birthday_placeholder"),this.gender_trans=salla.lang.get("pages.profile.gender"),this.gender_placeholder_trans=salla.lang.get("pages.profile.gender_placeholder"),this.male_trans=salla.lang.get("pages.profile.male"),this.female_trans=salla.lang.get("pages.profile.female"),this.email_trans=salla.lang.get("common.elements.email"),this.mobile_trans=salla.lang.get("common.elements.mobile"),this.save_btn_trans=salla.lang.get("common.elements.save"),this.drag_and_drop_trans=salla.lang.get("common.uploader.drag_and_drop"),this.browse_trans=salla.lang.get("common.uploader.browse"),this.email_required_trans=salla.lang.get("pages.checkout.email_required"),this.invalid_email_trans=salla.lang.get("pages.error.invalid_value",{attribute:"email"})}))}phoneNumberFieldEventHandler(t){t.detail.number?(this.userData.phone.number=Number.parseInt(t.detail.number),this.userData.phone.country=t.detail.country_code,this.disableAction=!1):this.disableAction=!0}handleFieldChange(t,i,e=!1){i.target.value?(this.userData[t]=i.target.value,this.disableAction=!1):e&&(this.disableAction=!0)}handleEmailInput(t,i){const e=document.getElementById("email-error"),s=i.target.value;if(!s)return this.disableAction=!0,void(e.textContent=this.email_required_trans);/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(s)||(this.disableAction=!0,e.textContent=this.invalid_email_trans),e.textContent="",this.userData[t]=s,this.disableAction=!1}submitForm(t){t.preventDefault(),this.disableAction=!0;const i=Object.assign({},this.userData);i.phone=void 0,i.phone=this.userData.phone.number,i.country_code=this.userData.phone.country,salla.api.profile.update(i).finally((()=>{this.disableAction=!1}))}getBirthDateRestriction(){const t=new Date,i=t.getFullYear()-this.minAge;return t.setFullYear(i),t}fetchData(){return salla.api.profile.info().then((t=>{this.userData=t.data})).finally((()=>{this.isLoading=!1,this.isEditable=!Salla.config.get("store.features").includes("sso-login")}))}renderLoadingSection(){return i("div",{class:"s-user-profile-skeleton-wrapper"},Array.from({length:6},((t,e)=>i("salla-skeleton",{class:"skeleton-item",width:"100%",height:"50px",key:e}))))}componentWillLoad(){Salla.onReady().then((()=>this.fetchData()))}render(){return this.isLoading?this.renderLoadingSection():i("form",{onSubmit:t=>this.submitForm(t)},i("div",{class:"s-user-profile-wrapper"},i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"first-name",class:"s-user-profile-field-label"},this.first_name_trans),i("input",{disabled:!this.isEditable,type:"text",name:"first_name",value:this.userData.first_name,id:"first-name",required:!0,autocomplete:"first_name",class:"form-input",onChange:t=>this.handleFieldChange("first_name",t)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"last-name",class:"s-user-profile-field-label"},this.last_name_trans),i("input",{disabled:!this.isEditable,type:"text",name:"last_name",value:this.userData.last_name,id:"last-name",required:!0,autocomplete:"last_name",class:"form-input",onChange:t=>this.handleFieldChange("last_name",t)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"birthday",class:"s-user-profile-field-label"},this.birthday_trans),i("salla-datetime-picker",{disabled:!this.isEditable,dateFormat:"Y-m-d",value:this.userData.birthday,placeholder:this.birthday_placeholder_trans,required:!0,maxDate:this.getBirthDateRestriction(),name:"birthday",onPicked:t=>this.handleFieldChange("birthday",t)})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"gender",class:"s-user-profile-field-label"},this.gender_trans),i("select",{disabled:!this.isEditable,class:"form-input",name:"gender",required:!0,onChange:t=>this.handleFieldChange("gender",t)},i("option",{value:""},this.gender_placeholder_trans),i("option",{value:m.Male,selected:this.userData.gender===m.Male},this.male_trans),i("option",{value:m.Female,selected:this.userData.gender===m.Female},this.female_trans))),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"email",class:"s-user-profile-field-label"},this.email_trans),i("input",{disabled:!this.isEditable,type:"email",name:"email",value:this.userData.email,id:"email",class:"form-input",required:!0,onInput:t=>this.handleEmailInput("email",t)}),i("p",{id:"email-error",class:"s-user-profile-field-error"})),i("div",{class:"s-user-profile-field"},i("label",{htmlFor:"international-mobile",class:"s-user-profile-field-label"},this.mobile_trans),i("salla-tel-input",{disabled:!this.isEditable,name:"international-mobile","country-code":this.userData.phone.country,phone:`${this.userData.phone.number}`,onPhoneEntered:t=>this.phoneNumberFieldEventHandler(t)}))),i("salla-button",{type:"submit",loading:this.disableAction,disabled:this.disableAction||!this.isEditable,"loader-position":"end",class:"s-user-profile-submit"},this.save_btn_trans))}};oi.style=":host{display:block}";var ni='\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>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';const ri=class{constructor(i){t(this,i),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),salla.onReady((()=>{this.isHiddenName=salla.config.get("user.is_hidden_name"),this.isNotifiable=salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.isNotifiable&&this.isHiddenName||salla.event.on("profile::info.fetched",(t=>{this.isHiddenName=t.data.is_hidden_name,this.isNotifiable=t.data.is_notifiable}))})),salla.lang.onLoaded((()=>{this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description"),this.warningText=salla.lang.get("pages.profile.warning_for_deactivate"),this.sorryForLeavingText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account")}))}toggleSetting(t,i){salla.profile.updateSettings({name:t,value:i.target.checked})}capitalizeText(t){return t.charAt(0).toUpperCase()+t.slice(1)}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async deleteAccount(){await salla.profile.delete().finally((()=>this.confirmationModal.close()))}render(){return i(e,{key:"33752e10e70ffbf01efb75b31d4849edef0a22ca",class:"s-user-settings-wrapper"},this.canHideName&&i("div",{key:"93d51db7a7034bd47afa1743046e7ed1f723f60c",class:"s-user-settings-section"},i("salla-list-tile",{key:"a5a516cd1fae2a592ce52d9eb4d406116b961d54"},i("div",{key:"84810dc0921a67f0506796fef48e4e0bdd6065ac",slot:"icon",class:"s-user-settings-section-icon"},i("span",{key:"6e9ec2538288787753b39b9eab5e73085fd77af2",innerHTML:'\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>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),i("div",{key:"ea4b1e3a1a7f0335041e6bf6f1ee17bf7c10df8d",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),i("div",{key:"05c29800a9f48ec42a8681e44e65c347b635c02e",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),i("div",{key:"14a925b8253d160fc13ba73eedc8dbc8cb950f89",slot:"action",class:"s-user-settings-section-action"},i("label",{key:"cdf006b150c126d25ae01254f142bad8a20dd553",class:"s-toggle"},i("input",{key:"d22dbe40daf8ba763b24d3456161ac24b4d59ec3",class:"s-toggle-input",checked:this.isHiddenName,onChange:t=>this.toggleSetting("is_hidden_name",t),type:"checkbox"}),i("div",{key:"73831affe4a191d6cc2c7eb3ea360a01f0287eee",class:"s-toggle-switcher"}))))),i("div",{key:"891e04a67ad6d20da94947e8cfa2d6edf9c7bb84",class:"s-user-settings-section"},i("salla-list-tile",{key:"206fe63e42899c9a8c7efffabd6feb49b6bcb917"},i("div",{key:"5d93ddd0678238418b4edd4e59352fea431a1ca3",slot:"icon",class:"s-user-settings-section-icon"},i("span",{key:"f58c73c740186085c5091139dad0270c18e96759",innerHTML:'\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>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),i("div",{key:"b6cf780f0cfe38a6fb5dc63cb2d4857f4b909c58",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),i("div",{key:"8e8a6d47fffa6b833b4047054d22faffac042936",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),i("div",{key:"2599fbfb496b0a9ce58e6c8dea53a8535cac5204",slot:"action",class:"s-user-settings-section-action"},i("label",{key:"0fbcb6ff94aeef953750fb8f8d22ece4b75c99b1",class:"s-toggle"},i("input",{key:"859c64fd37986ce5615bfeaacf22cfeb4aff9c6c",class:"s-toggle-input",checked:this.isNotifiable,onChange:t=>this.toggleSetting("is_notifiable",t),type:"checkbox"}),i("div",{key:"e1f46d025760d058516036757b47c847bef54600",class:"s-toggle-switcher"}))))),i("div",{key:"fee3c156efc03e2b7c3306f1399a862d7f42bfbb",class:"s-user-settings-section s-user-settings-section-deactivate-user"},i("salla-list-tile",{key:"494c6b20eff0df5c1733c649b6383735589550d8"},i("div",{key:"33f6dda6763b824e08071055bae7a993e54d82d7",slot:"icon",class:"s-user-settings-section-icon"},i("span",{key:"fb7a0899c926b2be7b4ea03e8079c0f755a3a724",innerHTML:ni})),i("div",{key:"91a27cfb2b9e19bbb1fdedbac04cac60f783fa8a",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),i("div",{key:"fa780dd1c2a71d180eaaeec517e3195add641011",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),i("div",{key:"fe97d9c07fd65ae7469551cf9d0ae4451167943e",slot:"action",class:"s-user-settings-section-action"},i("salla-button",{key:"c656e8800d73c813d4e00c6078ed3c53a1ce788f",fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),i("salla-modal",{key:"fa19e38a8ba2de3571045be2072097477e9ca797",width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:t=>this.confirmationModal=t},i("span",{key:"0d4eced0174ed3c4f13fddd61b711cd9d73dac47",slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:ni}),i("div",{key:"38be1edb34805de488c648e8312807e2d49a6733",class:"s-user-settings-confirmation"},i("div",{key:"949a75940d5065c4bd412e49ebc18fc9f3d39c21",class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),i("div",{key:"09403f1c85cc9bbc941dcd04bfa88b99aa0ac7c6",class:"s-user-settings-confirmation-actions"},i("salla-button",{key:"ccb531ffa8af9e47e758b591b9d98d980a498611",width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),i("salla-button",{key:"9783256bdabfab9dcb0452580748d4efd2ca0f88",fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.deleteAccount()},this.capitalizeText(this.deactivateAccount))))))}};ri.style="";export{k as salla_accordion,x as salla_accordion_body,z as salla_accordion_head,C as salla_add_product_button,T as salla_alert,P as salla_booking_field,L as salla_bottom_alert,O as salla_breadcrumb,H as salla_button,F as salla_cart_summary,N as salla_color_picker,G as salla_comment_form,U as salla_comment_item,Y as salla_comments,V as salla_conditional_fields,Z as salla_count_down,J as salla_datetime_picker,tt as salla_drawer,it as salla_file_upload,st as salla_gifting,at as salla_infinite_scroll,lt as salla_list_tile,ot as salla_loading,nt as salla_localization_modal,rt as salla_login_modal,ht as salla_loyalty,dt as salla_maintenance_alert,gt as salla_map,mt as salla_menu,ft as salla_modal,bt as salla_multiple_bundle_product,wt as salla_multiple_bundle_product_cart,yt as salla_multiple_bundle_product_details,_t as salla_multiple_bundle_product_options_modal,vt as salla_multiple_bundle_product_slider,kt as salla_offer_modal,xt as salla_placeholder,Mt as salla_product_availability,St as salla_product_card,Pt as salla_product_options,It as salla_product_size_guide,Lt as salla_products_list,$t as salla_products_slider,Dt as salla_progress_bar,Bt as salla_quantity_input,Rt as salla_quick_buy,Et as salla_quick_order,Nt as salla_rating_modal,Gt as salla_rating_stars,Ut as salla_reviews_summary,Vt as salla_scopes,Zt as salla_search,Jt as salla_skeleton,Qt as salla_slider,Kt as salla_social_share,ti as salla_tab_content,ii as salla_tab_header,ei as salla_tabs,si as salla_tel_input,li as salla_user_menu,oi as salla_user_profile,ri as salla_user_settings}