@salla.sa/twilight-components 2.14.348 → 2.14.349

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 (155) hide show
  1. package/dist/cjs/{filepond-B_sfbQx7.js → filepond-DFhbfTkt.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-CStjlaHV.js → filepond-plugin-file-poster-Dj4Zm459.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DrcM89vc.js → filepond-plugin-file-validate-size-DsH6GzKJ.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DnIoL6mq.js → filepond-plugin-file-validate-type-DfaEudMs.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-DLV0U0gb.js → filepond-plugin-image-edit-gz-CV83v.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-tPl3p3z_.js → filepond-plugin-image-exif-orientation-DfkLjcpx.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-WTfIQM6C.js → filepond-plugin-image-preview-BxaEwNCI.js} +1 -1
  8. package/dist/cjs/{index-4jrFyN8u.js → index-C9ymZIiv.js} +1 -1
  9. package/dist/cjs/{index-CkpcUCU5.js → index-DcTksD2K.js} +2 -2
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion_62.cjs.entry.js +44 -14
  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-hook.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -11
  30. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  46. package/dist/cjs/twilight.cjs.js +2 -2
  47. package/dist/cjs/{vanilla-picker-BBejdpPH.js → vanilla-picker-BYDLZw1n.js} +1 -1
  48. package/dist/collection/components/salla-count-down/salla-count-down.js +125 -1
  49. package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +0 -10
  50. package/dist/collection/components/salla-slider/salla-slider.css +4 -0
  51. package/dist/collection/components/salla-slider/salla-slider.js +22 -2
  52. package/dist/components/index.js +2 -2
  53. package/dist/components/salla-count-down2.js +24 -2
  54. package/dist/components/salla-order-details-multiple-bundle-product2.js +0 -10
  55. package/dist/components/salla-slider2.js +23 -3
  56. package/dist/esm/{filepond-BBd4zIxi.js → filepond-DQR2YBu7.js} +1 -1
  57. package/dist/esm/{filepond-plugin-file-poster-Vvhvcuu3.js → filepond-plugin-file-poster-XvYa1rlk.js} +1 -1
  58. package/dist/esm/{filepond-plugin-file-validate-size-NvdGUEr-.js → filepond-plugin-file-validate-size-BRBnctOE.js} +1 -1
  59. package/dist/esm/{filepond-plugin-file-validate-type-BwVZhOLd.js → filepond-plugin-file-validate-type-BuD6F1gi.js} +1 -1
  60. package/dist/esm/{filepond-plugin-image-edit-BOgZn2vW.js → filepond-plugin-image-edit-BJ8YnBRL.js} +1 -1
  61. package/dist/esm/{filepond-plugin-image-exif-orientation-BmbDj4hl.js → filepond-plugin-image-exif-orientation-BGad_AoX.js} +1 -1
  62. package/dist/esm/{filepond-plugin-image-preview-CDsLWAPe.js → filepond-plugin-image-preview-Cb6UzPfa.js} +1 -1
  63. package/dist/esm/{index-LmL2BolE.js → index-Bhszo8cU.js} +2 -2
  64. package/dist/esm/{index-BhHl4h44.js → index-DIfeuyTs.js} +1 -1
  65. package/dist/esm/loader.js +3 -3
  66. package/dist/esm/salla-accordion_62.entry.js +44 -14
  67. package/dist/esm/salla-advertisement.entry.js +1 -1
  68. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  69. package/dist/esm/salla-apps-icons.entry.js +1 -1
  70. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  71. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  72. package/dist/esm/salla-contacts.entry.js +1 -1
  73. package/dist/esm/salla-custom-fields.entry.js +1 -1
  74. package/dist/esm/salla-filters-widget.entry.js +1 -1
  75. package/dist/esm/salla-filters.entry.js +1 -1
  76. package/dist/esm/salla-hook.entry.js +1 -1
  77. package/dist/esm/salla-installment.entry.js +1 -1
  78. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  79. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  80. package/dist/esm/salla-metadata.entry.js +1 -1
  81. package/dist/esm/salla-notification-item.entry.js +1 -1
  82. package/dist/esm/salla-notifications.entry.js +1 -1
  83. package/dist/esm/salla-offer.entry.js +1 -1
  84. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -11
  85. package/dist/esm/salla-order-details-options.entry.js +1 -1
  86. package/dist/esm/salla-order-details.entry.js +1 -1
  87. package/dist/esm/salla-order-summary.entry.js +1 -1
  88. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  89. package/dist/esm/salla-orders.entry.js +1 -1
  90. package/dist/esm/salla-payments.entry.js +1 -1
  91. package/dist/esm/salla-price-range.entry.js +1 -1
  92. package/dist/esm/salla-review-card.entry.js +1 -1
  93. package/dist/esm/salla-reviews-page.entry.js +1 -1
  94. package/dist/esm/salla-reviews.entry.js +1 -1
  95. package/dist/esm/salla-social.entry.js +1 -1
  96. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  97. package/dist/esm/salla-tooltip.entry.js +1 -1
  98. package/dist/esm/salla-trust-badges.entry.js +1 -1
  99. package/dist/esm/salla-verify.entry.js +1 -1
  100. package/dist/esm/salla-wallet.entry.js +1 -1
  101. package/dist/esm/twilight.js +3 -3
  102. package/dist/esm/{vanilla-picker-nCA1ATQw.js → vanilla-picker-C4Kwbr5L.js} +1 -1
  103. package/dist/twilight/{p-23ff2132.entry.js → p-004be2ff.entry.js} +1 -1
  104. package/dist/twilight/{p-48b90fb3.entry.js → p-0daa34c4.entry.js} +1 -1
  105. package/dist/twilight/{p-2ed7cfba.entry.js → p-112e9574.entry.js} +1 -1
  106. package/dist/twilight/{p-312c1af1.entry.js → p-129e02c2.entry.js} +1 -1
  107. package/dist/twilight/{p-fbbd8d5d.entry.js → p-1bfef164.entry.js} +1 -1
  108. package/dist/twilight/{p-d2ed15e9.entry.js → p-25f64b3e.entry.js} +1 -1
  109. package/dist/twilight/{p-966ed241.entry.js → p-307b5fa0.entry.js} +1 -1
  110. package/dist/twilight/{p-3d69e45a.entry.js → p-46fb77ce.entry.js} +1 -1
  111. package/dist/twilight/{p-6c648552.entry.js → p-48617181.entry.js} +1 -1
  112. package/dist/twilight/{p-07add349.entry.js → p-48df4495.entry.js} +1 -1
  113. package/dist/twilight/p-4fc33cee.entry.js +4 -0
  114. package/dist/twilight/{p-9f39c553.entry.js → p-55c9e7fe.entry.js} +1 -1
  115. package/dist/twilight/{p-c38c65f0.entry.js → p-574bd55f.entry.js} +1 -1
  116. package/dist/twilight/{p-4d47725f.entry.js → p-5bb9ace5.entry.js} +1 -1
  117. package/dist/twilight/{p-133f1a48.entry.js → p-60747f3b.entry.js} +1 -1
  118. package/dist/twilight/{p-c302d3e3.entry.js → p-6222b0fa.entry.js} +1 -1
  119. package/dist/twilight/{p-388fb59e.entry.js → p-64c18854.entry.js} +1 -1
  120. package/dist/twilight/{p-950f9a87.entry.js → p-66c5dcd3.entry.js} +1 -1
  121. package/dist/twilight/{p-09dceb55.entry.js → p-7a706d50.entry.js} +1 -1
  122. package/dist/twilight/{p-45cd70b8.entry.js → p-911bbc7d.entry.js} +1 -1
  123. package/dist/twilight/{p-cd2c9076.entry.js → p-9f541d63.entry.js} +1 -1
  124. package/dist/twilight/{p-qNQwLhxq.js → p-B-MyfVCv.js} +1 -1
  125. package/dist/twilight/{p-CIEz2m31.js → p-BVmy-j16.js} +1 -1
  126. package/dist/twilight/{p-LmL2BolE.js → p-Bhszo8cU.js} +1 -1
  127. package/dist/twilight/{p-c0pjDpvN.js → p-BvldZUSR.js} +1 -1
  128. package/dist/twilight/{p-xUcnsSlW.js → p-ByJhdNbq.js} +1 -1
  129. package/dist/twilight/{p-D1_qMmD0.js → p-CmuTtBET.js} +1 -1
  130. package/dist/twilight/{p-2gPrnQD6.js → p-CuNS5C_o.js} +1 -1
  131. package/dist/twilight/{p-TSs7NqKJ.js → p-Cy9bcLMa.js} +1 -1
  132. package/dist/twilight/{p-v9xIxXO9.js → p-DAM1DKLB.js} +1 -1
  133. package/dist/twilight/{p-Bf4kQRcH.js → p-NTgp-Syt.js} +1 -1
  134. package/dist/twilight/{p-74aaf06c.entry.js → p-a25fe3c1.entry.js} +1 -1
  135. package/dist/twilight/{p-8c111815.entry.js → p-a5df8334.entry.js} +1 -1
  136. package/dist/twilight/{p-63e9750c.entry.js → p-a6f250b8.entry.js} +1 -1
  137. package/dist/twilight/{p-4cd30c07.entry.js → p-ae93ed50.entry.js} +1 -1
  138. package/dist/twilight/{p-0aef5345.entry.js → p-af8daa75.entry.js} +1 -1
  139. package/dist/twilight/{p-bcec0cf0.entry.js → p-b0abcc89.entry.js} +1 -1
  140. package/dist/twilight/{p-f74f1591.entry.js → p-b8a203c1.entry.js} +1 -1
  141. package/dist/twilight/p-cadbe7b6.entry.js +4 -0
  142. package/dist/twilight/{p-b30a12dc.entry.js → p-cc43a1bd.entry.js} +1 -1
  143. package/dist/twilight/{p-06956c1d.entry.js → p-cc6238be.entry.js} +1 -1
  144. package/dist/twilight/{p-03870195.entry.js → p-de290cc2.entry.js} +1 -1
  145. package/dist/twilight/{p-549ff403.entry.js → p-ed0f40e2.entry.js} +1 -1
  146. package/dist/twilight/{p-7c85a102.entry.js → p-f3d3e11e.entry.js} +1 -1
  147. package/dist/twilight/{p-f1f60ef7.entry.js → p-f4bf39fb.entry.js} +1 -1
  148. package/dist/twilight/twilight.esm.js +1 -1
  149. package/dist/types/components/salla-count-down/salla-count-down.d.ts +22 -0
  150. package/dist/types/components/salla-order-details/salla-order-details-multiple-bundle-product.d.ts +0 -1
  151. package/dist/types/components/salla-slider/salla-slider.d.ts +3 -0
  152. package/dist/types/components.d.ts +48 -0
  153. package/package.json +5 -5
  154. package/dist/twilight/p-2c9d0518.entry.js +0 -4
  155. package/dist/twilight/p-fff8923d.entry.js +0 -4
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,h as e,H as i,a as s,c as a,F as n,j as l}from"./p-LmL2BolE.js";import{a as o}from"./p-CgtvEd63.js";import{A as r,S as c}from"./p-yRO-ZESF.js";import{I as d}from"./p-uTyAzPSy.js";import{H as h}from"./p-Dljb4XCt.js";import{a as p}from"./p-BedNk7k1.js";import{C as u,G as f}from"./p-CBT_Nxny.js";import{S as m}from"./p-DiKTtDW5.js";import{M as g}from"./p-DmgxDvXL.js";import{w as b}from"./p-DWksgowB.js";import{f as w,t as v}from"./p-Dz7o69vX.js";import{G as y}from"./p-C0JNGIpa.js";const x=class{constructor(e){t(this,e),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 e(i,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:`s-accordion-wrapper ${this.dir} ${this.bordered?"s-accordion-wrapper-bordered":""} ${this.size?`size-${this.size}`:""}`,"data-collapsed":this.collapsed.toString()},e("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))}get host(){return s(this)}};x.style="";const _=class{constructor(e){t(this,e)}render(){return e(i,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},e("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))}};_.style="";var 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>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 S=class{constructor(e){t(this,e),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 e(i,{key:"9d88d243306cdf451c20d7068fbb9f48807b22e9","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},e("div",{key:"bad4c5a913ce1c4581b09c0b6d96fcbdb4236638",class:"s-accordion-head-wrapper-start"},e("slot",{key:"acb83cec8cbca5771a9f84e81c0b955c3edad731",name:"title"}),e("slot",{key:"a4ad42ea6fad4f452c4c218a9ee02dca0adb4a67",name:"progress"}),e("slot",{key:"96ab95d413dc906ac299079f4008816f01881990",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&e("div",{key:"8f9666a5038cd7b1ac6e357c6920ea26d31c5f03",class:"s-accordion-head-wrapper-end"},e("slot",{key:"14895e8c1385e91c14f046c9ae38ce5e4a4c9a60",name:"note"}),this.collapsible&&e("button",{key:"97dc7fabbb207fcc8b68ebf0a86f6c8a980dca13",class:{"s-accordion-head-wrapper-toggle":!0,active:!this.collapsed},onClick:t=>{t.stopPropagation(),this.toggleCollapse()}},e("span",{key:"3b24faf71dcd332663a354310b2ce09f7879eddc",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?k:M}))))}get host(){return s(this)}};S.style="";var C='\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 z=class{constructor(e){t(this,e),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?C: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 e=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);return e&&"function"==typeof e.validateAndScroll?e.validateAndScroll().then((async t=>{const e={isValid:t,component:this};if(await salla.hooks.call("salla-add-product-button","validate",e),e.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,[e,i])=>i?(t[e]=i,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 e("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"},e("div",{slot:"widget-label",class:"s-add-product-button-mini-checkout-content"},e("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?e(i,null,e("salla-product-availability",{...this.getBtnAttributes(),"is-subscribed":!0},e("span",{class:"s-hidden"},e("slot",null)))):"out-and-notify"===this.productStatus&&this.channels||this.hasOutOfStockOption?e(i,null,e("salla-product-availability",{...this.getBtnAttributes()},e("span",{class:"s-hidden"},e("slot",null)))):e(i,{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}},e("div",{class:{"s-add-product-button-main":this.showQuickBuy,"w-full":!document.getElementById("fast-checkout-js")||["financial_support","donating"].includes(this.productType)}},e("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"},e("slot",null)),this.showQuickBuy&&document.getElementById("fast-checkout-js")&&!["financial_support","donating"].includes(this.productType)?this.miniCheckoutWidget():""),this.showQuickBuy&&this.isApplePayActive?e("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 e=salla.storage.get(`product-${this.productId}-subscribed-options`);if((e||this.subscribedOptions)&&this.hasOutOfStockOption)if(salla.config.isGuest()){const t=e?e.map((t=>t.split(",").map((t=>parseInt(t))))):[];this.hasSubscribedOptions=t.length>0&&t.some((t=>t.every((t=>this.selectedOptions.some((e=>e.id===t))))))}else this.hasSubscribedOptions=!(!this.subscribedOptions||"null"===this.subscribedOptions||"[]"===this.subscribedOptions)&&JSON.parse(this.subscribedOptions).some((t=>t.every((t=>this.selectedOptions.some((e=>e.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)}};z.style=":host{display:block}salla-add-product-button[width=wide]{width:100%}";const T=class{constructor(e){t(this,e),this.variant="info"}renderIcon(){const t=this.icon||this.variant;if("none"===t)return null;switch(t){case"success":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return e("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},e("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 e("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 e(i,{key:"3b5dd808399eeda5d930454542cd41cca26b0cc3",class:`s-alert-wrapper s-alert-${this.variant}`},e("span",{key:"4f58234774d1afc790fb83bff983ca9366faa349",class:"s-alert-icon"},this.renderIcon()),e("span",{key:"10eb3f87e6e77dcc5406a24f866feee1cc1f46ef",class:"s-alert-text"},this.message,e("slot",{key:"3656e15aeb25fb7285e88f694c090bad3b32dfbd"})))}};T.style=":host{display:block}";const P=class{constructor(e){t(this,e),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,e,i)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],e,i),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,e=!1){if(!e||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,e){salla.storage.set("afterReloadEvent",{event:t,payload:e})}emitAfterReloadEvent(){const t=salla.storage.get("afterReloadEvent");if(t&&t.event){const e=new CustomEvent(t.event,{detail:t.payload});window.dispatchEvent(e),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 e=t.data.type,i=t.data.message;if(localStorage.getItem("debug")&&console.log(`Received an action:${e}`,t.data),"error"===e){if(i.fields?.reservation)return void salla.notify.error(i.fields.reservation[0]);const t=Object.values(i.fields||[i.message]).flat().map((t=>`<li>${t}</li>`)).join("");salla.notify.error(`<ul>${t}</ul>`)}if("success"===e){if(Number(i.productId)!==Number(this.productId))return;this.reservations=i.data.reservations.map((t=>{if(t.time&&t.time.length>0){const e=t.time[0];return{date:t.date,day:t.day,from_timestamp:e.from,to_timestamp:e.to}}return null})).filter((t=>null!==t)),salla.notify.success(this.bookedLabel),this.modal?.close(),setTimeout((()=>window.location.reload()))}"height"===e&&(this.iframe.height=i?.height+"px")}bookingModal(){return e("salla-modal",{class:"s-booking-field-modal",ref:t=>this.modal=t,width:"md",position:"middle",noPadding:!0},e("iframe",{ref:t=>this.iframe=t,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(t){return e("span",{class:t.from_timestamp?"s-booking-field-reservations-has-time":""},e("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?e("span",{class:"s-booking-field-reservations-time"},e("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'}),e("span",null,t.from_timestamp," - ",t.to_timestamp)):""}render(){return e(i,{key:"04c9e3dc3dc825bd6905221d858c260f7ca34748"},e("div",{key:"07ec38cec1bd1798640dd7ea9592bb3b17d945c6",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?e("div",{class:"s-booking-field-price"},e("span",{innerHTML:salla.money(this.option.price)})):"",e("salla-button",{key:"6b71889cfc0429d15c466a6f194df31549f09786",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:t=>this.openBookingModal(t,!1)},e("span",{key:"a16f8db6f52c7751ea605efcae04057ca0dc5b61",class:"s-booking-field-book-now-content"},e("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&&e("div",{key:"b3615100bbfff3d98d0ac99145aaf53449790c94",class:"s-booking-field-reservations"},this.reservations.map(((t,i)=>e("div",{key:i,class:"s-booking-field-reservations-item"},this.renderReservationDate(t),this.renderReservationTime(t))))),e("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(e){t(this,e),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 e("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?[e("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},e("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[e("div",{class:"s-bottom-alert-modal-content-title"},e("i",{innerHTML:I,class:"s-bottom-alert-modal-content-icon"}),e("span",null,this.storeFeatures)),e("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),e("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[e("div",{class:"s-bottom-alert-modal-content-title"},e("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"}),e("span",null,this.storePriceDetails)),e("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((t=>e("div",{class:"s-bottom-alert-modal-content-price-details-item"},e("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"}),e("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},t.name),e("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(t.price)})))))]:""),this.templateData?.link?e("div",{class:"s-bottom-alert-modal-content-footer"},e("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},e("i",{innerHTML:C}),this.buyTheTemplate)):"")]:"")}render(){const t=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return e(i,{key:"e5f273d72875760e30d99d419b247137583bc450",class:"s-bottom-alert-wrapper "+(t?"s-bottom-alert-wrapper-with-template":"")},t&&e("div",{key:"1db37d7c67aae449f41a9a3ed83489b2a0653cef",class:"s-bottom-alert-logo-section"},e("img",{key:"18701cd3d807042b4d852f283d43a6855282f791",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),e("span",{key:"66bb3f9b3c00aee5c2694d5ddb142e753ae7fa1a",class:"s-bottom-alert-logo-text"},this.readyStores)),e("div",{key:"01d47c9ec38370b83bdb3fdc29291f55e1b3aa42",class:"s-bottom-alert-content"},e("div",{key:"5380873bf9d393c0fa18da196e1bfb675a8c9c9b",class:"flex items-center gap-2"},e("div",{key:"882382de35a7c9a767e2eb90305c8a973d01ac21",class:"s-bottom-alert-icon"},e("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'})),e("div",{key:"dfbaa427fd4e8b755a479e0b5459422e44a95f59",class:"s-bottom-alert-message"},this.message?this.message:t?e("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,e("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),e("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&e("div",{key:"327ef4b5ecdab7d994418c033a78c2531eb28de5",class:t?"s-bottom-alert-actions-group":"s-bottom-alert-action"},t?this.loading?e("salla-loading",{size:"20"}):e("div",{class:"s-bottom-alert-actions-group-container"},e("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?e("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):e("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 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>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',O='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>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 E=class{constructor(e){t(this,e),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 e=this.getSessionBreadcrumbs();return"product.single"===t.slug&&e&&e.length>0?(e.push({title:t.title,url:t.url}),this.breadcrumbs=this.setBreadcrumbsFromArray(e),this.storeBreadcrumbSnapshot()):e&&e.length>0?this.isNewPage(t,e)?(this.breadcrumbs=this.generateBreadcrumbs(t),this.storeBreadcrumbSnapshot()):this.breadcrumbs=this.setBreadcrumbsFromArray(e):(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,e){const i=e[e.length-1];return i?.url!==t.url}setBreadcrumbsFromArray(t){return t.map(((e,i)=>({...e,is_last:i===t.length-1})))}sanitizeBreadcrumbTitle(t,e=1){return t.includes("|")?t.split("|").map((t=>t.trim()))[e]:t.trim()}generateBreadcrumbs(t){let e=[];if("product.single"===t.slug){const e=this.getSessionBreadcrumbs();if(e.length>0&&e[1]?.url===t.parent?.url)return this.setBreadcrumbsFromArray([...e,t])}let i=t;for(;i;)i.title&&e.unshift({title:i.title,url:i.url}),i=i.parent;return t.slug.includes("customer")&&"customer.profile"!==t.slug&&e.unshift({title:salla.lang.get("common.titles.profile"),url:salla.url.get("profile")}),t.slug.includes("blog")&&e.unshift({title:salla.lang.get("blocks.footer.blog"),url:salla.url.get("blog")}),"brands.single"===t.slug&&e.unshift({title:salla.lang.get("common.titles.brands"),url:salla.url.get("brands")}),t.title||"loyalty"!==t.slug||e.unshift({title:salla.lang.get("common.titles.loyalty_program"),url:salla.url.get("loyalty")}),e.unshift({title:salla.lang.get("common.titles.home"),url:salla.url.get("")}),e}storeBreadcrumbSnapshot(){try{const t=salla.config.get("page");if("product.single"===t?.slug)return;const e=[...this.breadcrumbs],i=e.length-1;i>=0&&(e[i].url=window.location.href);const s=JSON.stringify(e);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):e("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 i="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,i);return[e("div",{class:"s-breadcrumb-slot",innerHTML:s}),this.getArrowDomForItem(t)]})))}getArrowDomForItem(t){if(t.is_last)return"";let i=this.iconSlot||(salla.config.get("theme.is_rtl",!0)?A:O);return e("li",{class:"s-breadcrumb-arrow"},e("div",{class:{"s-breadcrumb-icon-slot":!0,"s-breadcrumb-default-icon":!this.iconSlot},innerHTML:i}))}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)}};E.style=":host{display:block}";const D=class{constructor(e){t(this,e),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(){const t={};for(let e=0;e<this.host.attributes.length;e++)["color","fill","size","width","id"].includes(this.host.attributes[e].name)||(t[this.host.attributes[e].name]=this.host.attributes[e].value);t.type=t.type||this.type;const e=t.class||"";return t.class=e+" 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),t["aria-label"]||t["aria-labelledby"]||(this.host.textContent||"").trim()||(e.includes("btn--wishlist")||e.includes("wishlist")?t["aria-label"]=salla.lang.getWithDefault("pages.products.add_to_wishlist","Add or remove to wishlist"):"icon"===this.shape&&console.warn("Icon button is missing aria-label attribute")),t}button(){return e("button",{...this.getBtnAttributes(),disabled:this.disabled},e("span",{class:"s-button-text",ref:t=>this.text=t},e("slot",null)),this.loading?e("span",{class:"s-button-loader"}):"")}render(){return this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":e(i,{class:"s-button-wrap"},this.href?e("a",{href:this.href},this.button()):this.button())}get host(){return s(this)}};D.style="";const j=class{constructor(e){t(this,e),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 e=this.host.querySelector("#s-cart-icon"),i=e.getBoundingClientRect(),s=i.top+window.scrollY,a=i.left+window.scrollX,n=t.getBoundingClientRect(),l=t.offsetWidth+"px",r=t.offsetHeight+"px",c=n.top,d=n.left,h=document.createElement("img");h.src=t.getAttribute("src"),h.className="s-cart-thumb",h.setAttribute("style","object-fit:cover; width:"+l+"; height:"+r+"; top:"+c+"px; left:"+d+"px;z-index:99999999; "),document.body.append(h);let p=document.querySelector(".s-cart-thumb");e.classList.remove("animated","rubberBand"),(new o.timeline).add({targets:p,width:[150,30],height:[150,30],top:[c,window.scrollY>0?s-window.scrollY-40:s-40],left:[d,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(){e.classList.add("animated","rubberBand"),p.remove()}},"-=1700")}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const e=salla.config.get("store.scope",salla.storage.get("scope"));if(e&&e.id)try{const i=new URL(t);return i.searchParams.set("scope",e.id),i.toString()}catch(i){const s=t.includes("?")?"&":"?";return`${t}${s}scope=${encodeURIComponent(e.id)}`}return t}render(){return e(i,{key:"f22c9fc5b6ad2c7b7f026a7b9ad2510a3c27c281"},e("a",{key:"b329fa512839a8dd6d8a1b175e254308c22a9fb0",class:"s-cart-summary-wrapper",href:this.getCartLink()},e("div",{key:"fbe89bcca0f38393a23016cf45358d38a53e5f8f",id:"s-cart-icon"},e("slot",{key:"f2668edcc903f0a8fd112c6449d8cda9113e2ffa",name:"icon"},e("i",{key:"f4a2c742903302b2676c4628961a90a7bcfe43eb",class:"s-cart-summary-icon",innerHTML:C}))),e("span",{key:"49678efeaae684b2da2c238382b014390516db8d",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),e("p",{key:"9a399f82fc90e6c974022b65ea75c3f556f67221",class:"s-cart-summary-content"},this.showCartLabel&&e("span",{key:"879348fe4998f2eb3f26e4bebe486877bc733bff",class:"s-cart-summary-label"},this.cartLabel),e("b",{key:"237d3ee6ebed4203752b6f5c4e2cb962c03cc087",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return s(this)}};j.style="";const F=class{constructor(e){t(this,e),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.picker=null,this.pickerReady=null,this.name="color",this.required=!1,this.format="hex",this.showCancelButton=!1,this.showTextField=!0,this.enableAlpha=!1}colorChangeHandler(t){this.colorInput&&(this.colorInput.value=t.hex),this.colorChanged.emit(t)}async submittedHandler(t){await this.setColorValue(t.rgbaString,!0),this.canvas&&(this.canvas.style.backgroundColor=t.rgbString),this.colorInput&&(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 ensurePicker(){if(this.picker)return this.picker;if(this.pickerReady)return await this.pickerReady;throw new Error("Color picker not initialized")}async setPickerOption(t){(await this.ensurePicker()).setOptions(t)}async movePopUp(t,e){(await this.ensurePicker()).movePopup(t,e)}async setColorValue(t,e){(await this.ensurePicker()).setColor(t,e)}async openPicker(){(await this.ensurePicker()).show()}async closePicker(){(await this.ensurePicker()).hide()}async destroyPicker(){(await this.ensurePicker()).destroy(),this.picker=null,this.pickerReady=null}componentWillLoad(){salla.onReady((()=>{this.color=this.color?this.color:salla.config.get("theme.color.primary","#5dd5c4")}))}setPopInPosition(){const t=this.host.querySelector(".picker_wrapper"),e=this.host.querySelector(".s-color-picker-widget");if(!t||!e)return;const i=e.getBoundingClientRect(),s=window.innerWidth/2-i.width/2,a=s>i.x,n=s<i.x,l=s===i.x,o=window.innerWidth<768;o&&a&&(t.style.left="0"),o&&n&&(t.style.left="auto"),(!o||o&&(!n&&!a||l))&&(t.style.left="-95px")}initColorPicker(){this.pickerReady=import("./p-Bf4kQRcH.js").then((function(t){return t.v})).then((t=>{const e=new(0,t.default)({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)});return this.picker=e,this.picker}))}render(){return e(i,{key:"f6a001611bf20e8264346028c848490cf94c686a",class:"s-color-picker-main"},e("slot",{key:"79648d165d81f200e064c8ef56a138f6b66757ed",name:"widget"},e("div",{key:"95e7a8b7a92f5bb8f6f05b8cd39e6c91710e52a2",class:"s-color-picker-widget"},e("div",{key:"24813d1de9a5834cfd37edf7affd4be94608f96c",class:"s-color-picker-widget-canvas",ref:t=>this.canvas=t}),e("span",{key:"5f29f537140bc4b74431fc33229563cb1b7ce231",innerHTML:r}))),e("input",{key:"188a9d7233388fca9a25cd5d319c0973448b07bc",class:"s-hidden",name:this.name,required:this.required,value:this.color,ref:t=>this.colorInput=t}))}componentDidLoad(){this.canvas&&(this.canvas.style.backgroundColor=this.color),this.initColorPicker(),this.colorInput&&(this.colorInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.colorInput.addEventListener("input",(()=>{this.colorInput.setCustomValidity(""),this.colorInput.reportValidity()})))}get host(){return s(this)}};F.style="";const R=class{constructor(e){t(this,e),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 e(i,{key:"fbea28507c188a338ee066b5198bcf93de2fbda2"},this.canComment?e("form",{ref:t=>this.commentForm=t},e("div",{class:"s-comment-form-wrapper"},this.showAvatar?e("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",e("div",{class:"s-comment-form-content"},e("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:t=>this.commentField=t,placeholder:this.placeholder,class:"s-comment-form-input",required:!0}),e("br",null),e("div",{class:"s-comment-form-action"},e("salla-button",{ref:t=>this.submitBtn=t,"loader-position":"center",onClick:()=>this.submit()},this.submitText))))):"")}};R.style=":host{display:block}";const H=class{constructor(e){t(this,e),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,e,i)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],e,i),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[e]=t.split(" "),[i,s,a]=e.split("-");return`${parseInt(a,10)}/${parseInt(s,10)}/${parseInt(i,10)}`}getTime(t){const[,e]=t.split(" "),[i,s]=e.split(":");return`${parseInt(i,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 e=t?`rating/${this.comment.id}/unlike`:`rating/${this.comment.id}/like`,i=await salla.api.request(e,"","put");salla.log(i.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,e){this.likedComments=JSON.parse(localStorage.getItem("liked_comments")||"[]"),e?this.likedComments.includes(t)||this.likedComments.push(t):this.likedComments=this.likedComments.filter((e=>e!==t)),localStorage.setItem("liked_comments",JSON.stringify(this.likedComments))}PinnedIcon(){return e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16",color:"#555555",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},e("path",{d:"M12 16V21"}),e("path",{d:"M8 5.2918C8 5.02079 8 4.88529 8.01312 4.77132C8.1194 3.84789 8.84789 3.1194 9.77133 3.01312C9.88529 3 10.0208 3 10.2918 3H13.7082C13.9792 3 14.1147 3 14.2287 3.01312C15.1521 3.1194 15.8806 3.84789 15.9869 4.77132C16 4.88529 16 5.02079 16 5.2918C16 5.37885 16 5.42237 15.9967 5.46264C15.9708 5.78281 15.7927 6.07104 15.5179 6.2374C15.4834 6.25832 15.4444 6.27779 15.3666 6.31672L15.1055 6.44726C14.7021 6.64897 14.5003 6.74983 14.3681 6.90564C14.26 7.03286 14.1856 7.18509 14.1515 7.34846C14.1097 7.54854 14.1539 7.76968 14.2424 8.21197L15 12H15.3333C15.9533 12 16.2633 12 16.5176 12.0681C17.2078 12.2531 17.7469 12.7922 17.9319 13.4824C18 13.7367 18 14.0467 18 14.6667C18 14.9767 18 15.1317 17.9659 15.2588C17.8735 15.6039 17.6039 15.8735 17.2588 15.9659C17.1317 16 16.9767 16 16.6667 16H7.33333C7.02334 16 6.86835 16 6.74118 15.9659C6.39609 15.8735 6.12654 15.6039 6.03407 15.2588C6 15.1317 6 14.9767 6 14.6667C6 14.0467 6 13.7367 6.06815 13.4824C6.25308 12.7922 6.79218 12.2531 7.48236 12.0681C7.73669 12 8.04669 12 8.66667 12H9L9.75761 8.21197C9.84606 7.76968 9.89029 7.54854 9.84852 7.34846C9.81441 7.18509 9.73995 7.03286 9.63194 6.90564C9.49965 6.74983 9.29794 6.64897 8.89452 6.44726L8.63344 6.31672C8.55558 6.27779 8.51665 6.25832 8.48208 6.2374C8.20731 6.07104 8.02917 5.78281 8.00326 5.46264C8 5.42237 8 5.37885 8 5.2918Z"}))}render(){let t="admin"==this.comment.type;return e(i,{key:"05979122884df06d634ab4f75f61d12cee93b228",class:t?"s-comments-item-admin":"s-comments-item"},e("div",{key:"d3be984afb159d8d6a1d4c0daf0bb72c97136a3a",class:{"s-comments-item-wrapper":!t,"s-comments-item-admin-wrapper":t},id:`s-comments-item-${this.comment.id}`},e("div",{key:"29a48174434b634e4afa5a1f2339b04705ea9f90",class:"s-comments-item-inner s-comments-flex-1"},t&&e("span",{key:"b2536843c0549b2eb24759a09f51a97b68e36654",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'}),e("div",{key:"553ad8fd8a3ada5cbca3c744f8b80a259ae7d2c2",class:"s-comments-item-avatar"},e("img",{key:"57d429fa1dc545d3fe16c1f4713b960d1d7ef9f8","data-src":this.comment?.avatar,alt:this.comment?.name,src:this.comment?.avatar,class:"s-comments-item-avatar-img lazy"})),e("div",{key:"8b2a3206dfa97c41a731baf18794e44ce096876f",class:"s-comments-flex-1"},e("div",{key:"95ebefb4d82bb66d7cbc567554d0b9da2e4b416a",class:"s-comments-item-user-wrapper"},e("div",{key:"1e6091d08973e5fc2ae8a982e6b09e5d349fede3",class:"s-comments-item-user-info"},e("h3",{key:"ee5ea0ea457fc43ee49cae033097297ab8358f76",class:this.comment.is_pinned?"s-comments-item-user-info-name":"s-comments-item-user-info-name-with-margin"},this.comment?.name),this.comment.is_pinned?e("div",{class:"s-comments-item-pinned-icon-with-margin"},this.PinnedIcon()):null,!this.comment.has_order&&!this.comment.rating||this.comment.is_pending||this.hideBought?null:e("div",{class:"s-comments-flex"},this.comment.has_order?[e("span",{class:"s-comments-item-has-order-check-icon",innerHTML:d}),e("span",{class:"s-comments-item-has-order-check-text"},this.has_bought_trans," ",this.comment.rating?", ":"")]:null,this.comment.rating?e("span",{class:"s-comments-item-rated-widget"},this.rated_trans):null)),e("p",{key:"80c430d77b6ae3e959db9bc089fd7fe834e56bd2",class:"s-comments-item-timestamp s-ltr"},this.getDate(this.comment.created_at?.date),e("span",{key:"49a1b26309490d6252f0fbd53b50374cbf10071d",class:"s-comments-item-time"}," - ",this.getTime(this.comment.created_at?.date))),this.comment.rating||this.comment.stars?e("salla-rating-stars",{size:"mini",class:"s-comments-item-stars",value:this.comment.rating||this.comment.stars}):null),e("div",{key:"780bee1166000b296e6956921c71cfd4f48e8153",class:"s-comments-item-content"},e("p",{key:"9ff2a32cbd551ff911300ce6cfa1065770117a18",innerHTML:this.comment.content}),this.allowAttachImages&&e("div",{key:"f47022f4916c3d4e0641273612b4a5f7c69a4595",class:"s-comments-item-images"},this.comment.images.map(((t,i)=>e("img",{key:i,src:t,alt:"",onClick:()=>this.modal.open()}))),e("salla-modal",{key:"8e70ec00301d369bbed5c1f11a1887a0498e2b0c",ref:t=>this.modal=t,width:"sm"},e("salla-slider",{key:"65cb35fd60869f64780fbb5bfc61fbc3cddc49c9",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"},e("div",{key:"bb0cf465f99ecfe9ee10dfb96949cd7b5793da90",slot:"items"},this.comment.images.map(((t,i)=>e("img",{key:i,src:t,alt:""})))),e("div",{key:"e195759f1df5a87b761478ac4a379411f284785c",slot:"thumbs"},this.comment.images.map(((t,i)=>e("div",{class:"s-comments-item-images-slider-thumb"},e("img",{key:i,src:t,alt:""})))))))),this.allowLikes&&!t&&salla.url.is_page("product.single")?e("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()},e("span",null,this.helpfulLabel," ",this.likesCount>0?`(${this.likesCount})`:""),e("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?e("span",{class:"s-comments-item-pending-text"},this.waiting_approval_trans):null))),this.getReplies().length&&!t?this.getReplies().map((t=>e("div",null,e("salla-comment-item",{comment:t})))):null))}get host(){return s(this)}};var B;H.style=":host{display:block}",function(t){t.PAGE="page",t.PRODUCT="product",t.BLOG="blog"}(B||(B={}));const q=class{constructor(e){t(this,e),this.type=B.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,e,i)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],e,i),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,e){const i=t.split("|"),s=[{condition:0===e,index:0},{condition:1===e,index:1},{condition:2===e,index:2},{condition:e>2&&e<=10,index:3},{condition:e>=11,index:4}],{index:a}=s.find((({condition:t})=>t))||{index:i.length-1};return i[a].replace(":count",salla.helpers.number(e.toString())).replace(/\{[0-9]+\}/g,"").replace(/\[\d+,\d+\]|\[11,\*\]/g,"")}wrapConsoleError(){Salla.infiniteScroll.errorWrapped||((()=>{const t=console.error.bind(console);console.error=(...e)=>{const i=e[0];return"string"==typeof i&&i.toLowerCase().replace(/\s/g,"").includes("infinitescroll")?console.log(...e):t(...e)}})(),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 e of this.handleResponse(t))this.wrapper.append(e);const e=this.host.querySelectorAll("salla-comment-item:not(.animated):not(.s-comments-item-admin)");this.animateItems(e),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 e=this.status?.querySelector(".s-button-text");e&&(h.toggleElementClassIf(e,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}animateItems(t){o({targets:t,opacity:[0,1],duration:1200,translateY:[20,0],delay:(t,e)=>100*e,easing:"easeOutExpo",complete:()=>{for(const e of t)e.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 e=document.createElement("salla-comment-item");return e.comment=t,e.hideBought=this.hideBought,e}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 e=new URLSearchParams(window.location.search);if(e.has("sort")&&(this.sort=e.get("sort")),this.testimonials){const e={sort:this.sort,type:"store"};t=await salla.api.request("reviews",{params:e},"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 e=this.nextPage.includes("?");/[?&]sort=/.test(this.nextPage)||(this.nextPage=this.nextPage+(e?"&":"?")+`sort=${this.sort}`)}setTimeout((()=>{for(const e of this.handleResponse(t))this.wrapper.append(e);this.initiateInfiniteScroll();const e=this.wrapper.querySelectorAll("salla-comment-item:not(.animated)");this.animateItems(e)}),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?e("div",null,this.total&&!this.hideTitle?e("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",this.hideForm||this.testimonials?"":e("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),e("div",{class:"s-comments-placeholder"},e("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'}),e("p",null,this.noComments))):e("div",{class:`s-comments s-comments-${this.testimonials?"testimonials":this.type}`},e("div",{class:this.type===B.PAGE?"s-comments-page-container":"s-comments-container"},this.total&&!this.hideTitle?e("h2",{class:"s-comments-title"},this.blockTitle?this.blockTitle:this.comment_title):"",!this.hideForm&&e("salla-comment-form",{showAvatar:this.showFormAvatar,type:this.type,"item-id":this.itemId}),salla.url.is_page("product.single")?e("salla-reviews-summary",{itemId:this.itemId}):"",e("div",{class:"s-comments-header "+(this.total?"has-total":"")},!!this.total&&e("span",{class:"s-comments-count-label",innerHTML:this.pluralize(this.comment_name,this.total)}),this.total&&!this.testimonials&&this.type!==B.BLOG?e("div",{class:"s-comments-filter-wrapper"},e("label",{class:"s-comments-filter-label",htmlFor:"comments-filter"},salla.lang.get("pages.categories.sorting")),e("select",{id:"comments-filter","aria-label":salla.lang.get("pages.categories.sorting"),class:"s-form-control s-comments-sort-input",onChange:t=>{this.sort=t.target.value,this.reload()}},e("option",{value:"latest",selected:!0},salla.lang.get("pages.testimonials.sort_by_date_desc")),e("option",{value:"oldest"},salla.lang.get("pages.testimonials.sort_by_date_asc")),this.allowLikes&&e("option",{value:"most_helpful"},this.mostHelpfulLabel))):""),e("div",{ref:t=>{this.wrapper=t}}),this.nextPage&&e("div",{class:"s-infinite-scroll-wrapper",ref:t=>{this.status=t}},e("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary",type:"button"},e("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),e("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)}};q.style=":host{display:block}";const N=class{constructor(e){t(this,e)}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 e=t.target.name.replace("[]",""),i="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^="${e}"]`),this.host.querySelectorAll(`[data-show-when^="${e}"]`).forEach((e=>{let n,l=!e?.dataset.showWhen.includes("!="),o=e?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();n=i?Array.from(this.host.querySelectorAll(`input[name="${t.target.name}"]:checked`),(t=>t?.value)).includes(o.toString()):s?t.target.checked&&t.target.value===o:a?o===t.target.value||"true"===o.toLowerCase()&&""!==t.target.value.trim():o===t.target.value,salla.log("The input is ",i?"Multiple":s?"Radio":a?"Text":"Single"," value:",n),l&&n||!l&&!n?(e.classList.remove("hidden"),e.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 e=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${t.getAttribute("name")}"]`));e.some((t=>t.checked))&&e.forEach((t=>{t.removeAttribute("required")}))}}))):(this.hideAllOptions(e.dataset.optionId),e.classList.add("hidden"),this.disableInputs(e))}))}componentDidRender(){this.host.querySelectorAll("[data-show-when]").forEach((t=>{let e=t?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();e&&this.changeHandler({target:this.host.querySelector('[name^="'+e+'"]')})}))}render(){return e(i,{key:"af75ffed0725edefeb9e6fcd2f95bf9209f63dd0"},e("slot",{key:"b28f91555071a31d967d85ba7d693e16266bcc6c"}))}get host(){return s(this)}},G=class{constructor(e){t(this,e),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 e,i=t.includes("-"),s=t.split(" ");return e=i?s[0].replace(/-/g,"/"):s[0],!isNaN(Date.parse(e))}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 e=t.getTime();this.countInterval=setInterval((()=>{let t=(new Date).getTime(),i=e-t;this.days=this.number(Math.floor(i/864e5)),this.hours=this.number(Math.floor(i%864e5/36e5)),this.minutes=this.number(Math.floor(i%36e5/6e4)),this.seconds=this.number(Math.floor(i%6e4/1e3)),i<0&&this.endCountDown()}),1e3)}renderCountDown(){return e("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}`},e("li",{class:"s-count-down-item"},e("div",{class:"s-count-down-item-value"},this.seconds),this.labeled&&e("div",{class:"s-count-down-item-label"},this.secondsLabel)),e("li",{class:"s-count-down-item"},e("div",{class:"s-count-down-item-value"},this.minutes),this.labeled&&e("div",{class:"s-count-down-item-label"},this.minutesLabel)),e("li",{class:"s-count-down-item"},e("div",{class:"s-count-down-item-value"},this.hours),this.labeled&&e("div",{class:"s-count-down-item-label"},this.hoursLabel)),e("li",{class:"s-count-down-item"},e("div",{class:"s-count-down-item-value"},this.days),this.labeled&&e("div",{class:"s-count-down-item-label"},this.daysLabel)))}renderInvalidDate(){return e("div",{class:"s-count-down-text-center"},this.invalidDate)}renderOfferEnded(){return e("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)?e("div",{class:"s-count-down-info-message"},e("i",{class:"sicon-info"}),e("span",null,salla.lang.getWithDefault("pages.products.expected_to_be","متوقَّع توفُّره بتاريخ:")),e("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?e("div",{class:"s-count-down-pre-order-container"},e("p",{class:"text-sm "},salla.lang.getWithDefault("pages.products.pre_order_ends_in","ينتهي الطلب المسبق خلال:")),this.renderCountDown()):null}renderPreOrder(){return e("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 e(i,{key:"96bba6312e710673e1f249cabecfc8756fac5c0e",class:"s-count-down-wrapper "+(this.preOrder&&this.isValidDate(this.date)?"s-count-down-pre-order":"")},this.renderContent(),this.offerEnded&&this.renderOfferEnded())}};G.style="";const W=class{constructor(e){t(this,e),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 e("div",{key:"f619b5fa5fdb68b3cc8562be43496dabb1d78f37",class:"s-datetime-picker"},e("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,e)=>this.picked.emit(this.value=e)};this.flatpickr(this.dateInput,t),this.dateInput.addEventListener("invalid",(t=>{this.invalidInput.emit(t)})),this.dateInput.addEventListener("input",(()=>{this.dateInput.setCustomValidity(""),this.dateInput.reportValidity()}))}};W.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 U='\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',V='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>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 J=class{constructor(e){t(this,e),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 e=this.host.querySelector(".s-drawer-body");h.toggleElementClassIf(e,"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?e(i,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:t=>this.handleKeyUp(t)},e("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:t=>this.overlay=t,onClick:()=>this.closeDrawer("backdropClick")}),e("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},e("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")},e("slot",{name:"loading"},e("salla-loading",null)),e("div",{class:"s-hidden"},e("slot",null))))):e(i,{class:"salla-drawer s-drawer s-drawer-container s-hidden","aria-modal":"true",role:"dialog"},e("div",{class:"s-drawer-overlay s-drawer-overlay-leaving",ref:t=>this.overlay=t,onClick:()=>this.closeDrawer("backdropClick")}),e("div",{class:"s-drawer-wrapper s-drawer-wrapper-"+this.position},e("div",{class:"s-drawer-body s-drawer-leaving s-drawer-"+this.position+" s-drawer-"+this.getWidth()+(this.noPadding?" s-drawer-nopadding":" s-drawer-padding")},e("div",{class:{"s-drawer-header":!0,"s-drawer-is-center":this.centered}},this.isClosable?e("button",{class:"s-drawer-close",onClick:()=>this.closeDrawer("closeButtonClick"),type:"button"},e("span",{innerHTML:U})):"",this.drawerTitle||this.subTitle?e("div",{class:"s-drawer-header-inner"},e("slot",{name:"icon"},this.iconStyle?e("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?V:X}):""),e("div",{class:"s-drawer-header-content"},this.drawerTitle?e("div",{class:{"s-drawer-title":!0,"s-drawer-title-below":this.subTitleFirst},innerHTML:this.drawerTitle}):"",this.subTitle?e("p",{class:{"s-drawer-sub-title":!0},innerHTML:this.subTitle}):"")):""),e("slot",null),e("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return s(this)}static get watchers(){return{visible:["handleVisible"]}}};J.style="";const Z=class{async loadFilePond(){if(!this.filePondLoaded)try{const[t,e,i,s,a,n,l]=await Promise.all([import("./p-xUcnsSlW.js").then((function(t){return t.f})),import("./p-TSs7NqKJ.js").then((function(t){return t.f})),import("./p-CIEz2m31.js").then((function(t){return t.f})),import("./p-c0pjDpvN.js").then((function(t){return t.f})),import("./p-qNQwLhxq.js").then((function(t){return t.f})),import("./p-2gPrnQD6.js").then((function(t){return t.f})),import("./p-v9xIxXO9.js").then((function(t){return t.f}))]);this.FilePond=t,this.FilePond.registerPlugin(s.default,i.default,e.default,a.default,n.default,l.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(e){t(this,e),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,e,i)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],e,i),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,e){if(this.added.emit({error:t,file:e}),this.host.querySelector(".filepond--root").classList.remove("s-file-upload-has-error"),t||!e.file.type)return void this.host.querySelector(".filepond--root").classList.add("s-file-upload-has-error");let i=new DataTransfer,s=this.getFormDataFileInput();i.items.add(e.file),s.type="file",s.files=i.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 e=this.getFormDataFileInput();e.type="hidden",e.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="",e.dispatchEvent(new window.Event("change",{bubbles:!0}));let i=this.allowMultiple?t.getMetadata("id"):t;return this.removed.emit(i)}async setOption(t,e){this.filepond[t]=e}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 e=new XMLHttpRequest;return e.open("HEAD",t,!1),e.send(null),200===e.status?e.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 e(i,{key:"45383bff9bc408ef0328e888751827e6fc70038d",class:{"s-file-upload":!0,"s-file-upload-profile-image":this.profileImage,"s-file-upload-multiple":this.allowMultiple}},e("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?e("div",{class:"s-file-upload-hint s-hidden"},this.max_count_hint(this.maxFilesCount)):"",e("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,e)=>this.addedHandler(t,e),onwarning:t=>{"Max files"===t.body&&salla.notify.error(this.max_images_count(this.maxFilesCount))},onprocessfile:(t,e)=>{if(this.allowMultiple&&!t){const t=e.serverId,i=this.uploadedFiles.find((e=>e.id===t));i&&(e.setMetadata("id",i.id,!0),e.setMetadata("url",i.url,!0),this.value={id:i.id,url:i.url},this.uploadedHandler())}},onupdatefiles:t=>{const e=this.host.querySelector(".filepond--drop-label"),i=this.host.querySelector(".filepond--list-scroller");this.allowMultiple&&(t.length>0?(e.classList.add("s-hidden"),!this.isListScrollerListenerAdded&&t.length<this.maxFilesCount&&(this.showMaxCountHint=!0,i.addEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!0)):(e.classList.remove("s-hidden"),this.isListScrollerListenerAdded&&(i.removeEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!1)),t.length===this.maxFilesCount&&this.isListScrollerListenerAdded&&(i.removeEventListener("click",this.openFileBrowser),this.isListScrollerListenerAdded=!1,this.showMaxCountHint=!1))},server:{url:this.url,method:this.method,revert:null,process:{onload:t=>{let e=JSON.parse(t).data;if((this.instantUpload||this.allowMultiple)&&Array.isArray(e)&&e.length>0){const t=`${this.host.id}-${Math.floor(100+900*Math.random())}`;return this.uploadedFiles.push({id:t,url:e[0]}),t}return this.value=e.filePath||e.url,this.uploadedHandler(),this.value},headers:salla.api.getHeaders(),onerror:t=>{try{let e=JSON.parse(t).error.fields;return e=e[this.payloadName||this.name],e&&e[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 e=new FormData;return t.forEach((t=>{e.append("files[]",t)})),e.append("type",this.type),e}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[e,i]of Object.entries(this.payloadParams))t.append(e,i);this.cartItemId&&t.append("cart_item_id",this.cartItemId);try{Object.entries(JSON.parse(this.formData)).forEach((e=>e[1]&&t.append(e[0],e[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((e=>{this.removedHandler(t),e(!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)}};Z.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 Y='\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 K=class{constructor(e){t(this,e),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,e,i){for(let s in t){if(!t.hasOwnProperty(s)||null==t[s])continue;const a=i?`${i}[${s}]`:s;"object"!=typeof t[s]||null===t[s]||t[s]instanceof File?e.set(a,t[s]):this.mergeObjectToFormData(t[s],e,a)}return e}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,e=250,i=0,s=0){let a=document.querySelector(`#${this.hostId} .gift-step-${t}`);setTimeout((()=>{this.stepsWrapper.style.height=s?`${s}px`:a.offsetHeight+i+"px"}),e)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let e=t.target.children[t.target.selectedIndex].getAttribute("data-id"),i="custom"==e;this.showGiftText=i,e?(this.selectedGiftTextOption=e,this.selectedText=i?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 o.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:o.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:o.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 e=new o.timeline({autoplay:!1});e.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:o.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:o.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),e.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 e=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");e.classList.add("filepond-bg"),e.classList.remove("s-hidden"),e.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(e),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 e=t.target.value;this.selectedCountryId=e;const i=this.gift?.countries?.find((t=>t.id==e));if(this.selectedCountryCode=i?.country_code,!e||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=${e}`);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 e=t.detail;this.receiverMobile=e.number,this.receiverCountryCode=e.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 e={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 i;this.productId&&this.formSelector&&(i=this.getFormDataFromForm()||new FormData,i=this.mergeObjectToFormData(e,i));const s=this.productId?()=>salla.product.addProductGiftToCart(this.productId,i,!0):()=>salla.cart.addCartGiftToCart(e,!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[e("div",{key:"69f449221a2abf8e4d9264b46ab023eb7baca314"},e("salla-list-tile",{key:"0072bab6171c9b11e54f0c6655c408b12d554e24",class:this.generateClass()},e("div",{key:"38aa5f8decf6d9c97253c3c16b80a478d623985e",slot:"title"},this.vertical?e("span",{innerHTML:Y}):"",e("h3",{key:"37fddbe7a80f38b3acca42220028208cab52ba15"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),e("div",{key:"b3bf6bff40b60a3fbace637ed69f6aa72853c04b",slot:"subtitle"},e("div",{key:"46643b7cd897524ca42c41da24e657401f85ab28"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),e("div",{key:"5129acfd67425ccfad68b3770843f11c9fa55b18",slot:"action"},e("salla-button",{key:"0e93efc647444a26198e4631614b8590f75f122e",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},e("slot",{key:"b88d95a25308cebc29b796bb2b0c25e4fa230406",name:"widget-btn-content"},e("div",{key:"4cdbaaeb2bc67f056ea348755ffbdfbc831a1a5b",class:"s-gifting-widget-action-content"},e("span",{key:"7dfec389970416df9be46c8ae5f0904dd64e17ad",innerHTML:Y}),"  ",e("span",{key:"768f3621011bc3c984dce13ce83b3fb6cceb0171"},this.sectionBtnText)))))),e("salla-modal",{key:"b3c94ef80f955b42baecd963f5550f17a80c6fb4",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},e("div",{key:"c09e12eabff63ba1a781c8980b449f854affc164",slot:"loading"},e("div",{key:"dbafa39345c573eae0d045a7d23e346f7068ec0b",class:"s-gifting-skeleton"},e("div",{key:"ff247ea5c79b87ca1c76e6035813d7ecb2caeff2",class:"s-gifting-modal-header"},e("salla-skeleton",{key:"1e67bea2f1f957744c4f6f0af83ded347799916e",type:"circle",height:"5rem",width:"5rem"}),e("h2",{key:"6486434a702624358211c22e7a6b48be16d96c42",class:"s-gifting-modal-title"},e("div",{key:"688854d37e5ca46fcaa7957d3e72a52d7c706f8d",class:"s-gifting-modal-badge-wrapper"},e("salla-skeleton",{key:"9fcbb2086aa25b02effdc873bbfd45087e673de6",height:"15px",width:"150px"})))),e("div",{key:"1b9bf709a01b20e87d68f92f3cb93600214460cd",class:"s-gifting-skeleton-content"},e("salla-skeleton",{key:"ba6b0c87442412398c360da1f6e8b5094812900f",height:"10px",width:"150px"}),e("salla-skeleton",{key:"6583783ace4e2668705c47c4bcac2a33b346a72b",height:"230px"}),e("salla-skeleton",{key:"c76b038f100072d56a7cedd0438eeacc98bf7b42",height:"10px",width:"150px"}),e("salla-skeleton",{key:"1d331e7be7cd88ea5c108f331626dddc74699ed2",height:"30px"}),e("salla-skeleton",{key:"5cc3d1b8d67b7bf199219099af909591b8a8a869",height:"40px"})))),e("slot",{key:"9dc4c6f3a717e16e3527f9651b05a74ca1a6212c",name:"header"}),this.hasError?e("salla-placeholder",{alignment:"center"},e("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),e("span",{slot:"description"}," ")):[e("div",{class:"s-gifting-modal-header"},e("span",{class:"s-gifting-modal-icon"},e("span",{innerHTML:Y})),e("h2",{class:"s-gifting-modal-title"},e("div",{class:"s-gifting-modal-badge-wrapper"},e("div",{class:"s-gifting-modal-badge"},e("span",null,e("span",null,this.currentStep),"/2")),e("span",null,this.giftDetails)))),e("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},e("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},e("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),e("div",{class:"s-gifting-modal-uploader anime-item",ref:t=>this.uploader=t},e("span",{class:"s-gifting-remove-preview",onClick:()=>this.removePreview(),innerHTML:U}),this.selectImageOrUpload&&e("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()})),e("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?e("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},e("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>e("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},e("img",{style:{width:"120px"},src:t.url,alt:`${t.id}`})))):"")):""),e("div",{class:"anime-item"},e("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},e("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},e("option",{"data-id":null,selected:!0},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>e("option",{"data-id":t.id,value:t.text,key:t.id},t.text))):"",e("option",{"data-id":"custom"},this.giftCustomText))),e("div",{class:this.showGiftText?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},e("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),e("div",{class:"mt-1"},e("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"})))),e("div",{class:"anime-item"},e("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2()},e("span",null,this.nextStep)))),e("div",{class:"s-gifting-step-two gift-step-2",ref:t=>this.step2Elems=t},e("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"},e("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),e("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?e("span",{class:"s-gifting-error"},this.errors.sender_name):""),e("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"},e("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),e("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"]?e("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),e("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"},e("label",{class:"s-form-label"},this.receiverMobileFieldLabel),e("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"]?e("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.physicalProducts&&e("div",null,e("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"},e("label",{class:"s-form-label"},this.receiverCountryFieldLabel),e("select",{name:"country",class:"s-form-control",onChange:t=>this.handleCountryChange(t),required:!0},e("option",{value:""},this.selectCountry),this.gift?.countries?.map((t=>e("option",{value:t.id},t.name)))),this.errors&&this.errors["receiver.country"]?e("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),e("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"},e("label",{class:"s-form-label"},this.receiverCityFieldLabel),e("select",{name:"city","aria-label":salla.lang.get("blocks.buy_as_gift.select_city"),class:"s-form-control",onChange:t=>this.handleReceiverCity(t),disabled:this.loadingCities},e("option",{value:"",selected:!0},this.loadingCities?salla.lang.get("common.elements.loading"):this.selectCity),this.gift?.cities?.map((t=>e("option",{value:t.id},t.name)))),this.errors&&this.errors["receiver.city_id"]?e("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),e("div",{class:"s-gifting-info anime-item opacity-0"},e("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'}),e("span",null,this.selectCityInfo))),!this.physicalProducts&&e("div",{class:"anime-item opacity-0"},e("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},e("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),e("span",{class:"s-form-label"}," ",this.sendLater," "))),e("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},e("label",{class:"s-form-label"},this.selectSendDateAndTime),e("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)}),e("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),e("div",{class:"s-gifting-step-two-footer anime-item opacity-0"},e("a",{href:"#!",innerHTML:p,onClick:t=>this.goToStep1(t)}),e("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},e("span",null,this.sendGift)))))],e("slot",{key:"2ca6746edd5e72c996633b6d0b3ccdc5009198c4",name:"footer"})))]}};K.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 Q=class{constructor(e){t(this,e),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 e=this.status.querySelector(".s-button-text");h.toggleElementClassIf(e,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none"}render(){return this.nextPage.length>1?e(i,{class:"s-infinite-scroll-container"},e("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let t=this,e=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==e.pageIndex&&e.option({loadOnScroll:!1}),3==e.pageIndex&&e.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return s(this)}};Q.style="";const tt=class{constructor(e){t(this,e),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return e(i,{key:"1e84d5e259adbf61502fbe1ee771ce948c87f218"},e("a",{key:"5e28c64a0f1c62e6749a32859180e705f99af27e",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},e("div",{key:"ace3fdaae7332c4c23ab411f0b97cb0699c26ec2",class:"s-list-tile-item-icon"},e("slot",{key:"f8790cd45f2004691b156ef96d12a0f003d99899",name:"icon"})),e("div",{key:"a788d022e2afe3cd383c321f4100dafbae84f844",class:"s-list-tile-item-content"},e("div",{key:"a07afce13d054e11236ffb282901de9db3d23923",class:"s-list-tile-item-title"},e("slot",{key:"43c23495cfb026ddba8739dcc1a619ec25fe98e0",name:"title"})),e("div",{key:"db5e2767a4220ee5d658b3b9384c28d0e105febb",class:"s-list-tile-item-subtitle"},e("slot",{key:"245f602055419b1f32fa943805a72c6a207eea3f",name:"subtitle"}))),e("div",{key:"394a2d1402d3e8346cbc1ebd8d410405ed568c77",class:"s-list-tile-item-action"},e("slot",{key:"6086eb6b1f9894f5a3a77ca484c74dd06f0d468f",name:"action"}))))}};tt.style="";const et=class{constructor(e){t(this,e),this.size=32,this.width=2,this.color=void 0,this.bgColor="#e5e7eb"}render(){return e(i,{key:"2592e9504b03cb78f212d57e51c19075172fadd0",class:"s-loading-container"},e("svg",{key:"4d495370551559a59423d5b672a3f1b4ed6bd7e3","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"},e("path",{key:"aedf2f6df87ac1dc82c32180cbf11dcf925a2267",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"}),e("path",{key:"db02a829fe6142c41f43f4c6d3d07695b1fa41f9",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"})))}};et.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 it=class{constructor(e){t(this,e),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 e("salla-modal",{key:"8f37a27df315cdc0c28e3294dc91209c852be37f",isLoading:!0,class:"s-hidden",ref:t=>this.modal=t,width:"xs"},e("div",{key:"f12693b51bd57a866dd5eb40dedfb824262d69c9",slot:"loading"},e("div",{key:"cf40e4ae38a9bffe76b63688b59638a534dfbfeb",class:"s-localization-modal-skeleton"},e("salla-skeleton",{key:"b58668b0c16863b7998832c4be120636b32e4b05",width:"25%",height:"15px"}),e("div",{key:"2277672008dd8895791954ad3f8ac0bf090095cd",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>e("div",{class:"s-localization-modal-skeleton-item"},e("div",{class:"s-localization-modal-skeleton-item-flex"},e("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),e("salla-skeleton",{height:"10px",width:"100px"})),e("salla-skeleton",{height:"15px",width:"20px"}))))),e("salla-skeleton",{key:"e22fe136879a706972c05b2b9ea8ab85be57b82f",width:"25%",height:"15px"}),e("div",{key:"8800d040033db851d2903c05fe0ce947072aae2e",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>e("div",{class:"s-localization-modal-skeleton-item"},e("div",{class:"s-localization-modal-skeleton-item-flex"},e("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),e("salla-skeleton",{height:"10px",width:"100px"})),e("salla-skeleton",{height:"15px",width:"20px"}))))),e("salla-skeleton",{key:"3248a10d8023fa2c8b411294da1072d4209e9a87",height:"40px",width:"100%"}))),this.hasError?e("salla-placeholder",{alignment:"center"},e("span",{slot:"description"},this.errorMessage)):e("div",{class:"s-localization-modal-inner"},this.languages.length>1?e("div",{class:"s-localization-modal-section"},e("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.language")),e("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((t=>e("div",{class:"s-localization-modal-item"},e("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}),e("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)})))):e("select",{class:"s-localization-modal-select",name:"language",onChange:t=>this.onChangeLanguage(t)},this.languages.map((t=>e("option",{value:t.code,selected:this.language==t.code},t.name)))))):"",this.currencies.length>1?e("div",{class:"s-localization-modal-section"},e("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.currency")),e("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((t=>e("div",{class:"s-localization-modal-item"},e("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}),e("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)})))):e("select",{class:"s-localization-modal-select",name:"currency",onChange:t=>this.onChangeCurrency(t)},this.currencies.map((t=>e("option",{value:t.code,selected:this.currency==t.code},t.name)))))):"",e("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)}},st=class{constructor(e){t(this,e),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 e=t.data?.type?.replace("iframe::",""),i=t.data.message;if("ready"==e)return i.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"==e)return this.iframe.height=i?.height+"px";if("storage"==e)return this.handleIframeStorageAction(i);if("scrolling"==e)return this.scrolling=i,void(this.isClosable=!1);if("direction"==e)return document.dir=this.direction=i?"rtl":"ltr";if("notify"==e)return salla.notify[i.type](i.message);if("authenticated"==e||"authenticated_web_auth"==e)return!i?.withoutClose&&this.close(),salla.auth.api.handlAfterAuthenticatedResponse(i,this.supportWebAuth).then((()=>!(i?.withoutReload||this.withoutReload)&&setTimeout((()=>window.location.reload()),1e3)));if("dispatchEvent"!=e||"auth::verified"!=i.event){if("dispatchEvent"==e)return salla.event.emit(i.event,...i.payload);if("reload"==e)return i?.withClose&&this.modal.close(),window.location.reload();if("open_page"===e)return window.location.href=i.url;if("open_passkey_page"!==e)return"guest-checkout"===e?this.handleGuestCheckout():void("close"==e&&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 e,i=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 n="string"==typeof a?a?.replace(/^"|"$/g,""):a;salla.storage.set(t,n),"token"===t&&(e=n),"user"===t&&i&&n.id!==i&&(s=!0)})),e){this.modal.close(),Salla.auth.event.tokenFetched(e);try{await Salla.api.cart.assign()}catch(t){Salla.log("Error on assign after handle iframe",t)}s&&Salla.cart.reset();try{!Salla.auth.api.isSessionless()&&await Salla.auth.api.request("auth/jwt"),Salla.auth.api.canRedirect()?setTimeout((()=>window.location.reload()),100):await Salla.auth.event.loggedIn({data:{token:e}}).then((()=>Salla.auth.api.afterUserLogin()))}catch(t){this.modal.open(),Salla.log("Error on request auth/jwt after handle iframe",t)}}else 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(e){console.error("Failed to parse headers!",this.headers,e),t=void 0}const e={user:salla.storage.get("user"),s_translations:salla.storage.get("s_translations"),token:salla.storage.get("token")};e.user||delete e.user,e.s_translations||delete e.s_translations,e.token||delete e.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:e}})}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():e("salla-modal",{class:"s-login-modal",ref:t=>this.modal=t,width:"xs"},this.getLoginDom())}getLoginDom(){if(this.canRenderIframe)return e(n,null,e("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)}};st.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 at='\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 nt=class{constructor(e){t(this,e),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 e("div",{onClick:()=>this.setSelectedPrizeItem(t),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==t.id,"s-loyalty-prize-item":!0}},e("img",{class:"s-loyalty-prize-item-image",src:t.image,alt:t.name}),e("div",{class:"s-loyalty-prize-item-title"},t.name),e("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(t.description)),e("div",{class:"s-loyalty-prize-item-points"},t.cost_points," ",salla.lang.get("pages.loyalty_program.point"),e("div",{class:"s-loyalty-prize-item-check"},e("div",null))))}getConfirmationModal(){return[e("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"},e("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),e("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",e("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",e("strong",null,this.selectedItem?.name)," )")),e("div",{class:"s-loyalty-confirmation-actions"},e("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),e("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return e("slot",{name:"points-applied-widget"},e("salla-list-tile",{class:"s-loyalty-after-exchange"},e("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle,"   -   ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),e("div",{slot:"action",class:"s-loyalty-after-exchange-action"},e("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},e("span",{innerHTML:U})))))}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():[e("slot",{name:"widget"},this.customerPoints?e("salla-list-tile",{class:"s-loyalty-widget"},e("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:at}),e("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,e("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")))):""),e("salla-modal",{noPadding:!0,width:"sm",ref:t=>this.confirmationModal=t},this.getConfirmationModal()),e("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},e("div",{slot:"loading"},e("div",{class:"s-loyalty-skeleton"},e("salla-list-tile",{class:"s-loyalty-header"},e("div",{slot:"icon",class:"s-loyalty-header-icon"},e("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),e("div",{slot:"title",class:"s-loyalty-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>e("div",{class:"s-loyalty-prize-item swiper-slide"},e("salla-skeleton",{height:"9rem"}),e("div",{class:"s-loyalty-prize-item-title"},e("salla-skeleton",{height:"15px",width:"75%"})),e("div",{class:"s-loyalty-prize-item-subtitle"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-loyalty-prize-item-points"},e("salla-skeleton",{height:"15px",width:"100px"}),e("div",{class:"s-loyalty-prize-item-check"},e("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[e("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},e("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>'}),e("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),e("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),e("salla-tabs",null,this.loyaltyProgram.prizes.map((t=>e("salla-tab-header",{slot:"header",name:t.title},e("span",null,t.title)))),this.loyaltyProgram.prizes.map(((t,i)=>e("salla-tab-content",{slot:"content",name:t.title},e("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+i,type:"carousel"},e("div",{slot:"items"},t.items.map((t=>this.prizeItem(t))))))))),e("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:e("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?e("span",{slot:"description"},this.errorMessage):""))]}};nt.style="";const lt=class{constructor(e){t(this,e)}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 e(i,{key:"f307529d9fa1a3cfdf33cc48dea142e274eb4f72",class:"s-maintenance-alert-wrapper"},e("button",{key:"a8a8d3d4c03151f9fe468153d4368ab66de0ba5f",class:"s-maintenance-alert-close",innerHTML:U,onClick:()=>this.closeAlert()}),e("div",{key:"f53e7ab72950f72b68eeb5ff6887203e8f6d0dbd",class:"s-maintenance-alert-content"},e("div",{key:"c3c69c738da0417114c87b03c49f0a8d36663558",class:"s-maintenance-alert-container"},e("div",{key:"af1ec8ff601873c04de610341f15775e05a5d185",class:"s-maintenance-alert-icon"},e("img",{key:"a1b6dd0d161749eff7f6e7d4e92fd161896b593b",src:salla.url.cdn("images/alert.png"),alt:"Alert"})),e("div",{key:"f1f81302bbaf4d83d50770ff1f40416624bde583",class:"s-maintenance-alert-text"},e("h2",{key:"79eab40b1cf6cf9d307d1e9bda24fe6dd8c03852"},this.title),e("p",{key:"5bdbe219346851b9aff8c20fd41075853fe6b981"},this.message))),e("div",{key:"8e2cd9ad611a551ee7960310f11a9f7f07668811"},e("a",{key:"9658d9a3e82f9719c35caf362601a12a62475508",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)}};lt.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 ot={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 rt{constructor(t=null,e={}){if(this.apiKey=t,this.options=e,"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[rt.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,e)=>{this.resolve=t,this.reject=e;const i=document.createElement("script");i.src=this.createUrl(),i.async=!0,i.onerror=t=>e(t),document.head.appendChild(i)})))}createUrl(){const t=[`callback=${rt.CALLBACK_NAME}`];this.apiKey&&t.push(`key=${this.apiKey}`);for(let e in this.options)if(this.options.hasOwnProperty(e)){let i=this.options[e];"version"===e&&(e="v"),"libraries"===e&&(i=i.join(",")),t.push(`${e}=${i}`)}return`https://maps.googleapis.com/maps/api/js?${t.join("&")}`}}rt.CALLBACK_NAME="_dk_google_maps_loader_cb";const ct=class{constructor(e){t(this,e),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,e=!1){(new google.maps.Geocoder).geocode({location:t},((t,i)=>{i===google.maps.GeocoderStatus.OK&&(this.searchable&&(this.searchInputValue=t[0].formatted_address,this.searchInput.value=t[0].formatted_address),e&&(this.formattedAddress=t[0].formatted_address))}))}initGoogleMaps(t,e){new rt(this.apiKey,t).load().then((t=>{if(this.map=new t.maps.Map(e,{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?ot.light:ot.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 e=new t.maps.places.SearchBox(this.searchInput);t.maps.event.addListener(e,"places_changed",(()=>{const t=e.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 e={center:new google.maps.LatLng(t.coords.latitude,t.coords.longitude),zoom:15};this.map.setOptions(e),this.marker.setPosition(e.center),this.getPositionAddress(e.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 e("div",null,e("div",{class:"s-map-modal-title"},this.modalTitle?this.modalTitle:this.modalActivityTitle),e("div",{class:"s-map-modal-body"},e("div",{class:"s-map-element",ref:t=>this.mapElement=t}),this.readonly?"":[this.searchable&&e("div",{class:"s-map-search-wrapper"},e("input",{class:"s-map-search-input",ref:t=>this.searchInput=t,placeholder:this.searchPlaceholder})),e("salla-button",{class:"s-map-my-location-button",onClick:()=>{this.getCurrentLocation()},shape:"icon",color:"primary"},e("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'})),e("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 e(i,{key:"f3b0f4e444e266a4f9c60782bea7920a1b4c34b4",class:"s-map-wrapper"},e("salla-modal",{key:"5066a0f19b59509656350bd0a02bc8ff8bb3d9d7",class:"s-map-modal-wrapper",noPadding:!0,ref:t=>{this.locationModal=t}},this.getLocationModal()),e("slot",{key:"884266b42b7c5532486c4e8bd1aba8b0e6bf2f89",name:"button"},e("salla-button",{key:"32b96c45aca7589681a3819d165b38e8f9ee036e",onClick:()=>{this.open()},color:"primary",class:"s-map-location-button"},e("span",{key:"d73a9837cb6a6df740300a4f52c35dd7f9499e73",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?e("div",null,this.locateButtonEdit," | ",this.formatAddress(this.formattedAddress)):this.locateButtonTitle)),e("input",{key:"77a53ca7c0b51268813238d80db56a9b9449c3f9",class:"s-hidden",name:this.name,required:this.required,value:this.getLatLng(),ref:t=>this.mapInput=t}))}get host(){return s(this)}};ct.style="";const dt=class{constructor(e){t(this,e),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,e){return`!hidden lg:!block ${e?"root-level lg:!inline-block":"relative"} ${t.products?" mega-menu":""}\n ${this.hasChildren(t)?"has-children":""}`}getAttributes(t){return t.trim().split(" ").reduce(((t,e)=>{let[i,s]=e.split("=");return t[i]=s.replace(/"/g,""),t}),{})}getMobileMenu(t,i){const s=t.image?e("img",{src:t.image,class:"rounded-full",width:"48",height:"48",alt:t.title}):null;return e("li",{class:"lg:hidden text-sm font-bold",...this.getAttributes(t.attrs)},this.hasChildren(t)?e(n,null,e("span",{class:t.image?"!py-3":""},s,t.title),e("ul",null,e("li",{class:"text-sm font-bold"},e("a",{href:t.url,class:"text-gray-500"},i)),t.children.map((t=>this.getMobileMenu(t,i))))):e("a",{href:t.url,"aria-label":t.title||"category",class:"text-gray-500 "+(t.image?"!py-3":""),...this.getAttributes(t.link_attrs)},s,e("span",null,t.title||"")))}getDesktopMenu(t,i){return e("li",{class:this.getDesktopClasses(t,i),...this.getAttributes(t.attrs)},e("a",{href:t.url,"aria-label":t.title||"category",...this.getAttributes(t.link_attrs)},e("span",null,t.title)),this.hasChildren(t)?e("div",{class:"sub-menu shadow-default "+(this.hasProducts(t)?"w-full left-0 flex":"w-56")},e("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)?e("salla-products-list",{source:"selected","shadow-on-hover":!0,"source-value":`[${t.products}]`}):null):null)}getFooterMenu(t){const i=this.topnav||this.limit?t.slice(0,this.limit||3):t;return e("div",null,e("div",{class:{"s-menu-footer-list":!this.topnav,"s-menu-topnav-list":this.topnav}},i.map((t=>e("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):[e("nav",{key:"main-nav",id:"mobile-menu",class:"mobile-menu"},e("ul",{class:"main-menu"},this.getHeaderMenu(this.menus)),e("button",{class:"btn--close close-mobile-menu sicon-cancel lg:hidden"})),e("button",{key:"close-btn",class:"btn--close-sm close-mobile-menu sicon-cancel hidden"})]}};dt.style=":host{display:block}";const ht=class{constructor(e){t(this,e),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 e=this.host.querySelector(".s-modal-body");h.toggleElementClassIf(e,"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?e(i,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:t=>this.handleKeyUp(t)},e("div",{class:"s-modal-overlay",ref:t=>this.overlay=t,onClick:()=>this.closeModal("backdropClick")}),e("div",{class:"s-modal-wrapper"},e("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),e("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},e("slot",{name:"loading"},e("salla-loading",null)),e("div",{class:"s-hidden"},e("slot",null))))):e(i,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog"},e("div",{class:"s-modal-overlay",ref:t=>this.overlay=t,onClick:()=>this.closeModal("backdropClick")}),e("div",{class:"s-modal-wrapper"},e("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),e("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},e("div",{class:{"s-modal-header":!0,"s-modal-is-center":this.centered}},this.isClosable?e("button",{class:"s-modal-close",onClick:()=>this.closeModal("closeButtonClick"),type:"button"},e("span",{innerHTML:U})):"",this.modalTitle||this.subTitle?e("div",{class:"s-modal-header-inner"},e("slot",{name:"icon"},this.iconStyle?e("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?V:X}):""),e("div",{class:"s-modal-header-content"},this.modalTitle?e("div",{class:{"s-modal-title":!0,"s-modal-title-below":this.subTitleFirst},innerHTML:this.modalTitle}):"",this.subTitle?e("p",{class:{"s-modal-sub-title":!0},innerHTML:this.subTitle}):"")):""),e("slot",null),e("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return s(this)}static get watchers(){return{visible:["handleVisible"]}}};ht.style="@media screen and (max-width: 470px){.modal-is-open{position:fixed;width:100%}}";const pt=class{constructor(e){t(this,e),this.parsedSections=[]}parseProducts(t){let e=[];if("string"==typeof t)try{const i=JSON.parse(t);e=this.extractSections(i)}catch(i){console.error("Invalid JSON passed to bundleSections prop:",t),e=[]}else t&&(e=this.extractSections(t));this.parsedSections=e}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 e("salla-multiple-bundle-product-cart",{sections:this.parsedSections})}renderDetailsPage(){return e("salla-multiple-bundle-product-details",{sections:this.parsedSections})}componentWillLoad(){this.parseProducts(this.bundleSections)}render(){return e(i,{key:"91666a9a9d0302d7f93f001b39d06160f2dc6960",class:"s-multiple-bundle-product-wrapper"},this.isCartPage()?this.renderCartPage():this.renderDetailsPage())}static get watchers(){return{bundleSections:["parseProducts"]}}};pt.style=":host{display:block}";const ut=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const i=this.host.closest("form");if(i){const s=i.getAttribute("id");if(s&&"string"==typeof s){const i=s.match(/item-(\d+)/)?.[1];this.itemNumber=i||"";const a=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>a?.remove()))}}}renderRemoveButton(t,i,s=!1){return e("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,i)},s?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,i){const s=i?.options&&i?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(s?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:i?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:i?.image?.url,alt:i?.image?.alt||i?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:i?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},i?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:i?.price?salla.money(i?.price):""})),i?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(i?.sale_price)}))),i?.quantity_in_group>0&&0!==i?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,i?.quantity_in_group)))),!s&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,i,!1))))}render(){return e(i,{key:"34b9ae8c08eccee16d15f5ebff73b1d27f636e79",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"2f8d0bf68e67aa3bc21206d7282113fbfa67560b",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,i)=>t.products.map((s=>{const a={sectionId:t.id,sectionIndex:i,productId:s.id};return e("salla-accordion",{key:s.id,collapsed:!1,bordered:!0,collapsible:!!(s.options&&s.options.length>0),size:"sm",id:`accordion-${s.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),s)),s.options&&s.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(s.options),key:`${s.id}-persistent`,"product-id":s.id,"bundle-context":JSON.stringify(a)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),s,!0))))}))))))}get host(){return s(this)}};ut.style="";const ft=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const i=e.id,s=this.selectedProducts[t].has(i);s?(this.selectedProducts[t].delete(i),this.clearProductFormData(i,t),this.clearProductModalOptions(i,t)):this.selectedProducts[t].add(i),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:s,isSelected:!s})},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const i=e.id;this.selectedProducts[t].has(i)||(this.selectedProducts[t].add(i),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options}))},this.onSelectProductOptions=(t,e)=>{const i=this.sections.findIndex((t=>t.id==e)),s=this.sections.find((t=>t.id==e)),a=s?.products?.findIndex((e=>e.id==t.id))??0;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:i,productIndex:a})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:i}=t.detail;this.onSelectProduct(i,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:i}=t.detail;this.onSelectProductOptions(e,i)}}clearProductFormData(t,e){const i=this.host.closest("form");if(e){const s=`bundle[${e}][`;Array.from(i.querySelectorAll("input")).filter((e=>e.getAttribute("data-product-id")===String(t)&&e.name&&e.name.startsWith(s))).forEach((t=>t.remove()))}else i.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let i=null,s=null;if(null!=e&&(i=this.sections.findIndex((t=>t.id==e)),i>-1)){const e=this.sections[i];if(e){const i=e.products?.findIndex((e=>e.id==t));s="number"==typeof i&&i>-1?i:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:i,productIndex:s})}renderAccordionHeader(t,i){return e(n,null,e("h2",{slot:"title"},t?.name),t?.obligatory_products?e("span",{slot:"note"},salla.lang.get("pages.products.obligatory_products",{count:t?.obligatory_products||0})):"",e("span",{slot:"progress"},i,"/",t?.products?.length||0))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:i,product:s,fromModal:a}=t.detail;a?this.ensureProductSelected(i,s||{id:e}):this.onSelectProduct(i,s||{id:e})},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 e(i,{key:"2a7a27e8bfc7325575fec782139828333590eb9f",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"affcb43ee67e329a9a87d6234bb91b5494a69a35",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,i)=>e("salla-accordion",{key:t.id,collapsed:0!==i},e("salla-accordion-head",null,this.renderAccordionHeader(t,this.selectedProducts[t.id]?.size||0)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:i,selectedProducts:this.selectedProducts,onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"6b9065e8f7872da72166979fc9ce61efaad21c0a"}))}get host(){return s(this)}};ft.style="";const mt=class{constructor(e){t(this,e),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,e,i){return`${t||"unknown"}-${e||0}-${i||"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 e=t.detail||t,{option:i,detail:s}=e,a=i||e.option_id&&this.product?.options?.find((t=>t.id===e.option_id||String(t.id)===String(e.option_id))),n=s||(e.id?e:null);this.product?.id&&a&&this.handleOptionChange(Number(this.product.id),a,n)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const e=t.target;if(e&&"checkbox"===e.type&&e.name&&e.name.includes("bundle[")&&e.name.includes("][id]")){const t=e.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!e.checked){const[,i,s]=t,a=e.value,n=this.host.closest("form");this.cleanupProductDeselection({sectionId:i,productIndex:parseInt(s,10),productId:a,form:n,uncheckedInput:e})}}},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:e,productIndex:i,productId:s,form:a,uncheckedInput:n}=t;if(this.clearProductOptions(s,e,i),a){const t=`bundle[${e}][${i}]`;Array.from(a.querySelectorAll(`input[name^="${t}"]`)).forEach((e=>{if(e===n)return;const i="hidden"===e.type,a=e.getAttribute("data-product-id")===String(s)&&e.name?.startsWith(t);(i||a)&&e.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});a.dispatchEvent(t)}))}}generateFormInputName(t,e,i){return`bundle[${t}][${e}][options][${i}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,e=this.generateCacheKey(this.sectionId,this.productIndex,t),i=document.querySelector(`salla-product-options[product-id="${t}"]`);if(i)try{const t=await i.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[e]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,e,i){const s={...this.selectedOptions};if(null==e||null==i||Number.isNaN(i)){const e=`-${String(t)}`,i=[];Object.keys(s).forEach((t=>{t.endsWith(e)&&(delete s[t],i.push(t))})),i.forEach((t=>this.bumpOptionsResetToken(t)))}else{const a=this.generateCacheKey(e,i,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,e,i){const s=this.generateCacheKey(this.sectionId,this.productIndex,t),a=document.querySelector(`salla-product-options[product-id="${t}"]`);let n=[];if(a)try{n=await a.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(n.length>0)this.selectedOptions={...this.selectedOptions,[s]:n};else if(this.selectedOptions[s]&&this.selectedOptions[s].length>0){const t=[...this.selectedOptions[s]||[]],a=t.findIndex((t=>t.option_id===e.id));a>-1?i&&null!=i.id?t[a]={...i,option_id:e.id}:t.splice(a,1):i&&null!=i.id&&t.push({...i,option_id:e.id}),this.selectedOptions={...this.selectedOptions,[s]:t}}else i&&null!=i.id&&(this.selectedOptions={...this.selectedOptions,[s]:[{...i,option_id:e.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],e=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,e),s=document.querySelector(`salla-product-options[product-id="${e}"]`);let a=[];if(s)try{a=await s.getSelectedOptions()||[];const t=this.selectedOptions[i]||[];(t.length>a.length||0===a.length&&t.length>0)&&(a=t)}catch(t){a=this.selectedOptions[i]||[]}else a=this.selectedOptions[i]||[];return 0===a.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((e=>{e.required&&(a.some((t=>t.option_id==e.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:e.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const e=this.product?.id;if(!e)return;const i=this.generateCacheKey(this.sectionId,this.productIndex,e);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${e}"]`);let s=await(t?.getSelectedOptions());if((!s||0===s.length)&&this.selectedOptions[i]?.length>0&&(s=this.selectedOptions[i]),!s||0===s.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[i]:s};const a=this.host.closest("form");if(!a)return void(this.isLoading=!1);const n=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(a.querySelectorAll(`input[name^="${n}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(a.querySelectorAll(`[data-product-id="${e}"][name^="${n}"]`)).forEach((t=>t.remove()));const l=`bundle[${this.sectionId}][${this.productIndex}][id]`,o=document.getElementById(l);if(o)o.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(e),t.dataset.productId=String(e),a.appendChild(t)}s.forEach((t=>{const i=t.option_id,s=document.createElement("input");s.type="hidden",s.name=this.generateFormInputName(this.sectionId,this.productIndex??0,i),s.value=String(t.id),s.dataset.productId=String(e),a.appendChild(s)}));const r=new window.Event("change",{bubbles:!0});a.dispatchEvent(r),this.optionsSaved.emit({productId:Number(e),selectedOptions:s,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(e),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),e=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const i=e.some((e=>e.id===t.id));return{...t,is_selected:i}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),a=this.generateCacheKey(this.sectionId,this.productIndex,t),n=this.optionsResetTokens[a]||0,l=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return e(i,{key:"28786c060499c9bfbacf025b75f21d0e8a2d6ab1"},e("salla-modal",{key:"6322c0542ca2769f50ed6fc616c6d5c72d456c9c",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"},e("div",{key:"812707c4108b5bdefa97e1ff7537998083e2403b",slot:"loading"},e("salla-skeleton",{key:"e82b875495873b66414ee4a75d845823373b4914",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&e("salla-slider",{key:"f1f3545637b182257f9107972a819ae9819de137",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,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},e("div",{key:"97b50195903a01376e057bc99ddb353fd3dfdb2b",slot:"items"},this.product?.images&&this.product?.images.map(((t,i)=>e("div",{key:i,class:"swiper-slide"},e("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${i+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&e("div",{key:"ff943c9c8f175ff1c0374a13153b33889c468dda",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,i)=>e("div",{key:i,"data-caption":`${this.product?.name} - Image ${i+1}`},e("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${i+1}`,alt:t.alt||`${this.product?.name} - ${i+1}`,onError:t=>{t.target.style.display="none"}})))))),e("salla-product-options",{options:JSON.stringify(s),key:`${a}-reset-${n}`,"product-id":t,"unique-key":`${a}-reset-${n}`}),e("div",{key:"7555836d26018f6405bc54a1cd735b4030d4bdf1",slot:"footer"},e("div",{key:"a7ee5f19a4c11a1c61e4dc026fa8673e0ab74c3f",class:"s-multiple-bundle-product-options-modal-footer"},e("salla-button",{key:"1da19964053766f3a1339ea0e77ab7aaa4d8a003",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:l},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"]}}};mt.style=":host{display:block}";const gt=class{constructor(e){t(this,e),this.productSelected=a(this,"productSelected"),this.productOptionsSelected=a(this,"productOptionsSelected"),this.selectedProducts={},this.savedOptionsByInstance={},this.handleProductClick=(t,e)=>{const i=this.generateEventName(this.section.id,e),s=document.getElementById(i);if(s){if(s){const i=!s.checked;i||(this.dispatchClearOptionsEvent(t,e),this.clearSavedOptionsState(this.section.id,e)),s.checked=i,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,e){return`${t}::${e}`}dispatchClearOptionsEvent(t,e){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:e})}handleOptionsSaved(t){const e=t.detail;if(!e)return;const{sectionId:i,productIndex:s,selectedOptions:a}=e;if(null==i||i!==this.section?.id)return;if(null==s||Number.isNaN(s))return;const n=this.getProductInstanceKey(i,s);if(a?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[n]:!0};else if(this.savedOptionsByInstance[n]){const t={...this.savedOptionsByInstance};delete t[n],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,e){const i=this.getProductInstanceKey(t,e);if(!this.savedOptionsByInstance[i])return;const s={...this.savedOptionsByInstance};delete s[i],this.savedOptionsByInstance=s}generateEventName(t,e){return`bundle[${t}][${e}][id]`}render(){return e(i,{key:"a1e7d56d8a50d1c31ba102d3246b0251516e0a73"},e("salla-slider",{key:"8308576a46ec71f557a3d686d59cd0109d5bef0f",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}},e("div",{key:"3ea742119ab77f129b8c60bbcc0f8c0f7bd3e97d",slot:"items"},this?.section?.products?.map(((t,i)=>{const s=this.selectedProducts[this.section.id]?.has(t.id)||!1,a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,i)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let n=salla.config.get("theme.is_rtl",!0)?A:O;return e("div",{class:"s-multiple-bundle-product-slide-one-third "+(0==t.quantity?"s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},e("div",{class:"s-multiple-bundle-product-card"},e("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,i)},e("input",{id:this.generateEventName(this.section.id,i),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:s,name:this.generateEventName(this.section.id,i),value:t.id}),e("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"})),e("div",{class:"s-multiple-bundle-product-content-wrapper"},e("div",{class:"s-multiple-bundle-product-content"},e("div",{class:"s-multiple-bundle-product-details"},e("div",{class:"s-multiple-bundle-product-title-wrapper"},e("h2",{class:"s-multiple-bundle-product-title"},e("a",{href:t?.url||"#",target:"_blank",rel:"noopener noreferrer"},t.name))),e("div",{class:"s-multiple-bundle-product-price-wrapper"},e("span",{class:"s-multiple-bundle-product-price"},e("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&e("span",{class:"s-multiple-bundle-product-price-discount"},e("span",{innerHTML:salla.money(t.regular_price)})))),t.quantity_in_group>0&&0!==t.quantity&&e("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),e("span",null,t.quantity_in_group)),0===t.quantity&&e("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&e("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,e("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:n})))))})))))}get host(){return s(this)}};gt.style="";const bt=class{constructor(e){t(this,e),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 e("div",{class:"s-offer-modal-discount-table"},e("table",null,e("tbody",null,this.offer.get.discounts_table?.map((t=>e("tr",null,e("td",null,t.text),e("td",{class:"s-offer-modal-discount-table-cell"},e("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,i={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,t),spaceBetween:16},1024:{slidesPerView:Math.min(3,t),spaceBetween:16}}};return e("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(i)})}return this.offer.get.categories?.length?e("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"},e("div",{slot:"items"},this.offer.get.categories.map((t=>e("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 e("salla-modal",{key:"2c88abbe21015431b7e70f2369284e2f93c6fd3c","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:""}`},e("div",{key:"f44a915307bdc059c937d60a79a1c22a59957928",slot:"loading"},e("div",{key:"7b4b6f9572a2893aa5353a5ba2d4d62a2a5d8742",class:"s-offer-modal-skeleton"},e("div",{key:"a6b2f782cd643dc322e3f3c29a596a44fc9b1ace",class:"s-offer-modal-skeleton-header"},e("salla-skeleton",{key:"a745dc619995820ac3a3bb9169b8a25cbceed9ea",type:"circle",height:"80px",width:"80px"}),e("salla-skeleton",{key:"7d54b0aaa14742f4dfef0e2b26d48eb24f1661c5",height:"15px",width:"50%"}),e("salla-skeleton",{key:"042349f3c34308d070f36c30ac942935da5afebe",height:"10px",width:"30%"})),e("div",{key:"691f32282147054b2dd76d1e324ddd172214cbbd",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>e("div",{class:"s-offer-modal-skeleton-item"},e("salla-skeleton",{height:"9rem"}),e("div",{class:"s-offer-modal-skeleton-item-title"},e("salla-skeleton",{height:"15px",width:"100%"})),e("div",{class:"s-offer-modal-skeleton-item-subtitle"},e("salla-skeleton",{height:"9px",width:"50%"}),e("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'})))))),e("div",{key:"97cbe8b3ca1c8dde39a2c33995116a7a5d088594",class:"s-offer-modal-skeleton-footer"},e("salla-skeleton",{key:"c2f5d9d2e212e0383f6b4d159f1c9ce52c9064b7",height:"15px",width:"50%"}),e("salla-skeleton",{key:"c64ed16e51a4c9f302f915c025473a42d69d4490",height:"15px",width:"30%"})))),this.hasError||null===this.offer?e("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?e("span",{slot:"description"},this.errorMessage):""):[e("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:c}),this.getOfferContent(),e("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?e("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",e("label",{class:"s-offer-modal-remember-label"},e("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)}};bt.style=".s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}";const wt=class{constructor(e){t(this,e),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 e(i,{key:"5f8dc6c1c73a5ed21d571b692eadbf56cac2a133",class:this.alignmentClass()},e("div",{key:"56df7bf4ce025b484943ec504c20bdedbb15604e",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),e("div",{key:"c72a76711d4e915bc24557c7c490c2cf5899db12",class:"s-placeholder-title"},e("slot",{key:"a77295c121d95dad05657577b56bd4c220bdca03",name:"title"},e("span",{key:"de463d3b9d37bd3231dc818dca9d3d37211881ad"},salla.lang.get("common.elements.no_options")))),e("div",{key:"5af30b0673bef28cc61165969138f30638f6bc1a",class:"s-placeholder-description"},e("slot",{key:"18057d95114aa4a074c29dbc60de1b4a707fa8f5",name:"description"},e("span",{key:"1695227c9a861b78fad5a850b22f8d51e812c0ab"},salla.lang.get("common.errors.empty_results")))))}};wt.style="";var vt='\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 yt=class{constructor(e){t(this,e),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 e=document.querySelector(`salla-product-options[product-id="${this.productId}"]`),i=Object.values(await(e?.getSelectedOptionsData())||{});if(i.length&&!await(e?.reportValidity())){let t=salla.lang.get("common.messages.required_fields");throw salla.error(t),t}return t.options=[],i.forEach((e=>{e&&!isNaN(e)&&t.options.push(Number(e))})),t},this.typing=t=>{const e=t.target.nextElementSibling;t.target.classList.remove("s-has-error"),e?.classList.contains("s-product-availability-error-msg")&&(e.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:e,countryCode:i}=await this.mobileInput.getValues();t.country_code=i,t.phone=e}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 e=salla.storage.get(`product-${this.productId}-subscribed-options`)||[],i=t.options.join(",");e.includes(i)?salla.log("already subscribed to this options"):(e.push(i),salla.storage.set(`product-${this.productId}-subscribed-options`,e),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=h.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,e){t.classList.add("s-has-error"),t.nextElementSibling.innerText="* "+e}render(){return e(i,{key:"e5b3121a6e352338ff666ba419100150e838e0d2",class:"s-product-availability-wrap"},this.isSubscribed||this.isVisitorSubscribed?e("div",{class:"s-product-availability-subscribed"},e("span",{innerHTML:vt,class:"s-product-availability-subs-icon"}),salla.lang.get("pages.products.notify_availability_success")):e("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 e("salla-modal",{ref:t=>this.modal=t,"modal-title":this.title_,subTitle:salla.lang.get("pages.products.notify_availability_subtitle"),width:"sm"},e("span",{slot:"icon",class:"s-product-availability-header-icon",innerHTML:vt}),e("div",{class:"s-product-availability-body"},this.channels_.includes("email")?[e("label",{class:"s-product-availability-label"},salla.lang.get("common.elements.email")),e("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"}),e("span",{class:"s-product-availability-error-msg"})]:"",this.channels_.includes("sms")?[e("label",{class:"s-product-availability-label"},salla.lang.get("common.elements.mobile")),e("salla-tel-input",{ref:t=>this.mobileInput=t,onKeyDown:t=>this.typing(t)})]:""),e("div",{slot:"footer",class:"s-product-availability-footer"},e("salla-button",{class:"modal-cancel-btn",width:"wide",color:"light",fill:"outline",onClick:()=>this.modal.close()},salla.lang.get("common.elements.cancel")),e("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"]}}};yt.style="";var xt='\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 _t=class{constructor(e){if(t(this,e),salla.onReady((()=>{this.fitImageHeight=salla.config.get("store.settings.product.fit_type"),salla.wishlist.event.onAdded(((t,e)=>this.toggleFavoriteIcon(!0,e))),salla.wishlist.event.onRemoved(((t,e)=>this.toggleFavoriteIcon(!1,e))),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,e=null){e&&e!==this.productData.id||this.wishlistBtn?.classList.toggle("s-product-card-wishlist-added",t)}formatDate(t){let e=new Date(t);return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}getProductBadge(){return this.productData.promotion_title?e("div",{class:"s-product-card-promotion-title"},this.productData.promotion_title):this.showQuantity&&this.productData?.quantity?e("div",{class:"s-product-card-quantity"},this.remained," ",salla.helpers.number(this.productData?.quantity)):this.showQuantity&&this.productData?.is_out_of_stock?e("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?e("div",{class:"s-product-card-sale-price"},e("h4",{innerHTML:this.getPriceFormat(this.productData.sale_price)}),e("span",{innerHTML:this.getPriceFormat(this.productData?.regular_price)})):this.productData.starting_price?e("div",{class:"s-product-card-starting-price"},e("p",null,this.startingPrice),e("h4",{innerHTML:this.getPriceFormat(this.productData?.starting_price)})):e("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 e(i,{key:"95347f86f3dc0354a057290ce41f74aef0a66282",id:`product-${this.productData?.id}`,class:t},e("div",{key:"86927cbc56a2ea92a8e18c44c8999ee1d6f82b4d",class:this.fullImage?"s-product-card-image-full":"s-product-card-image"},e("a",{key:"6294925bce0a46287389a9423b16199cf92919fd",...s},e("img",{key:"74e0d9fae7c61e0e3e0e20e38166d64618c8ca3d",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&&e("a",{key:"fd2db94c99d91815b13141460a8c4538aae4a53b",...s,class:"s-product-card-overlay"}),this.horizontal||this.fullImage?"":e("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)},e("span",{innerHTML:xt}))),e("div",{key:"9f4f39db770a394d9719664cd77111aef1c575f4",class:"s-product-card-content"},this.isSpecial&&this.productData?.quantity?e("div",{class:"s-product-card-content-pie",ref:t=>this.pie=t},e("span",null,e("b",null,salla.helpers.number(this.productData?.quantity)),this.remained),e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -1 36 34",class:"s-product-card-content-pie-svg"},e("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-base"}),e("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-bar"}))):"",e("div",{key:"eab2c5f49112dd490733e0b6f1e8c30ad9670690",class:{"s-product-card-content-main":!0,"s-product-card-content-extra-padding":this.isSpecial}},e("h3",{key:"5fadc35b2bf704903bf38128c390f71ec0a8b910",class:"s-product-card-content-title"},e("a",{key:"7e0767efef938e20ed4c2592a0abec812a9caf86",...s},this.productData?.name)),this.productData?.subtitle&&!this.minimal?e("p",{class:"s-product-card-content-subtitle"},this.productData?.subtitle):""),!this.productData?.donation||this.minimal||this.fullImage?"":[e("salla-progress-bar",{donation:this.productData?.donation}),e("div",{class:"s-product-card-donation-input"},this.productData?.donation?.can_donate?[e("label",{htmlFor:"donation-amount"},this.donationAmount," ",e("span",null,"*")),e("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})]:"")],e("div",{key:"f29cdbd8b8bb715583ecb6c6bcc571c64341ee39",class:{"s-product-card-content-sub":!0,"s-product-card-content-extra-padding":this.isSpecial}},this.getProductPrice(),this.productData?.rating?.stars&&!this.minimal?e("div",{class:"s-product-card-rating"},e("span",{innerHTML:at}),e("span",null,this.productData.rating.stars)):""),this.isSpecial&&this.productData.discount_ends?e("salla-count-down",{date:this.formatDate(this.productData.discount_ends),"end-of-day":!0,boxed:!0,labeled:!0}):"",this.hideAddBtn?"":e("div",{class:"s-product-card-content-footer"},e("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},e("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label)),this.horizontal||this.fullImage?e("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 }}"},e("span",{class:"text-xl",innerHTML:xt})):"")))}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 kt,Mt;_t.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"}(kt||(kt={})),function(t){t.Sar="SAR"}(Mt||(Mt={}));const St=class{constructor(i){if(t(this,i),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.canDisabled=!1,this.disableCardValue=!0,this.availableDigitalCardValues=[],this.userInitiatedValidation=!1,this.outSkus=[],this.ignoreDefaultCardValue=!1,this.productId=salla.config.get("page.id"),this.handleDonationOptions=(t,e,i)=>{if("custom"===e&&"input"===i){const e=t.target;return salla.helpers.inputDigitsOnly(e),salla.event.emit("product-options::donation-changed",{id:this.productId,price:e.value}),void e.dispatchEvent(new window.Event("change",{bubbles:!0}))}const s="option"===i?String(t.target?.value??""):"";if("option"===i&&"custom"===e&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()),this.isCustomDonation="custom"===s,this.donationInput){if("custom"===s?(this.donationInput.value="",this.donationInput.focus()):this.donationInput.value=s,"custom"===e)return;salla.event.emit("product-options::donation-changed",{id:this.productId,price:s})}},this.hideLabel=t=>!(t.type!==kt.DONATION||!t.donation||t.donation.can_donate),this.getExpireDonationMessage=t=>{if(!t.donation)return;const i=t.donation.target_amount<=t.donation.collected_amount;return e("div",{class:{"s-product-options-donation-message":!0,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},e("p",null,t.donation.target_message),e("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))},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 e=this;this.optionsData[0]?.details?.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>e.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={},e=this.host.getElementSallaData(),i=void 0!==this.bundleContext?this.bundleContext:null;return e.forEach(((e,s)=>{if(i){if(s.startsWith("bundle[")&&s.includes("[options][")){const i=s.split("[options][")[1].replace("]","");t[i]=e}}else s.startsWith("options[")&&(t[s.replace("options[","").replace("]","")]=e)})),t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let e=!0;for(let i=0;i<t.length;i++)"reportValidity"in t[i]&&!t[i].reportValidity()&&(e=!1);return e}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((e=>e.id===t))}invalidHandler(t,e){const i=t.target.closest(".s-product-options-option");i.classList.contains("s-product-options-option-error")||i.classList.add("s-product-options-option-error"),!this.userInitiatedValidation&&!salla.helpers.isIOSDevice()||salla.url.is_page("cart")||this.host.querySelector(".s-product-options-option-error")===i&&this.scrollToElement(i)}scrollToElement(t){t&&t.scrollIntoView({behavior:"smooth",block:"center"})}changedHandler(t,e,i=!0){const s={event:t,option:e,detail:null,productId:this.productId};if(e.details){const i=e.details.find((e=>Number(e.id)===Number(t.target.value)));s.detail=i}"country"===e.type&&this.handleCountryOptionChange(t,s.detail);const a=t.target.closest(".s-product-options-option");(t.target.value||(e.type===kt.FILE||e.type===kt.IMAGE)&&"added"===t.type||e.type===kt.MAP&&"selected"===t.type&&t.target.lat&&t.target.lng)&&setTimeout((()=>{a.classList.remove("s-product-options-option-error")}),200),e.type===kt.DONATION&&salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value}),this.setSelectedSkus(),this.handleRequiredMultipleOptions(e);const n=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===kt.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?n>-1?this.selectedOptions[n]={...s.detail,option_id:s.option.id}:this.selectedOptions.push({...s.detail,option_id:s.option.id}):n>-1&&this.selectedOptions.splice(n,1);this.optionsData=this.optionsData.map((t=>t.id===s.option.id?{...t,details:t.details.map((t=>({...t,is_selected:s.option.type===kt.MULTIPLE_OPTIONS?this.selectedOptions.some((e=>e.id===t.id)):Number(t.id)===Number(s.detail?.id),value:s.detail?.value})))}:t)),i&&(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,e)=>t.filter((t=>e.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==kt.MULTIPLE_OPTIONS||!t.required)return;const e=this.host.querySelector(`[data-option-id="${t.id}"]`),i=e.querySelectorAll("input:checked").length;e.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!i)))}getLatLng(t,e){return t?t.split(",")["lat"===e?0:1]:""}getDisplayForType(t){return this[`${t.type}Option`]?this[`${t.type}Option`](t):t.type===kt.COLOR_PICKER?this.colorPickerOption(t):t.type===kt.MULTIPLE_OPTIONS?this.multipleOptions(t):t.type===kt.SINGLE_OPTION?this.singleOption(t):t.type===kt.RADIO?this.radioOption(t):t.type===kt.DIGITAL_CARD_VALUE?this.digitalCardValuesOption(t):t.type===kt.COUNTRY?this.countryOption(t):t.type===kt.BOOKING&&salla.url.is_page("cart")?e("salla-booking-field",{onInvalidInput:e=>this.invalidHandler(e,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 e=this.optionsData.find((({type:t})=>"digital-code-value"===t));if(!e)throw new Error("product-options:: No digital card options found");const i=Object.keys(t.skus_availability).filter((e=>!1===t.skus_availability[e]));this.availableDigitalCardValues=e.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>i.includes(t))).length))}handleCountryOptionChange(t,e){t.stopImmediatePropagation(),this.ignoreDefaultCardValue=!0;const i=this.host.querySelector("input[data-code-value]:checked");if(i&&(i.checked=!1),!this.optionsData.find((({type:t})=>"digital-code-value"===t)))throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(e)}getSelectedDigitalCardOptions(t){const e=t.details.find((t=>t.is_selected)),i=t.details.find((t=>!!t.is_default))||t.details[0];if(["digital-code-value","country"].includes(t.type))return e||i}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)),e=t&&this.getSelectedDigitalCardOptions(t);e&&this.getAvailableDigitalCardSKUs(e)}return this.outOfStockText=salla.lang.get("pages.products.out_of_stock"),await salla.onReady(),this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart"),this.pasteHandler=this.handlePaste.bind(this),document.addEventListener("paste",this.pasteHandler),!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)))?salla.api.cart.getCurrentCartId(!1,"salla-product-options"):null}disconnectedCallback(){this.pasteHandler&&document.removeEventListener("paste",this.pasteHandler)}handlePaste(t){const e=t.target;if(!(Salla.helpers.isAppleDevice()&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.classList.contains("s-form-control")&&this.host.contains(e)))return;t.preventDefault();const i=t.clipboardData?.getData("text")||"",s=e.selectionStart,a=e.selectionEnd,n=e.value.slice(0,s)+i+e.value.slice(a);e.value=n,e.setSelectionRange(s+i.length,s+i.length);try{e.dispatchEvent(new window.Event("change",{bubbles:!0}))}catch(t){Salla.log("Error on change")}}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===kt.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){if(0!==this.optionsData?.length)return e(i,{class:"s-product-options-wrapper"},e("salla-conditional-fields",null,this.optionsData.map((t=>e("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():e("div",{class:{"s-product-options-option":!0,"s-product-options-option-booking":t.type===kt.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},e("label",{htmlFor:this.generateInputId(t.id),class:"s-product-options-option-label "+(this.hideLabel(t)?"s-product-options-option-label-hidden":"")},e("b",null,t.name,t.required&&e("span",null," * ")," "),e("small",null,t.placeholder)),e("div",{class:"s-product-options-option-content "+(this.hideLabel(t)||t.type===kt.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":"")},this.getDisplayForType(t))))))))}generateUniqueKey(t){const e=this.bundleContext;let i=this.uniqueKey?`${t}-${this.uniqueKey}`:t;if(e)try{const t="string"==typeof e?JSON.parse(e):e,{sectionId:s,productId:a}=t;i=`${i}-bundle-${s}-${a}`}catch(t){}return i}generateInputId(t){return this.generateUniqueKey(`option-${t}`)}generateInputName(t){const e=this.bundleContext,i=t.toString();if(e)try{const t="string"==typeof e?JSON.parse(e):e,{sectionId:s,productId:a}=t;return`bundle[${s}][${a}][options][${i}]`}catch(t){return`options[${i}]`}return`options[${i}]`}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,e)=>{const i=e.details.filter((t=>t.is_selected)).map((t=>({...t,option_id:e.id})));return t.concat(i)}),[])}componentDidLoad(){if(0===this.optionsData?.length&&!this.optionsData.some((t=>t.type===kt.DONATION)))return;const t=this.optionsData.find((t=>t.type===kt.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,i){return e("div",{class:"s-product-options-donation-wrapper"},t.donation?.can_donate?[t.donation?e("div",{key:t.id,class:"s-product-options-donation-progress"},e("salla-progress-bar",{donation:t.donation})):"",t.details.length?[e("h4",{key:t.id},this.selectAmount),e("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>e("div",{key:t.id,class:"s-product-options-donation-options-item"},e("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:e=>this.handleDonationOptions(e,i,"option",t)}),e("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},e("span",{innerHTML:salla.money(i.name)}))))),t.donation?.custom_amount_enabled?e("div",{class:"s-product-options-donation-options-item"},e("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:e=>this.handleDonationOptions(e,"custom","option",t)}),e("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},e("span",null," ",this.selectDonationAmount," "))):"")]:"",e("div",{key:t.id,class:{"s-product-options-donation-input-group":!0,shown:!t.details.length||t.details.length&&this.isCustomDonation}},e("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:e=>this.handleDonationOptions(e,"custom","input",t),onBlur:e=>this.changedHandler(e,t),onInvalid:e=>this.invalidHandler(e,t)}),e("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){return e("salla-file-upload",{...i||{},"payload-name":"file",value:t.value,"instant-upload":!0,name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,height:"120px",onAdded:e=>this.changedHandler(e,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:e=>this.invalidHandler(e,t),class:{"s-product-options-image-input":!0,required:t.required}},e("div",{class:"s-product-options-filepond-placeholder"},e("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:i.accept?.split(",").every((t=>t.includes("image")))?u:'\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'}),e("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),e("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 e=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return e?.length?this.fileUploader(t,{accept:e.join(",")}):"File types not selected."}numberOption(t){return e("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,id:this.generateInputId(t.id),name:this.generateInputName(t.id),placeholder:t.placeholder,onBlur:e=>this.changedHandler(e,t),onInvalid:e=>this.invalidHandler(e,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return e("div",{class:"s-product-options-splitter"})}textOption(t){return e("div",{class:"s-product-options-text"},e("input",{type:"text",value:t.value,maxLength:t?.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:this.generateInputId(t.id),name:this.generateInputName(t.id),placeholder:t.placeholder,onInvalid:e=>this.invalidHandler(e,t),onChange:e=>this.changedHandler(e,t)}))}textareaOption(t){return e("div",{class:"s-product-options-textarea"},e("div",{class:"mt-1"},e("textarea",{rows:4,value:t.value,maxLength:t?.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:this.generateInputId(t.id),name:this.generateInputName(t.id),placeholder:t.placeholder,onInvalid:e=>this.invalidHandler(e,t),onChange:e=>this.changedHandler(e,t)})))}mapOption(t){return e("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:e=>this.invalidHandler(e,t),onSelected:e=>this.changedHandler(e,t)})}colorPickerOption(t){return e("salla-color-picker",{onSubmitted:e=>this.changedHandler(e,t),name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,onInvalidInput:e=>this.invalidHandler(e,t),color:t.value})}timeOption(t){return e("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:e=>this.invalidHandler(e,t),onPicked:e=>this.changedHandler(e,t)})}dateOption(t){return e("div",{class:"s-product-options-date-element"},e("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:this.generateInputName(t.id),onInvalidInput:e=>this.invalidHandler(e,t),onPicked:e=>this.changedHandler(e,t)}))}datetimeOption(t){return e("div",{class:"s-product-options-datetime-element"},e("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:e=>this.invalidHandler(e,t),onPicked:e=>this.changedHandler(e,t)}))}getOptionDetailName(t,e=!0,i){let s;return i&&i===kt.COLOR&&(s=t.name+(e&&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+(e&&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 e=this.selectedOptions.filter((e=>e.id===t.id)).length;if(e&&1===this.selectedOptions.length)return!1;if(e){const e=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>e.includes(Number(t))))}return this.selectedOptions.some((e=>e.is_out&&e.option_id!==t.option_id))}renderInput(t,i,s,a,n,l){const o=this.generateUniqueKey(`${t}-${s.id}-${i.id}`),r=this.isOptionDetailOut(i);return e("label",{class:{"s-product-options-disabled":r}},e("input",{id:o,type:t,name:n,value:i.id,disabled:r,required:a,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),e("div",{class:{"s-product-options-grid-mode-span":l,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,e,i,s=!1){const a=this.generateInputName(e.id),n="radio"===t?a:`${a}[]`;return e?.details.map((a=>this.renderInput(t,a,e,i,n,s)))}renderSelect(t){return e("div",null,e("select",{id:this.generateInputId(t.id),name:this.generateInputName(t.id),required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:e=>this.invalidHandler(e,t),onChange:e=>this.changedHandler(e,t)},e("option",{value:""},t.placeholder),t?.details.map((t=>e("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return e("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,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 i="button"===this.optionConfig?.["multiple-option"]?.type,s=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return i?this.renderButtonStyle("checkbox",t,s):e("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 e("fieldset",{class:"s-product-options-colors-wrapper"},t?.details.map((i=>e("div",{class:"s-product-options-colors-item",key:i.id},e("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:this.generateInputName(t.id),disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:e=>this.invalidHandler(e,t),onChange:e=>this.changedHandler(e,t)}),e("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},e("span",{style:{backgroundColor:i.color}}),e("div",{innerHTML:this.getOptionDetailName(i,!0,t.type)}))))))}thumbnailOption(t){return e("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>e("div",{key:i.id},e("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:this.generateInputName(t.id),"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:e=>this.invalidHandler(e,t),onChange:e=>this.changedHandler(e,t)}),e("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},e("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),e("span",{innerHTML:d,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[e("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?e("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),e("p",null,this.getOptionDetailName(i,!1)," ")))))}digitalCardValuesOption(t){return e("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{const s=String(i.id);return e("label",{htmlFor:this.generateUniqueKey(s.toString()),key:s,class:"s-product-options-digital-card-option"},e("input",{type:"radio","data-code-value":!0,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:this.generateInputName(t.id),id:this.generateUniqueKey(s.toString()),required:!t.visibility_condition&&t.required,onInvalid:e=>this.invalidHandler(e,t),...this.ignoreDefaultCardValue?{}:{defaultChecked:this.getSelectedDigitalCardOptions(t)?.id===i.id}}),e("span",null,i.name," ",salla.config?.currency()?.symbol))})):e("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return e("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>e("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":!0,"s-product-options-digital-card-option-stock-out":i.is_out}},e("input",{id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:this.generateInputName(t.id),disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:e=>this.invalidHandler(e,t),onChange:e=>this.changedHandler(e,t),onClick:()=>{this.disableCardValue=!1},...salla.url.is_page("cart")?{defaultChecked:this.getSelectedDigitalCardOptions(t)?.id===i.id}:{}}),e("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`,onError:t=>{t.currentTarget.onerror=null,t.currentTarget.src=salla.url.cdn("images/globe.svg")}}),e("span",null,i.name)))))}get host(){return s(this)}};St.style="";const Ct=class{constructor(e){t(this,e),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 e("salla-placeholder",{alignment:"center",iconSize:"xl"},e("div",{slot:"title"},this.placeholder_title),e("div",{slot:"description"},this.placeholder_description))}render(){return e("salla-modal",{key:"6c952c6cdd01f99332809112fd5921c4b43cd518",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},e("span",{key:"f4260144f981da0081e09895b7a065cad1fa66bc",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'}),e("div",{key:"80e28a80741f103fdc788a6afa8809dfabfd64f6",slot:"loading"},e("div",{key:"e190d657a6a03e48a813c2f78321c12cf95eadcb",class:"s-product-size-guide-skeleton"},e("salla-skeleton",{key:"94cb87240b52244a86ba76893261048aa3f356d9",height:"15px",width:"25%"}),e("div",{key:"c8bba70713c78829d0973b845a3ed942cb7fa150",class:"s-product-size-guide-skeleton-header"},e("salla-skeleton",{key:"13b2fe8a4655457567d087e5763e43abb8b2d2a5",height:"40px"}),e("salla-skeleton",{key:"4b23015076c7c44794eecf85a4355264f778ef10",height:"40px"}),e("salla-skeleton",{key:"3cd58dfafb05cc2bac89ad6973247075d0dd9571",height:"40px"}),e("salla-skeleton",{key:"36f28def58893e567e6186d94ec3a84abed159ab",height:"40px"})),e("div",{key:"854881c782f372b2ed1b08874dfa4bd5d64edef2",class:"s-product-size-guide-skeleton-content"},e("salla-skeleton",{key:"a790751c95177a49135859f5810b4cd947fa4314",height:"15px",width:"25%"}),e("salla-skeleton",{key:"a9e4bd9a0bf55bd391da7f68ba85db7893f1eb81",height:"10px",width:"75%"}),e("salla-skeleton",{key:"b0f73c83abd9b6e8521dacb823d65f13f9ba54bb",height:"10px",width:"50%"}),e("salla-skeleton",{key:"fe92879eedf28801c4d267e4595e5f4aa5c7b871",height:"10px",width:"75%"}),e("salla-skeleton",{key:"652d460114bc710073adcb2e31a6627c938259c5",height:"10px",width:"100%"}),e("salla-skeleton",{key:"71f461d5256a05d4ac407b00daf2e20dccef0cf5",height:"10px",width:"25%"}),e("salla-skeleton",{key:"dbd224caad4233eb0bf8a5012fab7160d067d371",height:"10px",width:"60%"}),e("salla-skeleton",{key:"c87baa836ae0282047ccc8b7fb122a80cdf7256a",height:"10px",width:"45%"}),e("salla-skeleton",{key:"2c02db790ed567de556d7fa74f48843d156dedb6",height:"10px",width:"30%"})))),e("slot",{key:"155efc69836cfc62382a8b3f7929c7200244f4ba",name:"header"}),!this.hasError&&this.guides?[e("salla-tabs",null,this.guides.map((t=>e("salla-tab-header",{slot:"header",name:t.name},e("span",null,t.name)))),this.guides.map((t=>e("salla-tab-content",{slot:"content",name:t.name},e("div",{innerHTML:t.description})))))]:this.showPlaceholder(),e("slot",{key:"6d212a3d48df9363485e77f37f71276a1c3f8ee7",name:"footer"}))}get host(){return s(this)}};Ct.style="";const zt=class{constructor(e){t(this,e),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=h.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),h.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(){o({targets:"salla-products-list salla-product-card",opacity:[0,1],duration:1200,translateY:[20,0],delay:function(t,e){return 100*e}})}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,e]of Object.entries(this.parsedFilters||{}))if(["string","number"].includes(typeof e))this.nextPage+=`&filters[${encodeURIComponent(t)}]=${encodeURIComponent(e)}`;else if(Array.isArray(e))e.forEach((e=>this.nextPage+=`&filters[${encodeURIComponent(t)}][]=${encodeURIComponent(e)}`));else if("object"==typeof e)for(const[i,s]of Object.entries(e))this.nextPage+=`&filters[${encodeURIComponent(t)}][${encodeURIComponent(i)}]=${encodeURIComponent(s)}`}buildNextPageUrl(){let t=this.getSource();if("json"===t)return;const e=sessionStorage.getItem(this.infiniteScrollStateKey);if(e){const{nextPage:t}=JSON.parse(e);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(e){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,e=!1){if(t){let t=e&&!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="");try{if(this.source&&t.url&&!t.url.includes("s-product-source=")){const[e,i]=t.url.split("#"),s=e.includes("?")?"&":"?",a=salla.config?.get("page.slug")||"unknown";t.url=`${e}${s}s-product-source=${a}.${this.source}${i?"#"+i:""}`}}catch(t){Salla.log("Error with source")}const e=document.createElement(this.hasCustomComponent?this.productCardComponent:"salla-product-card");return e.product=t,this.applyLandingPageStyles(e),this.applyHorizontalCardStyles(e),e.addEventListener("click",(e=>{this.hasInfiniteScroll&&e.target.closest("a")&&(this.takeStateSnapshot(),sessionStorage.setItem(this.lastViewedProductKey,t.id))})),e}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 e=null;return new Promise((i=>{const s=new ResizeObserver((()=>{clearTimeout(e),e=setTimeout((()=>{s.disconnect(),i(null)}),160)}));s.observe(t)}))}waitForLayoutStable(t){let e=null;return new Promise((i=>{const s=new MutationObserver((()=>{clearTimeout(e),e=setTimeout((()=>{s.disconnect(),i(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 e=this.wrapper?.querySelector(`[id*="${t}"]`);if(!e)return;const i=()=>{const t=()=>{e.scrollIntoView({block:"start",behavior:"instant"});const t=matchMedia("(max-width: 1024px)").matches?"header .inner":"ul.main-menu",i=window?.header_is_sticky?document.querySelector(t)?.getBoundingClientRect()?.height??56:0,s=parseInt(getComputedStyle(this.wrapper).rowGap)??16;scrollBy({top:-1*(i+s),behavior:"instant"})};requestAnimationFrame(t),e.querySelectorAll("img.lazy").forEach((e=>{const i=e,s=()=>{requestAnimationFrame(t),i.onload=i.onerror=null};i.onload=s,i.onerror=s})),this.removeScrollRestorationSession()};this.waitForStableLayout(this.host).then((()=>requestAnimationFrame(i)))}))}isElementLoaded(t){return new Promise((e=>{const i=setInterval((()=>{if(document.querySelector(t))return clearInterval(i),e(document.querySelector(t))}),50)}))}takeStateSnapshot(){const t=[];for(let e=0;e<this.wrapper.children.length;e++){const i=this.wrapper.children?.[e];t.push(i.product)}const e={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(e));let i=salla.config.get("page.id");const s=Object.keys(this.specialPagesWithoutIds).find((t=>salla.url.is_page(t)));s?i=this.specialPagesWithoutIds[s]:null!==i&&(i=String(i)),sessionStorage.setItem(this.prevCategoryIdKey,i)}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),e=sessionStorage.getItem(this.filtersKey),i=sessionStorage.getItem(this.prevCategoryIdKey),s=this.specialPagesWithoutIds[salla.config.get("page.slug")]||null,a=salla.config.get("page.id"),n=salla.url.is_page("index"),l=salla.url.is_page("product.single"),o=s?i!==s:i!==String(a);if(i&&o&&!n&&!l||n&&!this.hasInfiniteScroll)return this.removeScrollRestorationSession(),this.switchToNormalBehavior=!0,!1;if(l)return this.switchToNormalBehavior=!0,!1;if(t)try{const{pageIndex:i,nextPage:s,currentPageData:a}=JSON.parse(t);if("undefined"!==e){const t=JSON.parse(e);salla.event.emit("filters::fetched",{filters:t})}this.page=i,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 h.getProductsSource(this.source)}getSourceValue(){return this.currentCategoryIdFilter?this.currentCategoryIdFilter:h.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,e)=>({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:e+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 e=this.handleResponse(t);this.infiniteScroll.appendItems(e),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(),e=window.innerHeight;t.bottom-e<=200&&!this.isProcessing&&this.nextPage&&this.manualLoadNextPage()}),200))}manualLoadNextPage(){this.nextPage&&this.infiniteScroll.loadNextPage()}async injectAndProcessData(t){try{await h.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 h.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=h.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?e("div",{class:"s-products-list-placeholder"},e("span",{innerHTML:m}),e("p",null,this.placeholderText)):e(i,{class:"s-products-list"},e("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}),e("div",{class:"s-infinite-scroll-status",ref:t=>this.status=t},e("p",{class:"s-infinite-scroll-last infinite-scroll-last s-hidden"},this.endOfText),e("p",{class:"s-infinite-scroll-error infinite-scroll-error s-hidden"},this.failedLoadMore)),this.autoload&&e("div",{class:"s-products-list-loading-wrapper",style:{display:"none"},ref:t=>this.loader=t},e("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"})),this.hasInfiniteScroll&&this.nextPage&&!this.autoload?e("div",{class:"s-infinite-scroll-wrapper",style:{display:"none"},ref:t=>this.loadMoreWrapper=t},e("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},e("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),e("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,e=!0){if(!t)return[];let i=this.getSource(),s="";if(1===t.cursor?.current){s=h.getPageTitleForSource(i);try{if("search"===this.getSource())s=salla.lang.get("common.elements.search_about",{word:this.getSourceValue()});else if(!s){let e=this.parsedFilters.category_id||this.getSourceValue()[0];s=t.filters?.find((t=>"category_id"===t.key))?.values?.find((t=>t.key===e))?.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)}h.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"),e&&(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 e=0;e<t.data.length;e++)a.push(this.getItemHTML(t.data?.[e]));return a}get host(){return s(this)}};zt.style="";const $t=class{constructor(e){t(this,e),this.productCardComponent="custom-salla-product-card",this.apiUrl=""}componentWillLoad(){return salla.onReady().then((()=>{if(this.includes=h.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),h.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=>h.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 e=setInterval((()=>{this.host.querySelectorAll('[loading="lazy"]')?.forEach((t=>t.removeAttribute("loading"))),t++,t>=10&&clearInterval(e)}),1e3)}async componentDidLoad(){await Salla.hooks.registerComponent("salla-products-slider",this)}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 e("div",{class:"s-products-slider-card"},e("custom-salla-product-card",{product:t,source:this.getSource(),"source-value":this.getSourceValue()}));if(this.hasCustomComponent){const i=document.createElement(this.productCardComponent);return i.setAttribute("product",JSON.stringify(t)),i.setAttribute("source",this.getSource()),i.setAttribute("source-value",this.getSourceValue()),e("div",{class:"s-products-slider-card",innerHTML:i.outerHTML})}return e("div",{class:"s-products-slider-card"},e("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 h.getProductsSource(this.source)}getSourceValue(){return h.getProductsSourceValue(this.source,this.sourceValue)}render(){if(this.canRender())return e(i,{class:"s-products-slider-wrapper"},e("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},e("div",{slot:"items"},this.productsData?.map((t=>this.getItemHTML(t))))))}get host(){return s(this)}};$t.style="";const Tt=class{constructor(e){t(this,e),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?e("div",{class:"s-progress-bar-container"},this.header?e("div",{class:"s-progress-bar-header"},this.header):"",this.getProgressBar(),this.message?e("span",{class:"s-progress-bar-message"},this.message):""):""}getProgressBar(){return this.target?[this.hideUnits?null:e("div",{class:"s-progress-bar-target-section"},e("span",{innerHTML:`${salla.helpers.number(this.value)} ${this.unit}`}),e("span",{innerHTML:`${salla.helpers.number(this.target)} ${this.unit}`})),e("div",{class:"s-progress-bar-wrapper",style:{height:this.height}},e("div",{class:{"s-progress-bar-progress":!0,"s-progress-bar-progress-stripped":this.stripped},style:{width:`${this.getPercentage()}%`,backgroundColor:this.color}}))]:null}};Tt.style="";const Pt=class{constructor(e){t(this,e),this.disableInput=!1,this.hostAttributes={},this.hasIncrementSlot=!1,this.hasDecrementSlot=!1,this.didLoaded=!1,this.quantity=1,this.fireChangeEvent=!0}watchPropHandler(){this.didLoaded&&(this.fireChangeEvent?h.debounce((()=>{salla.document.event.fireEvent(this.textInput,"change",{bubbles:!0,detail:{productId:this.cartItemId,quantity:this.quantity}})})):this.fireChangeEvent=!0)}async componentWillLoad(){await salla.onReady(),this.disableInput=!salla.config.get("store.settings.product.manual_quantity"),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,e=!0){this.fireChangeEvent=e;let i=parseInt(this.host.getAttribute("max"));return i&&t>i&&(t=i),t<=1&&(t=1),this.quantity=t,this.host}render(){const t=this.getInputAttributes();return t["aria-label"]||t["aria-labelledby"]||(t["aria-label"]=salla.lang.getWithDefault("common.elements.quantity","Quantity")),e(i,{key:"ba636a941071cccc06a8fbcadf7a3ff93d88f4d0",class:"s-quantity-input"},e("div",{key:"5fbe227ca172661fb8edc32940f586e7e26c8d46",class:"s-quantity-input-container"},e("button",{key:"dbdb3cbac199c2fb73ef49dcdb513ebd38f5f3b5",onClick:()=>this.increase(),class:"s-quantity-input-increase-button s-quantity-input-button",type:"button","aria-label":salla.lang.getWithDefault("common.elements.increase_quantity","Increase quantity")},this.hasIncrementSlot?"":e("span",{innerHTML:k}),e("slot",{key:"f117c437e73134ab4fe949c61190e38e4db81e44",name:"increment-button"})),e("input",{key:"c41fd5bbb8760171462d3a5cc54ebe9ae54747fc",class:"s-quantity-input-input",...t,ref:t=>this.textInput=t,onInput:t=>this.setValue(t.target.value),min:"1",readOnly:this.disableInput,value:this.quantity}),e("button",{key:"94ea2537b3deb379d9a07233e49d60fb3982784e",class:"s-quantity-input-decrease-button s-quantity-input-button",onClick:()=>this.decrease(),type:"button","aria-label":salla.lang.getWithDefault("common.elements.decrease_quantity","Decrease quantity")},this.hasDecrementSlot?"":e("span",{innerHTML:M}),e("slot",{key:"4756e4069e6e16f92de72eefa99d48c3793d58cf",name:"decrement-button"}))))}get host(){return s(this)}static get watchers(){return{quantity:["watchPropHandler"]}}};Pt.style="";var It={request:(t,e,i,s=null,a=null)=>l.request({url:e,data:i,method:t.toLowerCase(),responseType:"json"}).then(s).catch(a),get:(t,e=null,i=null,s)=>l.get(t,{params:s}).then(e).catch(i),post(t,e,i=null,s=null){return this.request("post",t,e,i,s)},put(t,e,i=null,s=null){return this.request("put",t,e,i,s)},delete(t,e,i=null,s=null){return this.request("delete",t,e,i,s)},requestWithSupportAjax(t,e,i="post"){return new Promise(((s,a)=>{if(!window?.isLegacyTheme)return this.request(i,t,e,(({data:t})=>s(t)),(({response:t})=>a(t)));$.ajax({url:t,method:i.toUpperCase(),data:e,async:!1,success:function({data:t}){return s(t)},error:function({response:t}){return a(t)}})}))}},Lt={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,e){var i,s,a,n=0,l=0;for(n=0;n<e.length;n+=1)if(new RegExp(e[n].value,"i").test(t)){if(i=new RegExp(e[n].version+"[- /:;]([\\d._]+)","i"),a="",(s=t.match(i))&&s[1]&&(s=s[1]),s)for(s=s.split(/[._]+/),l=0;l<s.length;l+=1)a+=0===l?s[l]+".":s[l];else a="0";return{name:e[n].name,version:parseFloat(a)}}return{name:"unknown",version:0}}};async function At(t,e,i=!1){if(salla.logger.log("🍏 Pay: mutateShippingContact called",e,i),t.detail.requiredShippingContactFields&&0!=t.detail.requiredShippingContactFields.length)if(i){if(salla.config.isGuest()&&salla.config.get("store.features").includes("guest-checkout")){if(!(e.emailAddress&&e.givenName&&e.familyName&&e.phoneNumber)){salla.logger.warn("🍏 Pay: Guest contact fields are required",e);const i=[];return e.emailAddress||i.push(new window.ApplePayError("shippingContactInvalid","emailAddress","Email address is required")),e.phoneNumber||i.push(new window.ApplePayError("shippingContactInvalid","phoneNumber","Phone number is required")),e.givenName&&e.familyName||i.push(new window.ApplePayError("shippingContactInvalid","name","Name is required")),void t.session.completePayment({status:t.session.STATUS_INVALID_SHIPPING_CONTACT,errors:i})}await async function(t,e){return salla.logger.log("🍏 Pay: Updating guest contact",e),new Promise(((i,s)=>{It.post(t.detail.guestContactSelected.url.replace("{id}",t.id),{email:e.emailAddress||null,first_name:e.givenName||null,last_name:e.familyName||null,phone_number:e.phoneNumber||null,country_code:e.countryCode||null},(async({data:e})=>{"function"==typeof t.detail.guestContactSelected?.onSuccess&&t.detail.guestContactSelected.onSuccess(e),i(e)}),(({response:e})=>{salla.logger.warn("🍏 Pay: Failed to update guest contact via api",e),"function"==typeof t.detail.guestContactSelected?.onFailed&&t.detail.guestContactSelected.onFailed(e),s({response:e})}))}))}(t,e)}}else if(t.detail.requiredShippingContactFields.includes("postalAddress"))return It.post(t.detail.shippingContactSelected.url.replace("{id}",t.id),{country:e.country,city:e.locality,local:e.subLocality||e.administrativeArea||e.locality,description:e.subAdministrativeArea,street:e.addressLines?.join(", ")||e.administrativeArea,country_code:e.countryCode,postal_code:e.postalCode},(async({data:e})=>{if("function"==typeof t.detail.shippingContactSelected.onSuccess&&t.detail.shippingContactSelected.onSuccess(e),t.address_id=e.data.address_id,t.shipping_methods=e.data.shipping_methods,!t.shipping_methods||t.shipping_methods&&!t.shipping_methods.length)return salla.logger.warn("🍏 Pay: We dont found any supported methods",e),void t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]});try{await t.selectApplePayShippingMethod(t.shipping_methods[0])}catch(e){return salla.logger.warn("Failed set the shipping details to api",e),void t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]})}try{await t.recalculateTotal()}catch(e){return salla.logger.warn("🍏 Pay: Failed recalculate total",e),void t.session.completeShippingContactSelection({status:t.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]})}const i={newTotal:t.prepareTotal(),newLineItems:t.prepareLineItems(),newShippingMethods:t.mappingShippingMethods(t.shipping_methods)};salla.logger.log("🍏 Pay: completeShippingContactSelection",i),t.session.completeShippingContactSelection(i)}),(({response:e})=>{salla.logger.warn("🍏 Pay: Failed add address via api",e),"function"==typeof t.detail.shippingContactSelected.onFailed&&t.detail.shippingContactSelected.onFailed(e);let i=e?.data?.error?.fields,s=function(t){return Object.entries(t).filter((([t,e])=>e&&e.length>0)).map((([t,e])=>new window.ApplePayError("shippingContactInvalid",t,e[0])))}({countryCode:i?.country_code&&i.country_code.length>0?i.country_code[0]:null,locality:i?.city&&i.city.length>0?i.city[0]:null,country:i?.country&&i.country.length>0?i.country[0]:null});0===s.length&&e?.data?.error?.message&&s.push(new window.ApplePayError("shippingContactInvalid","locality",e?.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,totals:[],shippingCompany: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:parseFloat(SallaApplePay.detail.amount).toString()}]),SallaApplePay.detail.items},prepareTotal:function(){return{label:window.location.hostname||"Salla",amount:parseFloat(SallaApplePay.detail.amount).toString()}},isPhysical:()=>SallaApplePay.detail?.requiredShippingContactFields?.includes("postalAddress"),startSession:async function(t){SallaApplePay.detail=t.detail||t,salla.log("🍏 Pay: payments::apple-pay.start-transaction",SallaApplePay.detail),SallaApplePay.initDefault();let e=SallaApplePay.getApplePaySessionVersion(),i=SallaApplePay.detail.supportedNetworks||["masterCard","visa"];5===e&&i.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:i,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(e,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()},onPaymentMethodSelected:async t=>{if(salla.logger.log("🍏 Pay: onPaymentMethodSelected",t),SallaApplePay.isPhysical())salla.logger.log("🍏 Pay: completePaymentMethodSelection",{newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()}),SallaApplePay.session.completePaymentMethodSelection({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()});else try{await SallaApplePay.recalculateTotal();const t={newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()};salla.logger.log("🍏 Pay: completePaymentMethodSelection",t),SallaApplePay.session.completePaymentMethodSelection(t)}catch(t){salla.logger.warn("🍏 Pay: Failed recalculate total",t),SallaApplePay.session.completePaymentMethodSelection({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems(),status:SallaApplePay.session.STATUS_FAILURE,errors:[new window.ApplePayError("unknown",void 0,t?.response?.data?.error?.message||t?.response?.data?.error?.code||"Failed to recalculate total")]})}},onCouponCodeChanged:t=>(Salla.event.dispatch("payments::apple-pay.coupon.change",t),It.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 e=t?.response;Salla.event.dispatch("payments::apple-pay.coupon.failed",e),"function"==typeof SallaApplePay.detail.onCouponCodeChanged.onFailed&&SallaApplePay.detail.onCouponCodeChanged.onFailed(e),await SallaApplePay.recalculateTotal(),SallaApplePay.session.completeCouponCodeChange({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems(),errors:[new window.ApplePayError("couponCodeInvalid")]})}))),onCancel:(t={},e=null)=>{SallaApplePay.detail.onError(e||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);try{await At(SallaApplePay,t.payment.shippingContact,!0)}catch(t){salla.logger.error("🍏 Pay: Failed to update guest contact details",t);const e=t?.response||t,i=e?.data?.error?.fields||{},s=[];return i?.email&&i.email.length>0&&s.push(new window.ApplePayError("shippingContactInvalid","emailAddress",i.email[0])),i?.phone&&i.phone.length>0&&s.push(new window.ApplePayError("shippingContactInvalid","phoneNumber",i.phone[0])),i?.first_name&&i.first_name.length>0?s.push(new window.ApplePayError("shippingContactInvalid","name",i.first_name[0])):i?.last_name&&i.last_name.length>0&&s.push(new window.ApplePayError("shippingContactInvalid","name",i.last_name[0])),0===s.length&&s.push(new window.ApplePayError("shippingContactInvalid","name",e?.data?.error?.message||e?.data?.error?.code||"Invalid shipping contact details")),Salla.event.dispatch("payments::apple-pay.authorized.failed",e),"function"==typeof SallaApplePay.detail.authorized.onFailed&&SallaApplePay.detail.authorized.onFailed(e),void SallaApplePay.session.completePayment({status:ApplePaySession.STATUS_INVALID_SHIPPING_CONTACT,errors:s})}Salla.event.dispatch("payments::apple-pay.authorized.init",t),It.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),"function"==typeof SallaApplePay.detail.authorized.onSuccess&&SallaApplePay.detail.authorized.onSuccess(t),SallaApplePay.session.completePayment(ApplePaySession.STATUS_SUCCESS)}),(t=>{let e=t?.response;Salla.event.dispatch("payments::apple-pay.authorized.failed",e),"function"==typeof SallaApplePay.detail.authorized.onFailed&&SallaApplePay.detail.authorized.onFailed(e),SallaApplePay.session.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[new window.ApplePayError("unknown",void 0,e?.data?.error?.message||e?.data?.error?.code||"Failed to parse authorized response")]})}))},onValidateMerchant:async t=>{try{Salla.event.dispatch("payments::apple-pay.validate-merchant.init",t);const{data:e}=await It.post(SallaApplePay.detail.validateMerchant.url.replace("{id}",SallaApplePay.id),{validation_url:t.validationURL});Salla.event.dispatch("payments::apple-pay.validate-merchant.success",e);const i=t=>{SallaApplePay.session.completeMerchantValidation(t)};if("function"==typeof SallaApplePay.detail.validateMerchant.onSuccess){const t=await SallaApplePay.detail.validateMerchant.onSuccess(e);if(t?.redirect)return window.location=t.redirect,SallaApplePay.abortValidateMerchant(t)}i(e.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),await At(SallaApplePay,t.shippingContact)},onShippingMethodSelected:async t=>{let e=t.shippingMethod.identifier.split(","),i={ship_id:e[0],private_ship_id:void 0===e[1]?null:e[1],type:void 0===e[2]?null:e[2],route_id:void 0===e[3]?null:e[3]};if(salla.logger.log("🍏 Pay: onShippingMethodSelected",{event:t,previous:SallaApplePay.shippingCompany,current:i}),SallaApplePay.shouldUpdateShippingCompany(i))try{await SallaApplePay.selectApplePayShippingMethod(i),await SallaApplePay.recalculateTotal()}catch(t){return salla.logger.warn("🍏 Pay: Failed set the shipping details to api",t),void SallaApplePay.session.completeShippingMethodSelection({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems(),status:SallaApplePay.session.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,errors:[new window.ApplePayError("addressUnserviceable")]})}salla.logger.log("🍏 Pay: completeShippingMethodSelection",{newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()}),SallaApplePay.session.completeShippingMethodSelection({newTotal:SallaApplePay.prepareTotal(),newLineItems:SallaApplePay.prepareLineItems()})},abortSession:()=>{SallaApplePay.session&&SallaApplePay.session.abort()},shouldUpdateShippingCompany:t=>SallaApplePay.shippingCompany?.ship_id!=t?.ship_id||SallaApplePay.shippingCompany?.private_ship_id!=t?.private_ship_id,getApplePaySessionVersion:()=>{if("sallapp"===(navigator.userAgent||navigator.vendor||window.opera))return 5;let t=Lt.init(),e=parseFloat(t.os.version);if("Macintosh"===t.os.name){if(e<10.142)return 1}else if(e<12.11)return 1;return 5},recalculateTotal:()=>(salla.logger.log("🍏 Pay: recalculate total"),It.get(SallaApplePay.detail.recalculateTotal.url.replace("{id}",SallaApplePay.id),(({data:t})=>{salla.logger.log("🍏 Pay: recalculate total success",t);let e=t.data.initial_data?.cart||t.data.cart,i=t.data.initial_data?.payments||t.data.payments;salla.logger.log("🍏 Pay: recalculate total success",{cart:e,payments:i}),SallaApplePay.detail.amount=i?.gateways?.applePay?.supportedMultiCurrency?e.total_in_customer_currency:e.total,SallaApplePay.detail.items=(e.totals||e.items).map((t=>({label:t.title,amount:"مجاني"===t.amount||"Free"===t.amount?0:t.amount.toString().replace("+","")}))),SallaApplePay.detail.items.pop(),SallaApplePay.totals=SallaApplePay.detail.items}),(t=>(salla.logger.warn("🍏 Pay: recalculate total failed",t),t?.response?.data?.message)))),selectApplePayShippingMethod:t=>{salla.logger.log("🍏 Pay: select shipping method ",t),SallaApplePay.shippingCompany=t;const e={address_id:SallaApplePay.address_id,company_id:t.ship_id,private_company_id:t.private_ship_id,type:t.type||void 0,route_id:t.route_id||void 0,payment_method:"apple_pay"};return It.post(SallaApplePay.detail.shippingMethodSelected.url.replace("{id}",SallaApplePay.id),e,(({data:t})=>("function"==typeof SallaApplePay.detail.shippingMethodSelected.onSuccess&&SallaApplePay.detail.shippingMethodSelected.onSuccess(t),!0)),(t=>{salla.logger.warn("🍏 Pay: Set shipping method failed",t),"function"==typeof SallaApplePay.detail.shippingMethodSelected.onFailed&&SallaApplePay.detail.shippingMethodSelected.onFailed(t);let e=t?.response?.data?.error;return e?.data?.fields?.address_id?e?.data?.fields?.address_id[0]:e?.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():"")+(t.type?","+t.type:"")+(t.route_id?","+t.route_id:"")})))},window.ApplePaySession?.canMakePayments()?SallaApplePay.init():document.querySelectorAll("data-show-if-apple-pay-supported").forEach((t=>t.style.display="none"));const Ot=class{constructor(e){t(this,e),this.validationFailed=a(this,"validationFailed"),this.requireLogin=a(this,"requireLogin"),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()&&!this.isGuestCheckout()){this.requireLogin.emit({productId:this.productId});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 this.validationFailed.emit({productId:this.productId}),salla.error(salla.lang.get("common.messages.required_fields"));let e=this.host.getElementSallaData();if(!this.isApplePayActive)return salla.api.request("checkout/quick-purchase/"+this.productId,e,"post").then((t=>(t.data.redirect&&(window.location.href=t.data.redirect),t)));e.is_applepay=!0,"append"in e&&e.append("is_applepay",!0),salla.event.dispatch("payments::apple-pay.start-transaction",{amount:this.amount,currency:this.currency||"SAR",requiredShippingContactFields:this.getRequiredShippingContactFields(),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 e?e: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,guestContactSelected:this.isGuestCheckout()?{url:salla.url.get("checkout/{id}/customer")}: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)}})}isGuestCheckout(){return salla.config.isGuest()&&salla.config.get("store.features").includes("guest-checkout")}getRequiredShippingContactFields(){let t=[];return this.isRequireShipping&&t.push("postalAddress"),this.isGuestCheckout()&&t.push("email","phone","name"),t}componentWillLoad(){console.log("🍏 Pay: Quick Buy Component Loaded");const t="undefined"!=typeof window&&!!window.ApplePaySession?.canMakePayments?.(),e=salla?.config?.get?.("store.settings.payments")?.includes?.("apple_pay")??!0,i=salla?.config?.get?.("store.settings.is_salla_gateway",!1)??!0;this.isApplePayActive=t&&e&&i;const s=async()=>{if(!this.currency&&salla?.config?.get&&(this.currency=salla.config.get("store.settings.buy_now.multi_currency")?salla.config.get("user.currency_code"):"SAR"),!this.productId&&salla?.config?.get&&salla.url?.is_page&&(this.productId=salla.config.get("page.id")),this.applePayOnly||this.productId){if(this.amount&&this.isRequireShipping||!this.productId||!salla?.product?.getDetails||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)})),"donate"===this.type&&salla?.event?.on?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&&salla.product.event.onPriceUpdated((t=>{this.amount=t.data.price})),this.isApplePayActive=(salla?.helpers?.hasApplePay?.()??t)&&(salla?.config?.get?.("store.settings.payments")?.includes?.("apple_pay")??e)&&(salla?.config?.get?.("store.settings.is_salla_gateway",!1)??i),!document.getElementById("apple-pay-sdk")&&this.isApplePayActive){const t=document.createElement("script");t.src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js",t.setAttribute("id","apple-pay-sdk"),t.async=!0,document.body.appendChild(t)}}else salla?.logger?.warn?.("🍏 Pay: Failed load the quick buy, the product id is missing")};return new Promise((t=>{"function"==typeof salla?.onReady?salla.onReady((()=>s().then((()=>t(!0))))):s().then((()=>t(!0)))}))}render(){return e(i,{key:"9a36fa6b7163dae6feed474712e3d0c3003d012c"},this.quickBuyButton())}quickBuyButton(){return e("apple-pay-button",{locale:salla?.config?.get?.("user.language_code")||"ar",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)}};Ot.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(e){t(this,e),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,e){return"terms"==e?salla.lang.get("pages.checkout.check_agreement"):salla.lang.get(`common.errors.${t}`,{attribute:"name"==e?this.userNameLabel:this.placeHolderEmail})}handleInvalidInput(t){let e,i=t.target,s=i.validity;s.valueMissing?(e=this.getErrorMessage("field_required",i.name),console.log(this.getErrorMessage("field_required",i.name))):s.typeMismatch&&(e=this.getErrorMessage("invalid_value",i.name)),i.setCustomValidity(e)}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,e=!1){return t.preventDefault(),e&&!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,e=150){return t?t.length<=e?t:(new DOMParser).parseFromString(t,"text/html").documentElement.innerText.substring(0,e)+"...":""}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?e(i,{class:"s-quick-order"},e("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")}},e("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'}),e("span",null,this.thanksMessage))):e(i,{class:`s-quick-order s-quick-order-${this.getDarkOrLight()}`},e("div",{class:`s-quick-order-container s-quick-order-${this.quickOrderStyle}`,style:{backgroundColor:this.getStyleColor()}},e("div",{class:"s-quick-order-button-cont"},e("div",null,e("h3",null,this.quickOrderTitle),e("p",null,this.subTitle)),e("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?e("i",{innerHTML:U}):this.confirmPayButtonTitle)),e("form",{onSubmit:t=>this.submit(t),class:"s-quick-order-expandable "+(this.expanded?"s-quick-order-shown":"")},Salla.config.isGuest()&&[e("div",{class:"s-form-group"},e("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'}),e("input",{type:"text",required:!0,class:"s-form-control s-quick-order-phone-field",name:"name",placeholder:this.userNameLabel,ref:t=>this.nameInput=t})),e("div",{class:"s-quick-order-flex-input"},e("div",{class:"s-form-group"},e("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'}),e("salla-tel-input",{ref:t=>this.phoneInput=t})),e("div",{class:"s-form-group"},e("span",{innerHTML:g}),e("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&&e("label",{htmlFor:"terms",class:"s-quick-order-terms"},e("input",{type:"checkbox",required:!0,name:"terms",id:"terms",ref:t=>this.termsInput=t,onChange:()=>this.termsChecked=this.termsInput.checked,class:"s-checkbox"}),e("span",{class:"s-form-label"}," ",e("div",{innerHTML:this.formatAgreementText(this.agreementText,150)},this.agreementText.length>150&&e("salla-button",{shape:"link",onClick:()=>this.agreementModal.open()},this.agreementShowText))," ")),e("salla-button",{type:"submit",color:this.getBtnColor(),width:"wide",ref:t=>this.submitBtn=t},this.payButtonTitle)),e("salla-modal",{"modal-title":this.agreementModalHead,ref:t=>this.agreementModal=t},e("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 Dt='\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',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>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 Ft=class{constructor(e){t(this,e),this.hasError=!1,this.showContactWidget=!0,this.images=[],this.productImages={},this.editItemImages=[],this.contact_body=(t,e,i)=>salla.lang.get("pages.rating.contact_subject",{store:t,id:e,customer:i}),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((e=>{o({targets:this.contentRefs[t],duration:100,height:this.contentRefs[t].scrollHeight,opacity:[0,1],easing:"easeOutQuart",complete:()=>e()})})),this.onClose=t=>new Promise((e=>{o({targets:this.contentRefs[t],duration:100,height:0,opacity:[1,0],easing:"easeOutQuart",complete:()=>e()})})),this.toggleUploader=async t=>{this.isOpen[t]=!this.isOpen[t],h.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,e,i)=>new Promise((s=>{salla.helpers.setNested(salla.lang.messages[t],e,i),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,e,i)=>salla.lang.get("pages.rating.contact_body",{store:t,id:e,customer:i})})()}))}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 e of this.order.products)t[e.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((e=>{t(!1),this.hasError=!0,this.errorMessage=e.response?.data?.error?.message||e.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 e=`rating/${t}/show`,i=await salla.api.request(e);this.editItem=i.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((e=>{const i=salla.helpers.inputData(e.name,e.value,t);t[i.name]=i.value})),t.images&&(t.images=t.images.split(","));const e=`rating/${this.editFeedbackId}`;await salla.api.request(e,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],h.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&&(h.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>h.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const e=this.steps[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(e?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${e}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.body?.setAttribute("style",`height:${this.currentTab?.offsetHeight}px`)))}previousTab(){this.currentIndex>0&&this.currentIndex--,h.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((()=>h.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,e=null){if(!t&&"products"===this.currentTab.dataset.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));const i=(t=t||this.currentTab).querySelector(".rating_hidden_input").value,s=t.querySelector(".s-rating-modal-validation-msg");if(e=e||t.dataset.type,!i)throw s.innerHTML=salla.lang.get(`pages.rating.rate_${e}_stars`).replace(" (:item)",""),new Error(s.innerHTML);s.innerHTML=""}sendFeedback(){const t={};if(this.currentTab.querySelectorAll("[name]").forEach((e=>{const i=salla.helpers.inputData(e.name,e.value,t);t[i.name]=i.value})),this.allowAttachImages&&t.products)for(let e in t.products)t.products[e].images&&(t.products[e].images=t.products[e].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,e=setInterval((()=>{this.thanksTime.innerHTML="00:0"+t--,t>0||(clearInterval(e),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}`,e=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),i=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(e)}`;window.open(i,"_blank")}handleSendWhatsApp(){const t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),e=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(t)}`;window.open(e,"_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 e("salla-modal",{ref:t=>this.deleteModal=t,width:"xs",onModalVisibilityChanged:t=>this.resetData(t)},e("div",{class:"s-rating-modal-delete-wrapper",ref:t=>this.body=t},e("h3",null,this.confirmDeletionLabel),e("p",null,this.areYouSureLabel),e("div",{class:"s-rating-modal-delete-actions"},e("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),e("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal.close()},this.cancelLabel))))}renderUploadedImagesCount(t){const i=this.editMode?this.editItemImages.length:(this.productImages[t]||[]).length;return e("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",i,{current:i,total:this.MAX_UPLOAD_LIMIT}))}getEditModal(){return e("salla-modal",{ref:t=>this.editModal=t,width:"md",onModalVisibilityChanged:t=>this.resetData(t)},e("div",{class:"s-rating-modal-edit-wrapper",ref:t=>this.body=t},"store"===this.editType&&this.editItem?e("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:t=>this.currentTab=t},e("div",{class:"s-rating-modal-rounded-icon"},e("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"})),e("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),e("div",{class:"s-rating-modal-stars-company"},e("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),e("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),e("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?e("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?e("div",{class:"s-rating-modal-rounded-icon"},e("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):e("span",{class:"s-rating-modal-icon",innerHTML:jt}),e("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),e("div",{class:"s-rating-modal-stars-company"},e("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),e("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),e("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?e("section",{class:"s-rating-modal-step","data-type":"products",ref:t=>this.currentTab=t},e("div",{class:"s-rating-modal-product"},e("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},e("div",{class:"s-rating-modal-product-img-wrap"},e("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),e("div",{class:"s-rating-modal-product-details"},e("div",{class:"s-rating-modal-product-details-main"},e("div",null,e("h3",{class:"s-rating-modal-product-title"}," ",this.editItem.product.name),e("div",{class:"s-rating-modal-stars-product"},e("salla-rating-stars",{withLabel:!0,size:"small",editable:!0,value:this.editItem.stars}))),this.allowAttachImages&&e("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(1)},e("span",null,this.editItemImages.length?this.editImagesLabel:this.addImagesLabel),e("span",{innerHTML:I}))),e("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"content",class:"s-rating-modal-comment"}),e("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&e("div",{class:"s-rating-modal-uploader is-closed",ref:t=>this.contentRefs[1]=t},e("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 e=t.detail;e&&(this.editItemImages=this.editItemImages.filter((t=>t.id!==e)),this.hiddenInputs[1].value=this.editItemImages.map((t=>t.url)).join())},labelIdle:this.getFilepondPlaceholder()}),e("input",{type:"hidden",name:"images",value:this.editItem.images.join(","),ref:t=>this.hiddenInputs[1]=t}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,e("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},e("salla-button",{"loader-position":"center",onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.deleteMode?e(i,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?e(i,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?e(i,{class:"s-rating-modal"},e("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:t=>this.resetData(t),isLoading:!0,width:"md",ref:t=>this.modal=t},e("div",{slot:"loading"},e("div",{class:"s-rating-modal-skeleton"},e("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),e("salla-skeleton",{height:"15px",width:"60%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((t=>e("div",{key:t,innerHTML:Dt})))),e("salla-skeleton",{height:"100px",width:"100%"}),e("div",{class:"s-rating-modal-skeleton-footer"},e("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[e("div",{class:"s-rating-modal-wrapper",ref:t=>this.body=t},this.order?.testimonials_enabled?e("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},e("div",{class:"s-rating-modal-rounded-icon"},e("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"})),e("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),e("div",{class:"s-rating-modal-stars-company"},e("salla-rating-stars",{withLabel:!0,size:"large"})),e("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),e("small",{class:"s-rating-modal-validation-msg"})):"",this.order.products_enabled?e("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products"},this.order.products.map(((t,i)=>e("div",{class:"s-rating-modal-product",key:i},e("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},e("div",{class:"s-rating-modal-product-img-wrap"},e("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),e("div",{class:"s-rating-modal-product-details"},e("div",{class:"s-rating-modal-product-details-main"},e("div",null,e("h3",{class:"s-rating-modal-product-title"}," ",t.product.name),e("div",{class:"s-rating-modal-stars-product"},e("salla-rating-stars",{withLabel:!0,size:"small",name:`products[${i}][rating]`}))),this.allowAttachImages&&e("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(i)},e("span",null,this.addImagesLabel),e("span",{innerHTML:I}))),e("input",{type:"hidden",name:`products[${i}][product_id]`,value:t.product.id}),e("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:`products[${i}][comment]`,class:"s-rating-modal-comment"}),e("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&e("div",{class:"s-rating-modal-uploader is-closed",ref:t=>this.contentRefs[i]=t},e("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:e=>{this.productImages={...this.productImages,[t.product.id]:[...this.productImages[t.product.id]||[],e.detail]},this.hiddenInputs[i].value=this.productImages[t.product.id].map((t=>t.url)).join(",")},onRemoved:e=>{const s=e.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[i].value=this.productImages[t.product.id].map((t=>t.url)).join(","))},labelIdle:this.getFilepondPlaceholder()}),e("input",{type:"hidden",name:`products[${i}][images]`,value:(this.productImages[t.product.id]||[]).map((t=>t.url)).join(","),ref:t=>this.hiddenInputs[i]=t}),this.renderUploadedImagesCount(t.product.id)))))):"",this.order.shipping_enabled&&this.order.shipping?.company?e("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},e("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?e("div",{class:"s-rating-modal-rounded-icon"},e("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):e("span",{class:"s-rating-modal-icon",innerHTML:jt}),e("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),e("div",{class:"s-rating-modal-stars-company"},e("salla-rating-stars",{withLabel:!0,size:"large"})),e("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),e("small",{class:"s-rating-modal-validation-msg"})):"",e("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>this.thanksTab=t},e("span",{class:"s-rating-modal-icon",innerHTML:X}),e("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),e("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),e("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"))?e("div",{class:"s-rating-modal-contact"},e("p",null,this.contactUsLabel),e("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&e("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:b}),salla.config.get("store.contacts.email")&&e("span",{onClick:()=>this.handleSendEmail(),innerHTML:g}))):"",e("div",{class:"s-rating-modal-footer"},e("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?e("ul",{class:"s-rating-modal-dots"},[0,1,2].slice(0,this.stepsCount).map((t=>e("li",{key:t,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",e("salla-button",{"loader-position":"center",ref:t=>this.nextBtn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:e("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)}};Ft.style="";const Rt=class{constructor(e){t(this,e),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"),e=t[t.length-1];if(!e)return;let i=parseInt(e.getAttribute("data-star"));this.starsElem.querySelector(".rating_hidden_input").value=i.toString(),this.starsElem.querySelectorAll(".s-rating-stars-btn-star").forEach(((t,e)=>h.toggleElementClassIf(t,"s-rating-stars-selected","s-rating-stars-unselected",(()=>e<i)))),this.starsElem.querySelectorAll("[aria-pressed]").forEach((t=>t.removeAttribute("aria-pressed"))),e.setAttribute("aria-pressed","true"),this.selectedStar=i,this.withLabel&&(this.reviewLabel=this.labels[i-1])}triggerRatingProgrammatically(t){if(!this.starsElem)return;const e=this.starsElem.querySelectorAll(".s-rating-stars-btn-star");e&&t>=0&&t<=e.length&&(e.forEach(((e,i)=>{e.classList.toggle("s-rating-stars-hovered",i<=t)})),this.handleRating())}highlightSelectedStars(){let t="s-rating-stars-hovered",e=this.starsElem?.querySelectorAll(".s-rating-stars-btn-star");e?.forEach(((i,s)=>{i.addEventListener("mouseover",(()=>{for(let i=0;i<=s;i++)e[i].classList.add(t);this.withLabel&&(this.reviewLabel=this.labels[s])})),i.addEventListener("mouseout",(()=>{i.classList.remove(t),this.withLabel&&(this.reviewLabel=this.selectedStar?this.labels[this.selectedStar-1]:"")}))})),this.starsElem?.addEventListener("mouseout",(()=>e.forEach((e=>e.classList.remove(t)))))}createStars(t){let i=[];for(let s=0;s<5;s++)i.push(e("span",{class:{"s-rating-stars-btn-star":!0,["s-rating-stars-"+this.size]:!0,"s-rating-stars-selected":s<t},innerHTML:at}));return this.reviews>0&&i.push(e("span",{class:"s-rating-stars-reviews",ref:t=>this.reviewsElement=t},"(",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.reviews)),")")),i}render(){return this.translationsLoaded?this.host.closest(".swiper-slide")?.classList.contains("swiper-slide-duplicate")?"":e(i,null,e("div",{class:"s-rating-stars-wrapper"},!this.value&&0!=this.value||this.editable?e("div",{class:"s-rating-stars-element",ref:t=>this.starsElem=t},e("input",{type:"hidden",class:"rating_hidden_input",name:this.name,value:""}),[1,2,3,4,5].map((t=>e("button",{class:"s-rating-stars-btn-star s-rating-stars-"+this.size,"data-star":t},e("span",{innerHTML:at}))))):this.createStars(this.value),this.withLabel&&this.reviewLabel?e("span",{class:"s-rating-stars-label"},this.reviewLabel):"")):e(i,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)}};Rt.style="";const Ht=class{constructor(e){t(this,e),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?e("div",{class:("s-reviews-summary-header-section "+(this.recommendationOnly?"s-reviews-summary-recommendation-only":"")).trim()},e("h4",{class:"s-reviews-summary-recommendation-percentage"},"%",this.data?.recommendation),e("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((i=>{const s=t[i];return e("div",{key:i,class:"s-reviews-summary-row"},e("div",{class:"s-reviews-summary-row-rate"},i," ",e("span",{innerHTML:at})),e("salla-progress-bar",{class:"s-reviews-summary-progress",value:s,target:100,hideUnits:!0,height:"16px"}),e("span",{class:"s-reviews-summary-percentage"},s,"%"))}));return e(i,{class:"s-reviews-summary-wrapper"},e("div",{class:"s-reviews-summary-header"},e("div",{class:"s-reviews-summary-header-section"},e("h3",{class:"s-reviews-summary-average"},this.data.rating),e("div",null,e("salla-rating-stars",{size:"large",value:this.data.rating}),e("p",{class:"s-reviews-summary-count"},this.basedOnLabel," ",salla.helpers.number(salla.lang.choice("pages.rating.reviews",this.data.count))))),this.renderRecommendation()),e("div",{class:"s-reviews-summary-rows"},s))}};Ht.style=":host{display:block}";var Bt,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>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"}(Bt||(Bt={}));const Nt=class{constructor(e){t(this,e),this.loadedScopes={[Bt.DEFAULT]:null,[Bt.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=Bt.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===Bt.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:e=null})=>{this.open(t,e)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}async close(){return await(this.modal?.close())}async open(t=Bt.DEFAULT,e=null){return this.hasError=!1,this.mode=[Bt.AVAILABILITY,Bt.DEFAULT].includes(t)?t:Bt.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>t==Bt.AVAILABILITY?salla.scope.getProductAvailability(e):salla.scope.get())).then((e=>{if(t==Bt.AVAILABILITY)return this.setScopeValues(this.loadedScopes[Bt.AVAILABILITY]=e.data);this.setScopeValues(this.loadedScopes[this.mode]=e.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 e=t.target.value.toLocaleLowerCase();this.scopes=e?this.originalScopesList.filter((t=>t.name.toLowerCase().includes(e))):this.originalScopesList}handleScopeSelection(t){this.current_scope=this.scopes?.find((e=>e.id==t.target.value))}placeholderContent(){return e("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},e("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),e("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[e("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((t=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("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}),e("label",{htmlFor:`${this.selection} + '_scope_' + ${t.id}`,class:"s-scopes-label s-scopes-clickable"},e("span",null,t.name)))))),this.footerContent()]}availabilityContent(){return e("div",{class:"s-scopes-container"},this.scopes?.map((t=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===Bt.DEFAULT}},e("span",null,t.name)),e("h2",{style:{color:t?.availability?.color},class:`s-scopes-${t?.availability?.key}`},t?.availability?.label)))))}footerContent(){return e("div",{class:"s-scopes-footer"},e("slot",{name:"footer"},e("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 e(i,{key:"8cbe5fbbe87bff9b835ae59fc92278725a9d09cf"},e("salla-modal",{key:"82017d18802be5fa8fff95b2cbe32886308bb23e",ref:t=>this.modal=t,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?e("div",{slot:"loading"},e("div",{class:"s-scopes-skeleton"},e("salla-list-tile",{class:"s-scopes-header"},e("div",{slot:"icon",class:"s-scopes-header-icon"},e("salla-skeleton",{type:"circle"})),e("div",{slot:"title",class:"s-scopes-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-scopes-skeleton-search"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"30px",width:"100%"})),e("div",{class:"s-scopes-skeleton-scopes"},e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-scopes-skeleton-btn"},e("salla-skeleton",{height:"40px",width:"100%"})))):[e("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},e("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'}),e("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),e("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&e("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?e("div",{class:"s-scopes-search-wrapper"},e("div",{class:"s-scopes-search-icon",innerHTML:qt}),e("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!==Bt.AVAILABILITY?this.placeholderContent():this.mode===Bt.DEFAULT?this.defaultContent():this.availabilityContent())]))}componentDidLoad(){this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};Nt.style=".s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}";const Gt=class{constructor(e){t(this,e),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 e=t.target.value.trim().split(/\s+/);if(e.length>this.maxWords){const t=e.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((e=>{this.results=e,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",h.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=e("div",{key:"2e945555af379b5992375336c5b33a1dbb92589b",class:{"s-search-container":!0,"s-search-inline":this.inline},ref:t=>this.container=t},e("div",{key:"28c948e49a1d72a3a79e87477f37cc5f26dd4b3a",class:"s-search-input-wrapper"},e("span",{key:"b053ea1b4e6ed3c4030010dd61923421fcfeb214",class:"s-search-icon-wrap"},e("span",{key:"e1ecd01ab77d0ddd0b7b2010788fe28deaebd2af",class:"s-search-icon",innerHTML:this.loading?'<i class="s-search-spinner-loader"/>':qt})),e("input",{key:"bca441ce72aac9bb85f2862413c77fa853e703c6",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?e("salla-button",{loading:this.loading,class:{"s-search-action":!0,"s-search-action-oval":this.oval},onClick:()=>this.handleActionClick()},!this.loading&&e("span",{innerHTML:qt})):null),e("div",{key:"07ed4d8828b8343dd05bacb3a6904ad30eacce7a",class:"s-search-results"},this.results?.data.map((t=>e("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)}))),e("p",{key:"7a3420f60f2172f39c44633176a454f9ae06f0ce",ref:t=>this.noResults=t,class:"s-search-no-results-placeholder"},salla.lang.get("common.elements.no_options"))));return this.inline?e("div",{class:"s-search-modal"},t):e("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"]}}};Gt.style="";const Wt=class{constructor(e){t(this,e),this.type="normal",this.width="100%",this.height="100%"}render(){return e(i,{key:"ad465a77b10e2f1d739c802643076f63985cfda5",class:"s-skeleton-wrapper",style:{width:this.width,height:this.height}},e("div",{key:"0b05bcfc21d3bcb85389a2a0c9b63c3a7aa28d60",class:{"s-skeleton-item":!0,"s-skeleton-item-circular":"circle"==this.type}}," "))}};function Ut(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function Vt(t={},e={}){const i=["__proto__","constructor","prototype"];Object.keys(e).filter((t=>i.indexOf(t)<0)).forEach((i=>{void 0===t[i]?t[i]=e[i]:Ut(e[i])&&Ut(t[i])&&Object.keys(e[i]).length>0&&Vt(t[i],e[i])}))}Wt.style=":host{display:block}";const Xt={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Jt(){const t="undefined"!=typeof document?document:{};return Vt(t,Xt),t}const Zt={document:Xt,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:t=>"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0),cancelAnimationFrame(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function Yt(){const t="undefined"!=typeof window?window:{};return Vt(t,Zt),t}function Kt(t=""){return t.trim().split(" ").filter((t=>!!t.trim()))}function Qt(t,e=0){return setTimeout(t,e)}function te(){return Date.now()}function ee(t,e="x"){const i=Yt();let s,a,n;const l=function(t){const e=Yt();let i;return e.getComputedStyle&&(i=e.getComputedStyle(t,null)),!i&&t.currentStyle&&(i=t.currentStyle),i||(i=t.style),i}(t);return i.WebKitCSSMatrix?(a=l.transform||l.webkitTransform,a.split(",").length>6&&(a=a.split(", ").map((t=>t.replace(",","."))).join(", ")),n=new i.WebKitCSSMatrix("none"===a?"":a)):(n=l.MozTransform||l.OTransform||l.MsTransform||l.msTransform||l.transform||l.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),s=n.toString().split(",")),"x"===e&&(a=i.WebKitCSSMatrix?n.m41:16===s.length?parseFloat(s[12]):parseFloat(s[4])),"y"===e&&(a=i.WebKitCSSMatrix?n.m42:16===s.length?parseFloat(s[13]):parseFloat(s[5])),a||0}function ie(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function se(...t){const e=Object(t[0]),i=["__proto__","constructor","prototype"];for(let a=1;a<t.length;a+=1){const n=t[a];if(null!=n&&(s=n,!("undefined"!=typeof window&&void 0!==window.HTMLElement?s instanceof HTMLElement:s&&(1===s.nodeType||11===s.nodeType)))){const t=Object.keys(Object(n)).filter((t=>i.indexOf(t)<0));for(let i=0,s=t.length;i<s;i+=1){const s=t[i],a=Object.getOwnPropertyDescriptor(n,s);void 0!==a&&a.enumerable&&(ie(e[s])&&ie(n[s])?n[s].__swiper__?e[s]=n[s]:se(e[s],n[s]):!ie(e[s])&&ie(n[s])?(e[s]={},n[s].__swiper__?e[s]=n[s]:se(e[s],n[s])):e[s]=n[s])}}}var s;return e}function ae(t,e,i){t.style.setProperty(e,i)}function ne({swiper:t,targetPosition:e,side:i}){const s=Yt(),a=-t.translate;let n,l=null;const o=t.params.speed;t.wrapperEl.style.scrollSnapType="none",s.cancelAnimationFrame(t.cssModeFrameID);const r=e>a?"next":"prev",c=(t,e)=>"next"===r&&t>=e||"prev"===r&&t<=e,d=()=>{n=(new Date).getTime(),null===l&&(l=n);const r=Math.max(Math.min((n-l)/o,1),0),h=.5-Math.cos(r*Math.PI)/2;let p=a+h*(e-a);if(c(p,e)&&(p=e),t.wrapperEl.scrollTo({[i]:p}),c(p,e))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout((()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[i]:p})})),void s.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=s.requestAnimationFrame(d)};d()}function le(t){return t.querySelector(".swiper-slide-transform")||t.shadowRoot&&t.shadowRoot.querySelector(".swiper-slide-transform")||t}function oe(t,e=""){const i=Yt(),s=[...t.children];return i.HTMLSlotElement&&t instanceof HTMLSlotElement&&s.push(...t.assignedElements()),e?s.filter((t=>t.matches(e))):s}function re(t){try{return void console.warn(t)}catch(t){}}function ce(t,e=[]){const i=document.createElement(t);return i.classList.add(...Array.isArray(e)?e:Kt(e)),i}function de(t){const e=Yt(),i=Jt(),s=t.getBoundingClientRect(),a=i.body;return{top:s.top+(t===e?e.scrollY:t.scrollTop)-(t.clientTop||a.clientTop||0),left:s.left+(t===e?e.scrollX:t.scrollLeft)-(t.clientLeft||a.clientLeft||0)}}function he(t,e){return Yt().getComputedStyle(t,null).getPropertyValue(e)}function pe(t){let e,i=t;if(i){for(e=0;null!==(i=i.previousSibling);)1===i.nodeType&&(e+=1);return e}}function ue(t,e){const i=[];let s=t.parentElement;for(;s;)e?s.matches(e)&&i.push(s):i.push(s),s=s.parentElement;return i}function fe(t,e){e&&t.addEventListener("transitionend",(function i(s){s.target===t&&(e.call(t,s),t.removeEventListener("transitionend",i))}))}function me(t,e){const i=Yt();return t["width"===e?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(t,null).getPropertyValue("width"===e?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(t,null).getPropertyValue("width"===e?"margin-left":"margin-bottom"))}function ge(t){return(Array.isArray(t)?t:[t]).filter((t=>!!t))}function be(t){return e=>Math.abs(e)>0&&t.browser&&t.browser.need3dFix&&Math.abs(e)%90==0?e+.001:e}function we(t,e=""){t.innerHTML="undefined"!=typeof trustedTypes?trustedTypes.createPolicy("html",{createHTML:t=>t}).createHTML(e):e}let ve,ye,xe;function _e(){return ve||(ve=function(){const t=Yt(),e=Jt();return{smoothScroll:e.documentElement&&e.documentElement.style&&"scrollBehavior"in e.documentElement.style,touch:!!("ontouchstart"in t||t.DocumentTouch&&e instanceof t.DocumentTouch)}}()),ve}function ke(t={}){return ye||(ye=function({userAgent:t}={}){const e=_e(),i=Yt(),s=i.navigator.platform,a=t||i.navigator.userAgent,n={ios:!1,android:!1},l=i.screen.width,o=i.screen.height,r=a.match(/(Android);?[\s\/]+([\d.]+)?/);let c=a.match(/(iPad)(?!\1).*OS\s([\d_]+)/);const d=a.match(/(iPod)(.*OS\s([\d_]+))?/),h=!c&&a.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p="Win32"===s;let u="MacIntel"===s;return!c&&u&&e.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${l}x${o}`)>=0&&(c=a.match(/(Version)\/([\d.]+)/),c||(c=[0,1,"13_0_0"]),u=!1),r&&!p&&(n.os="android",n.android=!0),(c||h||d)&&(n.os="ios",n.ios=!0),n}(t)),ye}function Me(){return xe||(xe=function(){const t=Yt(),e=ke();let i=!1;function s(){const e=t.navigator.userAgent.toLowerCase();return e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0}if(s()){const e=String(t.navigator.userAgent);if(e.includes("Version/")){const[t,s]=e.split("Version/")[1].split(" ")[0].split(".").map((t=>Number(t)));i=t<16||16===t&&s<2}}const a=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t.navigator.userAgent),n=s();return{isSafari:i||n,needPerspectiveFix:i,need3dFix:n||a&&e.ios,isWebView:a}}()),xe}var Se={on(t,e,i){const s=this;if(!s.eventsListeners||s.destroyed)return s;if("function"!=typeof e)return s;const a=i?"unshift":"push";return t.split(" ").forEach((t=>{s.eventsListeners[t]||(s.eventsListeners[t]=[]),s.eventsListeners[t][a](e)})),s},once(t,e,i){const s=this;if(!s.eventsListeners||s.destroyed)return s;if("function"!=typeof e)return s;function a(...i){s.off(t,a),a.__emitterProxy&&delete a.__emitterProxy,e.apply(s,i)}return a.__emitterProxy=e,s.on(t,a,i)},onAny(t,e){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!=typeof t)return i;const s=e?"unshift":"push";return i.eventsAnyListeners.indexOf(t)<0&&i.eventsAnyListeners[s](t),i},offAny(t){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsAnyListeners)return e;const i=e.eventsAnyListeners.indexOf(t);return i>=0&&e.eventsAnyListeners.splice(i,1),e},off(t,e){const i=this;return!i.eventsListeners||i.destroyed?i:i.eventsListeners?(t.split(" ").forEach((t=>{void 0===e?i.eventsListeners[t]=[]:i.eventsListeners[t]&&i.eventsListeners[t].forEach(((s,a)=>{(s===e||s.__emitterProxy&&s.__emitterProxy===e)&&i.eventsListeners[t].splice(a,1)}))})),i):i},emit(...t){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let i,s,a;return"string"==typeof t[0]||Array.isArray(t[0])?(i=t[0],s=t.slice(1,t.length),a=e):(i=t[0].events,s=t[0].data,a=t[0].context||e),s.unshift(a),(Array.isArray(i)?i:i.split(" ")).forEach((t=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach((e=>{e.apply(a,[t,...s])})),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach((t=>{t.apply(a,s)}))})),e}};const Ce=(t,e,i)=>{e&&!t.classList.contains(i)?t.classList.add(i):!e&&t.classList.contains(i)&&t.classList.remove(i)},ze=(t,e,i)=>{e&&!t.classList.contains(i)?t.classList.add(i):!e&&t.classList.contains(i)&&t.classList.remove(i)},$e=(t,e)=>{if(!t||t.destroyed||!t.params)return;const i=e.closest(t.isElement?"swiper-slide":`.${t.params.slideClass}`);if(i){let e=i.querySelector(`.${t.params.lazyPreloaderClass}`);!e&&t.isElement&&(i.shadowRoot?e=i.shadowRoot.querySelector(`.${t.params.lazyPreloaderClass}`):requestAnimationFrame((()=>{i.shadowRoot&&(e=i.shadowRoot.querySelector(`.${t.params.lazyPreloaderClass}`),e&&!e.lazyPreloaderManaged&&e.remove())}))),e&&!e.lazyPreloaderManaged&&e.remove()}},Te=(t,e)=>{if(!t.slides[e])return;const i=t.slides[e].querySelector('[loading="lazy"]');i&&i.removeAttribute("loading")},Pe=t=>{if(!t||t.destroyed||!t.params)return;let e=t.params.lazyPreloadPrevNext;const i=t.slides.length;if(!i||!e||e<0)return;e=Math.min(e,i);const s="auto"===t.params.slidesPerView?t.slidesPerViewDynamic():Math.ceil(t.params.slidesPerView),a=t.activeIndex;if(t.params.grid&&t.params.grid.rows>1){const i=a,n=[i-e];return n.push(...Array.from({length:e}).map(((t,e)=>i+s+e))),void t.slides.forEach(((e,i)=>{n.includes(e.column)&&Te(t,i)}))}const n=a+s-1;if(t.params.rewind||t.params.loop)for(let s=a-e;s<=n+e;s+=1){const e=(s%i+i)%i;(e<a||e>n)&&Te(t,e)}else for(let s=Math.max(a-e,0);s<=Math.min(n+e,i-1);s+=1)s!==a&&(s>n||s<a)&&Te(t,s)};var Ie={updateSize:function(){const t=this;let e,i;const s=t.el;e=null!=t.params.width?t.params.width:s.clientWidth,i=null!=t.params.height?t.params.height:s.clientHeight,0===e&&t.isHorizontal()||0===i&&t.isVertical()||(e=e-parseInt(he(s,"padding-left")||0,10)-parseInt(he(s,"padding-right")||0,10),i=i-parseInt(he(s,"padding-top")||0,10)-parseInt(he(s,"padding-bottom")||0,10),Number.isNaN(e)&&(e=0),Number.isNaN(i)&&(i=0),Object.assign(t,{width:e,height:i,size:t.isHorizontal()?e:i}))},updateSlides:function(){const t=this;function e(e,i){return parseFloat(e.getPropertyValue(t.getDirectionLabel(i))||0)}const i=t.params,{wrapperEl:s,slidesEl:a,rtlTranslate:n,wrongRTL:l}=t,o=t.virtual&&i.virtual.enabled,r=o?t.virtual.slides.length:t.slides.length,c=oe(a,`.${t.params.slideClass}, swiper-slide`),d=o?t.virtual.slides.length:c.length;let h=[];const p=[],u=[];let f=i.slidesOffsetBefore;"function"==typeof f&&(f=i.slidesOffsetBefore.call(t));let m=i.slidesOffsetAfter;"function"==typeof m&&(m=i.slidesOffsetAfter.call(t));const g=t.snapGrid.length,b=t.slidesGrid.length,w=t.size-f-m;let v=i.spaceBetween,y=-f,x=0,_=0;if(void 0===w)return;"string"==typeof v&&v.indexOf("%")>=0?v=parseFloat(v.replace("%",""))/100*w:"string"==typeof v&&(v=parseFloat(v)),t.virtualSize=-v-f-m,c.forEach((t=>{n?t.style.marginLeft="":t.style.marginRight="",t.style.marginBottom="",t.style.marginTop=""})),i.centeredSlides&&i.cssMode&&(ae(s,"--swiper-centered-offset-before",""),ae(s,"--swiper-centered-offset-after","")),i.cssMode&&(ae(s,"--swiper-slides-offset-before",`${f}px`),ae(s,"--swiper-slides-offset-after",`${m}px`));const k=i.grid&&i.grid.rows>1&&t.grid;let M;k?t.grid.initSlides(c):t.grid&&t.grid.unsetSlides();const S="auto"===i.slidesPerView&&i.breakpoints&&Object.keys(i.breakpoints).filter((t=>void 0!==i.breakpoints[t].slidesPerView)).length>0;for(let s=0;s<d;s+=1){M=0;const a=c[s];if(!a||(k&&t.grid.updateSlide(s,a,c),"none"!==he(a,"display"))){if(o&&"auto"===i.slidesPerView)i.virtual.slidesPerViewAutoSlideSize&&(M=i.virtual.slidesPerViewAutoSlideSize),M&&a&&(i.roundLengths&&(M=Math.floor(M)),a.style[t.getDirectionLabel("width")]=`${M}px`);else if("auto"===i.slidesPerView){S&&(a.style[t.getDirectionLabel("width")]="");const s=getComputedStyle(a),n=a.style.transform,l=a.style.webkitTransform;if(n&&(a.style.transform="none"),l&&(a.style.webkitTransform="none"),i.roundLengths)M=t.isHorizontal()?me(a,"width"):me(a,"height");else{const t=e(s,"width"),i=e(s,"padding-left"),n=e(s,"padding-right"),l=e(s,"margin-left"),o=e(s,"margin-right"),r=s.getPropertyValue("box-sizing");if(r&&"border-box"===r)M=t+l+o;else{const{clientWidth:e,offsetWidth:s}=a;M=t+i+n+l+o+(s-e)}}n&&(a.style.transform=n),l&&(a.style.webkitTransform=l),i.roundLengths&&(M=Math.floor(M))}else M=(w-(i.slidesPerView-1)*v)/i.slidesPerView,i.roundLengths&&(M=Math.floor(M)),a&&(a.style[t.getDirectionLabel("width")]=`${M}px`);a&&(a.swiperSlideSize=M),u.push(M),i.centeredSlides?(y=y+M/2+x/2+v,0===x&&0!==s&&(y=y-w/2-v),0===s&&(y=y-w/2-v),Math.abs(y)<.001&&(y=0),i.roundLengths&&(y=Math.floor(y)),_%i.slidesPerGroup==0&&h.push(y),p.push(y)):(i.roundLengths&&(y=Math.floor(y)),(_-Math.min(t.params.slidesPerGroupSkip,_))%t.params.slidesPerGroup==0&&h.push(y),p.push(y),y=y+M+v),t.virtualSize+=M+v,x=M,_+=1}}if(t.virtualSize=Math.max(t.virtualSize,w)+m,n&&l&&("slide"===i.effect||"coverflow"===i.effect)&&(s.style.width=`${t.virtualSize+v}px`),i.setWrapperSize&&(s.style[t.getDirectionLabel("width")]=`${t.virtualSize+v}px`),k&&t.grid.updateWrapperSize(M,h),!i.centeredSlides){const e=i.snapToSlideEdge&&!i.loop&&("auto"===i.slidesPerView||"auto"!==i.slidesPerView&&i.slidesPerView%1!=0);let s=h.length;if(e){let t;if("auto"===i.slidesPerView){t=1;let e=0;for(let i=u.length-1;i>=0&&(e+=u[i]+(i<u.length-1?v:0),e<=w);i-=1)t=u.length-i}else t=Math.floor(i.slidesPerView);s=Math.max(d-t,0)}const a=[];for(let n=0;n<h.length;n+=1){let l=h[n];i.roundLengths&&(l=Math.floor(l)),e?n<=s&&a.push(l):h[n]<=t.virtualSize-w&&a.push(l)}h=a,Math.floor(t.virtualSize-w)-Math.floor(h[h.length-1])>1&&(e||h.push(t.virtualSize-w))}if(o&&i.loop){const e=u[0]+v;if(i.slidesPerGroup>1){const s=Math.ceil((t.virtual.slidesBefore+t.virtual.slidesAfter)/i.slidesPerGroup),a=e*i.slidesPerGroup;for(let t=0;t<s;t+=1)h.push(h[h.length-1]+a)}for(let s=0;s<t.virtual.slidesBefore+t.virtual.slidesAfter;s+=1)1===i.slidesPerGroup&&h.push(h[h.length-1]+e),p.push(p[p.length-1]+e),t.virtualSize+=e}if(0===h.length&&(h=[0]),0!==v){const e=t.isHorizontal()&&n?"marginLeft":t.getDirectionLabel("marginRight");c.filter(((t,e)=>!(i.cssMode&&!i.loop)||e!==c.length-1)).forEach((t=>{t.style[e]=`${v}px`}))}if(i.centeredSlides&&i.centeredSlidesBounds){let t=0;u.forEach((e=>{t+=e+(v||0)})),t-=v;const e=t>w?t-w:0;h=h.map((t=>t<=0?-f:t>e?e+m:t))}if(i.centerInsufficientSlides){let t=0;u.forEach((e=>{t+=e+(v||0)})),t-=v;const e=(f||0)+(m||0);if(t+e<w){const i=(w-t-e)/2;h.forEach(((t,e)=>{h[e]=t-i})),p.forEach(((t,e)=>{p[e]=t+i}))}}if(Object.assign(t,{slides:c,snapGrid:h,slidesGrid:p,slidesSizesGrid:u}),i.centeredSlides&&i.cssMode&&!i.centeredSlidesBounds){ae(s,"--swiper-centered-offset-before",-h[0]+"px"),ae(s,"--swiper-centered-offset-after",t.size/2-u[u.length-1]/2+"px");const e=-t.snapGrid[0],i=-t.slidesGrid[0];t.snapGrid=t.snapGrid.map((t=>t+e)),t.slidesGrid=t.slidesGrid.map((t=>t+i))}if(d!==r&&t.emit("slidesLengthChange"),h.length!==g&&(t.params.watchOverflow&&t.checkOverflow(),t.emit("snapGridLengthChange")),p.length!==b&&t.emit("slidesGridLengthChange"),i.watchSlidesProgress&&t.updateSlidesOffset(),t.emit("slidesUpdated"),!(o||i.cssMode||"slide"!==i.effect&&"fade"!==i.effect)){const e=`${i.containerModifierClass}backface-hidden`,s=t.el.classList.contains(e);d<=i.maxBackfaceHiddenSlides?s||t.el.classList.add(e):s&&t.el.classList.remove(e)}},updateAutoHeight:function(t){const e=this,i=[],s=e.virtual&&e.params.virtual.enabled;let a,n=0;"number"==typeof t?e.setTransition(t):!0===t&&e.setTransition(e.params.speed);const l=t=>s?e.slides[e.getSlideIndexByData(t)]:e.slides[t];if("auto"!==e.params.slidesPerView&&e.params.slidesPerView>1)if(e.params.centeredSlides)(e.visibleSlides||[]).forEach((t=>{i.push(t)}));else for(a=0;a<Math.ceil(e.params.slidesPerView);a+=1){const t=e.activeIndex+a;if(t>e.slides.length&&!s)break;i.push(l(t))}else i.push(l(e.activeIndex));for(a=0;a<i.length;a+=1)if(void 0!==i[a]){const t=i[a].offsetHeight;n=t>n?t:n}(n||0===n)&&(e.wrapperEl.style.height=`${n}px`)},updateSlidesOffset:function(){const t=this,e=t.slides,i=t.isElement?t.isHorizontal()?t.wrapperEl.offsetLeft:t.wrapperEl.offsetTop:0;for(let s=0;s<e.length;s+=1)e[s].swiperSlideOffset=(t.isHorizontal()?e[s].offsetLeft:e[s].offsetTop)-i-t.cssOverflowAdjustment()},updateSlidesProgress:function(t=this&&this.translate||0){const e=this,i=e.params,{slides:s,rtlTranslate:a,snapGrid:n}=e;if(0===s.length)return;void 0===s[0].swiperSlideOffset&&e.updateSlidesOffset();let l=-t;a&&(l=t),e.visibleSlidesIndexes=[],e.visibleSlides=[];let o=i.spaceBetween;"string"==typeof o&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*e.size:"string"==typeof o&&(o=parseFloat(o));for(let t=0;t<s.length;t+=1){const r=s[t];let c=r.swiperSlideOffset;i.cssMode&&i.centeredSlides&&(c-=s[0].swiperSlideOffset);const d=(l+(i.centeredSlides?e.minTranslate():0)-c)/(r.swiperSlideSize+o),h=(l-n[0]+(i.centeredSlides?e.minTranslate():0)-c)/(r.swiperSlideSize+o),p=-(l-c),u=p+e.slidesSizesGrid[t],f=p>=0&&p<=e.size-e.slidesSizesGrid[t],m=p>=0&&p<e.size-1||u>1&&u<=e.size||p<=0&&u>=e.size;m&&(e.visibleSlides.push(r),e.visibleSlidesIndexes.push(t)),Ce(r,m,i.slideVisibleClass),Ce(r,f,i.slideFullyVisibleClass),r.progress=a?-d:d,r.originalProgress=a?-h:h}},updateProgress:function(t){const e=this;void 0===t&&(t=e&&e.translate&&e.translate*(e.rtlTranslate?-1:1)||0);const i=e.params,s=e.maxTranslate()-e.minTranslate();let{progress:a,isBeginning:n,isEnd:l,progressLoop:o}=e;const r=n,c=l;if(0===s)a=0,n=!0,l=!0;else{a=(t-e.minTranslate())/s;const i=Math.abs(t-e.minTranslate())<1,o=Math.abs(t-e.maxTranslate())<1;n=i||a<=0,l=o||a>=1,i&&(a=0),o&&(a=1)}if(i.loop){const i=e.getSlideIndexByData(0),s=e.getSlideIndexByData(e.slides.length-1),a=e.slidesGrid[i],n=e.slidesGrid[s],l=e.slidesGrid[e.slidesGrid.length-1],r=Math.abs(t);o=r>=a?(r-a)/l:(r+l-n)/l,o>1&&(o-=1)}Object.assign(e,{progress:a,progressLoop:o,isBeginning:n,isEnd:l}),(i.watchSlidesProgress||i.centeredSlides&&i.autoHeight)&&e.updateSlidesProgress(t),n&&!r&&e.emit("reachBeginning toEdge"),l&&!c&&e.emit("reachEnd toEdge"),(r&&!n||c&&!l)&&e.emit("fromEdge"),e.emit("progress",a)},updateSlidesClasses:function(){const t=this,{slides:e,params:i,slidesEl:s,activeIndex:a}=t,n=t.grid&&i.grid&&i.grid.rows>1,l=t=>oe(s,`.${i.slideClass}${t}, swiper-slide${t}`)[0];let o,r,c;if(t.virtual&&i.virtual.enabled)if(i.loop){let e=a-t.virtual.slidesBefore;e<0&&(e=t.virtual.slides.length+e),e>=t.virtual.slides.length&&(e-=t.virtual.slides.length),o=l(`[data-swiper-slide-index="${e}"]`)}else o=l(`[data-swiper-slide-index="${a}"]`);else n?(o=e.find((t=>t.column===a)),c=e.find((t=>t.column===a+1)),r=e.find((t=>t.column===a-1))):o=e[a];o&&(n||(c=function(t,e){const i=[];for(;t.nextElementSibling;){const s=t.nextElementSibling;e?s.matches(e)&&i.push(s):i.push(s),t=s}return i}(o,`.${i.slideClass}, swiper-slide`)[0],i.loop&&!c&&(c=e[0]),r=function(t,e){const i=[];for(;t.previousElementSibling;){const s=t.previousElementSibling;e?s.matches(e)&&i.push(s):i.push(s),t=s}return i}(o,`.${i.slideClass}, swiper-slide`)[0],i.loop&&0===!r&&(r=e[e.length-1]))),e.forEach((t=>{ze(t,t===o,i.slideActiveClass),ze(t,t===c,i.slideNextClass),ze(t,t===r,i.slidePrevClass)})),t.emitSlidesClasses()},updateActiveIndex:function(t){const e=this,i=e.rtlTranslate?e.translate:-e.translate,{snapGrid:s,params:a,activeIndex:n,realIndex:l,snapIndex:o}=e;let r,c=t;const d=t=>{let i=t-e.virtual.slidesBefore;return i<0&&(i=e.virtual.slides.length+i),i>=e.virtual.slides.length&&(i-=e.virtual.slides.length),i};if(void 0===c&&(c=function(t){const{slidesGrid:e,params:i}=t,s=t.rtlTranslate?t.translate:-t.translate;let a;for(let t=0;t<e.length;t+=1)void 0!==e[t+1]?s>=e[t]&&s<e[t+1]-(e[t+1]-e[t])/2?a=t:s>=e[t]&&s<e[t+1]&&(a=t+1):s>=e[t]&&(a=t);return i.normalizeSlideIndex&&(a<0||void 0===a)&&(a=0),a}(e)),s.indexOf(i)>=0)r=s.indexOf(i);else{const t=Math.min(a.slidesPerGroupSkip,c);r=t+Math.floor((c-t)/a.slidesPerGroup)}if(r>=s.length&&(r=s.length-1),c===n&&!e.params.loop)return void(r!==o&&(e.snapIndex=r,e.emit("snapIndexChange")));if(c===n&&e.params.loop&&e.virtual&&e.params.virtual.enabled)return void(e.realIndex=d(c));const h=e.grid&&a.grid&&a.grid.rows>1;let p;if(e.virtual&&a.virtual.enabled)p=a.loop?d(c):c;else if(h){const t=e.slides.find((t=>t.column===c));let i=parseInt(t.getAttribute("data-swiper-slide-index"),10);Number.isNaN(i)&&(i=Math.max(e.slides.indexOf(t),0)),p=Math.floor(i/a.grid.rows)}else if(e.slides[c]){const t=e.slides[c].getAttribute("data-swiper-slide-index");p=t?parseInt(t,10):c}else p=c;Object.assign(e,{previousSnapIndex:o,snapIndex:r,previousRealIndex:l,realIndex:p,previousIndex:n,activeIndex:c}),e.initialized&&Pe(e),e.emit("activeIndexChange"),e.emit("snapIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&(l!==p&&e.emit("realIndexChange"),e.emit("slideChange"))},updateClickedSlide:function(t,e){const i=this,s=i.params;let a=t.closest(`.${s.slideClass}, swiper-slide`);!a&&i.isElement&&e&&e.length>1&&e.includes(t)&&[...e.slice(e.indexOf(t)+1,e.length)].forEach((t=>{!a&&t.matches&&t.matches(`.${s.slideClass}, swiper-slide`)&&(a=t)}));let n,l=!1;if(a)for(let t=0;t<i.slides.length;t+=1)if(i.slides[t]===a){l=!0,n=t;break}if(!a||!l)return i.clickedSlide=void 0,void(i.clickedIndex=void 0);i.clickedSlide=a,i.clickedIndex=i.virtual&&i.params.virtual.enabled?parseInt(a.getAttribute("data-swiper-slide-index"),10):n,s.slideToClickedSlide&&void 0!==i.clickedIndex&&i.clickedIndex!==i.activeIndex&&i.slideToClickedSlide()}};function Le({swiper:t,runCallbacks:e,direction:i,step:s}){const{activeIndex:a,previousIndex:n}=t;let l=i;l||(l=a>n?"next":a<n?"prev":"reset"),t.emit(`transition${s}`),e&&"reset"===l?t.emit(`slideResetTransition${s}`):e&&a!==n&&(t.emit(`slideChangeTransition${s}`),t.emit("next"===l?`slideNextTransition${s}`:`slidePrevTransition${s}`))}var Ae={slideTo:function(t=0,e,i=!0,s,a){"string"==typeof t&&(t=parseInt(t,10));const n=this;let l=t;l<0&&(l=0);const{params:o,snapGrid:r,slidesGrid:c,previousIndex:d,activeIndex:h,rtlTranslate:p,wrapperEl:u,enabled:f}=n;if(!f&&!s&&!a||n.destroyed||n.animating&&o.preventInteractionOnTransition)return!1;void 0===e&&(e=n.params.speed);const m=Math.min(n.params.slidesPerGroupSkip,l);let g=m+Math.floor((l-m)/n.params.slidesPerGroup);g>=r.length&&(g=r.length-1);const b=-r[g];if(o.normalizeSlideIndex)for(let t=0;t<c.length;t+=1){const e=-Math.floor(100*b),i=Math.floor(100*c[t]),s=Math.floor(100*c[t+1]);void 0!==c[t+1]?e>=i&&e<s-(s-i)/2?l=t:e>=i&&e<s&&(l=t+1):e>=i&&(l=t)}if(n.initialized&&l!==h){if(!n.allowSlideNext&&(p?b>n.translate&&b>n.minTranslate():b<n.translate&&b<n.minTranslate()))return!1;if(!n.allowSlidePrev&&b>n.translate&&b>n.maxTranslate()&&(h||0)!==l)return!1}let w;l!==(d||0)&&i&&n.emit("beforeSlideChangeStart"),n.updateProgress(b),w=l>h?"next":l<h?"prev":"reset";const v=n.virtual&&n.params.virtual.enabled;if((!v||!a)&&(p&&-b===n.translate||!p&&b===n.translate))return n.updateActiveIndex(l),o.autoHeight&&n.updateAutoHeight(),n.updateSlidesClasses(),"slide"!==o.effect&&n.setTranslate(b),"reset"!==w&&(n.transitionStart(i,w),n.transitionEnd(i,w)),!1;if(o.cssMode){const t=n.isHorizontal(),i=p?b:-b;if(0===e)v&&(n.wrapperEl.style.scrollSnapType="none",n._immediateVirtual=!0),v&&!n._cssModeVirtualInitialSet&&n.params.initialSlide>0?(n._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{u[t?"scrollLeft":"scrollTop"]=i}))):u[t?"scrollLeft":"scrollTop"]=i,v&&requestAnimationFrame((()=>{n.wrapperEl.style.scrollSnapType="",n._immediateVirtual=!1}));else{if(!n.support.smoothScroll)return ne({swiper:n,targetPosition:i,side:t?"left":"top"}),!0;u.scrollTo({[t?"left":"top"]:i,behavior:"smooth"})}return!0}const y=Me();return v&&!a&&y.isSafari&&n.isElement&&n.virtual.update(!1,!1,l),n.setTransition(e),n.setTranslate(b),n.updateActiveIndex(l),n.updateSlidesClasses(),n.emit("beforeTransitionStart",e,s),n.transitionStart(i,w),0===e?n.transitionEnd(i,w):n.animating||(n.animating=!0,n.onSlideToWrapperTransitionEnd||(n.onSlideToWrapperTransitionEnd=function(t){n&&!n.destroyed&&t.target===this&&(n.wrapperEl.removeEventListener("transitionend",n.onSlideToWrapperTransitionEnd),n.onSlideToWrapperTransitionEnd=null,delete n.onSlideToWrapperTransitionEnd,n.transitionEnd(i,w))}),n.wrapperEl.addEventListener("transitionend",n.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(t=0,e,i=!0,s){"string"==typeof t&&(t=parseInt(t,10));const a=this;if(a.destroyed)return;void 0===e&&(e=a.params.speed);const n=a.grid&&a.params.grid&&a.params.grid.rows>1;let l=t;if(a.params.loop)if(a.virtual&&a.params.virtual.enabled)l+=a.virtual.slidesBefore;else{let t;if(n){const e=l*a.params.grid.rows;t=a.slides.find((t=>1*t.getAttribute("data-swiper-slide-index")===e)).column}else t=a.getSlideIndexByData(l);const e=n?Math.ceil(a.slides.length/a.params.grid.rows):a.slides.length,{centeredSlides:i,slidesOffsetBefore:o,slidesOffsetAfter:r}=a.params,c=i||!!o||!!r;let d=a.params.slidesPerView;"auto"===d?d=a.slidesPerViewDynamic():(d=Math.ceil(parseFloat(a.params.slidesPerView,10)),c&&d%2==0&&(d+=1));let h=e-t<d;if(c&&(h=h||t<Math.ceil(d/2)),s&&c&&"auto"!==a.params.slidesPerView&&!n&&(h=!1),h){const i=c?t<a.activeIndex?"prev":"next":t-a.activeIndex-1<a.params.slidesPerView?"next":"prev";a.loopFix({direction:i,slideTo:!0,activeSlideIndex:"next"===i?t+1:t-e+1,slideRealIndex:"next"===i?a.realIndex:void 0})}if(n){const t=l*a.params.grid.rows;l=a.slides.find((e=>1*e.getAttribute("data-swiper-slide-index")===t)).column}else l=a.getSlideIndexByData(l)}return requestAnimationFrame((()=>{a.slideTo(l,e,i,s)})),a},slideNext:function(t,e=!0,i){const s=this,{enabled:a,params:n,animating:l}=s;if(!a||s.destroyed)return s;void 0===t&&(t=s.params.speed);let o=n.slidesPerGroup;"auto"===n.slidesPerView&&1===n.slidesPerGroup&&n.slidesPerGroupAuto&&(o=Math.max(s.slidesPerViewDynamic("current",!0),1));const r=s.activeIndex<n.slidesPerGroupSkip?1:o;if(n.loop){if(l&&(!s.virtual||!n.virtual.enabled)&&n.loopPreventsSliding)return!1;if(s.loopFix({direction:"next"}),s._clientLeft=s.wrapperEl.clientLeft,s.activeIndex===s.slides.length-1&&n.cssMode)return requestAnimationFrame((()=>{s.slideTo(s.activeIndex+r,t,e,i)})),!0}return s.slideTo(n.rewind&&s.isEnd?0:s.activeIndex+r,t,e,i)},slidePrev:function(t,e=!0,i){const s=this,{params:a,snapGrid:n,slidesGrid:l,rtlTranslate:o,enabled:r,animating:c}=s;if(!r||s.destroyed)return s;if(void 0===t&&(t=s.params.speed),a.loop){if(c&&(!s.virtual||!a.virtual.enabled)&&a.loopPreventsSliding)return!1;s.loopFix({direction:"prev"}),s._clientLeft=s.wrapperEl.clientLeft}function d(t){return t<0?-Math.floor(Math.abs(t)):Math.floor(t)}const h=d(o?s.translate:-s.translate),p=n.map((t=>d(t))),u=a.freeMode&&a.freeMode.enabled;let f=n[p.indexOf(h)-1];if(void 0===f&&(a.cssMode||u)){let t;n.forEach(((e,i)=>{h>=e&&(t=i)})),void 0!==t&&(f=u?n[t]:n[t>0?t-1:t])}let m=0;return void 0!==f&&(m=l.indexOf(f),m<0&&(m=s.activeIndex-1),"auto"===a.slidesPerView&&1===a.slidesPerGroup&&a.slidesPerGroupAuto&&(m=m-s.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),a.rewind&&s.isBeginning?s.slideTo(s.params.virtual&&s.params.virtual.enabled&&s.virtual?s.virtual.slides.length-1:s.slides.length-1,t,e,i):a.loop&&0===s.activeIndex&&a.cssMode?(requestAnimationFrame((()=>{s.slideTo(m,t,e,i)})),!0):s.slideTo(m,t,e,i)},slideReset:function(t,e=!0,i){const s=this;if(!s.destroyed)return void 0===t&&(t=s.params.speed),s.slideTo(s.activeIndex,t,e,i)},slideToClosest:function(t,e=!0,i,s=.5){const a=this;if(a.destroyed)return;void 0===t&&(t=a.params.speed);let n=a.activeIndex;const l=Math.min(a.params.slidesPerGroupSkip,n),o=l+Math.floor((n-l)/a.params.slidesPerGroup),r=a.rtlTranslate?a.translate:-a.translate;if(r>=a.snapGrid[o]){const t=a.snapGrid[o];r-t>(a.snapGrid[o+1]-t)*s&&(n+=a.params.slidesPerGroup)}else{const t=a.snapGrid[o-1];r-t<=(a.snapGrid[o]-t)*s&&(n-=a.params.slidesPerGroup)}return n=Math.max(n,0),n=Math.min(n,a.slidesGrid.length-1),a.slideTo(n,t,e,i)},slideToClickedSlide:function(){const t=this;if(t.destroyed)return;const{params:e,slidesEl:i}=t,s="auto"===e.slidesPerView?t.slidesPerViewDynamic():e.slidesPerView;let a,n=t.getSlideIndexWhenGrid(t.clickedIndex);const l=t.isElement?"swiper-slide":`.${e.slideClass}`,o=t.grid&&t.params.grid&&t.params.grid.rows>1;if(e.loop){if(t.animating)return;a=parseInt(t.clickedSlide.getAttribute("data-swiper-slide-index"),10),e.centeredSlides?t.slideToLoop(a):n>(o?(t.slides.length-s)/2-(t.params.grid.rows-1):t.slides.length-s)?(t.loopFix(),n=t.getSlideIndex(oe(i,`${l}[data-swiper-slide-index="${a}"]`)[0]),Qt((()=>{t.slideTo(n)}))):t.slideTo(n)}else t.slideTo(n)}},Oe={loopCreate:function(t,e){const i=this,{params:s,slidesEl:a}=i;if(!s.loop||i.virtual&&i.params.virtual.enabled)return;const n=()=>{oe(a,`.${s.slideClass}, swiper-slide`).forEach(((t,e)=>{t.setAttribute("data-swiper-slide-index",e)}))},l=i.grid&&s.grid&&s.grid.rows>1;s.loopAddBlankSlides&&(s.slidesPerGroup>1||l)&&(()=>{const t=oe(a,`.${s.slideBlankClass}`);t.forEach((t=>{t.remove()})),t.length>0&&(i.recalcSlides(),i.updateSlides())})();const o=s.slidesPerGroup*(l?s.grid.rows:1),r=l&&i.slides.length%s.grid.rows!=0,c=t=>{for(let e=0;e<t;e+=1){const t=i.isElement?ce("swiper-slide",[s.slideBlankClass]):ce("div",[s.slideClass,s.slideBlankClass]);i.slidesEl.append(t)}};i.slides.length%o!=0?(s.loopAddBlankSlides?(c(o-i.slides.length%o),i.recalcSlides(),i.updateSlides()):re("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)"),n()):r?(s.loopAddBlankSlides?(c(s.grid.rows-i.slides.length%s.grid.rows),i.recalcSlides(),i.updateSlides()):re("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)"),n()):n(),i.loopFix({slideRealIndex:t,direction:s.centeredSlides||s.slidesOffsetBefore||s.slidesOffsetAfter?void 0:"next",initial:e})},loopFix:function({slideRealIndex:t,slideTo:e=!0,direction:i,setTranslate:s,activeSlideIndex:a,initial:n,byController:l,byMousewheel:o}={}){const r=this;if(!r.params.loop)return;r.emit("beforeLoopFix");const{slides:c,allowSlidePrev:d,allowSlideNext:h,slidesEl:p,params:u}=r,{centeredSlides:f,slidesOffsetBefore:m,slidesOffsetAfter:g,initialSlide:b}=u,w=f||!!m||!!g;if(r.allowSlidePrev=!0,r.allowSlideNext=!0,r.virtual&&u.virtual.enabled)return e&&(w||0!==r.snapIndex?w&&r.snapIndex<u.slidesPerView?r.slideTo(r.virtual.slides.length+r.snapIndex,0,!1,!0):r.snapIndex===r.snapGrid.length-1&&r.slideTo(r.virtual.slidesBefore,0,!1,!0):r.slideTo(r.virtual.slides.length,0,!1,!0)),r.allowSlidePrev=d,r.allowSlideNext=h,void r.emit("loopFix");let v=u.slidesPerView;"auto"===v?v=r.slidesPerViewDynamic():(v=Math.ceil(parseFloat(u.slidesPerView,10)),w&&v%2==0&&(v+=1));const y=u.slidesPerGroupAuto?v:u.slidesPerGroup;let x=w?Math.max(y,Math.ceil(v/2)):y;x%y!=0&&(x+=y-x%y),x+=u.loopAdditionalSlides,r.loopedSlides=x;const _=r.grid&&u.grid&&u.grid.rows>1;c.length<v+x||"cards"===r.params.effect&&c.length<v+2*x?re("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):_&&"row"===u.grid.fill&&re("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const k=[],M=[],S=_?Math.ceil(c.length/u.grid.rows):c.length,C=n&&S-b<v&&!w;let z=C?b:r.activeIndex;void 0===a?a=r.getSlideIndex(c.find((t=>t.classList.contains(u.slideActiveClass)))):z=a;const $="next"===i||!i,T="prev"===i||!i;let P=0,I=0;const L=(_?c[a].column:a)+(w&&void 0===s?-v/2+.5:0);if(L<x){P=Math.max(x-L,y);for(let t=0;t<x-L;t+=1){const e=t-Math.floor(t/S)*S;if(_){const t=S-e-1;for(let e=c.length-1;e>=0;e-=1)c[e].column===t&&k.push(e)}else k.push(S-e-1)}}else if(L+v>S-x){I=Math.max(L-(S-2*x),y),C&&(I=Math.max(I,v-S+b+1));for(let t=0;t<I;t+=1){const e=t-Math.floor(t/S)*S;_?c.forEach(((t,i)=>{t.column===e&&M.push(i)})):M.push(e)}}if(r.__preventObserver__=!0,requestAnimationFrame((()=>{r.__preventObserver__=!1})),"cards"===r.params.effect&&c.length<v+2*x&&(M.includes(a)&&M.splice(M.indexOf(a),1),k.includes(a)&&k.splice(k.indexOf(a),1)),T&&k.forEach((t=>{c[t].swiperLoopMoveDOM=!0,p.prepend(c[t]),c[t].swiperLoopMoveDOM=!1})),$&&M.forEach((t=>{c[t].swiperLoopMoveDOM=!0,p.append(c[t]),c[t].swiperLoopMoveDOM=!1})),r.recalcSlides(),"auto"===u.slidesPerView?r.updateSlides():_&&(k.length>0&&T||M.length>0&&$)&&r.slides.forEach(((t,e)=>{r.grid.updateSlide(e,t,r.slides)})),u.watchSlidesProgress&&r.updateSlidesOffset(),e)if(k.length>0&&T)if(void 0===t){const t=r.slidesGrid[z+P]-r.slidesGrid[z];o?r.setTranslate(r.translate-t):(r.slideTo(z+Math.ceil(P),0,!1,!0),s&&(r.touchEventsData.startTranslate=r.touchEventsData.startTranslate-t,r.touchEventsData.currentTranslate=r.touchEventsData.currentTranslate-t))}else s&&(r.slideTo(r.activeIndex+(_?k.length/u.grid.rows:k.length),0,!1,!0),r.touchEventsData.currentTranslate=r.translate);else if(M.length>0&&$)if(void 0===t){const t=r.slidesGrid[z-I]-r.slidesGrid[z];o?r.setTranslate(r.translate-t):(r.slideTo(z-I,0,!1,!0),s&&(r.touchEventsData.startTranslate=r.touchEventsData.startTranslate-t,r.touchEventsData.currentTranslate=r.touchEventsData.currentTranslate-t))}else r.slideTo(r.activeIndex-(_?M.length/u.grid.rows:M.length),0,!1,!0);if(r.allowSlidePrev=d,r.allowSlideNext=h,r.controller&&r.controller.control&&!l){const n={slideRealIndex:t,direction:i,setTranslate:s,activeSlideIndex:a,byController:!0};Array.isArray(r.controller.control)?r.controller.control.forEach((t=>{!t.destroyed&&t.params.loop&&t.loopFix({...n,slideTo:t.params.slidesPerView===u.slidesPerView&&e})})):r.controller.control instanceof r.constructor&&r.controller.control.params.loop&&r.controller.control.loopFix({...n,slideTo:r.controller.control.params.slidesPerView===u.slidesPerView&&e})}r.emit("loopFix")},loopDestroy:function(){const t=this,{params:e,slidesEl:i}=t;if(!e.loop||!i||t.virtual&&t.params.virtual.enabled)return;t.recalcSlides();const s=[];t.slides.forEach((t=>{const e=void 0===t.swiperSlideIndex?1*t.getAttribute("data-swiper-slide-index"):t.swiperSlideIndex;s[e]=t})),t.slides.forEach((t=>{t.removeAttribute("data-swiper-slide-index")})),s.forEach((t=>{i.append(t)})),t.recalcSlides(),t.slideTo(t.realIndex,0)}};function Ee(t,e,i){const s=Yt(),{params:a}=t,n=a.edgeSwipeDetection,l=a.edgeSwipeThreshold;return!n||!(i<=l||i>=s.innerWidth-l)||"prevent"===n&&(e.preventDefault(),!0)}function De(t){const e=this,i=Jt();let s=t;s.originalEvent&&(s=s.originalEvent);const a=e.touchEventsData;if("pointerdown"===s.type){if(null!==a.pointerId&&a.pointerId!==s.pointerId)return;a.pointerId=s.pointerId}else"touchstart"===s.type&&1===s.targetTouches.length&&(a.touchId=s.targetTouches[0].identifier);if("touchstart"===s.type)return void Ee(e,s,s.targetTouches[0].pageX);const{params:n,touches:l,enabled:o}=e;if(!o)return;if(!n.simulateTouch&&"mouse"===s.pointerType)return;if(e.animating&&n.preventInteractionOnTransition)return;!e.animating&&n.cssMode&&n.loop&&e.loopFix();let r=s.target;if("wrapper"===n.touchEventsTarget&&!function(t,e){const i=Yt();let s=e.contains(t);return!s&&i.HTMLSlotElement&&e instanceof HTMLSlotElement&&(s=[...e.assignedElements()].includes(t),s||(s=function(t,e){const i=[e];for(;i.length>0;){const e=i.shift();if(t===e)return!0;i.push(...e.children,...e.shadowRoot?e.shadowRoot.children:[],...e.assignedElements?e.assignedElements():[])}}(t,e))),s}(r,e.wrapperEl))return;if("which"in s&&3===s.which)return;if("button"in s&&s.button>0)return;if(a.isTouched&&a.isMoved)return;const c=!!n.noSwipingClass&&""!==n.noSwipingClass,d=s.composedPath?s.composedPath():s.path;c&&s.target&&s.target.shadowRoot&&d&&(r=d[0]);const h=n.noSwipingSelector?n.noSwipingSelector:`.${n.noSwipingClass}`;if(n.noSwiping&&(s.target&&s.target.shadowRoot?function(t,e=this){return function e(i){if(!i||i===Jt()||i===Yt())return null;i.assignedSlot&&(i=i.assignedSlot);const s=i.closest(t);return s||i.getRootNode?s||e(i.getRootNode().host):null}(e)}(h,r):r.closest(h)))return void(e.allowClick=!0);if(n.swipeHandler&&!r.closest(n.swipeHandler))return;l.currentX=s.pageX,l.currentY=s.pageY;const p=l.currentX,u=l.currentY;if(!Ee(e,s,p))return;Object.assign(a,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),l.startX=p,l.startY=u,a.touchStartTime=te(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,n.threshold>0&&(a.allowThresholdMove=!1);let f=!0;r.matches(a.focusableElements)&&(f=!1,"SELECT"===r.nodeName&&(a.isTouched=!1)),i.activeElement&&i.activeElement.matches(a.focusableElements)&&i.activeElement!==r&&("mouse"===s.pointerType||"mouse"!==s.pointerType&&!r.matches(a.focusableElements))&&i.activeElement.blur(),!n.touchStartForcePreventDefault&&!(f&&e.allowTouchMove&&n.touchStartPreventDefault)||r.isContentEditable||s.preventDefault(),n.freeMode&&n.freeMode.enabled&&e.freeMode&&e.animating&&!n.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",s)}function je(t){const e=Jt(),i=this,s=i.touchEventsData,{params:a,touches:n,rtlTranslate:l,enabled:o}=i;if(!o)return;if(!a.simulateTouch&&"mouse"===t.pointerType)return;let r,c=t;if(c.originalEvent&&(c=c.originalEvent),"pointermove"===c.type){if(null!==s.touchId)return;if(c.pointerId!==s.pointerId)return}if("touchmove"===c.type){if(r=[...c.changedTouches].find((t=>t.identifier===s.touchId)),!r||r.identifier!==s.touchId)return}else r=c;if(!s.isTouched)return void(s.startMoving&&s.isScrolling&&i.emit("touchMoveOpposite",c));const d=r.pageX,h=r.pageY;if(c.preventedByNestedSwiper)return n.startX=d,void(n.startY=h);if(!i.allowTouchMove)return c.target.matches(s.focusableElements)||(i.allowClick=!1),void(s.isTouched&&(Object.assign(n,{startX:d,startY:h,currentX:d,currentY:h}),s.touchStartTime=te()));if(a.touchReleaseOnEdges&&!a.loop)if(i.isVertical()){if(h<n.startY&&i.translate<=i.maxTranslate()||h>n.startY&&i.translate>=i.minTranslate())return s.isTouched=!1,void(s.isMoved=!1)}else{if(l&&(d>n.startX&&-i.translate<=i.maxTranslate()||d<n.startX&&-i.translate>=i.minTranslate()))return;if(!l&&(d<n.startX&&i.translate<=i.maxTranslate()||d>n.startX&&i.translate>=i.minTranslate()))return}if(e.activeElement&&e.activeElement.matches(s.focusableElements)&&e.activeElement!==c.target&&"mouse"!==c.pointerType&&e.activeElement.blur(),e.activeElement&&c.target===e.activeElement&&c.target.matches(s.focusableElements))return s.isMoved=!0,void(i.allowClick=!1);s.allowTouchCallbacks&&i.emit("touchMove",c),n.previousX=n.currentX,n.previousY=n.currentY,n.currentX=d,n.currentY=h;const p=n.currentX-n.startX,u=n.currentY-n.startY;if(i.params.threshold&&Math.sqrt(p**2+u**2)<i.params.threshold)return;if(void 0===s.isScrolling){let t;i.isHorizontal()&&n.currentY===n.startY||i.isVertical()&&n.currentX===n.startX?s.isScrolling=!1:p*p+u*u>=25&&(t=180*Math.atan2(Math.abs(u),Math.abs(p))/Math.PI,s.isScrolling=i.isHorizontal()?t>a.touchAngle:90-t>a.touchAngle)}if(s.isScrolling&&i.emit("touchMoveOpposite",c),void 0===s.startMoving&&(n.currentX===n.startX&&n.currentY===n.startY||(s.startMoving=!0)),s.isScrolling||"touchmove"===c.type&&s.preventTouchMoveFromPointerMove)return void(s.isTouched=!1);if(!s.startMoving)return;i.allowClick=!1,!a.cssMode&&c.cancelable&&c.preventDefault(),a.touchMoveStopPropagation&&!a.nested&&c.stopPropagation();let f=i.isHorizontal()?p:u,m=i.isHorizontal()?n.currentX-n.previousX:n.currentY-n.previousY;a.oneWayMovement&&(f=Math.abs(f)*(l?1:-1),m=Math.abs(m)*(l?1:-1)),n.diff=f,f*=a.touchRatio,l&&(f=-f,m=-m);const g=i.touchesDirection;i.swipeDirection=f>0?"prev":"next",i.touchesDirection=m>0?"prev":"next";const b=i.params.loop&&!a.cssMode,w="next"===i.touchesDirection&&i.allowSlideNext||"prev"===i.touchesDirection&&i.allowSlidePrev;if(!s.isMoved){if(b&&w&&i.loopFix({direction:i.swipeDirection}),s.startTranslate=i.getTranslate(),i.setTransition(0),i.animating){const t=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});i.wrapperEl.dispatchEvent(t)}s.allowMomentumBounce=!1,!a.grabCursor||!0!==i.allowSlideNext&&!0!==i.allowSlidePrev||i.setGrabCursor(!0),i.emit("sliderFirstMove",c)}if((new Date).getTime(),!1!==a._loopSwapReset&&s.isMoved&&s.allowThresholdMove&&g!==i.touchesDirection&&b&&w&&Math.abs(f)>=1)return Object.assign(n,{startX:d,startY:h,currentX:d,currentY:h,startTranslate:s.currentTranslate}),s.loopSwapReset=!0,void(s.startTranslate=s.currentTranslate);i.emit("sliderMove",c),s.isMoved=!0,s.currentTranslate=f+s.startTranslate;let v=!0,y=a.resistanceRatio;if(a.touchReleaseOnEdges&&(y=0),f>0?(b&&w&&s.allowThresholdMove&&s.currentTranslate>(a.centeredSlides?i.minTranslate()-i.slidesSizesGrid[i.activeIndex+1]-("auto"!==a.slidesPerView&&i.slides.length-a.slidesPerView>=2?i.slidesSizesGrid[i.activeIndex+1]+i.params.spaceBetween:0)-i.params.spaceBetween:i.minTranslate())&&i.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),s.currentTranslate>i.minTranslate()&&(v=!1,a.resistance&&(s.currentTranslate=i.minTranslate()-1+(-i.minTranslate()+s.startTranslate+f)**y))):f<0&&(b&&w&&s.allowThresholdMove&&s.currentTranslate<(a.centeredSlides?i.maxTranslate()+i.slidesSizesGrid[i.slidesSizesGrid.length-1]+i.params.spaceBetween+("auto"!==a.slidesPerView&&i.slides.length-a.slidesPerView>=2?i.slidesSizesGrid[i.slidesSizesGrid.length-1]+i.params.spaceBetween:0):i.maxTranslate())&&i.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:i.slides.length-("auto"===a.slidesPerView?i.slidesPerViewDynamic():Math.ceil(parseFloat(a.slidesPerView,10)))}),s.currentTranslate<i.maxTranslate()&&(v=!1,a.resistance&&(s.currentTranslate=i.maxTranslate()+1-(i.maxTranslate()-s.startTranslate-f)**y))),v&&(c.preventedByNestedSwiper=!0),!i.allowSlideNext&&"next"===i.swipeDirection&&s.currentTranslate<s.startTranslate&&(s.currentTranslate=s.startTranslate),!i.allowSlidePrev&&"prev"===i.swipeDirection&&s.currentTranslate>s.startTranslate&&(s.currentTranslate=s.startTranslate),i.allowSlidePrev||i.allowSlideNext||(s.currentTranslate=s.startTranslate),a.threshold>0){if(!(Math.abs(f)>a.threshold||s.allowThresholdMove))return void(s.currentTranslate=s.startTranslate);if(!s.allowThresholdMove)return s.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,s.currentTranslate=s.startTranslate,void(n.diff=i.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY)}a.followFinger&&!a.cssMode&&((a.freeMode&&a.freeMode.enabled&&i.freeMode||a.watchSlidesProgress)&&(i.updateActiveIndex(),i.updateSlidesClasses()),a.freeMode&&a.freeMode.enabled&&i.freeMode&&i.freeMode.onTouchMove(),i.updateProgress(s.currentTranslate),i.setTranslate(s.currentTranslate))}function Fe(t){const e=this,i=e.touchEventsData;let s,a=t;if(a.originalEvent&&(a=a.originalEvent),"touchend"===a.type||"touchcancel"===a.type){if(s=[...a.changedTouches].find((t=>t.identifier===i.touchId)),!s||s.identifier!==i.touchId)return}else{if(null!==i.touchId)return;if(a.pointerId!==i.pointerId)return;s=a}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(a.type)&&(!["pointercancel","contextmenu"].includes(a.type)||!e.browser.isSafari&&!e.browser.isWebView))return;i.pointerId=null,i.touchId=null;const{params:n,touches:l,rtlTranslate:o,slidesGrid:r,enabled:c}=e;if(!c)return;if(!n.simulateTouch&&"mouse"===a.pointerType)return;if(i.allowTouchCallbacks&&e.emit("touchEnd",a),i.allowTouchCallbacks=!1,!i.isTouched)return i.isMoved&&n.grabCursor&&e.setGrabCursor(!1),i.isMoved=!1,void(i.startMoving=!1);n.grabCursor&&i.isMoved&&i.isTouched&&(!0===e.allowSlideNext||!0===e.allowSlidePrev)&&e.setGrabCursor(!1);const d=te(),h=d-i.touchStartTime;if(e.allowClick){const t=a.path||a.composedPath&&a.composedPath();e.updateClickedSlide(t&&t[0]||a.target,t),e.emit("tap click",a),h<300&&d-i.lastClickTime<300&&e.emit("doubleTap doubleClick",a)}if(i.lastClickTime=te(),Qt((()=>{e.destroyed||(e.allowClick=!0)})),!i.isTouched||!i.isMoved||!e.swipeDirection||0===l.diff&&!i.loopSwapReset||i.currentTranslate===i.startTranslate&&!i.loopSwapReset)return i.isTouched=!1,i.isMoved=!1,void(i.startMoving=!1);let p;if(i.isTouched=!1,i.isMoved=!1,i.startMoving=!1,p=n.followFinger?o?e.translate:-e.translate:-i.currentTranslate,n.cssMode)return;if(n.freeMode&&n.freeMode.enabled)return void e.freeMode.onTouchEnd({currentPos:p});const u=p>=-e.maxTranslate()&&!e.params.loop;let f=0,m=e.slidesSizesGrid[0];for(let t=0;t<r.length;t+=t<n.slidesPerGroupSkip?1:n.slidesPerGroup){const e=t<n.slidesPerGroupSkip-1?1:n.slidesPerGroup;void 0!==r[t+e]?(u||p>=r[t]&&p<r[t+e])&&(f=t,m=r[t+e]-r[t]):(u||p>=r[t])&&(f=t,m=r[r.length-1]-r[r.length-2])}let g=null,b=null;n.rewind&&(e.isBeginning?b=n.virtual&&n.virtual.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(g=0));const w=(p-r[f])/m,v=f<n.slidesPerGroupSkip-1?1:n.slidesPerGroup;if(h>n.longSwipesMs){if(!n.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&e.slideTo(w>=n.longSwipesRatio?n.rewind&&e.isEnd?g:f+v:f),"prev"===e.swipeDirection&&(w>1-n.longSwipesRatio?e.slideTo(f+v):null!==b&&w<0&&Math.abs(w)>n.longSwipesRatio?e.slideTo(b):e.slideTo(f))}else{if(!n.shortSwipes)return void e.slideTo(e.activeIndex);!e.navigation||a.target!==e.navigation.nextEl&&a.target!==e.navigation.prevEl?("next"===e.swipeDirection&&e.slideTo(null!==g?g:f+v),"prev"===e.swipeDirection&&e.slideTo(null!==b?b:f)):e.slideTo(a.target===e.navigation.nextEl?f+v:f)}}function Re(){const t=this,{params:e,el:i}=t;if(i&&0===i.offsetWidth)return;e.breakpoints&&t.setBreakpoint();const{allowSlideNext:s,allowSlidePrev:a,snapGrid:n}=t,l=t.virtual&&t.params.virtual.enabled;t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses(),!("auto"===e.slidesPerView||e.slidesPerView>1)||!t.isEnd||t.isBeginning||t.params.centeredSlides||l&&e.loop?t.params.loop&&!l?t.slideToLoop(t.realIndex,0,!1,!0):t.slideTo(t.activeIndex,0,!1,!0):t.slideTo(t.slides.length-1,0,!1,!0),t.autoplay&&t.autoplay.running&&t.autoplay.paused&&(clearTimeout(t.autoplay.resizeTimeout),t.autoplay.resizeTimeout=setTimeout((()=>{t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.resume()}),500)),t.allowSlidePrev=a,t.allowSlideNext=s,t.params.watchOverflow&&n!==t.snapGrid&&t.checkOverflow()}function He(t){const e=this;e.enabled&&(e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation())))}function Be(){const t=this,{wrapperEl:e,rtlTranslate:i,enabled:s}=t;if(!s)return;let a;t.previousTranslate=t.translate,t.translate=t.isHorizontal()?-e.scrollLeft:-e.scrollTop,0===t.translate&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();const n=t.maxTranslate()-t.minTranslate();a=0===n?0:(t.translate-t.minTranslate())/n,a!==t.progress&&t.updateProgress(i?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}function qe(t){const e=this;$e(e,t.target),e.params.cssMode||"auto"!==e.params.slidesPerView&&!e.params.autoHeight||e.update()}function Ne(){const t=this;t.documentTouchHandlerProceeded||(t.documentTouchHandlerProceeded=!0,t.params.touchReleaseOnEdges&&(t.el.style.touchAction="auto"))}const Ge=(t,e)=>{const i=Jt(),{params:s,el:a,wrapperEl:n,device:l}=t,o=!!s.nested,r="on"===e?"addEventListener":"removeEventListener",c=e;a&&"string"!=typeof a&&(i[r]("touchstart",t.onDocumentTouchStart,{passive:!1,capture:o}),a[r]("touchstart",t.onTouchStart,{passive:!1}),a[r]("pointerdown",t.onTouchStart,{passive:!1}),i[r]("touchmove",t.onTouchMove,{passive:!1,capture:o}),i[r]("pointermove",t.onTouchMove,{passive:!1,capture:o}),i[r]("touchend",t.onTouchEnd,{passive:!0}),i[r]("pointerup",t.onTouchEnd,{passive:!0}),i[r]("pointercancel",t.onTouchEnd,{passive:!0}),i[r]("touchcancel",t.onTouchEnd,{passive:!0}),i[r]("pointerout",t.onTouchEnd,{passive:!0}),i[r]("pointerleave",t.onTouchEnd,{passive:!0}),i[r]("contextmenu",t.onTouchEnd,{passive:!0}),(s.preventClicks||s.preventClicksPropagation)&&a[r]("click",t.onClick,!0),s.cssMode&&n[r]("scroll",t.onScroll),t[c](s.updateOnWindowResize?l.ios||l.android?"resize orientationchange observerUpdate":"resize observerUpdate":"observerUpdate",Re,!0),a[r]("load",t.onLoad,{capture:!0}))},We=(t,e)=>t.grid&&e.grid&&e.grid.rows>1;var Ue={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,snapToSlideEdge:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function Ve(t,e){return function(i={}){const s=Object.keys(i)[0],a=i[s];"object"==typeof a&&null!==a?(!0===t[s]&&(t[s]={enabled:!0}),"navigation"===s&&t[s]&&t[s].enabled&&!t[s].prevEl&&!t[s].nextEl&&(t[s].auto=!0),["pagination","scrollbar"].indexOf(s)>=0&&t[s]&&t[s].enabled&&!t[s].el&&(t[s].auto=!0),s in t&&"enabled"in a?("object"!=typeof t[s]||"enabled"in t[s]||(t[s].enabled=!0),t[s]||(t[s]={enabled:!1}),se(e,i)):se(e,i)):se(e,i)}}const Xe={eventsEmitter:Se,update:Ie,translate:{getTranslate:function(t=(this.isHorizontal()?"x":"y")){const{params:e,rtlTranslate:i,translate:s,wrapperEl:a}=this;if(e.virtualTranslate)return i?-s:s;if(e.cssMode)return s;let n=ee(a,t);return n+=this.cssOverflowAdjustment(),i&&(n=-n),n||0},setTranslate:function(t,e){const i=this,{rtlTranslate:s,params:a,wrapperEl:n,progress:l}=i;let o,r=0,c=0;i.isHorizontal()?r=s?-t:t:c=t,a.roundLengths&&(r=Math.floor(r),c=Math.floor(c)),i.previousTranslate=i.translate,i.translate=i.isHorizontal()?r:c,a.cssMode?n[i.isHorizontal()?"scrollLeft":"scrollTop"]=i.isHorizontal()?-r:-c:a.virtualTranslate||(i.isHorizontal()?r-=i.cssOverflowAdjustment():c-=i.cssOverflowAdjustment(),n.style.transform=`translate3d(${r}px, ${c}px, 0px)`);const d=i.maxTranslate()-i.minTranslate();o=0===d?0:(t-i.minTranslate())/d,o!==l&&i.updateProgress(t),i.emit("setTranslate",i.translate,e)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(t=0,e=this.params.speed,i=!0,s=!0,a){const n=this,{params:l,wrapperEl:o}=n;if(n.animating&&l.preventInteractionOnTransition)return!1;const r=n.minTranslate(),c=n.maxTranslate();let d;if(d=s&&t>r?r:s&&t<c?c:t,n.updateProgress(d),l.cssMode){const t=n.isHorizontal();if(0===e)o[t?"scrollLeft":"scrollTop"]=-d;else{if(!n.support.smoothScroll)return ne({swiper:n,targetPosition:-d,side:t?"left":"top"}),!0;o.scrollTo({[t?"left":"top"]:-d,behavior:"smooth"})}return!0}return 0===e?(n.setTransition(0),n.setTranslate(d),i&&(n.emit("beforeTransitionStart",e,a),n.emit("transitionEnd"))):(n.setTransition(e),n.setTranslate(d),i&&(n.emit("beforeTransitionStart",e,a),n.emit("transitionStart")),n.animating||(n.animating=!0,n.onTranslateToWrapperTransitionEnd||(n.onTranslateToWrapperTransitionEnd=function(t){n&&!n.destroyed&&t.target===this&&(n.wrapperEl.removeEventListener("transitionend",n.onTranslateToWrapperTransitionEnd),n.onTranslateToWrapperTransitionEnd=null,delete n.onTranslateToWrapperTransitionEnd,n.animating=!1,i&&n.emit("transitionEnd"))}),n.wrapperEl.addEventListener("transitionend",n.onTranslateToWrapperTransitionEnd))),!0}},transition:{setTransition:function(t,e){const i=this;i.params.cssMode||(i.wrapperEl.style.transitionDuration=`${t}ms`,i.wrapperEl.style.transitionDelay=0===t?"0ms":""),i.emit("setTransition",t,e)},transitionStart:function(t=!0,e){const i=this,{params:s}=i;s.cssMode||(s.autoHeight&&i.updateAutoHeight(),Le({swiper:i,runCallbacks:t,direction:e,step:"Start"}))},transitionEnd:function(t=!0,e){const i=this,{params:s}=i;i.animating=!1,s.cssMode||(i.setTransition(0),Le({swiper:i,runCallbacks:t,direction:e,step:"End"}))}},slide:Ae,loop:Oe,grabCursor:{setGrabCursor:function(t){const e=this;if(!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const i="container"===e.params.touchEventsTarget?e.el:e.wrapperEl;e.isElement&&(e.__preventObserver__=!0),i.style.cursor="move",i.style.cursor=t?"grabbing":"grab",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1}))},unsetGrabCursor:function(){const t=this;t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t.isElement&&(t.__preventObserver__=!0),t["container"===t.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1})))}},events:{attachEvents:function(){const t=this,{params:e}=t;t.onTouchStart=De.bind(t),t.onTouchMove=je.bind(t),t.onTouchEnd=Fe.bind(t),t.onDocumentTouchStart=Ne.bind(t),e.cssMode&&(t.onScroll=Be.bind(t)),t.onClick=He.bind(t),t.onLoad=qe.bind(t),Ge(t,"on")},detachEvents:function(){Ge(this,"off")}},breakpoints:{setBreakpoint:function(){const t=this,{realIndex:e,initialized:i,params:s,el:a}=t,n=s.breakpoints;if(!n||n&&0===Object.keys(n).length)return;const l=Jt(),o="window"!==s.breakpointsBase&&s.breakpointsBase?"container":s.breakpointsBase,r=["window","container"].includes(s.breakpointsBase)||!s.breakpointsBase?t.el:l.querySelector(s.breakpointsBase),c=t.getBreakpoint(n,o,r);if(!c||t.currentBreakpoint===c)return;const d=(c in n?n[c]:void 0)||t.originalParams,h=We(t,s),p=We(t,d),u=t.params.grabCursor,f=d.grabCursor,m=s.enabled;h&&!p?(a.classList.remove(`${s.containerModifierClass}grid`,`${s.containerModifierClass}grid-column`),t.emitContainerClasses()):!h&&p&&(a.classList.add(`${s.containerModifierClass}grid`),(d.grid.fill&&"column"===d.grid.fill||!d.grid.fill&&"column"===s.grid.fill)&&a.classList.add(`${s.containerModifierClass}grid-column`),t.emitContainerClasses()),u&&!f?t.unsetGrabCursor():!u&&f&&t.setGrabCursor(),["navigation","pagination","scrollbar"].forEach((e=>{if(void 0===d[e])return;const i=s[e]&&s[e].enabled,a=d[e]&&d[e].enabled;i&&!a&&t[e].disable(),!i&&a&&t[e].enable()}));const g=d.direction&&d.direction!==s.direction,b=s.loop&&(d.slidesPerView!==s.slidesPerView||g),w=s.loop;g&&i&&t.changeDirection(),se(t.params,d);const v=t.params.enabled,y=t.params.loop;Object.assign(t,{allowTouchMove:t.params.allowTouchMove,allowSlideNext:t.params.allowSlideNext,allowSlidePrev:t.params.allowSlidePrev}),m&&!v?t.disable():!m&&v&&t.enable(),t.currentBreakpoint=c,t.emit("_beforeBreakpoint",d),i&&(b?(t.loopDestroy(),t.loopCreate(e),t.updateSlides()):!w&&y?(t.loopCreate(e),t.updateSlides()):w&&!y&&t.loopDestroy()),t.emit("breakpoint",d)},getBreakpoint:function(t,e="window",i){if(!t||"container"===e&&!i)return;let s=!1;const a=Yt(),n="window"===e?a.innerHeight:i.clientHeight,l=Object.keys(t).map((t=>{if("string"==typeof t&&0===t.indexOf("@")){const e=parseFloat(t.substr(1));return{value:n*e,point:t}}return{value:t,point:t}}));l.sort(((t,e)=>parseInt(t.value,10)-parseInt(e.value,10)));for(let t=0;t<l.length;t+=1){const{point:n,value:o}=l[t];"window"===e?a.matchMedia(`(min-width: ${o}px)`).matches&&(s=n):o<=i.clientWidth&&(s=n)}return s||"max"}},checkOverflow:{checkOverflow:function(){const t=this,{isLocked:e,params:i}=t,{slidesOffsetBefore:s}=i;if(s){const e=t.slides.length-1;t.isLocked=t.size>t.slidesGrid[e]+t.slidesSizesGrid[e]+2*s}else t.isLocked=1===t.snapGrid.length;!0===i.allowSlideNext&&(t.allowSlideNext=!t.isLocked),!0===i.allowSlidePrev&&(t.allowSlidePrev=!t.isLocked),e&&e!==t.isLocked&&(t.isEnd=!1),e!==t.isLocked&&t.emit(t.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const t=this,{classNames:e,params:i,rtl:s,el:a,device:n}=t,l=function(t,e){const i=[];return t.forEach((t=>{"object"==typeof t?Object.keys(t).forEach((s=>{t[s]&&i.push(e+s)})):"string"==typeof t&&i.push(e+t)})),i}(["initialized",i.direction,{"free-mode":t.params.freeMode&&i.freeMode.enabled},{autoheight:i.autoHeight},{rtl:s},{grid:i.grid&&i.grid.rows>1},{"grid-column":i.grid&&i.grid.rows>1&&"column"===i.grid.fill},{android:n.android},{ios:n.ios},{"css-mode":i.cssMode},{centered:i.cssMode&&i.centeredSlides},{"watch-progress":i.watchSlidesProgress}],i.containerModifierClass);e.push(...l),a.classList.add(...e),t.emitContainerClasses()},removeClasses:function(){const{el:t,classNames:e}=this;t&&"string"!=typeof t&&(t.classList.remove(...e),this.emitContainerClasses())}}},Je={};class Ze{constructor(...t){let e,i;1===t.length&&t[0].constructor&&"Object"===Object.prototype.toString.call(t[0]).slice(8,-1)?i=t[0]:[e,i]=t,i||(i={}),i=se({},i),e&&!i.el&&(i.el=e);const s=Jt();if(i.el&&"string"==typeof i.el&&s.querySelectorAll(i.el).length>1){const t=[];return s.querySelectorAll(i.el).forEach((e=>{const s=se({},i,{el:e});t.push(new Ze(s))})),t}const a=this;a.__swiper__=!0,a.support=_e(),a.device=ke({userAgent:i.userAgent}),a.browser=Me(),a.eventsListeners={},a.eventsAnyListeners=[],a.modules=[...a.__modules__],i.modules&&Array.isArray(i.modules)&&a.modules.push(...i.modules);const n={};a.modules.forEach((t=>{t({params:i,swiper:a,extendParams:Ve(i,n),on:a.on.bind(a),once:a.once.bind(a),off:a.off.bind(a),emit:a.emit.bind(a)})}));const l=se({},Ue,n);return a.params=se({},l,Je,i),a.originalParams=se({},a.params),a.passedParams=se({},i),a.params&&a.params.on&&Object.keys(a.params.on).forEach((t=>{a.on(t,a.params.on[t])})),a.params&&a.params.onAny&&a.onAny(a.params.onAny),Object.assign(a,{enabled:a.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===a.params.direction,isVertical:()=>"vertical"===a.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.emit("_swiper"),a.params.init&&a.init(),a}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:e,params:i}=this,s=pe(oe(e,`.${i.slideClass}, swiper-slide`)[0]);return pe(t)-s}getSlideIndexByData(t){return this.getSlideIndex(this.slides.find((e=>1*e.getAttribute("data-swiper-slide-index")===t)))}getSlideIndexWhenGrid(t){return this.grid&&this.params.grid&&this.params.grid.rows>1&&("column"===this.params.grid.fill?t=Math.floor(t/this.params.grid.rows):"row"===this.params.grid.fill&&(t%=Math.ceil(this.slides.length/this.params.grid.rows))),t}recalcSlides(){const{slidesEl:t,params:e}=this;this.slides=oe(t,`.${e.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,e){const i=this;t=Math.min(Math.max(t,0),1);const s=i.minTranslate(),a=i.maxTranslate();i.translateTo((a-s)*t+s,void 0===e?0:e),i.updateActiveIndex(),i.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const e=t.el.className.split(" ").filter((e=>0===e.indexOf("swiper")||0===e.indexOf(t.params.containerModifierClass)));t.emit("_containerClasses",e.join(" "))}getSlideClasses(t){const e=this;return e.destroyed?"":t.className.split(" ").filter((t=>0===t.indexOf("swiper-slide")||0===t.indexOf(e.params.slideClass))).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const e=[];t.slides.forEach((i=>{const s=t.getSlideClasses(i);e.push({slideEl:i,classNames:s}),t.emit("_slideClass",i,s)})),t.emit("_slideClasses",e)}slidesPerViewDynamic(t="current",e=!1){const{params:i,slides:s,slidesGrid:a,slidesSizesGrid:n,size:l,activeIndex:o}=this;let r=1;if("number"==typeof i.slidesPerView)return i.slidesPerView;if(i.centeredSlides){let t,e=s[o]?Math.ceil(s[o].swiperSlideSize):0;for(let i=o+1;i<s.length;i+=1)s[i]&&!t&&(e+=Math.ceil(s[i].swiperSlideSize),r+=1,e>l&&(t=!0));for(let i=o-1;i>=0;i-=1)s[i]&&!t&&(e+=s[i].swiperSlideSize,r+=1,e>l&&(t=!0))}else if("current"===t)for(let t=o+1;t<s.length;t+=1)(e?a[t]+n[t]-a[o]<l:a[t]-a[o]<l)&&(r+=1);else for(let t=o-1;t>=0;t-=1)a[o]-a[t]<l&&(r+=1);return r}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:e,params:i}=t;function s(){const e=Math.min(Math.max(t.rtlTranslate?-1*t.translate:t.translate,t.maxTranslate()),t.minTranslate());t.setTranslate(e),t.updateActiveIndex(),t.updateSlidesClasses()}let a;i.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach((e=>{e.complete&&$e(t,e)})),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),i.freeMode&&i.freeMode.enabled&&!i.cssMode?(s(),i.autoHeight&&t.updateAutoHeight()):(a=t.slideTo(("auto"===i.slidesPerView||i.slidesPerView>1)&&t.isEnd&&!i.centeredSlides?(t.virtual&&i.virtual.enabled?t.virtual.slides:t.slides).length-1:t.activeIndex,0,!1,!0),a||s()),i.watchOverflow&&e!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,e=!0){const i=this,s=i.params.direction;return t||(t="horizontal"===s?"vertical":"horizontal"),t===s||"horizontal"!==t&&"vertical"!==t||(i.el.classList.remove(`${i.params.containerModifierClass}${s}`),i.el.classList.add(`${i.params.containerModifierClass}${t}`),i.emitContainerClasses(),i.params.direction=t,i.slides.forEach((e=>{"vertical"===t?e.style.width="":e.style.height=""})),i.emit("changeDirection"),e&&i.update()),i}changeLanguageDirection(t){const e=this;e.rtl&&"rtl"===t||!e.rtl&&"ltr"===t||(e.rtl="rtl"===t,e.rtlTranslate="horizontal"===e.params.direction&&e.rtl,e.rtl?(e.el.classList.add(`${e.params.containerModifierClass}rtl`),e.el.dir="rtl"):(e.el.classList.remove(`${e.params.containerModifierClass}rtl`),e.el.dir="ltr"),e.update())}mount(t){const e=this;if(e.mounted)return!0;let i=t||e.params.el;if("string"==typeof i&&(i=document.querySelector(i)),!i)return!1;i.swiper=e,i.parentNode&&i.parentNode.host&&i.parentNode.host.nodeName===e.params.swiperElementNodeName.toUpperCase()&&(e.isElement=!0);const s=()=>`.${(e.params.wrapperClass||"").trim().split(" ").join(".")}`;let a=i&&i.shadowRoot&&i.shadowRoot.querySelector?i.shadowRoot.querySelector(s()):oe(i,s())[0];return!a&&e.params.createElements&&(a=ce("div",e.params.wrapperClass),i.append(a),oe(i,`.${e.params.slideClass}`).forEach((t=>{a.append(t)}))),Object.assign(e,{el:i,wrapperEl:a,slidesEl:e.isElement&&!i.parentNode.host.slideSlots?i.parentNode.host:a,hostEl:e.isElement?i.parentNode.host:i,mounted:!0,rtl:"rtl"===i.dir.toLowerCase()||"rtl"===he(i,"direction"),rtlTranslate:"horizontal"===e.params.direction&&("rtl"===i.dir.toLowerCase()||"rtl"===he(i,"direction")),wrongRTL:"-webkit-box"===he(a,"display")}),!0}init(t){const e=this;if(e.initialized)return e;if(!1===e.mount(t))return e;e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.enabled&&e.setGrabCursor(),e.slideTo(e.params.loop&&e.virtual&&e.params.virtual.enabled?e.params.initialSlide+e.virtual.slidesBefore:e.params.initialSlide,0,e.params.runCallbacksOnInit,!1,!0),e.params.loop&&e.loopCreate(void 0,!0),e.attachEvents();const i=[...e.el.querySelectorAll('[loading="lazy"]')];return e.isElement&&i.push(...e.hostEl.querySelectorAll('[loading="lazy"]')),i.forEach((t=>{t.complete?$e(e,t):t.addEventListener("load",(t=>{$e(e,t.target)}))})),Pe(e),e.initialized=!0,Pe(e),e.emit("init"),e.emit("afterInit"),e}destroy(t=!0,e=!0){const i=this,{params:s,el:a,wrapperEl:n,slides:l}=i;return void 0===i.params||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),s.loop&&i.loopDestroy(),e&&(i.removeClasses(),a&&"string"!=typeof a&&a.removeAttribute("style"),n&&n.removeAttribute("style"),l&&l.length&&l.forEach((t=>{t.classList.remove(s.slideVisibleClass,s.slideFullyVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass),t.removeAttribute("style"),t.removeAttribute("data-swiper-slide-index")}))),i.emit("destroy"),Object.keys(i.eventsListeners).forEach((t=>{i.off(t)})),!1!==t&&(i.el&&"string"!=typeof i.el&&(i.el.swiper=null),function(t){const e=t;Object.keys(e).forEach((t=>{try{e[t]=null}catch(t){}try{delete e[t]}catch(t){}}))}(i)),i.destroyed=!0),null}static extendDefaults(t){se(Je,t)}static get extendedDefaults(){return Je}static get defaults(){return Ue}static installModule(t){Ze.prototype.__modules__||(Ze.prototype.__modules__=[]);const e=Ze.prototype.__modules__;"function"==typeof t&&e.indexOf(t)<0&&e.push(t)}static use(t){return Array.isArray(t)?(t.forEach((t=>Ze.installModule(t))),Ze):(Ze.installModule(t),Ze)}}function Ye(t,e,i,s){return t.params.createElements&&Object.keys(s).forEach((a=>{if(!i[a]&&!0===i.auto){let n=oe(t.el,`.${s[a]}`)[0];n||(n=ce("div",s[a]),n.className=s[a],t.el.append(n)),i[a]=n,e[a]=n}})),i}Object.keys(Xe).forEach((t=>{Object.keys(Xe[t]).forEach((e=>{Ze.prototype[e]=Xe[t][e]}))})),Ze.use([function({swiper:t,on:e,emit:i}){const s=Yt();let a=null,n=null;const l=()=>{t&&!t.destroyed&&t.initialized&&(i("beforeResize"),i("resize"))},o=()=>{t&&!t.destroyed&&t.initialized&&i("orientationchange")};e("init",(()=>{t.params.resizeObserver&&void 0!==s.ResizeObserver?t&&!t.destroyed&&t.initialized&&(a=new ResizeObserver((e=>{n=s.requestAnimationFrame((()=>{const{width:i,height:s}=t;let a=i,n=s;e.forEach((({contentBoxSize:e,contentRect:i,target:s})=>{s&&s!==t.el||(a=i?i.width:(e[0]||e).inlineSize,n=i?i.height:(e[0]||e).blockSize)})),a===i&&n===s||l()}))})),a.observe(t.el)):(s.addEventListener("resize",l),s.addEventListener("orientationchange",o))})),e("destroy",(()=>{n&&s.cancelAnimationFrame(n),a&&a.unobserve&&t.el&&(a.unobserve(t.el),a=null),s.removeEventListener("resize",l),s.removeEventListener("orientationchange",o)}))},function({swiper:t,extendParams:e,on:i,emit:s}){const a=[],n=Yt(),l=(e,i={})=>{const l=new(n.MutationObserver||n.WebkitMutationObserver)((e=>{if(t.__preventObserver__)return;if(1===e.length)return void s("observerUpdate",e[0]);const i=function(){s("observerUpdate",e[0])};n.requestAnimationFrame?n.requestAnimationFrame(i):n.setTimeout(i,0)}));l.observe(e,{attributes:void 0===i.attributes||i.attributes,childList:t.isElement||(void 0===i.childList||i).childList,characterData:void 0===i.characterData||i.characterData}),a.push(l)};e({observer:!1,observeParents:!1,observeSlideChildren:!1}),i("init",(()=>{if(t.params.observer){if(t.params.observeParents){const e=ue(t.hostEl);for(let t=0;t<e.length;t+=1)l(e[t])}l(t.hostEl,{childList:t.params.observeSlideChildren}),l(t.wrapperEl,{attributes:!1})}})),i("destroy",(()=>{a.forEach((t=>{t.disconnect()})),a.splice(0,a.length)}))}]);const Ke='<svg class="swiper-navigation-icon" width="11" height="20" viewBox="0 0 11 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.38296 20.0762C0.111788 19.805 0.111788 19.3654 0.38296 19.0942L9.19758 10.2796L0.38296 1.46497C0.111788 1.19379 0.111788 0.754138 0.38296 0.482966C0.654131 0.211794 1.09379 0.211794 1.36496 0.482966L10.4341 9.55214C10.8359 9.9539 10.8359 10.6053 10.4341 11.007L1.36496 20.0762C1.09379 20.3474 0.654131 20.3474 0.38296 20.0762Z" fill="currentColor"/></svg>';function Qe(t=""){return`.${t.trim().replace(/([\.:!+\/()[\]#>~*^$|=,'"@{}\\])/g,"\\$1").replace(/ /g,".")}`}function ti(t){const e=this,{params:i,slidesEl:s}=e;i.loop&&e.loopDestroy();const a=t=>{if("string"==typeof t){const e=document.createElement("div");we(e,t),s.append(e.children[0]),we(e,"")}else s.append(t)};if("object"==typeof t&&"length"in t)for(let e=0;e<t.length;e+=1)t[e]&&a(t[e]);else a(t);e.recalcSlides(),i.loop&&e.loopCreate(),i.observer&&!e.isElement||e.update()}function ei(t){const e=this,{params:i,activeIndex:s,slidesEl:a}=e;i.loop&&e.loopDestroy();let n=s+1;const l=t=>{if("string"==typeof t){const e=document.createElement("div");we(e,t),a.prepend(e.children[0]),we(e,"")}else a.prepend(t)};if("object"==typeof t&&"length"in t){for(let e=0;e<t.length;e+=1)t[e]&&l(t[e]);n=s+t.length}else l(t);e.recalcSlides(),i.loop&&e.loopCreate(),i.observer&&!e.isElement||e.update(),e.slideTo(n,0,!1)}function ii(t,e){const i=this,{params:s,activeIndex:a,slidesEl:n}=i;let l=a;s.loop&&(l-=i.loopedSlides,i.loopDestroy(),i.recalcSlides());const o=i.slides.length;if(t<=0)return void i.prependSlide(e);if(t>=o)return void i.appendSlide(e);let r=l>t?l+1:l;const c=[];for(let e=o-1;e>=t;e-=1){const t=i.slides[e];t.remove(),c.unshift(t)}if("object"==typeof e&&"length"in e){for(let t=0;t<e.length;t+=1)e[t]&&n.append(e[t]);r=l>t?l+e.length:l}else n.append(e);for(let t=0;t<c.length;t+=1)n.append(c[t]);i.recalcSlides(),s.loop&&i.loopCreate(),s.observer&&!i.isElement||i.update(),i.slideTo(s.loop?r+i.loopedSlides:r,0,!1)}function si(t){const e=this,{params:i,activeIndex:s}=e;let a=s;i.loop&&(a-=e.loopedSlides,e.loopDestroy());let n,l=a;if("object"==typeof t&&"length"in t){for(let i=0;i<t.length;i+=1)n=t[i],e.slides[n]&&e.slides[n].remove(),n<l&&(l-=1);l=Math.max(l,0)}else n=t,e.slides[n]&&e.slides[n].remove(),n<l&&(l-=1),l=Math.max(l,0);e.recalcSlides(),i.loop&&e.loopCreate(),i.observer&&!e.isElement||e.update(),e.slideTo(i.loop?l+e.loopedSlides:l,0,!1)}function ai(){const t=this,e=[];for(let i=0;i<t.slides.length;i+=1)e.push(i);t.removeSlide(e)}function ni(t){const{effect:e,swiper:i,on:s,setTranslate:a,setTransition:n,overwriteParams:l,perspective:o,recreateShadows:r,getEffectParams:c}=t;let d;s("beforeInit",(()=>{if(i.params.effect!==e)return;i.classNames.push(`${i.params.containerModifierClass}${e}`),o&&o()&&i.classNames.push(`${i.params.containerModifierClass}3d`);const t=l?l():{};Object.assign(i.params,t),Object.assign(i.originalParams,t)})),s("setTranslate _virtualUpdated",(()=>{i.params.effect===e&&a()})),s("setTransition",((t,s)=>{i.params.effect===e&&n(s)})),s("transitionEnd",(()=>{if(i.params.effect===e&&r){if(!c||!c().slideShadows)return;i.slides.forEach((t=>{t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>t.remove()))})),r()}})),s("virtualUpdate",(()=>{i.params.effect===e&&(i.slides.length||(d=!0),requestAnimationFrame((()=>{d&&i.slides&&i.slides.length&&(a(),d=!1)})))}))}function li(t,e){const i=le(e);return i!==e&&(i.style.backfaceVisibility="hidden",i.style["-webkit-backface-visibility"]="hidden"),i}function oi({swiper:t,duration:e,transformElements:i,allSlides:s}){const{activeIndex:a}=t;if(t.params.virtualTranslate&&0!==e){let e,n=!1;e=s?i:i.filter((e=>{const i=e.classList.contains("swiper-slide-transform")?(e=>e.parentElement?e.parentElement:t.slides.find((t=>t.shadowRoot&&t.shadowRoot===e.parentNode)))(e):e;return t.getSlideIndex(i)===a})),e.forEach((e=>{fe(e,(()=>{if(n)return;if(!t||t.destroyed)return;n=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(e)}))}))}}function ri(t,e,i){const s=`swiper-slide-shadow${i?`-${i}`:""}${t?` swiper-slide-shadow-${t}`:""}`,a=le(e);let n=a.querySelector(`.${s.split(" ").join(".")}`);return n||(n=ce("div",s.split(" ")),a.append(n)),n}const ci=[function({swiper:t,extendParams:e,on:i,emit:s}){let a;e({virtual:{enabled:!1,slides:[],cache:!0,slidesPerViewAutoSlideSize:320,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});const n=Jt();t.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const l=n.createElement("div");function o(e,i){const s=t.params.virtual;if(s.cache&&t.virtual.cache[i])return t.virtual.cache[i];let a;return s.renderSlide?(a=s.renderSlide.call(t,e,i),"string"==typeof a&&(we(l,a),a=l.children[0])):a=t.isElement?ce("swiper-slide"):ce("div",t.params.slideClass),a.setAttribute("data-swiper-slide-index",i),s.renderSlide||we(a,e),s.cache&&(t.virtual.cache[i]=a),a}function r(e,i,a){const{slidesPerGroup:n,centeredSlides:l,slidesPerView:r,loop:c,initialSlide:d}=t.params;if(i&&!c&&d>0)return;const{addSlidesBefore:h,addSlidesAfter:p,slidesPerViewAutoSlideSize:u}=t.params.virtual,{from:f,to:m,slides:g,slidesGrid:b,offset:w}=t.virtual;t.params.cssMode||t.updateActiveIndex();const v=void 0===a?t.activeIndex||0:a;let y,x,_,k;if(y=t.rtlTranslate?"right":t.isHorizontal()?"left":"top","auto"===r)if(u){let e=t.size;e||(e=t.isHorizontal()?t.el.getBoundingClientRect().width:t.el.getBoundingClientRect().height),x=Math.max(1,Math.ceil(e/u))}else x=1;else x=r;l?(_=Math.floor(x/2)+n+p,k=Math.floor(x/2)+n+h):(_=x+(n-1)+p,k=(c?x:n)+h);let M=v-k,S=v+_;c||(M=Math.max(M,0),S=Math.min(S,g.length-1));let C=(t.slidesGrid[M]||0)-(t.slidesGrid[0]||0);function z(){t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),s("virtualUpdate")}if(c&&v>=k?(M-=k,l||(C+=t.slidesGrid[0])):c&&v<k&&(M=-k,l&&(C+=t.slidesGrid[0])),Object.assign(t.virtual,{from:M,to:S,offset:C,slidesGrid:t.slidesGrid,slidesBefore:k,slidesAfter:_}),f===M&&m===S&&!e)return t.slidesGrid!==b&&C!==w&&t.slides.forEach((e=>{e.style[y]=C-Math.abs(t.cssOverflowAdjustment())+"px"})),t.updateProgress(),void s("virtualUpdate");if(t.params.virtual.renderExternal)return t.params.virtual.renderExternal.call(t,{offset:C,from:M,to:S,slides:function(){const t=[];for(let e=M;e<=S;e+=1)t.push(g[e]);return t}()}),void(t.params.virtual.renderExternalUpdate?z():s("virtualUpdate"));const $=[],T=[],P=t=>{let e=t;return t<0?e=g.length+t:e>=g.length&&(e-=g.length),e};if(e)t.slides.filter((e=>e.matches(`.${t.params.slideClass}, swiper-slide`))).forEach((t=>{t.remove()}));else for(let e=f;e<=m;e+=1)if(e<M||e>S){const i=P(e);t.slides.filter((e=>e.matches(`.${t.params.slideClass}[data-swiper-slide-index="${i}"], swiper-slide[data-swiper-slide-index="${i}"]`))).forEach((t=>{t.remove()}))}const I=c?2*g.length:g.length;for(let t=c?-g.length:0;t<I;t+=1)if(t>=M&&t<=S){const i=P(t);void 0===m||e?T.push(i):(t>m&&T.push(i),t<f&&$.push(i))}if(T.forEach((e=>{t.slidesEl.append(o(g[e],e))})),c)for(let e=$.length-1;e>=0;e-=1){const i=$[e];t.slidesEl.prepend(o(g[i],i))}else $.sort(((t,e)=>e-t)),$.forEach((e=>{t.slidesEl.prepend(o(g[e],e))}));oe(t.slidesEl,".swiper-slide, swiper-slide").forEach((e=>{e.style[y]=C-Math.abs(t.cssOverflowAdjustment())+"px"})),z()}i("beforeInit",(()=>{if(!t.params.virtual.enabled)return;let e;if(void 0===t.passedParams.virtual.slides){const i=[...t.slidesEl.children].filter((e=>e.matches(`.${t.params.slideClass}, swiper-slide`)));i&&i.length&&(t.virtual.slides=[...i],e=!0,i.forEach(((e,i)=>{e.setAttribute("data-swiper-slide-index",i),t.virtual.cache[i]=e,e.remove()})))}e||(t.virtual.slides=t.params.virtual.slides),t.classNames.push(`${t.params.containerModifierClass}virtual`),t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0,r(!1,!0)})),i("setTranslate",(()=>{t.params.virtual.enabled&&(t.params.cssMode&&!t._immediateVirtual?(clearTimeout(a),a=setTimeout((()=>{r()}),100)):r())})),i("init update resize",(()=>{t.params.virtual.enabled&&t.params.cssMode&&ae(t.wrapperEl,"--swiper-virtual-size",`${t.virtualSize}px`)})),Object.assign(t.virtual,{appendSlide:function(e){if("object"==typeof e&&"length"in e)for(let i=0;i<e.length;i+=1)e[i]&&t.virtual.slides.push(e[i]);else t.virtual.slides.push(e);r(!0)},prependSlide:function(e){const i=t.activeIndex;let s=i+1,a=1;if(Array.isArray(e)){for(let i=0;i<e.length;i+=1)e[i]&&t.virtual.slides.unshift(e[i]);s=i+e.length,a=e.length}else t.virtual.slides.unshift(e);if(t.params.virtual.cache){const e=t.virtual.cache,i={};Object.keys(e).forEach((t=>{const s=e[t],n=s.getAttribute("data-swiper-slide-index");n&&s.setAttribute("data-swiper-slide-index",parseInt(n,10)+a),i[parseInt(t,10)+a]=s})),t.virtual.cache=i}r(!0),t.slideTo(s,0)},removeSlide:function(e){if(null==e)return;let i=t.activeIndex;if(Array.isArray(e))for(let s=e.length-1;s>=0;s-=1)t.params.virtual.cache&&(delete t.virtual.cache[e[s]],Object.keys(t.virtual.cache).forEach((i=>{i>e&&(t.virtual.cache[i-1]=t.virtual.cache[i],t.virtual.cache[i-1].setAttribute("data-swiper-slide-index",i-1),delete t.virtual.cache[i])}))),t.virtual.slides.splice(e[s],1),e[s]<i&&(i-=1),i=Math.max(i,0);else t.params.virtual.cache&&(delete t.virtual.cache[e],Object.keys(t.virtual.cache).forEach((i=>{i>e&&(t.virtual.cache[i-1]=t.virtual.cache[i],t.virtual.cache[i-1].setAttribute("data-swiper-slide-index",i-1),delete t.virtual.cache[i])}))),t.virtual.slides.splice(e,1),e<i&&(i-=1),i=Math.max(i,0);r(!0),t.slideTo(i,0)},removeAllSlides:function(){t.virtual.slides=[],t.params.virtual.cache&&(t.virtual.cache={}),r(!0),t.slideTo(0,0)},update:r})},function({swiper:t,extendParams:e,on:i,emit:s}){const a=Jt(),n=Yt();function l(e){if(!t.enabled)return;const{rtlTranslate:i}=t;let l=e;l.originalEvent&&(l=l.originalEvent);const o=l.keyCode||l.charCode,r=t.params.keyboard.pageUpDown,c=r&&33===o,d=r&&34===o,h=37===o,p=39===o,u=38===o,f=40===o;if(!t.allowSlideNext&&(t.isHorizontal()&&p||t.isVertical()&&f||d))return!1;if(!t.allowSlidePrev&&(t.isHorizontal()&&h||t.isVertical()&&u||c))return!1;if(l.shiftKey||l.altKey||l.ctrlKey||l.metaKey)return;if(a.activeElement&&(a.activeElement.isContentEditable||a.activeElement.nodeName&&("input"===a.activeElement.nodeName.toLowerCase()||"textarea"===a.activeElement.nodeName.toLowerCase())))return;if(t.params.keyboard.onlyInViewport&&(c||d||h||p||u||f)){let e=!1;if(ue(t.el,`.${t.params.slideClass}, swiper-slide`).length>0&&0===ue(t.el,`.${t.params.slideActiveClass}`).length)return;const s=t.el,a=s.clientWidth,l=s.clientHeight,o=n.innerWidth,r=n.innerHeight,c=de(s);i&&(c.left-=s.scrollLeft);const d=[[c.left,c.top],[c.left+a,c.top],[c.left,c.top+l],[c.left+a,c.top+l]];for(let t=0;t<d.length;t+=1){const i=d[t];if(i[0]>=0&&i[0]<=o&&i[1]>=0&&i[1]<=r){if(0===i[0]&&0===i[1])continue;e=!0}}if(!e)return}const m=t.params.keyboard.speed;t.isHorizontal()?((c||d||h||p)&&(l.preventDefault?l.preventDefault():l.returnValue=!1),((d||p)&&!i||(c||h)&&i)&&t.slideNext(m),((c||h)&&!i||(d||p)&&i)&&t.slidePrev(m)):((c||d||u||f)&&(l.preventDefault?l.preventDefault():l.returnValue=!1),(d||f)&&t.slideNext(m),(c||u)&&t.slidePrev(m)),s("keyPress",o)}function o(){t.keyboard.enabled||(a.addEventListener("keydown",l),t.keyboard.enabled=!0)}function r(){t.keyboard.enabled&&(a.removeEventListener("keydown",l),t.keyboard.enabled=!1)}t.keyboard={enabled:!1},e({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0,speed:void 0}}),i("init",(()=>{t.params.keyboard.enabled&&o()})),i("destroy",(()=>{t.keyboard.enabled&&r()})),Object.assign(t.keyboard,{enable:o,disable:r})},function({swiper:t,extendParams:e,on:i,emit:s}){const a=Yt();let n;e({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),t.mousewheel={enabled:!1};let l,o=te();const r=[];function c(){t.enabled&&(t.mouseEntered=!0)}function d(){t.enabled&&(t.mouseEntered=!1)}function h(e){return!(t.params.mousewheel.thresholdDelta&&e.delta<t.params.mousewheel.thresholdDelta||t.params.mousewheel.thresholdTime&&te()-o<t.params.mousewheel.thresholdTime||!(e.delta>=6&&te()-o<60)&&(e.direction<0?t.isEnd&&!t.params.loop||t.animating||(t.slideNext(),s("scroll",e.raw)):t.isBeginning&&!t.params.loop||t.animating||(t.slidePrev(),s("scroll",e.raw)),o=(new a.Date).getTime(),1))}function p(e){let i=e,a=!0;if(!t.enabled)return;if(e.target.closest(`.${t.params.mousewheel.noMousewheelClass}`))return;const o=t.params.mousewheel;t.params.cssMode&&i.preventDefault();let c=t.el;"container"!==t.params.mousewheel.eventsTarget&&(c=document.querySelector(t.params.mousewheel.eventsTarget));const d=c&&c.contains(i.target);if(!t.mouseEntered&&!d&&!o.releaseOnEdges)return!0;i.originalEvent&&(i=i.originalEvent);let p=0;const u=t.rtlTranslate?-1:1,f=function(t){let e=0,i=0,s=0,a=0;return"detail"in t&&(i=t.detail),"wheelDelta"in t&&(i=-t.wheelDelta/120),"wheelDeltaY"in t&&(i=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=i,i=0),s=10*e,a=10*i,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(s=t.deltaX),t.shiftKey&&!s&&(s=a,a=0),(s||a)&&t.deltaMode&&(1===t.deltaMode?(s*=40,a*=40):(s*=800,a*=800)),s&&!e&&(e=s<1?-1:1),a&&!i&&(i=a<1?-1:1),{spinX:e,spinY:i,pixelX:s,pixelY:a}}(i);if(o.forceToAxis)if(t.isHorizontal()){if(!(Math.abs(f.pixelX)>Math.abs(f.pixelY)))return!0;p=-f.pixelX*u}else{if(!(Math.abs(f.pixelY)>Math.abs(f.pixelX)))return!0;p=-f.pixelY}else p=Math.abs(f.pixelX)>Math.abs(f.pixelY)?-f.pixelX*u:-f.pixelY;if(0===p)return!0;o.invert&&(p=-p);let m=t.getTranslate()+p*o.sensitivity;if(m>=t.minTranslate()&&(m=t.minTranslate()),m<=t.maxTranslate()&&(m=t.maxTranslate()),a=!!t.params.loop||!(m===t.minTranslate()||m===t.maxTranslate()),a&&t.params.nested&&i.stopPropagation(),t.params.freeMode&&t.params.freeMode.enabled){const e={time:te(),delta:Math.abs(p),direction:Math.sign(p)},a=l&&e.time<l.time+500&&e.delta<=l.delta&&e.direction===l.direction;if(!a){l=void 0;let c=t.getTranslate()+p*o.sensitivity;const d=t.isBeginning,h=t.isEnd;if(c>=t.minTranslate()&&(c=t.minTranslate()),c<=t.maxTranslate()&&(c=t.maxTranslate()),t.setTransition(0),t.setTranslate(c),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses(),(!d&&t.isBeginning||!h&&t.isEnd)&&t.updateSlidesClasses(),t.params.loop&&t.loopFix({direction:e.direction<0?"next":"prev",byMousewheel:!0}),t.params.freeMode.sticky){clearTimeout(n),n=void 0,r.length>=15&&r.shift();const i=r.length?r[r.length-1]:void 0,s=r[0];if(r.push(e),i&&(e.delta>i.delta||e.direction!==i.direction))r.splice(0);else if(r.length>=15&&e.time-s.time<500&&s.delta-e.delta>=1&&e.delta<=6){const i=p>0?.8:.2;l=e,r.splice(0),n=Qt((()=>{!t.destroyed&&t.params&&t.slideToClosest(t.params.speed,!0,void 0,i)}),0)}n||(n=Qt((()=>{!t.destroyed&&t.params&&(l=e,r.splice(0),t.slideToClosest(t.params.speed,!0,void 0,.5))}),500))}if(a||s("scroll",i),t.params.autoplay&&t.params.autoplay.disableOnInteraction&&t.autoplay.stop(),o.releaseOnEdges&&(c===t.minTranslate()||c===t.maxTranslate()))return!0}}else{const i={time:te(),delta:Math.abs(p),direction:Math.sign(p),raw:e};r.length>=2&&r.shift();const s=r.length?r[r.length-1]:void 0;if(r.push(i),s?(i.direction!==s.direction||i.delta>s.delta||i.time>s.time+150)&&h(i):h(i),function(e){const i=t.params.mousewheel;if(e.direction<0){if(t.isEnd&&!t.params.loop&&i.releaseOnEdges)return!0}else if(t.isBeginning&&!t.params.loop&&i.releaseOnEdges)return!0;return!1}(i))return!0}return i.preventDefault?i.preventDefault():i.returnValue=!1,!1}function u(e){let i=t.el;"container"!==t.params.mousewheel.eventsTarget&&(i=document.querySelector(t.params.mousewheel.eventsTarget)),i[e]("mouseenter",c),i[e]("mouseleave",d),i[e]("wheel",p)}function f(){return t.params.cssMode?(t.wrapperEl.removeEventListener("wheel",p),!0):!t.mousewheel.enabled&&(u("addEventListener"),t.mousewheel.enabled=!0,!0)}function m(){return t.params.cssMode?(t.wrapperEl.addEventListener(event,p),!0):!!t.mousewheel.enabled&&(u("removeEventListener"),t.mousewheel.enabled=!1,!0)}i("init",(()=>{!t.params.mousewheel.enabled&&t.params.cssMode&&m(),t.params.mousewheel.enabled&&f()})),i("destroy",(()=>{t.params.cssMode&&f(),t.mousewheel.enabled&&m()})),Object.assign(t.mousewheel,{enable:f,disable:m})},function({swiper:t,extendParams:e,on:i,emit:s}){function a(e){let i;return e&&"string"==typeof e&&t.isElement&&(i=t.el.querySelector(e)||t.hostEl.querySelector(e),i)?i:(e&&("string"==typeof e&&(i=[...document.querySelectorAll(e)]),t.params.uniqueNavElements&&"string"==typeof e&&i&&i.length>1&&1===t.el.querySelectorAll(e).length?i=t.el.querySelector(e):i&&1===i.length&&(i=i[0])),e&&!i?e:i)}function n(e,i){const s=t.params.navigation;(e=ge(e)).forEach((e=>{e&&(e.classList[i?"add":"remove"](...s.disabledClass.split(" ")),"BUTTON"===e.tagName&&(e.disabled=i),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](s.lockClass))}))}function l(){const{nextEl:e,prevEl:i}=t.navigation;if(t.params.loop)return n(i,!1),void n(e,!1);n(i,t.isBeginning&&!t.params.rewind),n(e,t.isEnd&&!t.params.rewind)}function o(e){e.preventDefault(),(!t.isBeginning||t.params.loop||t.params.rewind)&&(t.slidePrev(),s("navigationPrev"))}function r(e){e.preventDefault(),(!t.isEnd||t.params.loop||t.params.rewind)&&(t.slideNext(),s("navigationNext"))}function c(){const e=t.params.navigation;if(t.params.navigation=Ye(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!e.nextEl&&!e.prevEl)return;let i=a(e.nextEl),s=a(e.prevEl);Object.assign(t.navigation,{nextEl:i,prevEl:s}),i=ge(i),s=ge(s);const n=(i,s)=>{if(i){if(e.addIcons&&i.matches(".swiper-button-next,.swiper-button-prev")&&!i.querySelector("svg")){const t=document.createElement("div");we(t,Ke),i.appendChild(t.querySelector("svg")),t.remove()}i.addEventListener("click","next"===s?r:o)}!t.enabled&&i&&i.classList.add(...e.lockClass.split(" "))};i.forEach((t=>n(t,"next"))),s.forEach((t=>n(t,"prev")))}function d(){let{nextEl:e,prevEl:i}=t.navigation;e=ge(e),i=ge(i);const s=(e,i)=>{e.removeEventListener("click","next"===i?r:o),e.classList.remove(...t.params.navigation.disabledClass.split(" "))};e.forEach((t=>s(t,"next"))),i.forEach((t=>s(t,"prev")))}e({navigation:{nextEl:null,prevEl:null,addIcons:!0,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null,arrowSvg:Ke},i("init",(()=>{!1===t.params.navigation.enabled?h():(c(),l())})),i("toEdge fromEdge lock unlock",(()=>{l()})),i("destroy",(()=>{d()})),i("enable disable",(()=>{let{nextEl:e,prevEl:i}=t.navigation;e=ge(e),i=ge(i),t.enabled?l():[...e,...i].filter((t=>!!t)).forEach((e=>e.classList.add(t.params.navigation.lockClass)))})),i("click",((e,i)=>{let{nextEl:a,prevEl:n}=t.navigation;a=ge(a),n=ge(n);const l=i.target;let o=n.includes(l)||a.includes(l);if(t.isElement&&!o){const t=i.path||i.composedPath&&i.composedPath();t&&(o=t.find((t=>a.includes(t)||n.includes(t))))}if(t.params.navigation.hideOnClick&&!o){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===l||t.pagination.el.contains(l)))return;let e;a.length?e=a[0].classList.contains(t.params.navigation.hiddenClass):n.length&&(e=n[0].classList.contains(t.params.navigation.hiddenClass)),s(!0===e?"navigationShow":"navigationHide"),[...a,...n].filter((t=>!!t)).forEach((e=>e.classList.toggle(t.params.navigation.hiddenClass)))}}));const h=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),d()};Object.assign(t.navigation,{enable:()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),c(),l()},disable:h,update:l,init:c,destroy:d})},function({swiper:t,extendParams:e,on:i,emit:s}){const a="swiper-pagination";let n;e({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:t=>t,formatFractionTotal:t=>t,bulletClass:`${a}-bullet`,bulletActiveClass:`${a}-bullet-active`,modifierClass:`${a}-`,currentClass:`${a}-current`,totalClass:`${a}-total`,hiddenClass:`${a}-hidden`,progressbarFillClass:`${a}-progressbar-fill`,progressbarOppositeClass:`${a}-progressbar-opposite`,clickableClass:`${a}-clickable`,lockClass:`${a}-lock`,horizontalClass:`${a}-horizontal`,verticalClass:`${a}-vertical`,paginationDisabledClass:`${a}-disabled`}}),t.pagination={el:null,bullets:[]};let l=0;function o(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&0===t.pagination.el.length}function r(e,i){const{bulletActiveClass:s}=t.params.pagination;e&&(e=e[("prev"===i?"previous":"next")+"ElementSibling"])&&(e.classList.add(`${s}-${i}`),(e=e[("prev"===i?"previous":"next")+"ElementSibling"])&&e.classList.add(`${s}-${i}-${i}`))}function c(e){const i=e.target.closest(Qe(t.params.pagination.bulletClass));if(!i)return;e.preventDefault();const s=pe(i)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===s)return;const e=(a=t.realIndex,n=s,(n%=l=t.slides.length)==1+(a%=l)?"next":n===a-1?"previous":void 0);"next"===e?t.slideNext():"previous"===e?t.slidePrev():t.slideToLoop(s)}else t.slideTo(s);var a,n,l}function d(){const e=t.rtl,i=t.params.pagination;if(o())return;let a,c,d=t.pagination.el;d=ge(d);const h=t.params.loop?Math.ceil((t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length)/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(c=t.previousRealIndex||0,a=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):void 0!==t.snapIndex?(a=t.snapIndex,c=t.previousSnapIndex):(c=t.previousIndex||0,a=t.activeIndex||0),"bullets"===i.type&&t.pagination.bullets&&t.pagination.bullets.length>0){const s=t.pagination.bullets;let o,h,p;if(i.dynamicBullets&&(n=me(s[0],t.isHorizontal()?"width":"height"),d.forEach((e=>{e.style[t.isHorizontal()?"width":"height"]=n*(i.dynamicMainBullets+4)+"px"})),i.dynamicMainBullets>1&&void 0!==c&&(l+=a-(c||0),l>i.dynamicMainBullets-1?l=i.dynamicMainBullets-1:l<0&&(l=0)),o=Math.max(a-l,0),h=o+(Math.min(s.length,i.dynamicMainBullets)-1),p=(h+o)/2),s.forEach((t=>{const e=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((t=>`${i.bulletActiveClass}${t}`))].map((t=>"string"==typeof t&&t.includes(" ")?t.split(" "):t)).flat();t.classList.remove(...e)})),d.length>1)s.forEach((e=>{const s=pe(e);s===a?e.classList.add(...i.bulletActiveClass.split(" ")):t.isElement&&e.setAttribute("part","bullet"),i.dynamicBullets&&(s>=o&&s<=h&&e.classList.add(...`${i.bulletActiveClass}-main`.split(" ")),s===o&&r(e,"prev"),s===h&&r(e,"next"))}));else{const e=s[a];if(e&&e.classList.add(...i.bulletActiveClass.split(" ")),t.isElement&&s.forEach(((t,e)=>{t.setAttribute("part",e===a?"bullet-active":"bullet")})),i.dynamicBullets){const t=s[o],e=s[h];for(let t=o;t<=h;t+=1)s[t]&&s[t].classList.add(...`${i.bulletActiveClass}-main`.split(" "));r(t,"prev"),r(e,"next")}}if(i.dynamicBullets){const a=Math.min(s.length,i.dynamicMainBullets+4),l=(n*a-n)/2-p*n,o=e?"right":"left";s.forEach((e=>{e.style[t.isHorizontal()?o:"top"]=`${l}px`}))}}d.forEach(((e,n)=>{if("fraction"===i.type&&(e.querySelectorAll(Qe(i.currentClass)).forEach((t=>{t.textContent=i.formatFractionCurrent(a+1)})),e.querySelectorAll(Qe(i.totalClass)).forEach((t=>{t.textContent=i.formatFractionTotal(h)}))),"progressbar"===i.type){let s;s=i.progressbarOpposite?t.isHorizontal()?"vertical":"horizontal":t.isHorizontal()?"horizontal":"vertical";const n=(a+1)/h;let l=1,o=1;"horizontal"===s?l=n:o=n,e.querySelectorAll(Qe(i.progressbarFillClass)).forEach((e=>{e.style.transform=`translate3d(0,0,0) scaleX(${l}) scaleY(${o})`,e.style.transitionDuration=`${t.params.speed}ms`}))}"custom"===i.type&&i.renderCustom?(we(e,i.renderCustom(t,a+1,h)),0===n&&s("paginationRender",e)):(0===n&&s("paginationRender",e),s("paginationUpdate",e)),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](i.lockClass)}))}function h(){const e=t.params.pagination;if(o())return;const i=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.grid&&t.params.grid.rows>1?t.slides.length/Math.ceil(t.params.grid.rows):t.slides.length;let a=t.pagination.el;a=ge(a);let n="";if("bullets"===e.type){let s=t.params.loop?Math.ceil(i/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&s>i&&(s=i);for(let i=0;i<s;i+=1)n+=e.renderBullet?e.renderBullet.call(t,i,e.bulletClass):`<${e.bulletElement} ${t.isElement?'part="bullet"':""} class="${e.bulletClass}"></${e.bulletElement}>`}"fraction"===e.type&&(n=e.renderFraction?e.renderFraction.call(t,e.currentClass,e.totalClass):`<span class="${e.currentClass}"></span> / <span class="${e.totalClass}"></span>`),"progressbar"===e.type&&(n=e.renderProgressbar?e.renderProgressbar.call(t,e.progressbarFillClass):`<span class="${e.progressbarFillClass}"></span>`),t.pagination.bullets=[],a.forEach((i=>{"custom"!==e.type&&we(i,n||""),"bullets"===e.type&&t.pagination.bullets.push(...i.querySelectorAll(Qe(e.bulletClass)))})),"custom"!==e.type&&s("paginationRender",a[0])}function p(){t.params.pagination=Ye(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const e=t.params.pagination;if(!e.el)return;let i;"string"==typeof e.el&&t.isElement&&(i=t.el.querySelector(e.el)),i||"string"!=typeof e.el||(i=[...document.querySelectorAll(e.el)]),i||(i=e.el),i&&0!==i.length&&(t.params.uniqueNavElements&&"string"==typeof e.el&&Array.isArray(i)&&i.length>1&&(i=[...t.el.querySelectorAll(e.el)],i.length>1&&(i=i.find((e=>ue(e,".swiper")[0]===t.el)))),Array.isArray(i)&&1===i.length&&(i=i[0]),Object.assign(t.pagination,{el:i}),i=ge(i),i.forEach((i=>{"bullets"===e.type&&e.clickable&&i.classList.add(...(e.clickableClass||"").split(" ")),i.classList.add(e.modifierClass+e.type),i.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass),"bullets"===e.type&&e.dynamicBullets&&(i.classList.add(`${e.modifierClass}${e.type}-dynamic`),l=0,e.dynamicMainBullets<1&&(e.dynamicMainBullets=1)),"progressbar"===e.type&&e.progressbarOpposite&&i.classList.add(e.progressbarOppositeClass),e.clickable&&i.addEventListener("click",c),t.enabled||i.classList.add(e.lockClass)})))}function u(){const e=t.params.pagination;if(o())return;let i=t.pagination.el;i&&(i=ge(i),i.forEach((i=>{i.classList.remove(e.hiddenClass),i.classList.remove(e.modifierClass+e.type),i.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),e.clickable&&(i.classList.remove(...(e.clickableClass||"").split(" ")),i.removeEventListener("click",c))}))),t.pagination.bullets&&t.pagination.bullets.forEach((t=>t.classList.remove(...e.bulletActiveClass.split(" "))))}i("changeDirection",(()=>{if(!t.pagination||!t.pagination.el)return;const e=t.params.pagination;let{el:i}=t.pagination;i=ge(i),i.forEach((i=>{i.classList.remove(e.horizontalClass,e.verticalClass),i.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass)}))})),i("init",(()=>{!1===t.params.pagination.enabled?f():(p(),h(),d())})),i("activeIndexChange",(()=>{void 0===t.snapIndex&&d()})),i("snapIndexChange",(()=>{d()})),i("snapGridLengthChange",(()=>{h(),d()})),i("destroy",(()=>{u()})),i("enable disable",(()=>{let{el:e}=t.pagination;e&&(e=ge(e),e.forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass))))})),i("lock unlock",(()=>{d()})),i("click",((e,i)=>{const a=i.target,n=ge(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&n&&n.length>0&&!a.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&a===t.navigation.nextEl||t.navigation.prevEl&&a===t.navigation.prevEl))return;const e=n[0].classList.contains(t.params.pagination.hiddenClass);s(!0===e?"paginationShow":"paginationHide"),n.forEach((e=>e.classList.toggle(t.params.pagination.hiddenClass)))}}));const f=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=ge(e),e.forEach((e=>e.classList.add(t.params.pagination.paginationDisabledClass)))),u()};Object.assign(t.pagination,{enable:()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=ge(e),e.forEach((e=>e.classList.remove(t.params.pagination.paginationDisabledClass)))),p(),h(),d()},disable:f,render:h,update:d,init:p,destroy:u})},function({swiper:t,extendParams:e,on:i,emit:s}){const a=Jt();let n,l,o,r,c=!1,d=null,h=null;function p(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:e,rtlTranslate:i}=t,{dragEl:s,el:a}=e,n=t.params.scrollbar;let r=l,c=(o-l)*(t.params.loop?t.progressLoop:t.progress);i?(c=-c,c>0?(r=l-c,c=0):-c+l>o&&(r=o+c)):c<0?(r=l+c,c=0):c+l>o&&(r=o-c),t.isHorizontal()?(s.style.transform=`translate3d(${c}px, 0, 0)`,s.style.width=`${r}px`):(s.style.transform=`translate3d(0px, ${c}px, 0)`,s.style.height=`${r}px`),n.hide&&(clearTimeout(d),a.style.opacity=1,d=setTimeout((()=>{a.style.opacity=0,a.style.transitionDuration="400ms"}),1e3))}function u(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:e}=t,{dragEl:i,el:s}=e;i.style.width="",i.style.height="",o=t.isHorizontal()?s.offsetWidth:s.offsetHeight,r=t.size/(t.virtualSize+t.params.slidesOffsetBefore-(t.params.centeredSlides?t.snapGrid[0]:0)),l="auto"===t.params.scrollbar.dragSize?o*r:parseInt(t.params.scrollbar.dragSize,10),t.isHorizontal()?i.style.width=`${l}px`:i.style.height=`${l}px`,s.style.display=r>=1?"none":"",t.params.scrollbar.hide&&(s.style.opacity=0),t.params.watchOverflow&&t.enabled&&e.el.classList[t.isLocked?"add":"remove"](t.params.scrollbar.lockClass)}function f(e){return t.isHorizontal()?e.clientX:e.clientY}function m(e){const{scrollbar:i,rtlTranslate:s}=t,{el:a}=i;let r;r=(f(e)-de(a)[t.isHorizontal()?"left":"top"]-(null!==n?n:l/2))/(o-l),r=Math.max(Math.min(r,1),0),s&&(r=1-r);const c=t.minTranslate()+(t.maxTranslate()-t.minTranslate())*r;t.updateProgress(c),t.setTranslate(c),t.updateActiveIndex(),t.updateSlidesClasses()}function g(e){const i=t.params.scrollbar,{scrollbar:a,wrapperEl:l}=t,{el:o,dragEl:r}=a;c=!0,n=e.target===r?f(e)-e.target.getBoundingClientRect()[t.isHorizontal()?"left":"top"]:null,e.preventDefault(),e.stopPropagation(),l.style.transitionDuration="100ms",r.style.transitionDuration="100ms",m(e),clearTimeout(h),o.style.transitionDuration="0ms",i.hide&&(o.style.opacity=1),t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="none"),s("scrollbarDragStart",e)}function b(e){const{scrollbar:i,wrapperEl:a}=t,{el:n,dragEl:l}=i;c&&(e.preventDefault&&e.cancelable?e.preventDefault():e.returnValue=!1,m(e),a.style.transitionDuration="0ms",n.style.transitionDuration="0ms",l.style.transitionDuration="0ms",s("scrollbarDragMove",e))}function w(e){const i=t.params.scrollbar,{scrollbar:a,wrapperEl:n}=t,{el:l}=a;c&&(c=!1,t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="",n.style.transitionDuration=""),i.hide&&(clearTimeout(h),h=Qt((()=>{l.style.opacity=0,l.style.transitionDuration="400ms"}),1e3)),s("scrollbarDragEnd",e),i.snapOnRelease&&t.slideToClosest())}function v(e){const{scrollbar:i,params:s}=t,n=i.el;if(!n)return;const l=!!s.passiveListeners&&{passive:!1,capture:!1},o=!!s.passiveListeners&&{passive:!0,capture:!1};if(!n)return;const r="on"===e?"addEventListener":"removeEventListener";n[r]("pointerdown",g,l),a[r]("pointermove",b,l),a[r]("pointerup",w,o)}function y(){const{scrollbar:e,el:i}=t;t.params.scrollbar=Ye(t,t.originalParams.scrollbar,t.params.scrollbar,{el:"swiper-scrollbar"});const s=t.params.scrollbar;if(!s.el)return;let n,l;if("string"==typeof s.el&&t.isElement&&(n=t.el.querySelector(s.el)),n||"string"!=typeof s.el)n||(n=s.el);else if(n=a.querySelectorAll(s.el),!n.length)return;t.params.uniqueNavElements&&"string"==typeof s.el&&n.length>1&&1===i.querySelectorAll(s.el).length&&(n=i.querySelector(s.el)),n.length>0&&(n=n[0]),n.classList.add(t.isHorizontal()?s.horizontalClass:s.verticalClass),n&&(l=n.querySelector(Qe(t.params.scrollbar.dragClass)),l||(l=ce("div",t.params.scrollbar.dragClass),n.append(l))),Object.assign(e,{el:n,dragEl:l}),s.draggable&&t.params.scrollbar.el&&t.scrollbar.el&&v("on"),n&&n.classList[t.enabled?"remove":"add"](...Kt(t.params.scrollbar.lockClass))}function x(){const e=t.params.scrollbar,i=t.scrollbar.el;i&&i.classList.remove(...Kt(t.isHorizontal()?e.horizontalClass:e.verticalClass)),t.params.scrollbar.el&&t.scrollbar.el&&v("off")}e({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),t.scrollbar={el:null,dragEl:null},i("changeDirection",(()=>{if(!t.scrollbar||!t.scrollbar.el)return;const e=t.params.scrollbar;let{el:i}=t.scrollbar;i=ge(i),i.forEach((i=>{i.classList.remove(e.horizontalClass,e.verticalClass),i.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass)}))})),i("init",(()=>{!1===t.params.scrollbar.enabled?_():(y(),u(),p())})),i("update resize observerUpdate lock unlock changeDirection",(()=>{u()})),i("setTranslate",(()=>{p()})),i("setTransition",((e,i)=>{!function(e){t.params.scrollbar.el&&t.scrollbar.el&&(t.scrollbar.dragEl.style.transitionDuration=`${e}ms`)}(i)})),i("enable disable",(()=>{const{el:e}=t.scrollbar;e&&e.classList[t.enabled?"remove":"add"](...Kt(t.params.scrollbar.lockClass))})),i("destroy",(()=>{x()}));const _=()=>{t.el.classList.add(...Kt(t.params.scrollbar.scrollbarDisabledClass)),t.scrollbar.el&&t.scrollbar.el.classList.add(...Kt(t.params.scrollbar.scrollbarDisabledClass)),x()};Object.assign(t.scrollbar,{enable:()=>{t.el.classList.remove(...Kt(t.params.scrollbar.scrollbarDisabledClass)),t.scrollbar.el&&t.scrollbar.el.classList.remove(...Kt(t.params.scrollbar.scrollbarDisabledClass)),y(),u(),p()},disable:_,updateSize:u,setTranslate:p,init:y,destroy:x})},function({swiper:t,extendParams:e,on:i}){e({parallax:{enabled:!1}});const s="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",a=(e,i)=>{const{rtl:s}=t,a=s?-1:1,n=e.getAttribute("data-swiper-parallax")||"0";let l=e.getAttribute("data-swiper-parallax-x"),o=e.getAttribute("data-swiper-parallax-y");const r=e.getAttribute("data-swiper-parallax-scale"),c=e.getAttribute("data-swiper-parallax-opacity"),d=e.getAttribute("data-swiper-parallax-rotate");if(l||o?(l=l||"0",o=o||"0"):t.isHorizontal()?(l=n,o="0"):(o=n,l="0"),l=l.indexOf("%")>=0?parseInt(l,10)*i*a+"%":l*i*a+"px",o=o.indexOf("%")>=0?parseInt(o,10)*i+"%":o*i+"px",null!=c){const t=c-(c-1)*(1-Math.abs(i));e.style.opacity=t}let h=`translate3d(${l}, ${o}, 0px)`;null!=r&&(h+=` scale(${r-(r-1)*(1-Math.abs(i))})`),d&&null!=d&&(h+=` rotate(${d*i*-1}deg)`),e.style.transform=h},n=()=>{const{el:e,slides:i,progress:n,snapGrid:l}=t,o=oe(e,s);t.isElement&&o.push(...oe(t.hostEl,s)),o.forEach((t=>{a(t,n)})),i.forEach(((e,i)=>{let o=e.progress;t.params.slidesPerGroup>1&&"auto"!==t.params.slidesPerView&&(o+=Math.ceil(i/2)-n*(l.length-1)),o=Math.min(Math.max(o,-1),1),e.querySelectorAll(`${s}, [data-swiper-parallax-rotate]`).forEach((t=>{a(t,o)}))}))};i("beforeInit",(()=>{t.params.parallax.enabled&&(t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0)})),i("init",(()=>{t.params.parallax.enabled&&n()})),i("setTranslate",(()=>{t.params.parallax.enabled&&n()})),i("setTransition",((e,i)=>{t.params.parallax.enabled&&((e=t.params.speed)=>{const{el:i,hostEl:a}=t,n=[...i.querySelectorAll(s)];t.isElement&&n.push(...a.querySelectorAll(s)),n.forEach((t=>{let i=parseInt(t.getAttribute("data-swiper-parallax-duration"),10)||e;0===e&&(i=0),t.style.transitionDuration=`${i}ms`}))})(i)}))},function({swiper:t,extendParams:e,on:i,emit:s}){const a=Yt();e({zoom:{enabled:!1,limitToOriginalSize:!1,maxRatio:3,minRatio:1,panOnMouseMove:!1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),t.zoom={enabled:!1};let n,l,o=1,r=!1,c=!1,d={x:0,y:0};const h=[],p={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},u={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},f={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let m,g=1;function b(){return h.length<2?1:Math.sqrt((h[1].pageX-h[0].pageX)**2+(h[1].pageY-h[0].pageY)**2)}function w(){const e=t.params.zoom,i=p.imageWrapEl.getAttribute("data-swiper-zoom")||e.maxRatio;return e.limitToOriginalSize&&p.imageEl&&p.imageEl.naturalWidth?Math.min(p.imageEl.naturalWidth/p.imageEl.offsetWidth,i):i}function v(e){return!!e.target.matches(t.isElement?"swiper-slide":`.${t.params.slideClass}`)||t.slides.filter((t=>t.contains(e.target))).length>0}function y(e){const i=`.${t.params.zoom.containerClass}`;return!!e.target.matches(i)||[...t.hostEl.querySelectorAll(i)].filter((t=>t.contains(e.target))).length>0}function x(e){if("mouse"===e.pointerType&&h.splice(0,h.length),!v(e))return;const i=t.params.zoom;if(n=!1,l=!1,h.push(e),!(h.length<2)){if(n=!0,p.scaleStart=b(),!p.slideEl){p.slideEl=e.target.closest(`.${t.params.slideClass}, swiper-slide`),p.slideEl||(p.slideEl=t.slides[t.activeIndex]);let s=p.slideEl.querySelector(`.${i.containerClass}`);if(s&&(s=s.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),p.imageEl=s,p.imageWrapEl=s?ue(p.imageEl,`.${i.containerClass}`)[0]:void 0,!p.imageWrapEl)return void(p.imageEl=void 0);p.maxRatio=w()}if(p.imageEl){const[t,e]=function(){if(h.length<2)return{x:null,y:null};const t=p.imageEl.getBoundingClientRect();return[(h[0].pageX+(h[1].pageX-h[0].pageX)/2-t.x-a.scrollX)/o,(h[0].pageY+(h[1].pageY-h[0].pageY)/2-t.y-a.scrollY)/o]}();p.originX=t,p.originY=e,p.imageEl.style.transitionDuration="0ms"}r=!0}}function _(e){if(!v(e))return;const i=t.params.zoom,s=t.zoom,a=h.findIndex((t=>t.pointerId===e.pointerId));a>=0&&(h[a]=e),h.length<2||(l=!0,p.scaleMove=b(),p.imageEl&&(s.scale=p.scaleMove/p.scaleStart*o,s.scale>p.maxRatio&&(s.scale=p.maxRatio-1+(s.scale-p.maxRatio+1)**.5),s.scale<i.minRatio&&(s.scale=i.minRatio+1-(i.minRatio-s.scale+1)**.5),p.imageEl.style.transform=`translate3d(0,0,0) scale(${s.scale})`))}function k(e){if(!v(e))return;if("mouse"===e.pointerType&&"pointerout"===e.type)return;const i=t.params.zoom,s=t.zoom,a=h.findIndex((t=>t.pointerId===e.pointerId));a>=0&&h.splice(a,1),n&&l&&(n=!1,l=!1,p.imageEl&&(s.scale=Math.max(Math.min(s.scale,p.maxRatio),i.minRatio),p.imageEl.style.transitionDuration=`${t.params.speed}ms`,p.imageEl.style.transform=`translate3d(0,0,0) scale(${s.scale})`,o=s.scale,r=!1,s.scale>1&&p.slideEl?p.slideEl.classList.add(`${i.zoomedSlideClass}`):s.scale<=1&&p.slideEl&&p.slideEl.classList.remove(`${i.zoomedSlideClass}`),1===s.scale&&(p.originX=0,p.originY=0,p.slideEl=void 0)))}function M(){t.touchEventsData.preventTouchMoveFromPointerMove=!1}function S(e){const i="mouse"===e.pointerType&&t.params.zoom.panOnMouseMove;if(!v(e)||!y(e))return;const s=t.zoom;if(!p.imageEl)return;if(!u.isTouched||!p.slideEl)return void(i&&z(e));if(i)return void z(e);u.isMoved||(u.width=p.imageEl.offsetWidth||p.imageEl.clientWidth,u.height=p.imageEl.offsetHeight||p.imageEl.clientHeight,u.startX=ee(p.imageWrapEl,"x")||0,u.startY=ee(p.imageWrapEl,"y")||0,p.slideWidth=p.slideEl.offsetWidth,p.slideHeight=p.slideEl.offsetHeight,p.imageWrapEl.style.transitionDuration="0ms");const a=u.height*s.scale;if(u.minX=Math.min(p.slideWidth/2-u.width*s.scale/2,0),u.maxX=-u.minX,u.minY=Math.min(p.slideHeight/2-a/2,0),u.maxY=-u.minY,u.touchesCurrent.x=h.length>0?h[0].pageX:e.pageX,u.touchesCurrent.y=h.length>0?h[0].pageY:e.pageY,Math.max(Math.abs(u.touchesCurrent.x-u.touchesStart.x),Math.abs(u.touchesCurrent.y-u.touchesStart.y))>5&&(t.allowClick=!1),!u.isMoved&&!r){if(t.isHorizontal()&&(Math.floor(u.minX)===Math.floor(u.startX)&&u.touchesCurrent.x<u.touchesStart.x||Math.floor(u.maxX)===Math.floor(u.startX)&&u.touchesCurrent.x>u.touchesStart.x))return u.isTouched=!1,void M();if(!t.isHorizontal()&&(Math.floor(u.minY)===Math.floor(u.startY)&&u.touchesCurrent.y<u.touchesStart.y||Math.floor(u.maxY)===Math.floor(u.startY)&&u.touchesCurrent.y>u.touchesStart.y))return u.isTouched=!1,void M()}e.cancelable&&e.preventDefault(),e.stopPropagation(),clearTimeout(m),t.touchEventsData.preventTouchMoveFromPointerMove=!0,m=setTimeout((()=>{t.destroyed||M()})),u.isMoved=!0;const n=(s.scale-o)/(p.maxRatio-t.params.zoom.minRatio),{originX:l,originY:c}=p;u.currentX=u.touchesCurrent.x-u.touchesStart.x+u.startX+n*(u.width-2*l),u.currentY=u.touchesCurrent.y-u.touchesStart.y+u.startY+n*(u.height-2*c),u.currentX<u.minX&&(u.currentX=u.minX+1-(u.minX-u.currentX+1)**.8),u.currentX>u.maxX&&(u.currentX=u.maxX-1+(u.currentX-u.maxX+1)**.8),u.currentY<u.minY&&(u.currentY=u.minY+1-(u.minY-u.currentY+1)**.8),u.currentY>u.maxY&&(u.currentY=u.maxY-1+(u.currentY-u.maxY+1)**.8),f.prevPositionX||(f.prevPositionX=u.touchesCurrent.x),f.prevPositionY||(f.prevPositionY=u.touchesCurrent.y),f.prevTime||(f.prevTime=Date.now()),f.x=(u.touchesCurrent.x-f.prevPositionX)/(Date.now()-f.prevTime)/2,f.y=(u.touchesCurrent.y-f.prevPositionY)/(Date.now()-f.prevTime)/2,Math.abs(u.touchesCurrent.x-f.prevPositionX)<2&&(f.x=0),Math.abs(u.touchesCurrent.y-f.prevPositionY)<2&&(f.y=0),f.prevPositionX=u.touchesCurrent.x,f.prevPositionY=u.touchesCurrent.y,f.prevTime=Date.now(),p.imageWrapEl.style.transform=`translate3d(${u.currentX}px, ${u.currentY}px,0)`}function C(){const e=t.zoom;p.slideEl&&t.activeIndex!==t.slides.indexOf(p.slideEl)&&(p.imageEl&&(p.imageEl.style.transform="translate3d(0,0,0) scale(1)"),p.imageWrapEl&&(p.imageWrapEl.style.transform="translate3d(0,0,0)"),p.slideEl.classList.remove(`${t.params.zoom.zoomedSlideClass}`),e.scale=1,o=1,p.slideEl=void 0,p.imageEl=void 0,p.imageWrapEl=void 0,p.originX=0,p.originY=0)}function z(t){if(o<=1||!p.imageWrapEl)return;if(!v(t)||!y(t))return;const e=a.getComputedStyle(p.imageWrapEl).transform,i=new a.DOMMatrix(e);if(!c)return c=!0,d.x=t.clientX,d.y=t.clientY,u.startX=i.e,u.startY=i.f,u.width=p.imageEl.offsetWidth||p.imageEl.clientWidth,u.height=p.imageEl.offsetHeight||p.imageEl.clientHeight,p.slideWidth=p.slideEl.offsetWidth,void(p.slideHeight=p.slideEl.offsetHeight);const s=-3*(t.clientX-d.x),n=-3*(t.clientY-d.y),l=u.height*o,r=p.slideHeight,h=Math.min(p.slideWidth/2-u.width*o/2,0),f=-h,m=Math.min(r/2-l/2,0),g=-m,b=Math.max(Math.min(u.startX+s,f),h),w=Math.max(Math.min(u.startY+n,g),m);p.imageWrapEl.style.transitionDuration="0ms",p.imageWrapEl.style.transform=`translate3d(${b}px, ${w}px, 0)`,d.x=t.clientX,d.y=t.clientY,u.startX=b,u.startY=w,u.currentX=b,u.currentY=w}function $(e){const i=t.zoom,s=t.params.zoom;if(!p.slideEl){e&&e.target&&(p.slideEl=e.target.closest(`.${t.params.slideClass}, swiper-slide`)),p.slideEl||(p.slideEl=t.params.virtual&&t.params.virtual.enabled&&t.virtual?oe(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:t.slides[t.activeIndex]);let i=p.slideEl.querySelector(`.${s.containerClass}`);i&&(i=i.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),p.imageEl=i,p.imageWrapEl=i?ue(p.imageEl,`.${s.containerClass}`)[0]:void 0}if(!p.imageEl||!p.imageWrapEl)return;let n,l,r,c,d,h,f,m,g,b,v,y,x,_,k,M,S,C;p.maxRatio=w(),t.params.cssMode&&(t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.touchAction="none"),p.slideEl.classList.add(`${s.zoomedSlideClass}`),void 0===u.touchesStart.x&&e?(n=e.pageX,l=e.pageY):(n=u.touchesStart.x,l=u.touchesStart.y);const z=o,$="number"==typeof e?e:null;1===o&&$&&(n=void 0,l=void 0,u.touchesStart.x=void 0,u.touchesStart.y=void 0);const T=w();i.scale=$||T,o=$||T,!e||1===o&&$?(f=0,m=0):(S=p.slideEl.offsetWidth,C=p.slideEl.offsetHeight,r=de(p.slideEl).left+a.scrollX,c=de(p.slideEl).top+a.scrollY,d=r+S/2-n,h=c+C/2-l,g=p.imageEl.offsetWidth||p.imageEl.clientWidth,b=p.imageEl.offsetHeight||p.imageEl.clientHeight,v=g*i.scale,y=b*i.scale,x=Math.min(S/2-v/2,0),_=Math.min(C/2-y/2,0),k=-x,M=-_,z>0&&$&&"number"==typeof u.currentX&&"number"==typeof u.currentY?(f=u.currentX*i.scale/z,m=u.currentY*i.scale/z):(f=d*i.scale,m=h*i.scale),f<x&&(f=x),f>k&&(f=k),m<_&&(m=_),m>M&&(m=M)),$&&1===i.scale&&(p.originX=0,p.originY=0),u.currentX=f,u.currentY=m,p.imageWrapEl.style.transitionDuration="300ms",p.imageWrapEl.style.transform=`translate3d(${f}px, ${m}px,0)`,p.imageEl.style.transitionDuration="300ms",p.imageEl.style.transform=`translate3d(0,0,0) scale(${i.scale})`}function T(){const e=t.zoom,i=t.params.zoom;if(!p.slideEl){p.slideEl=t.params.virtual&&t.params.virtual.enabled&&t.virtual?oe(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:t.slides[t.activeIndex];let e=p.slideEl.querySelector(`.${i.containerClass}`);e&&(e=e.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),p.imageEl=e,p.imageWrapEl=e?ue(p.imageEl,`.${i.containerClass}`)[0]:void 0}p.imageEl&&p.imageWrapEl&&(p.maxRatio=w(),t.params.cssMode&&(t.wrapperEl.style.overflow="",t.wrapperEl.style.touchAction=""),e.scale=1,o=1,u.currentX=void 0,u.currentY=void 0,u.touchesStart.x=void 0,u.touchesStart.y=void 0,p.imageWrapEl.style.transitionDuration="300ms",p.imageWrapEl.style.transform="translate3d(0,0,0)",p.imageEl.style.transitionDuration="300ms",p.imageEl.style.transform="translate3d(0,0,0) scale(1)",p.slideEl.classList.remove(`${i.zoomedSlideClass}`),p.slideEl=void 0,p.originX=0,p.originY=0,t.params.zoom.panOnMouseMove&&(d={x:0,y:0},c&&(c=!1,u.startX=0,u.startY=0)))}function P(e){const i=t.zoom;i.scale&&1!==i.scale?T():$(e)}function I(){return{passiveListener:!!t.params.passiveListeners&&{passive:!0,capture:!1},activeListenerWithCapture:!t.params.passiveListeners||{passive:!1,capture:!0}}}function L(){const e=t.zoom;if(e.enabled)return;e.enabled=!0;const{passiveListener:i,activeListenerWithCapture:s}=I();t.wrapperEl.addEventListener("pointerdown",x,i),t.wrapperEl.addEventListener("pointermove",_,s),["pointerup","pointercancel","pointerout"].forEach((e=>{t.wrapperEl.addEventListener(e,k,i)})),t.wrapperEl.addEventListener("pointermove",S,s)}function A(){const e=t.zoom;if(!e.enabled)return;e.enabled=!1;const{passiveListener:i,activeListenerWithCapture:s}=I();t.wrapperEl.removeEventListener("pointerdown",x,i),t.wrapperEl.removeEventListener("pointermove",_,s),["pointerup","pointercancel","pointerout"].forEach((e=>{t.wrapperEl.removeEventListener(e,k,i)})),t.wrapperEl.removeEventListener("pointermove",S,s)}Object.defineProperty(t.zoom,"scale",{get:()=>g,set(t){g!==t&&s("zoomChange",t,p.imageEl,p.slideEl),g=t}}),i("init",(()=>{t.params.zoom.enabled&&L()})),i("destroy",(()=>{A()})),i("touchStart",((e,i)=>{t.zoom.enabled&&function(e){if(!p.imageEl)return;if(u.isTouched)return;t.device.android&&e.cancelable&&e.preventDefault(),u.isTouched=!0;const i=h.length>0?h[0]:e;u.touchesStart.x=i.pageX,u.touchesStart.y=i.pageY}(i)})),i("touchEnd",(()=>{t.zoom.enabled&&function(){const e=t.zoom;if(h.length=0,!p.imageEl)return;if(!u.isTouched||!u.isMoved)return u.isTouched=!1,void(u.isMoved=!1);u.isTouched=!1,u.isMoved=!1;let i=300,s=300;const a=u.currentX+f.x*i,n=u.currentY+f.y*s;0!==f.x&&(i=Math.abs((a-u.currentX)/f.x)),0!==f.y&&(s=Math.abs((n-u.currentY)/f.y));const l=Math.max(i,s);u.currentX=a,u.currentY=n;const o=u.height*e.scale;u.minX=Math.min(p.slideWidth/2-u.width*e.scale/2,0),u.maxX=-u.minX,u.minY=Math.min(p.slideHeight/2-o/2,0),u.maxY=-u.minY,u.currentX=Math.max(Math.min(u.currentX,u.maxX),u.minX),u.currentY=Math.max(Math.min(u.currentY,u.maxY),u.minY),p.imageWrapEl.style.transitionDuration=`${l}ms`,p.imageWrapEl.style.transform=`translate3d(${u.currentX}px, ${u.currentY}px,0)`}()})),i("doubleTap",((e,i)=>{!t.animating&&t.params.zoom.enabled&&t.zoom.enabled&&t.params.zoom.toggle&&P(i)})),i("transitionEnd",(()=>{t.zoom.enabled&&t.params.zoom.enabled&&C()})),i("slideChange",(()=>{t.zoom.enabled&&t.params.zoom.enabled&&t.params.cssMode&&C()})),Object.assign(t.zoom,{enable:L,disable:A,in:$,out:T,toggle:P})},function({swiper:t,extendParams:e,on:i}){function s(t,e){const i=function(){let t,e,i;return(s,a)=>{for(e=-1,t=s.length;t-e>1;)i=t+e>>1,s[i]<=a?e=i:t=i;return t}}();let s,a;return this.x=t,this.y=e,this.lastIndex=t.length-1,this.interpolate=function(t){return t?(a=i(this.x,t),s=a-1,(t-this.x[s])*(this.y[a]-this.y[s])/(this.x[a]-this.x[s])+this.y[s]):0},this}function a(){t.controller.control&&t.controller.spline&&(t.controller.spline=void 0,delete t.controller.spline)}e({controller:{control:void 0,inverse:!1,by:"slide"}}),t.controller={control:void 0},i("beforeInit",(()=>{"undefined"!=typeof window&&("string"==typeof t.params.controller.control||t.params.controller.control instanceof HTMLElement)?("string"==typeof t.params.controller.control?[...document.querySelectorAll(t.params.controller.control)]:[t.params.controller.control]).forEach((e=>{if(t.controller.control||(t.controller.control=[]),e&&e.swiper)t.controller.control.push(e.swiper);else if(e){const i=`${t.params.eventsPrefix}init`,s=a=>{t.controller.control.push(a.detail[0]),t.update(),e.removeEventListener(i,s)};e.addEventListener(i,s)}})):t.controller.control=t.params.controller.control})),i("update",(()=>{a()})),i("resize",(()=>{a()})),i("observerUpdate",(()=>{a()})),i("setTranslate",((e,i,s)=>{t.controller.control&&!t.controller.control.destroyed&&t.controller.setTranslate(i,s)})),i("setTransition",((e,i,s)=>{t.controller.control&&!t.controller.control.destroyed&&t.controller.setTransition(i,s)})),Object.assign(t.controller,{setTranslate:function(e,i){const a=t.controller.control;let n,l;const o=t.constructor;function r(e){if(e.destroyed)return;const i=t.rtlTranslate?-t.translate:t.translate;"slide"===t.params.controller.by&&(function(e){t.controller.spline=t.params.loop?new s(t.slidesGrid,e.slidesGrid):new s(t.snapGrid,e.snapGrid)}(e),l=-t.controller.spline.interpolate(-i)),l&&"container"!==t.params.controller.by||(n=(e.maxTranslate()-e.minTranslate())/(t.maxTranslate()-t.minTranslate()),!Number.isNaN(n)&&Number.isFinite(n)||(n=1),l=(i-t.minTranslate())*n+e.minTranslate()),t.params.controller.inverse&&(l=e.maxTranslate()-l),e.updateProgress(l),e.setTranslate(l,t),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(a))for(let t=0;t<a.length;t+=1)a[t]!==i&&a[t]instanceof o&&r(a[t]);else a instanceof o&&i!==a&&r(a)},setTransition:function(e,i){const s=t.constructor,a=t.controller.control;let n;function l(i){i.destroyed||(i.setTransition(e,t),0!==e&&(i.transitionStart(),i.params.autoHeight&&Qt((()=>{i.updateAutoHeight()})),fe(i.wrapperEl,(()=>{a&&i.transitionEnd()}))))}if(Array.isArray(a))for(n=0;n<a.length;n+=1)a[n]!==i&&a[n]instanceof s&&l(a[n]);else a instanceof s&&i!==a&&l(a)}})},function({swiper:t,extendParams:e,on:i}){e({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,containerRole:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null,scrollOnFocus:!0,wrapperLiveRegion:!0}}),t.a11y={clicked:!1};let s,a,n=null,l=(new Date).getTime();function o(t){0!==n.length&&we(n,t)}function r(t){(t=ge(t)).forEach((t=>{t.setAttribute("tabIndex","0")}))}function c(t){(t=ge(t)).forEach((t=>{t.setAttribute("tabIndex","-1")}))}function d(t,e){(t=ge(t)).forEach((t=>{t.setAttribute("role",e)}))}function h(t,e){(t=ge(t)).forEach((t=>{t.setAttribute("aria-roledescription",e)}))}function p(t,e){(t=ge(t)).forEach((t=>{t.setAttribute("aria-label",e)}))}function u(t){(t=ge(t)).forEach((t=>{t.setAttribute("aria-disabled",!0)}))}function f(t){(t=ge(t)).forEach((t=>{t.setAttribute("aria-disabled",!1)}))}function m(e){if(13!==e.keyCode&&32!==e.keyCode)return;const i=t.params.a11y,s=e.target;if(!t.pagination||!t.pagination.el||s!==t.pagination.el&&!t.pagination.el.contains(e.target)||e.target.matches(Qe(t.params.pagination.bulletClass))){if(t.navigation&&t.navigation.prevEl&&t.navigation.nextEl){const e=ge(t.navigation.prevEl);ge(t.navigation.nextEl).includes(s)&&(t.isEnd&&!t.params.loop||t.slideNext(),o(t.isEnd?i.lastSlideMessage:i.nextSlideMessage)),e.includes(s)&&(t.isBeginning&&!t.params.loop||t.slidePrev(),o(t.isBeginning?i.firstSlideMessage:i.prevSlideMessage))}t.pagination&&s.matches(Qe(t.params.pagination.bulletClass))&&s.click()}}function g(){return t.pagination&&t.pagination.bullets&&t.pagination.bullets.length}function b(){return g()&&t.params.pagination.clickable}const w=(t,e,i)=>{r(t),"BUTTON"!==t.tagName&&(d(t,"button"),t.addEventListener("keydown",m)),p(t,i),function(t,e){(t=ge(t)).forEach((t=>{t.setAttribute("aria-controls",e)}))}(t,e)},v=e=>{a&&a!==e.target&&!a.contains(e.target)&&(s=!0),t.a11y.clicked=!0},y=()=>{s=!1,requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.destroyed||(t.a11y.clicked=!1)}))}))},x=()=>{l=(new Date).getTime()},_=e=>{if(t.a11y.clicked||!t.params.a11y.scrollOnFocus)return;if((new Date).getTime()-l<100)return;const i=e.target.closest(`.${t.params.slideClass}, swiper-slide`);if(!i||!t.slides.includes(i))return;a=i;const n=t.slides.indexOf(i)===t.activeIndex,o=t.params.watchSlidesProgress&&t.visibleSlides&&t.visibleSlides.includes(i);n||o||e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||(t.isHorizontal()?t.el.scrollLeft=0:t.el.scrollTop=0,requestAnimationFrame((()=>{s||(t.params.loop?t.slideToLoop(t.getSlideIndexWhenGrid(parseInt(i.getAttribute("data-swiper-slide-index"))),0):t.slideTo(t.getSlideIndexWhenGrid(t.slides.indexOf(i)),0),s=!1)})))},k=()=>{const e=t.params.a11y;e.itemRoleDescriptionMessage&&h(t.slides,e.itemRoleDescriptionMessage),e.slideRole&&d(t.slides,e.slideRole);const i=t.slides.length;e.slideLabelMessage&&t.slides.forEach(((s,a)=>{const n=t.params.loop?parseInt(s.getAttribute("data-swiper-slide-index"),10):a;p(s,e.slideLabelMessage.replace(/\{\{index\}\}/,n+1).replace(/\{\{slidesLength\}\}/,i))}))};i("beforeInit",(()=>{n=ce("span",t.params.a11y.notificationClass),n.setAttribute("aria-live","assertive"),n.setAttribute("aria-atomic","true")})),i("afterInit",(()=>{t.params.a11y.enabled&&(()=>{const e=t.params.a11y;t.el.append(n);const i=t.el;e.containerRoleDescriptionMessage&&h(i,e.containerRoleDescriptionMessage),e.containerMessage&&p(i,e.containerMessage),e.containerRole&&d(i,e.containerRole);const s=t.wrapperEl,a=e.id||s.getAttribute("id")||`swiper-wrapper-${function(t=16){return"x".repeat(t).replace(/x/g,(()=>Math.round(16*Math.random()).toString(16)))}(16)}`;var l,o;l=a,ge(s).forEach((t=>{t.setAttribute("id",l)})),e.wrapperLiveRegion&&(o=t.params.autoplay&&t.params.autoplay.enabled?"off":"polite",ge(s).forEach((t=>{t.setAttribute("aria-live",o)}))),k();let{nextEl:r,prevEl:c}=t.navigation?t.navigation:{};r=ge(r),c=ge(c),r&&r.forEach((t=>w(t,a,e.nextSlideMessage))),c&&c.forEach((t=>w(t,a,e.prevSlideMessage))),b()&&ge(t.pagination.el).forEach((t=>{t.addEventListener("keydown",m)})),Jt().addEventListener("visibilitychange",x),t.el.addEventListener("focus",_,!0),t.el.addEventListener("pointerdown",v,!0),t.el.addEventListener("pointerup",y,!0)})()})),i("slidesLengthChange snapGridLengthChange slidesGridLengthChange",(()=>{t.params.a11y.enabled&&k()})),i("fromEdge toEdge afterInit lock unlock",(()=>{t.params.a11y.enabled&&function(){if(t.params.loop||t.params.rewind||!t.navigation)return;const{nextEl:e,prevEl:i}=t.navigation;i&&(t.isBeginning?(u(i),c(i)):(f(i),r(i))),e&&(t.isEnd?(u(e),c(e)):(f(e),r(e)))}()})),i("paginationUpdate",(()=>{t.params.a11y.enabled&&function(){const e=t.params.a11y;g()&&t.pagination.bullets.forEach((i=>{t.params.pagination.clickable&&(r(i),t.params.pagination.renderBullet||(d(i,"button"),p(i,e.paginationBulletMessage.replace(/\{\{index\}\}/,pe(i)+1)))),i.matches(Qe(t.params.pagination.bulletActiveClass))?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")}))}()})),i("destroy",(()=>{t.params.a11y.enabled&&function(){n&&n.remove();let{nextEl:e,prevEl:i}=t.navigation?t.navigation:{};e=ge(e),i=ge(i),e&&e.forEach((t=>t.removeEventListener("keydown",m))),i&&i.forEach((t=>t.removeEventListener("keydown",m))),b()&&ge(t.pagination.el).forEach((t=>{t.removeEventListener("keydown",m)})),Jt().removeEventListener("visibilitychange",x),t.el&&"string"!=typeof t.el&&(t.el.removeEventListener("focus",_,!0),t.el.removeEventListener("pointerdown",v,!0),t.el.removeEventListener("pointerup",y,!0))}()}))},function({swiper:t,extendParams:e,on:i}){e({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let s=!1,a={};const n=t=>t.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),l=t=>{const e=Yt();let i;i=t?new URL(t):e.location;const s=i.pathname.slice(1).split("/").filter((t=>""!==t)),a=s.length;return{key:s[a-2],value:s[a-1]}},o=(e,i)=>{const a=Yt();if(!s||!t.params.history.enabled)return;let l;l=t.params.url?new URL(t.params.url):a.location;const o=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${i}"]`):t.slides[i];let r=n(o.getAttribute("data-history"));if(t.params.history.root.length>0){let i=t.params.history.root;"/"===i[i.length-1]&&(i=i.slice(0,i.length-1)),r=`${i}/${e?`${e}/`:""}${r}`}else l.pathname.includes(e)||(r=`${e?`${e}/`:""}${r}`);t.params.history.keepQuery&&(r+=l.search);const c=a.history.state;c&&c.value===r||(t.params.history.replaceState?a.history.replaceState({value:r},null,r):a.history.pushState({value:r},null,r))},r=(e,i,s)=>{if(i)for(let a=0,l=t.slides.length;a<l;a+=1){const l=t.slides[a];if(n(l.getAttribute("data-history"))===i){const i=t.getSlideIndex(l);t.slideTo(i,e,s)}}else t.slideTo(0,e,s)},c=()=>{a=l(t.params.url),r(t.params.speed,a.value,!1)};i("init",(()=>{t.params.history.enabled&&(()=>{const e=Yt();if(t.params.history){if(!e.history||!e.history.pushState)return t.params.history.enabled=!1,void(t.params.hashNavigation.enabled=!0);s=!0,a=l(t.params.url),a.key||a.value?(r(0,a.value,t.params.runCallbacksOnInit),t.params.history.replaceState||e.addEventListener("popstate",c)):t.params.history.replaceState||e.addEventListener("popstate",c)}})()})),i("destroy",(()=>{t.params.history.enabled&&(()=>{const e=Yt();t.params.history.replaceState||e.removeEventListener("popstate",c)})()})),i("transitionEnd _freeModeNoMomentumRelease",(()=>{s&&o(t.params.history.key,t.activeIndex)})),i("slideChange",(()=>{s&&t.params.cssMode&&o(t.params.history.key,t.activeIndex)}))},function({swiper:t,extendParams:e,emit:i,on:s}){let a=!1;const n=Jt(),l=Yt();e({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(e,i){if(t.virtual&&t.params.virtual.enabled){const e=t.slides.find((t=>t.getAttribute("data-hash")===i));return e?parseInt(e.getAttribute("data-swiper-slide-index"),10):0}return t.getSlideIndex(oe(t.slidesEl,`.${t.params.slideClass}[data-hash="${i}"], swiper-slide[data-hash="${i}"]`)[0])}}});const o=()=>{i("hashChange");const e=n.location.hash.replace("#",""),s=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex];if(e!==(s?s.getAttribute("data-hash"):"")){const i=t.params.hashNavigation.getSlideIndex(t,e);if(void 0===i||Number.isNaN(i))return;t.slideTo(i)}},r=()=>{if(!a||!t.params.hashNavigation.enabled)return;const e=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex],s=e?e.getAttribute("data-hash")||e.getAttribute("data-history"):"";t.params.hashNavigation.replaceState&&l.history&&l.history.replaceState?(l.history.replaceState(null,null,`#${s}`||""),i("hashSet")):(n.location.hash=s||"",i("hashSet"))};s("init",(()=>{t.params.hashNavigation.enabled&&(()=>{if(!t.params.hashNavigation.enabled||t.params.history&&t.params.history.enabled)return;a=!0;const e=n.location.hash.replace("#","");if(e){const i=0,s=t.params.hashNavigation.getSlideIndex(t,e);t.slideTo(s||0,i,t.params.runCallbacksOnInit,!0)}t.params.hashNavigation.watchState&&l.addEventListener("hashchange",o)})()})),s("destroy",(()=>{t.params.hashNavigation.enabled&&t.params.hashNavigation.watchState&&l.removeEventListener("hashchange",o)})),s("transitionEnd _freeModeNoMomentumRelease",(()=>{a&&r()})),s("slideChange",(()=>{a&&t.params.cssMode&&r()}))},function({swiper:t,extendParams:e,on:i,emit:s,params:a}){let n,l;t.autoplay={running:!1,paused:!1,timeLeft:0},e({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let o,r,c,d,h,p,u,f=a&&a.autoplay?a.autoplay.delay:3e3,m=a&&a.autoplay?a.autoplay.delay:3e3,g=(new Date).getTime();function b(e){t&&!t.destroyed&&t.wrapperEl&&e.target===t.wrapperEl&&(t.wrapperEl.removeEventListener("transitionend",b),u||e.detail&&e.detail.bySwiperTouchMove||M())}const w=()=>{if(t.destroyed||!t.autoplay.running)return;t.autoplay.paused?r=!0:r&&(m=o,r=!1);const e=t.autoplay.paused?o:g+m-(new Date).getTime();t.autoplay.timeLeft=e,s("autoplayTimeLeft",e,e/f),l=requestAnimationFrame((()=>{w()}))},v=()=>{let e=t.params.autoplay.delay;const i=(()=>{let e;if(e=t.virtual&&t.params.virtual.enabled?t.slides.find((t=>t.classList.contains("swiper-slide-active"))):t.slides[t.activeIndex],e)return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();return!Number.isNaN(i)&&i>0&&(e=i),e},y=e=>{if(t.destroyed||!t.autoplay.running)return;cancelAnimationFrame(l),w();let i=e;void 0===i&&(i=v(),f=i,m=i),o=i;const a=t.params.speed,r=()=>{t&&!t.destroyed&&(t.params.autoplay.reverseDirection?!t.isBeginning||t.params.loop||t.params.rewind?(t.slidePrev(a,!0,!0),s("autoplay")):t.params.autoplay.stopOnLastSlide||(t.slideTo(t.slides.length-1,a,!0,!0),s("autoplay")):!t.isEnd||t.params.loop||t.params.rewind?(t.slideNext(a,!0,!0),s("autoplay")):t.params.autoplay.stopOnLastSlide||(t.slideTo(0,a,!0,!0),s("autoplay")),t.params.cssMode&&(g=(new Date).getTime(),requestAnimationFrame((()=>{y()}))))};return i>0?(clearTimeout(n),n=setTimeout((()=>{r()}),i)):requestAnimationFrame((()=>{r()})),i},x=()=>{g=(new Date).getTime(),t.autoplay.running=!0,y(),s("autoplayStart")},_=()=>{t.autoplay.running=!1,clearTimeout(n),cancelAnimationFrame(l),s("autoplayStop")},k=(e,i)=>{if(t.destroyed||!t.autoplay.running)return;clearTimeout(n),e||(p=!0);const a=()=>{s("autoplayPause"),t.params.autoplay.waitForTransition?t.wrapperEl.addEventListener("transitionend",b):M()};t.autoplay.paused=!0,i?a():(o=(o||t.params.autoplay.delay)-((new Date).getTime()-g),t.isEnd&&o<0&&!t.params.loop||(o<0&&(o=0),a()))},M=()=>{t.isEnd&&o<0&&!t.params.loop||t.destroyed||!t.autoplay.running||(g=(new Date).getTime(),p?(p=!1,y(o)):y(),t.autoplay.paused=!1,s("autoplayResume"))},S=()=>{if(t.destroyed||!t.autoplay.running)return;const e=Jt();"hidden"===e.visibilityState&&(p=!0,k(!0)),"visible"===e.visibilityState&&M()},C=e=>{"mouse"===e.pointerType&&(p=!0,u=!0,t.animating||t.autoplay.paused||k(!0))},z=e=>{"mouse"===e.pointerType&&(u=!1,t.autoplay.paused&&M())};i("init",(()=>{t.params.autoplay.enabled&&(t.params.autoplay.pauseOnMouseEnter&&(t.el.addEventListener("pointerenter",C),t.el.addEventListener("pointerleave",z)),Jt().addEventListener("visibilitychange",S),x())})),i("destroy",(()=>{t.el&&"string"!=typeof t.el&&(t.el.removeEventListener("pointerenter",C),t.el.removeEventListener("pointerleave",z)),Jt().removeEventListener("visibilitychange",S),t.autoplay.running&&_()})),i("_freeModeStaticRelease",(()=>{(d||p)&&M()})),i("_freeModeNoMomentumRelease",(()=>{t.params.autoplay.disableOnInteraction?_():k(!0,!0)})),i("beforeTransitionStart",((e,i,s)=>{!t.destroyed&&t.autoplay.running&&(s||!t.params.autoplay.disableOnInteraction?k(!0,!0):_())})),i("sliderFirstMove",(()=>{!t.destroyed&&t.autoplay.running&&(t.params.autoplay.disableOnInteraction?_():(c=!0,d=!1,p=!1,h=setTimeout((()=>{p=!0,d=!0,k(!0)}),200)))})),i("touchEnd",(()=>{if(!t.destroyed&&t.autoplay.running&&c){if(clearTimeout(h),clearTimeout(n),t.params.autoplay.disableOnInteraction)return d=!1,void(c=!1);d&&t.params.cssMode&&M(),d=!1,c=!1}})),i("slideChange",(()=>{!t.destroyed&&t.autoplay.running&&t.autoplay.paused&&(o=v(),f=v())})),Object.assign(t.autoplay,{start:x,stop:_,pause:k,resume:M})},function({swiper:t,extendParams:e,on:i}){e({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let s=!1,a=!1;function n(){const e=t.thumbs.swiper;return!(!e||e.destroyed)&&e.params.virtual&&e.params.virtual.enabled}function l(){const e=t.thumbs.swiper;if(!e||e.destroyed)return;const i=e.clickedIndex,s=e.clickedSlide;if(s&&s.classList.contains(t.params.thumbs.slideThumbActiveClass))return;if(null==i)return;let a;a=e.params.loop?parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10):i,t.params.loop?t.slideToLoop(a):t.slideTo(a)}function o(){const{thumbs:e}=t.params;if(s)return!1;s=!0;const i=t.constructor;if(e.swiper instanceof i){if(e.swiper.destroyed)return s=!1,!1;t.thumbs.swiper=e.swiper,Object.assign(t.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(t.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper.update()}else if(ie(e.swiper)){const s=Object.assign({},e.swiper);Object.assign(s,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper=new i(s),a=!0}return t.thumbs.swiper.el.classList.add(t.params.thumbs.thumbsContainerClass),t.thumbs.swiper.on("tap",l),n()&&t.thumbs.swiper.on("virtualUpdate",(()=>{r(!1,{autoScroll:!1})})),!0}function r(e,i){const s=t.thumbs.swiper;if(!s||s.destroyed)return;let a=1;const l=t.params.thumbs.slideThumbActiveClass;if(t.params.slidesPerView>1&&!t.params.centeredSlides&&(a=t.params.slidesPerView),t.params.thumbs.multipleActiveThumbs||(a=1),a=Math.floor(a),s.slides.forEach((t=>t.classList.remove(l))),s.params.loop||n())for(let e=0;e<a;e+=1)oe(s.slidesEl,`[data-swiper-slide-index="${t.realIndex+e}"]`).forEach((t=>{t.classList.add(l)}));else for(let e=0;e<a;e+=1)s.slides[t.realIndex+e]&&s.slides[t.realIndex+e].classList.add(l);(i?.autoScroll??1)&&function(e){const i=t.thumbs.swiper;if(!i||i.destroyed)return;const s="auto"===i.params.slidesPerView?i.slidesPerViewDynamic():i.params.slidesPerView,a=t.params.thumbs.autoScrollOffset,n=a&&!i.params.loop;if(t.realIndex!==i.realIndex||n){const l=i.activeIndex;let o,r;if(i.params.loop){const e=i.slides.find((e=>e.getAttribute("data-swiper-slide-index")===`${t.realIndex}`));o=i.slides.indexOf(e),r=t.activeIndex>t.previousIndex?"next":"prev"}else o=t.realIndex,r=o>t.previousIndex?"next":"prev";n&&(o+="next"===r?a:-1*a),i.visibleSlidesIndexes&&i.visibleSlidesIndexes.indexOf(o)<0&&(i.params.centeredSlides&&(o=o>l?o-Math.floor(s/2)+1:o+Math.floor(s/2)-1),i.slideTo(o,e))}}(e?0:void 0)}t.thumbs={swiper:null},i("beforeInit",(()=>{const{thumbs:e}=t.params;if(e&&e.swiper)if("string"==typeof e.swiper||e.swiper instanceof HTMLElement){const i=Jt(),s=()=>{const s="string"==typeof e.swiper?i.querySelector(e.swiper):e.swiper;if(s&&s.swiper)e.swiper=s.swiper,o(),r(!0);else if(s){const i=`${t.params.eventsPrefix}init`,a=n=>{e.swiper=n.detail[0],s.removeEventListener(i,a),o(),r(!0),e.swiper.update(),t.update()};s.addEventListener(i,a)}return s},a=()=>{t.destroyed||s()||requestAnimationFrame(a)};requestAnimationFrame(a)}else o(),r(!0)})),i("slideChange update resize observerUpdate",(()=>{r()})),i("setTransition",((e,i)=>{const s=t.thumbs.swiper;s&&!s.destroyed&&s.setTransition(i)})),i("beforeDestroy",(()=>{const e=t.thumbs.swiper;e&&!e.destroyed&&a&&e.destroy()})),Object.assign(t.thumbs,{init:o,update:r})},function({swiper:t,extendParams:e,emit:i,once:s}){e({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}}),Object.assign(t,{freeMode:{onTouchStart:function(){if(t.params.cssMode)return;const e=t.getTranslate();t.setTranslate(e),t.setTransition(0),t.touchEventsData.velocities.length=0,t.freeMode.onTouchEnd({currentPos:t.rtl?t.translate:-t.translate})},onTouchMove:function(){if(t.params.cssMode)return;const{touchEventsData:e,touches:i}=t;0===e.velocities.length&&e.velocities.push({position:i[t.isHorizontal()?"startX":"startY"],time:e.touchStartTime}),e.velocities.push({position:i[t.isHorizontal()?"currentX":"currentY"],time:te()})},onTouchEnd:function({currentPos:e}){if(t.params.cssMode)return;const{params:a,wrapperEl:n,rtlTranslate:l,snapGrid:o,touchEventsData:r}=t,c=te()-r.touchStartTime;if(e<-t.minTranslate())t.slideTo(t.activeIndex);else if(e>-t.maxTranslate())t.slideTo(t.slides.length<o.length?o.length-1:t.slides.length-1);else{if(a.freeMode.momentum){if(r.velocities.length>1){const e=r.velocities.pop(),i=r.velocities.pop(),s=e.time-i.time;t.velocity=(e.position-i.position)/s,t.velocity/=2,Math.abs(t.velocity)<a.freeMode.minimumVelocity&&(t.velocity=0),(s>150||te()-e.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=a.freeMode.momentumVelocityRatio,r.velocities.length=0;let e=1e3*a.freeMode.momentumRatio,c=t.translate+t.velocity*e;l&&(c=-c);let d,h=!1;const p=20*Math.abs(t.velocity)*a.freeMode.momentumBounceRatio;let u;if(c<t.maxTranslate())a.freeMode.momentumBounce?(c+t.maxTranslate()<-p&&(c=t.maxTranslate()-p),d=t.maxTranslate(),h=!0,r.allowMomentumBounce=!0):c=t.maxTranslate(),a.loop&&a.centeredSlides&&(u=!0);else if(c>t.minTranslate())a.freeMode.momentumBounce?(c-t.minTranslate()>p&&(c=t.minTranslate()+p),d=t.minTranslate(),h=!0,r.allowMomentumBounce=!0):c=t.minTranslate(),a.loop&&a.centeredSlides&&(u=!0);else if(a.freeMode.sticky){let e;for(let t=0;t<o.length;t+=1)if(o[t]>-c){e=t;break}c=Math.abs(o[e]-c)<Math.abs(o[e-1]-c)||"next"===t.swipeDirection?o[e]:o[e-1],c=-c}if(u&&s("transitionEnd",(()=>{t.loopFix()})),0!==t.velocity){if(e=l?Math.abs((-c-t.translate)/t.velocity):Math.abs((c-t.translate)/t.velocity),a.freeMode.sticky){const i=Math.abs((l?-c:c)-t.translate),s=t.slidesSizesGrid[t.activeIndex];e=i<s?a.speed:i<2*s?1.5*a.speed:2.5*a.speed}}else if(a.freeMode.sticky)return void t.slideToClosest();a.freeMode.momentumBounce&&h?(t.updateProgress(d),t.setTransition(e),t.setTranslate(c),t.transitionStart(!0,t.swipeDirection),t.animating=!0,fe(n,(()=>{t&&!t.destroyed&&r.allowMomentumBounce&&(i("momentumBounce"),t.setTransition(a.speed),setTimeout((()=>{t.setTranslate(d),fe(n,(()=>{t&&!t.destroyed&&t.transitionEnd()}))}),0))}))):t.velocity?(i("_freeModeNoMomentumRelease"),t.updateProgress(c),t.setTransition(e),t.setTranslate(c),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,fe(n,(()=>{t&&!t.destroyed&&t.transitionEnd()})))):t.updateProgress(c),t.updateActiveIndex(),t.updateSlidesClasses()}else{if(a.freeMode.sticky)return void t.slideToClosest();a.freeMode&&i("_freeModeNoMomentumRelease")}(!a.freeMode.momentum||c>=a.longSwipesMs)&&(i("_freeModeStaticRelease"),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}}}})},function({swiper:t,extendParams:e,on:i}){let s,a,n,l;e({grid:{rows:1,fill:"column"}});const o=()=>{let e=t.params.spaceBetween;return"string"==typeof e&&e.indexOf("%")>=0?e=parseFloat(e.replace("%",""))/100*t.size:"string"==typeof e&&(e=parseFloat(e)),e};i("init",(()=>{l=t.params.grid&&t.params.grid.rows>1})),i("update",(()=>{const{params:e,el:i}=t,s=e.grid&&e.grid.rows>1;l&&!s?(i.classList.remove(`${e.containerModifierClass}grid`,`${e.containerModifierClass}grid-column`),n=1,t.emitContainerClasses()):!l&&s&&(i.classList.add(`${e.containerModifierClass}grid`),"column"===e.grid.fill&&i.classList.add(`${e.containerModifierClass}grid-column`),t.emitContainerClasses()),l=s})),t.grid={initSlides:e=>{const{slidesPerView:i}=t.params,{rows:l,fill:o}=t.params.grid,r=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:e.length;n=Math.floor(r/l),s=Math.floor(r/l)===r/l?r:Math.ceil(r/l)*l,"auto"!==i&&"row"===o&&(s=Math.max(s,i*l)),a=s/l},unsetSlides:()=>{t.slides&&t.slides.forEach((e=>{e.swiperSlideGridSet&&(e.style.height="",e.style[t.getDirectionLabel("margin-top")]="")}))},updateSlide:(e,i,l)=>{const{slidesPerGroup:r}=t.params,c=o(),{rows:d,fill:h}=t.params.grid,p=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:l.length;let u,f,m;if("row"===h&&r>1){const t=Math.floor(e/(r*d)),a=e-d*r*t,n=0===t?r:Math.min(Math.ceil((p-t*d*r)/d),r);m=Math.floor(a/n),f=a-m*n+t*r,u=f+m*s/d,i.style.order=u}else"column"===h?(f=Math.floor(e/d),m=e-f*d,(f>n||f===n&&m===d-1)&&(m+=1,m>=d&&(m=0,f+=1))):(m=Math.floor(e/a),f=e-m*a);i.row=m,i.column=f,i.style.height=`calc((100% - ${(d-1)*c}px) / ${d})`,i.style[t.getDirectionLabel("margin-top")]=0!==m?c&&`${c}px`:"",i.swiperSlideGridSet=!0},updateWrapperSize:(e,i)=>{const{centeredSlides:a,roundLengths:n}=t.params,l=o(),{rows:r}=t.params.grid;if(t.virtualSize=(e+l)*s,t.virtualSize=Math.ceil(t.virtualSize/r)-l,t.params.cssMode||(t.wrapperEl.style[t.getDirectionLabel("width")]=`${t.virtualSize+l}px`),a){const e=[];for(let s=0;s<i.length;s+=1){let a=i[s];n&&(a=Math.floor(a)),i[s]<t.virtualSize+i[0]&&e.push(a)}i.splice(0,i.length),i.push(...e)}}}},function({swiper:t}){Object.assign(t,{appendSlide:ti.bind(t),prependSlide:ei.bind(t),addSlide:ii.bind(t),removeSlide:si.bind(t),removeAllSlides:ai.bind(t)})},function({swiper:t,extendParams:e,on:i}){e({fadeEffect:{crossFade:!1}}),ni({effect:"fade",swiper:t,on:i,setTranslate:()=>{const{slides:e}=t;for(let i=0;i<e.length;i+=1){const e=t.slides[i];let s=-e.swiperSlideOffset;t.params.virtualTranslate||(s-=t.translate);let a=0;t.isHorizontal()||(a=s,s=0);const n=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(e.progress),0):1+Math.min(Math.max(e.progress,-1),0),l=li(0,e);l.style.opacity=n,l.style.transform=`translate3d(${s}px, ${a}px, 0px)`}},setTransition:e=>{const i=t.slides.map((t=>le(t)));i.forEach((t=>{t.style.transitionDuration=`${e}ms`})),oi({swiper:t,duration:e,transformElements:i,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},function({swiper:t,extendParams:e,on:i}){e({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const s=(t,e,i)=>{let s=t.querySelector(i?".swiper-slide-shadow-left":".swiper-slide-shadow-top"),a=t.querySelector(i?".swiper-slide-shadow-right":".swiper-slide-shadow-bottom");s||(s=ce("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(i?"left":"top")).split(" ")),t.append(s)),a||(a=ce("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(i?"right":"bottom")).split(" ")),t.append(a)),s&&(s.style.opacity=Math.max(-e,0)),a&&(a.style.opacity=Math.max(e,0))};ni({effect:"cube",swiper:t,on:i,setTranslate:()=>{const{el:e,wrapperEl:i,slides:a,width:n,height:l,rtlTranslate:o,size:r,browser:c}=t,d=be(t),h=t.params.cubeEffect,p=t.isHorizontal(),u=t.virtual&&t.params.virtual.enabled;let f,m=0;h.shadow&&(p?(f=t.wrapperEl.querySelector(".swiper-cube-shadow"),f||(f=ce("div","swiper-cube-shadow"),t.wrapperEl.append(f)),f.style.height=`${n}px`):(f=e.querySelector(".swiper-cube-shadow"),f||(f=ce("div","swiper-cube-shadow"),e.append(f))));for(let t=0;t<a.length;t+=1){const e=a[t];let i=t;u&&(i=parseInt(e.getAttribute("data-swiper-slide-index"),10));let n=90*i,l=Math.floor(n/360);o&&(n=-n,l=Math.floor(-n/360));const c=Math.max(Math.min(e.progress,1),-1);let f=0,g=0,b=0;i%4==0?(f=4*-l*r,b=0):(i-1)%4==0?(f=0,b=4*-l*r):(i-2)%4==0?(f=r+4*l*r,b=r):(i-3)%4==0&&(f=-r,b=3*r+4*r*l),o&&(f=-f),p||(g=f,f=0);const w=`rotateX(${d(p?0:-n)}deg) rotateY(${d(p?n:0)}deg) translate3d(${f}px, ${g}px, ${b}px)`;c<=1&&c>-1&&(m=90*i+90*c,o&&(m=90*-i-90*c)),e.style.transform=w,h.slideShadows&&s(e,c,p)}if(i.style.transformOrigin=`50% 50% -${r/2}px`,i.style["-webkit-transform-origin"]=`50% 50% -${r/2}px`,h.shadow)if(p)f.style.transform=`translate3d(0px, ${n/2+h.shadowOffset}px, ${-n/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${h.shadowScale})`;else{const t=Math.abs(m)-90*Math.floor(Math.abs(m)/90),e=1.5-(Math.sin(2*t*Math.PI/360)/2+Math.cos(2*t*Math.PI/360)/2),i=h.shadowScale/e;f.style.transform=`scale3d(${h.shadowScale}, 1, ${i}) translate3d(0px, ${l/2+h.shadowOffset}px, ${-l/2/i}px) rotateX(-89.99deg)`}const g=(c.isSafari||c.isWebView)&&c.needPerspectiveFix?-r/2:0;i.style.transform=`translate3d(0px,0,${g}px) rotateX(${d(t.isHorizontal()?0:m)}deg) rotateY(${d(t.isHorizontal()?-m:0)}deg)`,i.style.setProperty("--swiper-cube-translate-z",`${g}px`)},setTransition:e=>{const{el:i,slides:s}=t;if(s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),t.params.cubeEffect.shadow&&!t.isHorizontal()){const t=i.querySelector(".swiper-cube-shadow");t&&(t.style.transitionDuration=`${e}ms`)}},recreateShadows:()=>{const e=t.isHorizontal();t.slides.forEach((t=>{const i=Math.max(Math.min(t.progress,1),-1);s(t,i,e)}))},getEffectParams:()=>t.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})},function({swiper:t,extendParams:e,on:i}){e({flipEffect:{slideShadows:!0,limitRotation:!0}});const s=(e,i)=>{let s=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),a=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");s||(s=ri("flip",e,t.isHorizontal()?"left":"top")),a||(a=ri("flip",e,t.isHorizontal()?"right":"bottom")),s&&(s.style.opacity=Math.max(-i,0)),a&&(a.style.opacity=Math.max(i,0))};ni({effect:"flip",swiper:t,on:i,setTranslate:()=>{const{slides:e,rtlTranslate:i}=t,a=t.params.flipEffect,n=be(t);for(let l=0;l<e.length;l+=1){const o=e[l];let r=o.progress;t.params.flipEffect.limitRotation&&(r=Math.max(Math.min(o.progress,1),-1));const c=o.swiperSlideOffset;let d=-180*r,h=0,p=t.params.cssMode?-c-t.translate:-c,u=0;t.isHorizontal()?i&&(d=-d):(u=p,p=0,h=-d,d=0),o.style.zIndex=-Math.abs(Math.round(r))+e.length,a.slideShadows&&s(o,r);const f=`translate3d(${p}px, ${u}px, 0px) rotateX(${n(h)}deg) rotateY(${n(d)}deg)`;li(0,o).style.transform=f}},setTransition:e=>{const i=t.slides.map((t=>le(t)));i.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oi({swiper:t,duration:e,transformElements:i})},recreateShadows:()=>{t.slides.forEach((e=>{let i=e.progress;t.params.flipEffect.limitRotation&&(i=Math.max(Math.min(e.progress,1),-1)),s(e,i)}))},getEffectParams:()=>t.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},function({swiper:t,extendParams:e,on:i}){e({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),ni({effect:"coverflow",swiper:t,on:i,setTranslate:()=>{const{width:e,height:i,slides:s,slidesSizesGrid:a}=t,n=t.params.coverflowEffect,l=t.isHorizontal(),o=t.translate,r=l?e/2-o:i/2-o,c=l?n.rotate:-n.rotate,d=n.depth,h=be(t);for(let t=0,e=s.length;t<e;t+=1){const e=s[t],i=a[t],o=(r-e.swiperSlideOffset-i/2)/i,p="function"==typeof n.modifier?n.modifier(o):o*n.modifier;let u=l?c*p:0,f=l?0:c*p,m=-d*Math.abs(p),g=n.stretch;"string"==typeof g&&-1!==g.indexOf("%")&&(g=parseFloat(n.stretch)/100*i);let b=l?0:g*p,w=l?g*p:0,v=1-(1-n.scale)*Math.abs(p);Math.abs(w)<.001&&(w=0),Math.abs(b)<.001&&(b=0),Math.abs(m)<.001&&(m=0),Math.abs(u)<.001&&(u=0),Math.abs(f)<.001&&(f=0),Math.abs(v)<.001&&(v=0);const y=`translate3d(${w}px,${b}px,${m}px) rotateX(${h(f)}deg) rotateY(${h(u)}deg) scale(${v})`;if(li(0,e).style.transform=y,e.style.zIndex=1-Math.abs(Math.round(p)),n.slideShadows){let t=e.querySelector(l?".swiper-slide-shadow-left":".swiper-slide-shadow-top"),i=e.querySelector(l?".swiper-slide-shadow-right":".swiper-slide-shadow-bottom");t||(t=ri("coverflow",e,l?"left":"top")),i||(i=ri("coverflow",e,l?"right":"bottom")),t&&(t.style.opacity=p>0?p:0),i&&(i.style.opacity=-p>0?-p:0)}}},setTransition:e=>{t.slides.map((t=>le(t))).forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))}))},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})},function({swiper:t,extendParams:e,on:i}){e({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const s=t=>"string"==typeof t?t:`${t}px`;ni({effect:"creative",swiper:t,on:i,setTranslate:()=>{const{slides:e,wrapperEl:i,slidesSizesGrid:a}=t,n=t.params.creativeEffect,{progressMultiplier:l}=n,o=t.params.centeredSlides,r=be(t);o&&(i.style.transform=`translateX(calc(50% - ${a[0]/2-t.params.slidesOffsetBefore||0}px))`);for(let i=0;i<e.length;i+=1){const a=e[i],c=a.progress,d=Math.min(Math.max(a.progress,-n.limitProgress),n.limitProgress);let h=d;o||(h=Math.min(Math.max(a.originalProgress,-n.limitProgress),n.limitProgress));const p=a.swiperSlideOffset,u=[t.params.cssMode?-p-t.translate:-p,0,0],f=[0,0,0];let m=!1;t.isHorizontal()||(u[1]=u[0],u[0]=0);let g={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};d<0?(g=n.next,m=!0):d>0&&(g=n.prev,m=!0),u.forEach(((t,e)=>{u[e]=`calc(${t}px + (${s(g.translate[e])} * ${Math.abs(d*l)}))`})),f.forEach(((t,e)=>{let i=g.rotate[e]*Math.abs(d*l);f[e]=i})),a.style.zIndex=-Math.abs(Math.round(c))+e.length;const b=u.join(", "),w=`rotateX(${r(f[0])}deg) rotateY(${r(f[1])}deg) rotateZ(${r(f[2])}deg)`,v=h<0?1+(1-g.opacity)*h*l:1-(1-g.opacity)*h*l,y=`translate3d(${b}) ${w} ${h<0?`scale(${1+(1-g.scale)*h*l})`:`scale(${1-(1-g.scale)*h*l})`}`;if(m&&g.shadow||!m){let t=a.querySelector(".swiper-slide-shadow");!t&&g.shadow&&(t=ri("creative",a)),t&&(t.style.opacity=Math.min(Math.max(Math.abs(n.shadowPerProgress?d*(1/n.limitProgress):d),0),1))}const x=li(0,a);x.style.transform=y,x.style.opacity=v,g.origin&&(x.style.transformOrigin=g.origin)}},setTransition:e=>{const i=t.slides.map((t=>le(t)));i.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oi({swiper:t,duration:e,transformElements:i,allSlides:!0})},perspective:()=>t.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})},function({swiper:t,extendParams:e,on:i}){e({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}}),ni({effect:"cards",swiper:t,on:i,setTranslate:()=>{const{slides:e,activeIndex:i,rtlTranslate:s}=t,a=t.params.cardsEffect,{startTranslate:n,isTouched:l}=t.touchEventsData,o=s?-t.translate:t.translate;for(let r=0;r<e.length;r+=1){const c=e[r],d=c.progress,h=Math.min(Math.max(d,-4),4);let p=c.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(p-=e[0].swiperSlideOffset);let u=t.params.cssMode?-p-t.translate:-p,f=0;const m=-100*Math.abs(h);let g=1,b=-a.perSlideRotate*h,w=a.perSlideOffset-.75*Math.abs(h);const v=t.virtual&&t.params.virtual.enabled?t.virtual.from+r:r;if((v===i||v===i-1)&&h>0&&h<1&&(l||t.params.cssMode)&&o<n||(v===i||v===i+1)&&h<0&&h>-1&&(l||t.params.cssMode)&&o>n){const e=(1-Math.abs((Math.abs(h)-.5)/.5))**.5;b+=-28*h*e,g+=-.5*e,w+=96*e,f=(a.rotate||t.isHorizontal()?-25:0)*e*Math.abs(h)+"%"}if(u=h<0?`calc(${u}px ${s?"-":"+"} (${w*Math.abs(h)}%))`:h>0?`calc(${u}px ${s?"-":"+"} (-${w*Math.abs(h)}%))`:`${u}px`,!t.isHorizontal()){const t=f;f=u,u=t}const y=`\n translate3d(${u}, ${f}, ${m}px)\n rotateZ(${a.rotate?s?-b:b:0}deg)\n scale(${h<0?""+(1+(1-g)*h):""+(1-(1-g)*h)})\n `;if(a.slideShadows){let t=c.querySelector(".swiper-slide-shadow");t||(t=ri("cards",c)),t&&(t.style.opacity=Math.min(Math.max((Math.abs(h)-.5)/.5,0),1))}c.style.zIndex=-Math.abs(Math.round(d))+e.length,li(0,c).style.transform=y}},setTransition:e=>{const i=t.slides.map((t=>le(t)));i.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),oi({swiper:t,duration:e,transformElements:i})},perspective:()=>!0,overwriteParams:()=>({_loopSwapReset:!1,watchSlidesProgress:!0,loopAdditionalSlides:t.params.cardsEffect.rotate?3:2,centeredSlides:!0,virtualTranslate:!t.params.cssMode})})}];Ze.use(ci);const di=class{constructor(e){t(this,e),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,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:{spaceBetween:30}}},thumbs:{slidesPerView:1,spaceBetween:30}},this.direction=this.direction||document.documentElement.dir}async sliderInstance(){return this.slider}async slideTo(t,e,i){return this.slider.slideTo(t,e,i)}async slideNext(t,e){this.slider?.slideNext(t,e)}async slidePrev(t,e){this.slider?.slidePrev(t,e)}async slideToLoop(t,e,i){this.slider.slideToLoop(t,e,i)}async slideNextLoop(t,e){this.slider.slideNextLoop(t,e)}async slidePrevLoop(t,e){this.slider.slidePrevLoop(t,e)}async slideReset(t,e){this.slider.slideReset(t,e)}async slideToClosest(t,e){this.slider.slideToClosest(t,e)}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,e,i){return this.thumbsSlider.slideTo(t,e,i)}async getThumbsSlides(){return await(this.thumbsSlider?.slides)}componentWillLoad(){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 e=this.sliderWrapper?.querySelector(`[data-img-id="${t.detail.option_value}"]`)?.getAttribute("data-slid-index");e&&this.slideTo(parseInt(e),300,!1)}}))}getSwiperConfig(){let t=this.autoPlay;t&&"object"!=typeof t&&(t={delay:1e4});let e={loop:this.loop,autoplay:t,centeredSlides:this.centered,slidesPerView:this.slidesPerView,autoHeight:this.autoHeight,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"}}},i={freeMode:!1,watchSlidesProgress:!0,slidesPerView:4,spaceBetween:10,watchOverflow:!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)},e={...e,...this.pre_defined_config[this.type]||{}},"thumbs"==this.type&&this.thumbsSliderWrapper){for(const t of Array.from(this.thumbsSliderWrapper.children))t.nodeType===Node.ELEMENT_NODE&&t.classList.add("swiper-slide");if(this.hasThumbSlot&&this.thumbsConfig)try{i={...i,..."string"==typeof this.thumbsConfig?JSON.parse(this.thumbsConfig):this.thumbsConfig}}catch(t){salla.logger.warn("Failed to parse thumbs slider config:",t)}if(!this.thumbsSliderContainer)return e;this.thumbsSlider=new Ze(this.thumbsSliderContainer,i),e.thumbs={swiper:this.thumbsSlider}}if(e={...e},this.sliderConfig)try{e={...e,..."string"==typeof this.sliderConfig?JSON.parse(this.sliderConfig):this.sliderConfig}}catch(t){salla.logger.warn("Failed to parse slider config:",t)}return e}getThumbsDirection(){const{verticalThumbs:t,windowWidth:e,direction:i}=this;return t&&e<768&&"rtl"===i?"rtl":t&&e>768&&"rtl"===i?"ltr":i}initSlider(){for(const t of Array.from(this.sliderWrapper?.children||[]))t.nodeType===Node.ELEMENT_NODE&&t.classList.add("swiper-slide");this.sliderContainer?(this.slider=new Ze(this.sliderContainer,this.getSwiperConfig()),this.loadLazyBackgrounds(),this.slider.on("slideChange",(()=>this.loadLazyBackgrounds())),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 e=t.activeIndex;t.params.mousewheel.releaseOnEdges=0===e||e===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)))):salla.logger.warn("Slider container not found")}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 ":"",e(i,{key:"671c02110bae2bd18cac37cf07ea33a5f0fbd671",class:"s-slider-wrapper "+t},this.blockTitle||this.showControls?e("div",{class:"s-slider-block__title"},this.blockTitle?e("div",{class:"s-slider-block__title-right"},e("h2",null,this.blockTitle),this.blockSubtitle?e("p",{innerHTML:this.blockSubtitle}):""):"",e("div",{class:"s-slider-block__title-left"},this.displayAllUrl?e("a",{href:this.displayAllUrl,class:"s-slider-block__display-all"},this.displayAllTitle):"",this.showControls?e("div",{class:"s-slider-block__title-nav",dir:"rtl"},e("button",{"aria-label":"Previous Slide",class:"s-slider-prev s-slider-nav-arrow"},e("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?O:A})),e("button",{"aria-label":"Next Slide",class:"s-slider-next s-slider-nav-arrow"},e("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?A:O}))):"")):"",e("div",{key:"75e963b5694e4af9d2cef0e179644c44bee587ef",class:"swiper s-slider-container",ref:t=>this.sliderContainer=t,dir:this.vertical?"ltr":this.direction},e("slot",{key:"01ab750e52328fec9acef587acfa23d0477ef41d"}),e("div",{key:"87790d8f677a5c6ae52c31de07fa53642be096ba",class:"swiper-wrapper s-slider-swiper-wrapper",ref:t=>this.sliderWrapper=t},e("slot",{key:"e14d002dbb228d96b4ce915a2a83f566fce00cf7",name:"items"})),this.pagination?e("div",{class:"swiper-pagination"}):""),"thumbs"==this.type&&this.hasThumbSlot?e("div",{class:"s-slider-thumbs"},e("div",{class:"swiper s-slider-thumbs-container",dir:this.getThumbsDirection(),ref:t=>this.thumbsSliderContainer=t},e("div",{class:{"s-slider-swiper-wrapper swiper-wrapper":!0,"s-slider-grid-thumbs":this.gridThumbs},ref:t=>this.thumbsSliderWrapper=t},e("slot",{name:"thumbs"})),this.showThumbsControls?e("div",{class:"s-slider-thumbs-nav",dir:"rtl"},e("button",{"aria-label":"Previous Slide",class:"s-slider-thumbs-prev s-slider-nav-arrow"},e("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?O:A})),e("button",{"aria-label":"Next Slide",class:"s-slider-thumbs-next s-slider-nav-arrow"},e("span",{class:"s-slider-button-icon",innerHTML:"rtl"==this.direction?A:O}))):null)):null)}loadLazyBackgrounds(){if(!this.slider?.slides)return;const t=this.slider.activeIndex;[t-1,t,t+1].forEach((t=>{const e=this.slider.slides[t];e&&e.querySelectorAll("[data-background]").forEach((t=>{this.loadBackgroundIfVisible(t)}))}))}loadBackgroundIfVisible(t){t.classList.contains("swiper-lazy-loaded")||(this.lazyObserver||(this.lazyObserver=new IntersectionObserver(((t,e)=>{t.forEach((t=>{if(!t.isIntersecting)return;const i=t.target,s=i.getAttribute("data-background");s&&(i.style.backgroundImage=`url('${s}')`,i.classList.add("swiper-lazy-loaded"),i.removeAttribute("data-background")),e.unobserve(i)}))}),{rootMargin:"50px"})),this.lazyObserver.observe(t))}flattenSlotToElements(t,e){const i=t?.querySelector(e);if(!i)return;const s=Array.from(i.children).filter((t=>t.nodeType===Node.ELEMENT_NODE));s.length&&i.replaceWith(...s)}componentDidLoad(){this.flattenSlotToElements(this.sliderWrapper,'div[slot="items"]'),"thumbs"==this.type&&this.hasThumbSlot&&this.flattenSlotToElements(this.thumbsSliderWrapper,'div[slot="thumbs"]'),this.initSlider()}disconnectedCallback(){this.lazyObserver?.disconnect()}get host(){return s(this)}};var hi;di.style="/**\n * Swiper 12.1.0\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * https://swiperjs.com\n *\n * Copyright 2014-2026 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: January 28, 2026\n */\n\n:root {\n --swiper-theme-color: #007aff;\n /*\n --swiper-preloader-color: var(--swiper-theme-color);\n --swiper-wrapper-transition-timing-function: initial;\n */\n}\n:host {\n position: relative;\n display: block;\n margin-left: auto;\n margin-right: auto;\n z-index: 1;\n}\n.swiper {\n margin-left: auto;\n margin-right: auto;\n position: relative;\n overflow: hidden;\n list-style: none;\n padding: 0;\n /* Fix of Webkit flickering */\n z-index: 1;\n display: block;\n}\n.swiper-vertical > .swiper-wrapper {\n flex-direction: column;\n}\n.swiper-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n z-index: 1;\n display: flex;\n transition-property: transform;\n transition-timing-function: var(--swiper-wrapper-transition-timing-function, initial);\n box-sizing: content-box;\n}\n.swiper-android .swiper-slide,\n.swiper-ios .swiper-slide,\n.swiper-wrapper {\n transform: translate3d(0px, 0, 0);\n}\n.swiper-horizontal {\n touch-action: pan-y;\n}\n.swiper-vertical {\n touch-action: pan-x;\n}\n.swiper-slide {\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n position: relative;\n transition-property: transform;\n display: block;\n}\n.swiper-slide-invisible-blank {\n visibility: hidden;\n}\n/* Auto Height */\n.swiper-autoheight,\n.swiper-autoheight .swiper-slide {\n height: auto;\n}\n.swiper-autoheight .swiper-wrapper {\n align-items: flex-start;\n transition-property: transform, height;\n}\n.swiper-backface-hidden .swiper-slide {\n transform: translateZ(0);\n backface-visibility: hidden;\n}\n/* 3D Effects */\n.swiper-3d.swiper-css-mode .swiper-wrapper {\n perspective: 1200px;\n}\n.swiper-3d .swiper-wrapper {\n transform-style: preserve-3d;\n}\n.swiper-3d {\n perspective: 1200px;\n .swiper-slide,\n .swiper-cube-shadow {\n transform-style: preserve-3d;\n }\n}\n\n/* CSS Mode */\n.swiper-css-mode {\n > .swiper-wrapper {\n overflow: auto;\n scrollbar-width: none; /* For Firefox */\n -ms-overflow-style: none; /* For Internet Explorer and Edge */\n &::-webkit-scrollbar {\n display: none;\n }\n }\n > .swiper-wrapper > .swiper-slide {\n scroll-snap-align: start start;\n }\n &.swiper-horizontal {\n > .swiper-wrapper {\n scroll-snap-type: x mandatory;\n }\n > .swiper-wrapper > .swiper-slide:first-child {\n margin-inline-start: var(--swiper-slides-offset-before);\n scroll-margin-inline-start: var(--swiper-slides-offset-before);\n }\n > .swiper-wrapper > .swiper-slide:last-child {\n margin-inline-end: var(--swiper-slides-offset-after);\n }\n }\n &.swiper-vertical {\n > .swiper-wrapper {\n scroll-snap-type: y mandatory;\n }\n > .swiper-wrapper > .swiper-slide:first-child {\n margin-block-start: var(--swiper-slides-offset-before);\n scroll-margin-block-start: var(--swiper-slides-offset-before);\n }\n > .swiper-wrapper > .swiper-slide:last-child {\n margin-block-end: var(--swiper-slides-offset-after);\n }\n }\n &.swiper-free-mode {\n > .swiper-wrapper {\n scroll-snap-type: none;\n }\n > .swiper-wrapper > .swiper-slide {\n scroll-snap-align: none;\n }\n }\n &.swiper-centered {\n > .swiper-wrapper::before {\n content: '';\n flex-shrink: 0;\n order: 9999;\n }\n > .swiper-wrapper > .swiper-slide {\n scroll-snap-align: center center;\n scroll-snap-stop: always;\n }\n }\n &.swiper-centered.swiper-horizontal {\n > .swiper-wrapper > .swiper-slide:first-child {\n margin-inline-start: var(--swiper-centered-offset-before);\n }\n > .swiper-wrapper::before {\n height: 100%;\n min-height: 1px;\n width: var(--swiper-centered-offset-after);\n }\n }\n &.swiper-centered.swiper-vertical {\n > .swiper-wrapper > .swiper-slide:first-child {\n margin-block-start: var(--swiper-centered-offset-before);\n }\n > .swiper-wrapper::before {\n width: 100%;\n min-width: 1px;\n height: var(--swiper-centered-offset-after);\n }\n }\n}\n\n/* Slide styles start */\n/* 3D Shadows */\n.swiper-3d {\n .swiper-slide-shadow,\n .swiper-slide-shadow-left,\n .swiper-slide-shadow-right,\n .swiper-slide-shadow-top,\n .swiper-slide-shadow-bottom,\n .swiper-slide-shadow,\n .swiper-slide-shadow-left,\n .swiper-slide-shadow-right,\n .swiper-slide-shadow-top,\n .swiper-slide-shadow-bottom {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n z-index: 10;\n }\n .swiper-slide-shadow {\n background: rgba(0, 0, 0, 0.15);\n }\n .swiper-slide-shadow-left {\n background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n }\n .swiper-slide-shadow-right {\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n }\n .swiper-slide-shadow-top {\n background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n }\n .swiper-slide-shadow-bottom {\n background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n }\n}\n.swiper-lazy-preloader {\n width: 42px;\n height: 42px;\n position: absolute;\n left: 50%;\n top: 50%;\n margin-left: -21px;\n margin-top: -21px;\n z-index: 10;\n transform-origin: 50%;\n box-sizing: border-box;\n border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));\n border-radius: 50%;\n border-top-color: transparent;\n}\n.swiper:not(.swiper-watch-progress),\n.swiper-watch-progress .swiper-slide-visible {\n .swiper-lazy-preloader {\n animation: swiper-preloader-spin 1s infinite linear;\n }\n}\n.swiper-lazy-preloader-white {\n --swiper-preloader-color: #fff;\n}\n.swiper-lazy-preloader-black {\n --swiper-preloader-color: #000;\n}\n@keyframes swiper-preloader-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n/* Slide styles end */\n\n.swiper-virtual .swiper-slide {\n -webkit-backface-visibility: hidden;\n transform: translateZ(0);\n}\n.swiper-virtual.swiper-css-mode {\n .swiper-wrapper::after {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n pointer-events: none;\n }\n}\n.swiper-virtual.swiper-css-mode.swiper-horizontal {\n .swiper-wrapper::after {\n height: 1px;\n width: var(--swiper-virtual-size);\n }\n}\n\n.swiper-virtual.swiper-css-mode.swiper-vertical {\n .swiper-wrapper::after {\n width: 1px;\n height: var(--swiper-virtual-size);\n }\n}\n\n\n\n:root {\n --swiper-navigation-size: 44px;\n /*\n --swiper-navigation-top-offset: 50%;\n --swiper-navigation-sides-offset: 4px;\n --swiper-navigation-color: var(--swiper-theme-color);\n */\n}\n.swiper-button-prev,\n.swiper-button-next {\n position: absolute;\n\n width: var(--swiper-navigation-size);\n height: var(--swiper-navigation-size);\n\n z-index: 10;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--swiper-navigation-color, var(--swiper-theme-color));\n &.swiper-button-disabled {\n opacity: 0.35;\n cursor: auto;\n pointer-events: none;\n }\n &.swiper-button-hidden {\n opacity: 0;\n cursor: auto;\n pointer-events: none;\n }\n .swiper-navigation-disabled & {\n display: none !important;\n }\n svg {\n width: 100%;\n height: 100%;\n object-fit: contain;\n transform-origin: center;\n fill: currentColor;\n pointer-events: none;\n }\n}\n\n.swiper-button-lock {\n display: none;\n}\n\n.swiper-button-prev,\n.swiper-button-next {\n top: var(--swiper-navigation-top-offset, 50%);\n margin-top: calc(0px - (var(--swiper-navigation-size) / 2));\n}\n.swiper-button-prev {\n left: var(--swiper-navigation-sides-offset, 4px);\n right: auto;\n .swiper-navigation-icon {\n transform: rotate(180deg);\n }\n}\n.swiper-button-next {\n right: var(--swiper-navigation-sides-offset, 4px);\n left: auto;\n}\n.swiper-horizontal {\n .swiper-button-prev,\n .swiper-button-next,\n ~ .swiper-button-prev,\n ~ .swiper-button-next {\n top: var(--swiper-navigation-top-offset, 50%);\n margin-top: calc(0px - (var(--swiper-navigation-size) / 2));\n margin-left: 0;\n }\n .swiper-button-prev,\n & ~ .swiper-button-prev,\n &.swiper-rtl .swiper-button-next,\n &.swiper-rtl ~ .swiper-button-next {\n left: var(--swiper-navigation-sides-offset, 4px);\n right: auto;\n }\n .swiper-button-next,\n & ~ .swiper-button-next,\n &.swiper-rtl .swiper-button-prev,\n &.swiper-rtl ~ .swiper-button-prev {\n right: var(--swiper-navigation-sides-offset, 4px);\n left: auto;\n }\n .swiper-button-prev,\n & ~ .swiper-button-prev,\n &.swiper-rtl .swiper-button-next,\n &.swiper-rtl ~ .swiper-button-next {\n .swiper-navigation-icon {\n transform: rotate(180deg);\n }\n }\n &.swiper-rtl .swiper-button-prev,\n &.swiper-rtl ~ .swiper-button-prev {\n .swiper-navigation-icon {\n transform: rotate(0deg);\n }\n }\n}\n.swiper-vertical {\n .swiper-button-prev,\n .swiper-button-next,\n ~ .swiper-button-prev,\n ~ .swiper-button-next {\n left: var(--swiper-navigation-top-offset, 50%);\n right: auto;\n margin-left: calc(0px - (var(--swiper-navigation-size) / 2));\n margin-top: 0;\n }\n .swiper-button-prev,\n ~ .swiper-button-prev {\n top: var(--swiper-navigation-sides-offset, 4px);\n bottom: auto;\n .swiper-navigation-icon {\n transform: rotate(-90deg);\n }\n }\n .swiper-button-next,\n ~ .swiper-button-next {\n bottom: var(--swiper-navigation-sides-offset, 4px);\n top: auto;\n .swiper-navigation-icon {\n transform: rotate(90deg);\n }\n }\n}\n\n:root {\n /*\n --swiper-pagination-color: var(--swiper-theme-color);\n --swiper-pagination-left: auto;\n --swiper-pagination-right: 8px;\n --swiper-pagination-bottom: 8px;\n --swiper-pagination-top: auto;\n --swiper-pagination-fraction-color: inherit;\n --swiper-pagination-progressbar-bg-color: rgba(0,0,0,0.25);\n --swiper-pagination-progressbar-size: 4px;\n --swiper-pagination-bullet-size: 8px;\n --swiper-pagination-bullet-width: 8px;\n --swiper-pagination-bullet-height: 8px;\n --swiper-pagination-bullet-border-radius: 50%;\n --swiper-pagination-bullet-inactive-color: #000;\n --swiper-pagination-bullet-inactive-opacity: 0.2;\n --swiper-pagination-bullet-opacity: 1;\n --swiper-pagination-bullet-horizontal-gap: 4px;\n --swiper-pagination-bullet-vertical-gap: 6px;\n */\n}\n.swiper-pagination {\n position: absolute;\n text-align: center;\n transition: 300ms opacity;\n transform: translate3d(0, 0, 0);\n z-index: 10;\n &.swiper-pagination-hidden {\n opacity: 0;\n }\n .swiper-pagination-disabled > &,\n &.swiper-pagination-disabled {\n display: none !important;\n }\n}\n/* Common Styles */\n.swiper-pagination-fraction,\n.swiper-pagination-custom,\n.swiper-horizontal > .swiper-pagination-bullets,\n.swiper-pagination-bullets.swiper-pagination-horizontal {\n bottom: var(--swiper-pagination-bottom, 8px);\n top: var(--swiper-pagination-top, auto);\n left: 0;\n width: 100%;\n}\n/* Bullets */\n.swiper-pagination-bullets-dynamic {\n overflow: hidden;\n font-size: 0;\n .swiper-pagination-bullet {\n transform: scale(0.33);\n position: relative;\n }\n .swiper-pagination-bullet-active {\n transform: scale(1);\n }\n .swiper-pagination-bullet-active-main {\n transform: scale(1);\n }\n .swiper-pagination-bullet-active-prev {\n transform: scale(0.66);\n }\n .swiper-pagination-bullet-active-prev-prev {\n transform: scale(0.33);\n }\n .swiper-pagination-bullet-active-next {\n transform: scale(0.66);\n }\n .swiper-pagination-bullet-active-next-next {\n transform: scale(0.33);\n }\n}\n.swiper-pagination-bullet {\n width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));\n height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));\n display: inline-block;\n border-radius: var(--swiper-pagination-bullet-border-radius, 50%);\n background: var(--swiper-pagination-bullet-inactive-color, #000);\n opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2);\n button& {\n border: none;\n margin: 0;\n padding: 0;\n box-shadow: none;\n appearance: none;\n }\n .swiper-pagination-clickable & {\n cursor: pointer;\n }\n\n &:only-child {\n display: none !important;\n }\n}\n.swiper-pagination-bullet-active {\n opacity: var(--swiper-pagination-bullet-opacity, 1);\n background: var(--swiper-pagination-color, var(--swiper-theme-color));\n}\n\n.swiper-vertical > .swiper-pagination-bullets,\n.swiper-pagination-vertical.swiper-pagination-bullets {\n right: var(--swiper-pagination-right, 8px);\n left: var(--swiper-pagination-left, auto);\n top: 50%;\n transform: translate3d(0px, -50%, 0);\n .swiper-pagination-bullet {\n margin: var(--swiper-pagination-bullet-vertical-gap, 6px) 0;\n display: block;\n }\n &.swiper-pagination-bullets-dynamic {\n top: 50%;\n transform: translateY(-50%);\n width: 8px;\n .swiper-pagination-bullet {\n display: inline-block;\n transition:\n 200ms transform,\n 200ms top;\n }\n }\n}\n.swiper-horizontal > .swiper-pagination-bullets,\n.swiper-pagination-horizontal.swiper-pagination-bullets {\n .swiper-pagination-bullet {\n margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);\n }\n &.swiper-pagination-bullets-dynamic {\n left: 50%;\n transform: translateX(-50%);\n white-space: nowrap;\n .swiper-pagination-bullet {\n transition:\n 200ms transform,\n 200ms left;\n }\n }\n}\n.swiper-horizontal.swiper-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet {\n transition:\n 200ms transform,\n 200ms right;\n}\n/* Fraction */\n.swiper-pagination-fraction {\n color: var(--swiper-pagination-fraction-color, inherit);\n}\n/* Progress */\n.swiper-pagination-progressbar {\n background: var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, 0.25));\n position: absolute;\n .swiper-pagination-progressbar-fill {\n background: var(--swiper-pagination-color, var(--swiper-theme-color));\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n transform: scale(0);\n transform-origin: left top;\n }\n .swiper-rtl & .swiper-pagination-progressbar-fill {\n transform-origin: right top;\n }\n .swiper-horizontal > &,\n &.swiper-pagination-horizontal,\n .swiper-vertical > &.swiper-pagination-progressbar-opposite,\n &.swiper-pagination-vertical.swiper-pagination-progressbar-opposite {\n width: 100%;\n height: var(--swiper-pagination-progressbar-size, 4px);\n left: 0;\n top: 0;\n }\n .swiper-vertical > &,\n &.swiper-pagination-vertical,\n .swiper-horizontal > &.swiper-pagination-progressbar-opposite,\n &.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite {\n width: var(--swiper-pagination-progressbar-size, 4px);\n height: 100%;\n left: 0;\n top: 0;\n }\n}\n.swiper-pagination-lock {\n display: none;\n}\n\n:root {\n /*\n --swiper-scrollbar-border-radius: 10px;\n --swiper-scrollbar-top: auto;\n --swiper-scrollbar-bottom: 4px;\n --swiper-scrollbar-left: auto;\n --swiper-scrollbar-right: 4px;\n --swiper-scrollbar-sides-offset: 1%;\n --swiper-scrollbar-bg-color: rgba(0, 0, 0, 0.1);\n --swiper-scrollbar-drag-bg-color: rgba(0, 0, 0, 0.5);\n --swiper-scrollbar-size: 4px;\n */\n}\n.swiper-scrollbar {\n border-radius: var(--swiper-scrollbar-border-radius, 10px);\n position: relative;\n touch-action: none;\n background: var(--swiper-scrollbar-bg-color, rgba(0, 0, 0, 0.1));\n .swiper-scrollbar-disabled > &,\n &.swiper-scrollbar-disabled {\n display: none !important;\n }\n .swiper-horizontal > &,\n &.swiper-scrollbar-horizontal {\n position: absolute;\n left: var(--swiper-scrollbar-sides-offset, 1%);\n bottom: var(--swiper-scrollbar-bottom, 4px);\n top: var(--swiper-scrollbar-top, auto);\n z-index: 50;\n height: var(--swiper-scrollbar-size, 4px);\n width: calc(100% - 2 * var(--swiper-scrollbar-sides-offset, 1%));\n }\n .swiper-vertical > &,\n &.swiper-scrollbar-vertical {\n position: absolute;\n left: var(--swiper-scrollbar-left, auto);\n right: var(--swiper-scrollbar-right, 4px);\n top: var(--swiper-scrollbar-sides-offset, 1%);\n z-index: 50;\n width: var(--swiper-scrollbar-size, 4px);\n height: calc(100% - 2 * var(--swiper-scrollbar-sides-offset, 1%));\n }\n}\n.swiper-scrollbar-drag {\n height: 100%;\n width: 100%;\n position: relative;\n background: var(--swiper-scrollbar-drag-bg-color, rgba(0, 0, 0, 0.5));\n border-radius: var(--swiper-scrollbar-border-radius, 10px);\n left: 0;\n top: 0;\n}\n.swiper-scrollbar-cursor-drag {\n cursor: move;\n}\n.swiper-scrollbar-lock {\n display: none;\n}\n\n\n/* Zoom container styles start */\n.swiper-zoom-container {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n > img,\n > svg,\n > canvas {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n}\n/* Zoom container styles end */\n\n.swiper-slide-zoomed {\n cursor: move;\n touch-action: none;\n}\n\n\n/* a11y */\n.swiper .swiper-notification {\n position: absolute;\n left: 0;\n top: 0;\n pointer-events: none;\n opacity: 0;\n z-index: -1000;\n}\n\n\n\n\n.swiper-thumbs {\n .swiper-slide-thumb-active {\n /* Styles for active thumb slide */\n }\n}\n\n.swiper-free-mode > .swiper-wrapper {\n transition-timing-function: ease-out;\n margin: 0 auto;\n}\n\n.swiper-grid > .swiper-wrapper {\n flex-wrap: wrap;\n}\n.swiper-grid-column > .swiper-wrapper {\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n\n.swiper-fade {\n &.swiper-free-mode {\n .swiper-slide {\n transition-timing-function: ease-out;\n }\n }\n .swiper-slide {\n pointer-events: none;\n transition-property: opacity;\n .swiper-slide {\n pointer-events: none;\n }\n }\n .swiper-slide-active {\n pointer-events: auto;\n & .swiper-slide-active {\n pointer-events: auto;\n }\n }\n}\n\n.swiper.swiper-cube {\n overflow: visible;\n}\n.swiper-cube {\n .swiper-slide {\n pointer-events: none;\n backface-visibility: hidden;\n z-index: 1;\n visibility: hidden;\n transform-origin: 0 0;\n width: 100%;\n height: 100%;\n .swiper-slide {\n pointer-events: none;\n }\n }\n &.swiper-rtl .swiper-slide {\n transform-origin: 100% 0;\n }\n .swiper-slide-active {\n &,\n & .swiper-slide-active {\n pointer-events: auto;\n }\n }\n .swiper-slide-active,\n .swiper-slide-next,\n .swiper-slide-prev {\n pointer-events: auto;\n visibility: visible;\n }\n\n .swiper-cube-shadow {\n position: absolute;\n left: 0;\n bottom: 0px;\n width: 100%;\n height: 100%;\n opacity: 0.6;\n z-index: 0;\n\n &:before {\n content: '';\n background: #000;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n filter: blur(50px);\n }\n }\n}\n.swiper-cube {\n .swiper-slide-next + .swiper-slide {\n pointer-events: auto;\n visibility: visible;\n }\n}\n/* Cube slide shadows start */\n.swiper-cube {\n .swiper-slide-shadow-cube.swiper-slide-shadow-top,\n .swiper-slide-shadow-cube.swiper-slide-shadow-bottom,\n .swiper-slide-shadow-cube.swiper-slide-shadow-left,\n .swiper-slide-shadow-cube.swiper-slide-shadow-right {\n z-index: 0;\n backface-visibility: hidden;\n }\n}\n/* Cube slide shadows end */\n\n.swiper.swiper-flip {\n overflow: visible;\n}\n.swiper-flip {\n .swiper-slide {\n pointer-events: none;\n backface-visibility: hidden;\n z-index: 1;\n .swiper-slide {\n pointer-events: none;\n }\n }\n .swiper-slide-active {\n &,\n & .swiper-slide-active {\n pointer-events: auto;\n }\n }\n}\n/* Flip slide shadows start */\n.swiper-flip {\n .swiper-slide-shadow-flip.swiper-slide-shadow-top,\n .swiper-slide-shadow-flip.swiper-slide-shadow-bottom,\n .swiper-slide-shadow-flip.swiper-slide-shadow-left,\n .swiper-slide-shadow-flip.swiper-slide-shadow-right {\n z-index: 0;\n backface-visibility: hidden;\n }\n}\n/* Flip slide shadows end */\n\n.swiper-coverflow {\n}\n\n.swiper-creative {\n .swiper-slide {\n backface-visibility: hidden;\n overflow: hidden;\n transition-property: transform, opacity, height;\n }\n}\n\n.swiper.swiper-cards {\n overflow: visible;\n}\n.swiper-cards {\n .swiper-slide {\n transform-origin: center bottom;\n backface-visibility: hidden;\n overflow: hidden;\n }\n}\n\n.swiper {\n overflow: clip;\n}",function(t){t.FACEBOOK="facebook",t.TWITTER="twitter",t.WHATSAPP="whatsapp",t.EMAIL="email",t.COPY_LINK="copy_link"}(hi||(hi={}));const pi=class{constructor(e){t(this,e),this.opened=!1,this.allPlatforms=[hi.WHATSAPP,hi.FACEBOOK,hi.TWITTER,hi.EMAIL,hi.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:hi.WHATSAPP},{icon:w,name:hi.FACEBOOK},{icon:v,name:hi.TWITTER},{icon:g,name:hi.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:hi.COPY_LINK}],this.convertedPlatforms=[],this.url="",this.urlName="",this.platforms="facebook,twitter,whatsapp,email,copy_link"}componentWillLoad(){if(this.host.hasAttribute("aria-label")&&this.host.removeAttribute("aria-label"),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 e={share_via:t.service.toLowerCase(),url:t.url,title:t.title};salla.event.emit("share-element",e)}})},document.body.appendChild(t)}async open(){const t=(new o.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:o.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 e("div",{key:"c4ac8faea4a8ec8aa5ba9f4e744710d508387d78",class:"s-social-share-wrapper"},e("slot",{key:"6c6b54513f67be8818a9a042570286d09b7115f8",name:"widget"},e("salla-button",{key:"8a57650940dad634cf3576dada4cc35687ed447c","aria-label":"Share",onClick:()=>this.open(),class:"s-social-share-btn",shape:"icon",fill:"outline",color:"light"},e("span",{key:"207f2fb0e2f89e7057775153ffcc68eebb069824",innerHTML:this.opened?U:'\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'}))),e("ul",{key:"fd9b25a483a93efa10994c2a7a876b6741d976c2",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=>e("li",null,e("a",{class:`a2a_button_${t}`,"aria-label":`Share Via ${t}`},this.platformIcons.map((i=>{if(i.name===t)return e("span",{class:"s-social-share-icon",innerHTML:i.icon})}))))))))}get host(){return s(this)}};pi.style="";const ui=class{constructor(e){t(this,e),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 e("div",{key:"6b11ec3a839c759e64e1766de55f9ac1be18931e",class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},e("slot",{key:"17300d7a52e068428ea956b2c5d5be6d0ab69fca"}))}};ui.style="";const fi=class{constructor(e){t(this,e),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[e("div",{key:"08c51c1ad15c6b0efbeb165c89fc7d73748467d0",class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},e("slot",{key:"ba5045dab7c254eb4533dc64630ab0c1f561701b"}))]}};fi.style="";const mi=class{constructor(e){t(this,e),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[t]=this.tabGroup;this.selectGroup(t)}))}onSelectedTab(t){const e=this.tabGroup.find((e=>e.header.id===t.detail.id));this.selectGroup(e)}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 e=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(e.map((async t=>await t.getChild()))),this.tabGroup=this.tabsHeader.map((t=>{const e=this.tabsContent.find((e=>e.name===t.name));return{header:t,content:e}}))}selectGroup(t){this.tabGroup.map((t=>{t.header.unselect(),t.content.unselect()})),t.header.selected(),t.content.selected()}render(){return[e("div",{key:"3195e8954179d52867093b5e861b3c0caa6d7af6",class:"s-tabs"},e("div",{key:"cf75a77b6cc9b9cd288e963ee56acf19e177029a",class:"s-tabs-header"},e("slot",{key:"fa345597be2fbb8ff4f1cb420a030c5ec821bc8b",name:"header"})),e("div",{key:"f7fd939608e5341b6d9c1d75e7d9dc909a4d8912",class:"s-tabs-content-wrapper"},e("slot",{key:"86ce2c9bcb3be06264e75369a6be81b2e1361619",name:"content"})))]}get host(){return s(this)}};mi.style=".s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}";const gi=class{async loadTelInput(){if(!this.TelInput)try{const t=await import("./p-D1_qMmD0.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(e){t(this,e),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 e(i,{key:"362e48d1b39b0715c10df0c15c730ca21793a46b",class:"s-tel-input"},e("input",{key:"07dcb2fcf639c2d7b95c250079bd24a80441e0ca",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"}),e("span",{key:"c50f81a50debf37dc92f81fc61c3ddd3e622031f",class:"s-tel-input-error-msg",ref:t=>this.errorMsg=t}),e("input",{key:"2217131b313a32c5b62dcce6132a4914f30dc005",type:"hidden",name:"country_code",value:this.countryCode,ref:t=>this.countryCodeInput=t,class:"country_code"}))}componentDidLoad(){this.initTelInput()}get host(){return s(this)}};gi.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 bi='\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 wi=class{constructor(e){t(this,e),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:vt,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:C,wishlist:Dt,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:y,profile:bi},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")})),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(),Salla.event.on("api::token.injected",(t=>this.profileUrl=this.buildProfileUrl(t))),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.items=this.sallaAccountEnabled?{...this.items,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'}:this.items,this.host.hasAttribute("with-rating")&&(this.items.rating=at),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';let t=Salla.storage.get("token");t||(t=""),this.profileUrl=this.buildProfileUrl(t);const e=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>',e&&(this.triggerSlot=e.innerHTML,e.innerHTML=this.replaceParams(e.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,e){"logout"===e&&(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,r)}getTheHeader(){return e("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,i],s){if(("wallet"!==t||window.can_access_wallet)&&("loyalty_program"!==t||Salla.config.get("store.features").includes("loyalty-system")))return e("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":s+1===Object.entries(this.items).length}},e("a",{...this.getItemAnchorLinkAttrs(t),class:"s-user-menu-dropdown-item-link",onClick:e=>this.menuItemClicked(e,t)},e("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:i}),e("span",{class:"s-user-menu-dropdown-item-title"},this[t]),["٠","0",void 0].includes(this.badges[t])?"":e("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[t])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return e(i,null,this.is_loggedIn?this.inline?e("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((t,e)=>this.getMenuItem(t,e)))):e("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),e("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},e("div",{class:"s-user-menu-dropdown",onClick:t=>t.stopPropagation(),onKeyUp:t=>t.stopPropagation()},this.showHeader?e("div",{class:"s-user-menu-dropdown-header"},e("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),e("div",{class:"s-user-menu-dropdown-header-content"},e("span",null,this.hello),e("p",null,this.first_name," ",this.last_name)),e("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:U,onClick:()=>{this.opened=!1}})):"",e("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((t,e)=>this.getMenuItem(t,e))))))):e("slot",{name:"login-btn"},e("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:bi})))}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}buildProfileUrl(t){return`${Salla.config.get("account.url","https://accounts.salla.com")}/${salla.config.get("user.language_code")}/user?store=${Salla.config.get("store.id")}&info=${encodeURIComponent(t)}`}get host(){return s(this)}};wi.style="";const vi=class{constructor(e){t(this,e),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,e,i=!1){e.target.value?(this.userData[t]=e.target.value,this.disableAction=!1):i&&(this.disableAction=!0)}handleEmailInput(t,e){const i=document.getElementById("email-error"),s=e.target.value;if(!s)return this.disableAction=!0,void(i.textContent=this.email_required_trans);/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(s)||(this.disableAction=!0,i.textContent=this.invalid_email_trans),i.textContent="",this.userData[t]=s,this.disableAction=!1}submitForm(t){t.preventDefault(),this.disableAction=!0;const e=Object.assign({},this.userData);e.phone=void 0,e.phone=this.userData.phone.number,e.country_code=this.userData.phone.country,salla.api.profile.update(e).finally((()=>{this.disableAction=!1}))}getBirthDateRestriction(){const t=new Date,e=t.getFullYear()-this.minAge;return t.setFullYear(e),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 e("div",{class:"s-user-profile-skeleton-wrapper"},Array.from({length:6},((t,i)=>e("salla-skeleton",{class:"skeleton-item",width:"100%",height:"50px",key:i}))))}componentWillLoad(){Salla.onReady().then((()=>this.fetchData()))}render(){return this.isLoading?this.renderLoadingSection():e("form",{onSubmit:t=>this.submitForm(t)},e("div",{class:"s-user-profile-wrapper"},e("div",{class:"s-user-profile-field"},e("label",{htmlFor:"first-name",class:"s-user-profile-field-label"},this.first_name_trans),e("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)})),e("div",{class:"s-user-profile-field"},e("label",{htmlFor:"last-name",class:"s-user-profile-field-label"},this.last_name_trans),e("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)})),e("div",{class:"s-user-profile-field"},e("label",{htmlFor:"birthday",class:"s-user-profile-field-label"},this.birthday_trans),e("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)})),e("div",{class:"s-user-profile-field"},e("label",{htmlFor:"gender",class:"s-user-profile-field-label"},this.gender_trans),e("select",{disabled:!this.isEditable,class:"form-input",name:"gender",required:!0,onChange:t=>this.handleFieldChange("gender",t)},e("option",{value:""},this.gender_placeholder_trans),e("option",{value:f.Male,selected:this.userData.gender===f.Male},this.male_trans),e("option",{value:f.Female,selected:this.userData.gender===f.Female},this.female_trans))),e("div",{class:"s-user-profile-field"},e("label",{htmlFor:"email",class:"s-user-profile-field-label"},this.email_trans),e("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)}),e("p",{id:"email-error",class:"s-user-profile-field-error"})),e("div",{class:"s-user-profile-field"},e("label",{htmlFor:"international-mobile",class:"s-user-profile-field-label"},this.mobile_trans),e("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)}))),e("salla-button",{type:"submit",loading:this.disableAction,disabled:this.disableAction||!this.isEditable,"loader-position":"end",class:"s-user-profile-submit"},this.save_btn_trans))}};vi.style=":host{display:block}";var yi='\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 xi=class{constructor(e){t(this,e),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,e){salla.profile.updateSettings({name:t,value:e.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 e(i,{key:"e47b5c39666443b29de9d54ec8f05cb97950ace1",class:"s-user-settings-wrapper"},this.canHideName&&e("div",{key:"54b3098aa736c43d6d3ef53f6a49710dc039a16d",class:"s-user-settings-section"},e("salla-list-tile",{key:"dd1d06cd2ad3e0696c76cfd3f4c8b342e774b679"},e("div",{key:"2e8b8fb48d36ce6f183698cb60a856ee0b74c639",slot:"icon",class:"s-user-settings-section-icon"},e("span",{key:"0f7158ae21c5a93c5458c38388c79fb7cfa1e88d",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'})),e("div",{key:"f3f648e8f55f5998362107654d3a3c438bec2999",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),e("div",{key:"eddfaf2a9faf242123db36f1aa5a87fc242f6ccc",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),e("div",{key:"1112ebcb125325688758d57de115ed36d965752d",slot:"action",class:"s-user-settings-section-action"},e("label",{key:"4bacd7e71a3f9ccef749d091d70be45b0184d195",class:"s-toggle"},e("input",{key:"64db5795f938f72a5c0710c03c46f84bb0248b68",class:"s-toggle-input",checked:this.isHiddenName,onChange:t=>this.toggleSetting("is_hidden_name",t),type:"checkbox"}),e("div",{key:"b1e178372d37f63992ba81ee6d5645fb17f5ce33",class:"s-toggle-switcher"}))))),e("div",{key:"a11d585e1b5fe0430ca00757394e5c9a085192f9",class:"s-user-settings-section"},e("salla-list-tile",{key:"61ad291644bc8314b443eec5d3a32abccc9c46ba"},e("div",{key:"e54526b5f18ce365d68efb9292af2d67ae20b77b",slot:"icon",class:"s-user-settings-section-icon"},e("span",{key:"e2bb0f2b30ac57d6336785485ef99279acf09617",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'})),e("div",{key:"2f6ec0835993e79b1923778bfe0d6442d71809f0",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),e("div",{key:"6ad65576302c12e2298abd3de70fd5edd54aa542",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),e("div",{key:"05f00c6ed5511bd6a21b3e01a54a01549c758940",slot:"action",class:"s-user-settings-section-action"},e("label",{key:"5c3520e04e57205dfe2e7f441e45c46682a56ad4",class:"s-toggle"},e("input",{key:"8f7f59433b3685acbc0d35c6ceca93a9a6a4ebbf",class:"s-toggle-input",checked:this.isNotifiable,onChange:t=>this.toggleSetting("is_notifiable",t),type:"checkbox"}),e("div",{key:"a92abe23b596360bfb3e516ffb0789b53abaabd0",class:"s-toggle-switcher"}))))),e("div",{key:"0996cc090ab85a67e763b5acd19cc87db11c090d",class:"s-user-settings-section s-user-settings-section-deactivate-user"},e("salla-list-tile",{key:"f6b43aa4a618d75981fed8844ed1f4ebc3947239"},e("div",{key:"3027e7c901c1ec214a9effdbd36e1c25d96cdb75",slot:"icon",class:"s-user-settings-section-icon"},e("span",{key:"11468d7a54fa406e697e07b2ff2fe5c945a28746",innerHTML:yi})),e("div",{key:"c2fd73f5d313daaba740c89ad2654144f6f54bb1",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),e("div",{key:"e2bad2737f3ca8e30bbb375ad7691d607366551c",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),e("div",{key:"df155e019df0514ed77faaeef107845ce144ca08",slot:"action",class:"s-user-settings-section-action"},e("salla-button",{key:"e7bd07fcbc49ba9e991adf52854b35c9ca8d0344",fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),e("salla-modal",{key:"730df3b04afb89a1eba96651899cf84818d49b6b",width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:t=>this.confirmationModal=t},e("span",{key:"5254b44fac993e1e1454da4eae346afc5ad7211c",slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:yi}),e("div",{key:"9c07be490266024dee72ca4a244c8dd4ffdd9d71",class:"s-user-settings-confirmation"},e("div",{key:"d42ac2fa9cc0030778b444b21958992677667cc3",class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),e("div",{key:"b3cd6b31255244c469571beaf05a0f266eb431af",class:"s-user-settings-confirmation-actions"},e("salla-button",{key:"aadfefcd7e2561542adb10c416bac0ff14b25fef",width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),e("salla-button",{key:"12693adf31b54a4ca993632fb527dac91ec810b2",fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.deleteAccount()},this.capitalizeText(this.deactivateAccount))))))}};xi.style="";export{x as salla_accordion,_ as salla_accordion_body,S as salla_accordion_head,z as salla_add_product_button,T as salla_alert,P as salla_booking_field,L as salla_bottom_alert,E as salla_breadcrumb,D as salla_button,j as salla_cart_summary,F as salla_color_picker,R as salla_comment_form,H as salla_comment_item,q as salla_comments,N as salla_conditional_fields,G as salla_count_down,W as salla_datetime_picker,J as salla_drawer,Z as salla_file_upload,K as salla_gifting,Q as salla_infinite_scroll,tt as salla_list_tile,et as salla_loading,it as salla_localization_modal,st as salla_login_modal,nt as salla_loyalty,lt as salla_maintenance_alert,ct as salla_map,dt as salla_menu,ht as salla_modal,pt as salla_multiple_bundle_product,ut as salla_multiple_bundle_product_cart,ft as salla_multiple_bundle_product_details,mt as salla_multiple_bundle_product_options_modal,gt as salla_multiple_bundle_product_slider,bt as salla_offer_modal,wt as salla_placeholder,yt as salla_product_availability,_t as salla_product_card,St as salla_product_options,Ct as salla_product_size_guide,zt as salla_products_list,$t as salla_products_slider,Tt as salla_progress_bar,Pt as salla_quantity_input,Ot as salla_quick_buy,Et as salla_quick_order,Ft as salla_rating_modal,Rt as salla_rating_stars,Ht as salla_reviews_summary,Nt as salla_scopes,Gt as salla_search,Wt as salla_skeleton,di as salla_slider,pi as salla_social_share,ui as salla_tab_content,fi as salla_tab_header,mi as salla_tabs,gi as salla_tel_input,wi as salla_user_menu,vi as salla_user_profile,xi as salla_user_settings}