@salla.sa/twilight-components 1.6.11 → 1.6.13

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 (115) hide show
  1. package/dist/cjs/_commonjsHelpers-691dd63b.js +28 -0
  2. package/dist/cjs/css-shim-c9fa4209.js +9 -0
  3. package/dist/cjs/dom-92c2a073.js +78 -0
  4. package/dist/cjs/{index-0d0167d5.js → index-cac2fd59.js} +65 -4
  5. package/dist/cjs/index-db09186f.js +7516 -0
  6. package/dist/cjs/loader.cjs.js +18 -2
  7. package/dist/cjs/salla-add-product-button.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-button_27.cjs.entry.js +44 -45
  9. package/dist/cjs/salla-conditional-fields.cjs.entry.js +1 -1
  10. package/dist/cjs/salla-installment.cjs.entry.js +15 -6
  11. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
  12. package/dist/cjs/salla-scopes.cjs.entry.js +2 -2
  13. package/dist/cjs/salla-select.cjs.entry.js +2 -2
  14. package/dist/cjs/twilight.cjs.js +81 -0
  15. package/dist/collection/Helpers/Helper.js +2 -2
  16. package/dist/collection/collection-manifest.json +2 -1
  17. package/dist/collection/components/salla-installment/salla-installment.js +13 -4
  18. package/dist/collection/components/salla-login-modal/salla-login-modal.js +35 -3
  19. package/dist/collection/components/salla-verify/salla-verify.js +23 -1
  20. package/dist/collection/global/app-dev.js +35 -0
  21. package/dist/collection/global/app.js +5 -31
  22. package/dist/components/Helper.js +2 -2
  23. package/dist/components/_commonjsHelpers.js +1 -1
  24. package/dist/components/index.d.ts +1 -1
  25. package/dist/components/index.js +7511 -0
  26. package/dist/components/salla-file-upload2.js +2 -2
  27. package/dist/components/salla-gifting.js +1 -1
  28. package/dist/components/salla-installment.js +14 -5
  29. package/dist/components/salla-loading2.js +1 -1
  30. package/dist/components/salla-localization-modal.js +1 -1
  31. package/dist/components/salla-login-modal.js +18 -3
  32. package/dist/components/salla-loyalty-prize-item.js +1 -1
  33. package/dist/components/salla-scopes.js +1 -1
  34. package/dist/components/salla-select.js +1 -1
  35. package/dist/components/salla-swiper2.js +1 -1
  36. package/dist/components/salla-tel-input2.js +2 -2
  37. package/dist/components/salla-verify2.js +6 -1
  38. package/dist/esm/_commonjsHelpers-1415ffd3.js +24 -0
  39. package/dist/esm/css-shim-0e7604db.js +7 -0
  40. package/dist/esm/dom-a1a72c67.js +76 -0
  41. package/dist/esm/{index-4e30ffd0.js → index-0ce70ad2.js} +61 -5
  42. package/dist/esm/index-f04e787f.js +7514 -0
  43. package/dist/esm/loader.js +18 -2
  44. package/dist/esm/salla-add-product-button.entry.js +1 -1
  45. package/dist/esm/salla-button_27.entry.js +32 -33
  46. package/dist/esm/salla-conditional-fields.entry.js +1 -1
  47. package/dist/esm/salla-installment.entry.js +15 -6
  48. package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
  49. package/dist/esm/salla-scopes.entry.js +2 -2
  50. package/dist/esm/salla-select.entry.js +2 -2
  51. package/dist/esm/twilight.js +79 -0
  52. package/dist/esm-es5/_commonjsHelpers-1415ffd3.js +4 -0
  53. package/dist/esm-es5/css-shim-0e7604db.js +4 -0
  54. package/dist/esm-es5/dom-a1a72c67.js +24 -0
  55. package/dist/esm-es5/index-0ce70ad2.js +4 -0
  56. package/dist/esm-es5/index-f04e787f.js +24 -0
  57. package/dist/{twilight-components/index.esm.js → esm-es5/index.js} +0 -0
  58. package/dist/esm-es5/loader.js +4 -0
  59. package/dist/esm-es5/salla-add-product-button.entry.js +4 -0
  60. package/dist/esm-es5/salla-button_27.entry.js +34 -0
  61. package/dist/esm-es5/salla-conditional-fields.entry.js +4 -0
  62. package/dist/esm-es5/salla-installment.entry.js +4 -0
  63. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +4 -0
  64. package/dist/esm-es5/salla-scopes.entry.js +4 -0
  65. package/dist/esm-es5/salla-select.entry.js +4 -0
  66. package/dist/esm-es5/search-19ea3313.js +4 -0
  67. package/dist/esm-es5/twilight.js +4 -0
  68. package/dist/index.js +1 -1
  69. package/dist/twilight/index.esm.js +3 -0
  70. package/dist/twilight/p-0db2b810.entry.js +4 -0
  71. package/dist/{twilight-components/p-49125b6a.entry.js → twilight/p-10ac9c79.entry.js} +1 -1
  72. package/dist/{twilight-components/p-76cb2574.entry.js → twilight/p-13129ac9.entry.js} +1 -1
  73. package/dist/twilight/p-1914490f.system.entry.js +4 -0
  74. package/dist/twilight/p-1e26972a.js +24 -0
  75. package/dist/twilight/p-24e726cc.system.entry.js +34 -0
  76. package/dist/twilight/p-26a23097.system.entry.js +4 -0
  77. package/dist/twilight/p-3d828bb4.js +4 -0
  78. package/dist/{twilight-components → twilight}/p-475ef754.js +0 -0
  79. package/dist/{twilight-components/p-019bb315.entry.js → twilight/p-521b6fde.entry.js} +1 -1
  80. package/dist/twilight/p-5db948f2.js +22 -0
  81. package/dist/twilight/p-89f1c6be.system.js +24 -0
  82. package/dist/{twilight-components/p-df1eb1e5.entry.js → twilight/p-97daba27.entry.js} +1 -1
  83. package/dist/twilight/p-9beb6b7b.system.js +4 -0
  84. package/dist/twilight/p-a7caaba3.system.entry.js +4 -0
  85. package/dist/twilight/p-ad42e3b6.system.js +4 -0
  86. package/dist/twilight/p-b7610000.system.js +4 -0
  87. package/dist/{twilight-components/p-46e23628.entry.js → twilight/p-bbc94b9b.entry.js} +1 -1
  88. package/dist/twilight/p-ca68752d.js +5 -0
  89. package/dist/twilight/p-ce3e3fa2.system.entry.js +4 -0
  90. package/dist/twilight/p-d64f3123.entry.js +22 -0
  91. package/dist/twilight/p-da69797f.system.js +4 -0
  92. package/dist/twilight/p-db0ba553.system.js +5 -0
  93. package/dist/twilight/p-dd9b3c90.system.entry.js +4 -0
  94. package/dist/twilight/p-e3655a96.system.js +24 -0
  95. package/dist/twilight/p-f610b6bf.system.entry.js +4 -0
  96. package/dist/twilight/p-f84bae34.js +4 -0
  97. package/dist/twilight/p-fd444b25.system.js +4 -0
  98. package/dist/twilight/twilight.esm.js +4 -0
  99. package/dist/twilight/twilight.js +133 -0
  100. package/dist/types/components/salla-installment/salla-installment.d.ts +2 -1
  101. package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +4 -0
  102. package/dist/types/components/salla-verify/salla-verify.d.ts +4 -0
  103. package/dist/types/components.d.ts +16 -0
  104. package/dist/types/global/app-dev.d.ts +2 -0
  105. package/dist/types/global/app.d.ts +5 -1
  106. package/dist/types/index.d.ts +0 -1
  107. package/loader/index.js +1 -1
  108. package/loader/package.json +1 -1
  109. package/package.json +9 -6
  110. package/dist/cjs/twilight-components.cjs.js +0 -22
  111. package/dist/esm/twilight-components.js +0 -20
  112. package/dist/twilight-components/p-1503d976.js +0 -5
  113. package/dist/twilight-components/p-826c1e7e.entry.js +0 -4
  114. package/dist/twilight-components/p-bebedfdf.entry.js +0 -22
  115. package/dist/twilight-components/twilight-components.esm.js +0 -4
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-0ce70ad2.js";var SallaConditionalFields=function(){function e(e){registerInstance(this,e)}e.prototype.changeHandler=function(e){var t=this;var r;salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((r=e===null||e===void 0?void 0:e.target)===null||r===void 0?void 0:r.tagName)||"N/A"));return}var a=e.target.name.replace("[]","");var n=e.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",'[data-show-when^="'.concat(a,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(a,'"]')).forEach((function(r){var a=!(r===null||r===void 0?void 0:r.dataset.showWhen.includes("!="));var l=r===null||r===void 0?void 0:r.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var o;if(n){var i=Array.from(t.host.querySelectorAll('input[name="'.concat(e.target.name,'"]:checked')),(function(e){return e===null||e===void 0?void 0:e.value}));o=i.includes(l.toString())}else{o=l===e.target.value}salla.log("The input is ",n?"Multiple":"Single"," value:",o);var s=a&&o||!a&&!o;if(s){r.classList.remove("hidden");r.querySelectorAll("[name]").forEach((function(e){e.removeAttribute("disabled");if(!["checkbox"].includes(e.getAttribute("type"))&&r.getElementsByClassName("required").length){e.setAttribute("required","")}}))}else{r.classList.add("hidden");r.querySelectorAll("[name]").forEach((function(e){e.setAttribute("disabled","");e.removeAttribute("required");if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))}}))};e.prototype.componentDidRender=function(){var e=this;this.host.querySelectorAll("[data-show-when]").forEach((function(t){var r;var a=(r=t===null||t===void 0?void 0:t.dataset)===null||r===void 0?void 0:r.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!a){return}e.changeHandler({target:e.host.querySelector('[name^="'+a+'"]')})}))};e.prototype.render=function(){return h(Host,null,h("slot",null))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();export{SallaConditionalFields as salla_conditional_fields};
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as registerInstance,h,H as Host}from"./index-0ce70ad2.js";var sallaInstallmentCss="#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";var SallaInstallment=function(){function t(t){var r=this;registerInstance(this,t);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.readyToRender=false;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.tamaraIsActive=false;this.tabbyIsActive=false;this.spotiiIsActive=false;salla.lang.onLoaded((function(){var t=salla.config.get("store.settings.installments");if(t){r.tamaraIsActive=t.includes("tamara_installment");r.tabbyIsActive=t.includes("tabby_installment");r.spotiiIsActive=t.includes("spotii_pay")}r.readyToRender=true}))}t.prototype.render=function(){return h(Host,null,this.tamaraIsActive?h("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"}):"",this.tabbyIsActive?h("div",{id:"tabbyPromoWrapper"},h("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?h("div",{class:"spotii-wrapper"},h("div",{class:"spotii-promo"})):"")};t.prototype.componentDidRender=function(){var t=this;if(!this.readyToRender){return}if(this.tamaraIsActive){var r=document.createElement("script");r.setAttribute("src","https://cdn.tamara.co/widget/product-widget.min.js");document.head.appendChild(r);r.onload=function(){window.TamaraProductWidget.init({lang:t.language});setTimeout((function(){window.TamaraProductWidget.render()}),300)}}if(this.tabbyIsActive){var r=document.createElement("script");r.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(r);r.onload=function(){var r=window.TabbyPromo;new r({selector:"#tabbyPromo",currency:t.currency,price:t.price,lang:t.language});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){var o=salla.money((Number(this.price)/4).toFixed(2));var a=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:4,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+o+"${logo} ${info}",textOne:a?"جزء الدفع على":"Split it into",textTwo:a?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var r=document.createElement("script");r.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(r)}};t.prototype.removeTabbyBorder=function(){var t=this;if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((function(){var r=document.querySelector("#tabbyPromo>div>div");r=r?r.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(r){r.style="border: none; margin: 15px 0!important;";t.tabbyBorderRemoved=true}else{t.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)};return t}();SallaInstallment.style=sallaInstallmentCss;export{SallaInstallment as salla_installment};
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as registerInstance,c as createEvent,h,H as Host}from"./index-0ce70ad2.js";var sallaLoyaltyPrizeItemCss="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";var SallaLoyaltyPrizeItem=function(){function t(t){registerInstance(this,t);this.prizeItemSelected=createEvent(this,"prizeItemSelected",7)}t.prototype.onPrizeItemClick=function(){this.prizeItemSelected.emit(this.item)};t.prototype.render=function(){return h(Host,null,h("div",{onClick:this.onPrizeItemClick.bind(this)},h("img",{class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),h("div",{class:"s-loyalty-prize-item-title"},this.item.name),h("div",{class:"s-loyalty-prize-item-subtitle"},this.item.description),h("div",{class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))};return t}();SallaLoyaltyPrizeItem.style=sallaLoyaltyPrizeItemCss;export{SallaLoyaltyPrizeItem as salla_loyalty_prize_item};
@@ -0,0 +1,4 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,t,s,o){function n(e){return e instanceof s?e:new s((function(t){t(e)}))}return new(s||(s=Promise))((function(s,i){function l(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o["throw"](e))}catch(e){i(e)}}function c(e){e.done?s(e.value):n(e.value).then(l,a)}c((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(t){return c([e,t])}}function c(l){if(o)throw new TypeError("Generator is already executing.");while(s)try{if(o=1,n&&(i=l[0]&2?n["return"]:l[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;if(n=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:s.label++;return{value:l[1],done:false};case 5:s.label++;n=l[1];l=[0];continue;case 7:l=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){s=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){s.label=l[1];break}if(l[0]===6&&s.label<i[1]){s.label=i[1];i=l;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(l);break}if(i[2])s.ops.pop();s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e];n=0}finally{o=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};
2
+ /*!
3
+ * Crafted with ❤ by Salla
4
+ */import{r as registerInstance,h,H as Host}from"./index-0ce70ad2.js";import{S as Search}from"./search-19ea3313.js";var StoreAlt='\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';var ModeType;(function(e){e["DEFAULT"]="default";e["AVAILABILITY"]="availability"})(ModeType||(ModeType={}));var sallaScopesCss=".s-scopes-availability-content{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.s-scopes-placeholder{-ms-flex:0 0 85%;flex:0 0 85%}";var SallaScopees=function(){function e(e){var t=this;registerInstance(this,e);this.translationLoaded=false;this.mode=ModeType.DEFAULT;this.scopes=[];this.originalScopesList=[];this.isOpenedBefore=salla.storage.get("branch-choosed-before");this.hasError=false;this.selection="optional";this.searchDisplayLimit=6;this.getFormTitle=function(){var e;if(((e=t.originalScopesList)===null||e===void 0?void 0:e.length)<2)return"";return t.mode===ModeType.DEFAULT?salla.lang.get("blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")};salla.event.on("scopes::open",(function(e){var s=e.mode,o=s===void 0?null:s,n=e.product_id,i=n===void 0?null:n;t.open(o,i)}));salla.lang.onLoaded((function(){t.translationLoaded=true}))}e.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,(e=this.modal)===null||e===void 0?void 0:e.close()];case 1:return[2,t.sent()]}}))}))};e.prototype.open=function(e,t){if(e===void 0){e=ModeType.DEFAULT}if(t===void 0){t=null}return __awaiter(this,void 0,void 0,(function(){var s;var o=this;return __generator(this,(function(n){switch(n.label){case 0:this.setScopeValues([]);if(typeof e!=="undefined"&&[ModeType.AVAILABILITY,ModeType.DEFAULT].includes(e)){this.mode=e}else{this.mode=ModeType.DEFAULT}this.modal.open();s=function(){return e==ModeType.AVAILABILITY?salla.scope.getProductAvailability(t):salla.scope.get()};return[4,salla.api.withoutNotifier(s).then((function(t){if(e==ModeType.AVAILABILITY){return o.setScopeValues(t.data)}o.setScopeValues(t.data.scopes)})).catch((function(e){console.log(e);o.hasError=true})).finally((function(){return o.modal.stopLoading()}))];case 1:return[2,n.sent()]}}))}))};e.prototype.handleSubmit=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(s){switch(s.label){case 0:e={id:this.current_scope.id};this.changeBtn.load();return[4,salla.scope.change(e).then((function(){salla.storage.set("branch-choosed-before",true);salla.storage.set("scope",{type:t.current_scope.type,id:t.current_scope.id});var e=new URL(window.location.href);e.searchParams.set("scope",t.current_scope.id);window.location.href=e.toString();window.location.replace(e.toString())})).catch((function(e){return console.log(e)})).finally((function(){t.changeBtn.stop()}))];case 1:return[2,s.sent()]}}))}))};e.prototype.setScopeValues=function(e){this.scopes=e;this.originalScopesList=e;if(e.length==1){this.current_scope=e[0];this.selected_scope=e[0]}else{this.current_scope=e.find((function(e){return e.selected}));this.selected_scope=e.find((function(e){return e.selected}))}};e.prototype.handleSearchFieldTyping=function(e){var t=e.target.value.toLocaleLowerCase();if(!!t){this.scopes=this.originalScopesList.filter((function(e){return e.name.toLowerCase().includes(t)}))}else{this.scopes=this.originalScopesList}};e.prototype.handleScopeSelection=function(e){this.current_scope=this.scopes.find((function(t){return t.id==e.target.value}))};e.prototype.placeholderContent=function(){return h("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},h("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),h("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))};e.prototype.defaultContent=function(){var e=this;return[h("div",{class:"s-scopes-container s-scrollbar"},this.scopes.map((function(t){return h("div",{class:"s-scopes-input-wrap","data-selection":e.selection},h("input",{id:"".concat(e.selection," + '_scope_' + ").concat(t.id),name:"lang",type:"radio",value:t.id,onChange:function(t){return e.handleScopeSelection(t)},class:"s-scopes-input",checked:!!e.current_scope&&e.current_scope.id==t.id}),h("label",{htmlFor:"".concat(e.selection," + '_scope_' + ").concat(t.id),class:"s-scopes-label s-scopes-clickable"},h("span",null,t.name)))}))),this.footerContent()]};e.prototype.availabilityContent=function(){var e=this;return h("div",{class:"s-scopes-container"},this.scopes.map((function(t){var s,o,n,i,l,a;return h("div",{class:"s-scopes-input-wrap","data-selection":e.selection},h("h2",{class:{"s-scopes-label":true,"s-scopes-clickable":e.mode===ModeType.DEFAULT}},h("span",null,t.name)),h("h2",{style:{color:(o=(s=t)===null||s===void 0?void 0:s.availability)===null||o===void 0?void 0:o.color},class:"s-scopes-".concat((i=(n=t)===null||n===void 0?void 0:n.availability)===null||i===void 0?void 0:i.key)},(a=(l=t)===null||l===void 0?void 0:l.availability)===null||a===void 0?void 0:a.label))})))};e.prototype.footerContent=function(){var e=this;return h("div",{class:"s-scopes-footer"},h("slot",{name:"footer"},h("salla-button",{ref:function(t){return e.changeBtn=t},disabled:!this.current_scope,onClick:function(){return e.handleSubmit()},class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))};e.prototype.render=function(){var e=this;return h(Host,null,h("salla-modal",{ref:function(t){return e.modal=t},isClosable:!!(this.isOpenedBefore||this.selection=="optional"),class:"s-scopes-modal",isLoading:true,"has-skeleton":true},h("div",{slot:"loading"},h("div",{class:"s-scopes-skeleton"},h("salla-list-tile",{class:"s-scopes-header"},h("div",{slot:"icon",class:"s-scopes-header-icon"},h("salla-skeleton",{type:"circle"})),h("div",{slot:"title",class:"s-scopes-header-title mb-5"},h("salla-skeleton",{height:"15px",width:"50%"})),h("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},h("salla-skeleton",{height:"10px"}),h("salla-skeleton",{height:"10px",width:"75%"}))),h("div",{class:"s-scopes-skeleton-search"},h("salla-skeleton",{height:"10px",width:"50%"}),h("salla-skeleton",{height:"30px",width:"100%"})),h("div",{class:"s-scopes-skeleton-scopes"},h("salla-skeleton",{height:"10px",width:"30%"}),h("salla-skeleton",{height:"10px",width:"25%"}),h("salla-skeleton",{height:"10px",width:"30%"}),h("salla-skeleton",{height:"10px",width:"25%"}),h("salla-skeleton",{height:"10px",width:"30%"}),h("salla-skeleton",{height:"10px",width:"25%"}),h("salla-skeleton",{height:"10px",width:"30%"}),h("salla-skeleton",{height:"10px",width:"25%"})),h("div",{class:"s-scopes-skeleton-btn"},h("salla-skeleton",{height:"40px",width:"100%"})))),h("salla-list-tile",{class:this.originalScopesList.length?"s-scopes-header block":"s-hidden"},h("div",{slot:"icon",class:"s-scopes-header-icon",innerHTML:StoreAlt}),h("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),h("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},!!this.selected_scope?this.selected_scope.name:"")),h("div",{class:"s-scopes-wrap"},!!this.originalScopesList.length&&h("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList.length>this.searchDisplayLimit?h("div",{class:"s-scopes-search-wrapper"},h("div",{class:"s-scopes-search-icon",innerHTML:Search}),h("input",{type:"text",class:"s-scopes-search-input",onInput:function(t){return e.handleSearchFieldTyping(t)},enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||this.scopes.length<2?this.placeholderContent():this.mode===ModeType.DEFAULT?this.defaultContent():this.availabilityContent())))};e.prototype.componentDidLoad=function(){if(!this.isOpenedBefore&&this.selection=="mandatory"){this.open()}};return e}();SallaScopees.style=sallaScopesCss;export{SallaScopees as salla_scopes};
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as registerInstance,h,H as Host}from"./index-0ce70ad2.js";var sallaSelectCss=".s-select-label{display:block;margin-bottom:0.5rem;color:#111827;font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-select-underline{display:block;padding-left:0;padding-right:0;padding-top:0.625rem;padding-bottom:0.625rem;background-color:transparent;color:#6B7280;font-size:0.875rem;line-height:1.25rem;width:100%;border-width:0;border-bottom-width:2px;border-color:#E5E7EB;-webkit-appearance:none;-moz-appearance:none;appearance:none}.s-select-outlined{display:block;padding:0.625rem;padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;background-color:#F9FAFB;color:#111827;font-size:0.875rem;line-height:1.25rem;width:100%;border-radius:0.5rem;border-width:1px;border-color:#D1D5DB}.s-select-x-large{height:5rem}.s-select-large{height:4rem}.s-select-normal{height:3rem}.s-select-small{height:3rem}.s-select-x-small{height:2.5rem}.s-select-field{padding-top:0.25rem;padding-bottom:0.25rem;padding-right:0.5rem;padding-left:0.5rem;margin:0;font-size:1.125rem;line-height:1.75rem;font-weight:400;line-height:1.75rem;width:100%;border-radius:0.375rem;border-color:#9CA3AF;-webkit-box-shadow:none;box-shadow:none}.s-select-hint{margin-top:0.25rem;color:#374151;font-size:0.875rem;line-height:1.25rem;line-height:1.25rem}";var SallaSelect=function(){function e(e){registerInstance(this,e);this.label=undefined;this.items=[];this.itemText="text";this.itemValue="value";this.itemDisabled="disabled";this.size="normal";this.value=undefined;this.autofocus=false;this.clearable=false;this.clearIcon="sicon-cancel";this.color="primary";this.flat=undefined;this.disabled=false;this.loading=false;this.loadingColor="primary";this.hint=undefined;this.persistHint=false;this.placeholder=undefined;this.multiple=false;this.autocomplete=false;this.required=false;this.chips=false;this.shape="outlined";this.returnObject=false;this.hideDetail=false}e.prototype.selectClass=function(){return"s-select-field s-select-".concat(this.shape," ").concat(this.color," ").concat(this.size)};e.prototype.onSelectedItemChange=function(e){var t=e.target.selectedIndex;if(t<0){this.value=undefined;return}var i=this.items[!!this.placeholder?t-1:t];this.value=this.returnObject?i:i[this.itemValue];console.log("🚀 ~ file: salla-select.tsx ~ line 153 ~ SallaSelect ~ onSelectedItemChange ~ this.value",this.value)};e.prototype.generateHint=function(){if(!this.persistHint&&!this.value){return""}return h("div",{class:"s-select-hint"},this.hint)};e.prototype.checkForSelected=function(e){if(this.returnObject&&!!this.value){return e[this.itemValue]=this.value[this.itemValue]}return e[this.itemValue]==this.value};e.prototype.render=function(){var e=this;return h(Host,null,!!this.label?h("label",{htmlFor:"s-select",class:"s-select-label"},this.label):"",h("select",{multiple:this.multiple,autocomplete:this.autocomplete?"on":"off",disabled:this.disabled,autoFocus:this.autofocus,id:"s-select",class:this.selectClass(),onChange:this.onSelectedItemChange.bind(this)},!!this.placeholder?h("option",{selected:!this.value},this.placeholder):"",this.items.map((function(t){return h("option",{label:t[e.itemText],value:t[e.itemValue],selected:e.checkForSelected(t),disabled:t[e.itemDisabled]})}))),h("div",{class:{"s-hidden":this.hideDetail}},this.generateHint()))};return e}();SallaSelect.style=sallaSelectCss;export{SallaSelect as salla_select};
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ var Search='\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';export{Search as S};
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{p as plt,w as win,d as doc,N as NAMESPACE,a as promiseResolve,b as bootstrapLazy}from"./index-0ce70ad2.js";import"./index-f04e787f.js";import"./_commonjsHelpers-1415ffd3.js";var getDynamicImportFunction=function(e){return"__sc_import_".concat(e.replace(/\s|-/g,"_"))};var patchBrowser=function(){{plt.$cssShim$=win.__cssshim}var e=Array.from(doc.querySelectorAll("script")).find((function(e){return new RegExp("/".concat(NAMESPACE,"(\\.esm)?\\.js($|\\?|#)")).test(e.src)||e.getAttribute("data-stencil-namespace")===NAMESPACE}));var a="";var l={};if(a!==""){l.resourcesUrl=new URL(".",a).href}else{l.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,win.location.href)).href;{patchDynamicImport(l.resourcesUrl,e)}if(!win.customElements){return import("./dom-a1a72c67.js").then((function(){return l}))}}return promiseResolve(l)};var patchDynamicImport=function(e,a){var l=getDynamicImportFunction(NAMESPACE);try{win[l]=new Function("w","return import(w);//".concat(Math.random()))}catch(o){var t=new Map;win[l]=function(o){var r=new URL(o,e).href;var i=t.get(r);if(!i){var n=doc.createElement("script");n.type="module";n.crossOrigin=a.crossOrigin;n.src=URL.createObjectURL(new Blob(["import * as m from '".concat(r,"'; window.").concat(l,".m = m;")],{type:"application/javascript"}));i=new Promise((function(e){n.onload=function(){e(win[l].m);n.remove()}}));t.set(r,i);doc.head.appendChild(n)}return i}}};patchBrowser().then((function(e){return bootstrapLazy(JSON.parse('[["salla-button_27",[[4,"salla-gifting",{"productId":[2,"product-id"],"sectionTitle":[32],"sectionSubtitle":[32],"sectionBtnText":[32],"giftDetails":[32],"selectImageForYourGift":[32],"selectImageOrUpload":[32],"selectGiftMessage":[32],"giftCustomText":[32],"textId":[32],"incorrectGiftText":[32],"nextStep":[32],"senderNameLabel":[32],"receiverNameFieldLabel":[32],"receiverMobileFieldLabel":[32],"receiverEmailFieldLabel":[32],"emailPlaceholder":[32],"sendLater":[32],"selectSendDateAndTime":[32],"canNotEditOrderAfterSelectDate":[32],"sendGift":[32],"donationRequired":[32],"step1Elems":[32],"step2Elems":[32],"stepsWrapper":[32],"textArea":[32],"imageCover":[32],"textSelect":[32],"customTextArea":[32],"calendarFormGroup":[32],"currentStep":[32],"showCalendar":[32],"showGiftText":[32],"currentLang":[32],"parentClass":[32],"errors":[32],"gift":[32],"selectedGiftTextOption":[32],"showTextArea":[32],"selectedImage":[32],"uploadedImage":[32],"selectedText":[32],"senderName":[32],"errorMessage":[32],"hasError":[32],"quantity":[32],"deliveryDate":[32],"timeZone":[32],"receiverName":[32],"receiverMobile":[32],"receiverCountryCode":[32],"receiverEmail":[32],"open":[64],"close":[64],"goToStep2":[64]}],[4,"salla-loyalty",{"prizePoints":[8,"prize-points"],"customerPoints":[2,"customer-points"],"prizeTitle":[1,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"placeholder_title":[32],"placeholder_description":[32],"modal_title":[32],"hasError":[32],"open":[64],"close":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"hasError":[32],"errorMessage":[32],"open":[64],"close":[64],"submit":[64]}],[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"supportWebAuth":[516,"support-web-auth"],"currentTabName":[32],"regType":[32],"translationLoaded":[32],"title":[32],"emailErrorMsg":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"open":[64]},[[8,"verified","onVerified"]]],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"showOffer":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"hasError":[32],"errorMessage":[32],"translationLoaded":[32],"open":[64],"close":[64]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]]],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[16],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"open":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}],[0,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"supportWebAuth":[4,"support-web-auth"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}],[0,"salla-datetime-picker",{"value":[1025],"placeholder":[1],"allowInput":[4,"allow-input"],"allowInvalidPreload":[4,"allow-invalid-preload"],"altFormat":[1,"alt-format"],"altInput":[4,"alt-input"],"altInputClass":[1,"alt-input-class"],"appendTo":[16],"ariaDateFormat":[1,"aria-date-format"],"autoFillDefaultTime":[4,"auto-fill-default-time"],"clickOpens":[4,"click-opens"],"closeOnSelect":[4,"close-on-select"],"conjunction":[1],"dateFormat":[1,"date-format"],"defaultDate":[8,"default-date"],"defaultHour":[2,"default-hour"],"defaultMinute":[2,"default-minute"],"defaultSeconds":[2,"default-seconds"],"disable":[16],"disableMobile":[4,"disable-mobile"],"enable":[16],"enableSeconds":[4,"enable-seconds"],"enableTime":[4,"enable-time"],"formatDate":[16],"hourIncrement":[2,"hour-increment"],"inline":[4],"locale":[1],"maxDate":[8,"max-date"],"maxTime":[8,"max-time"],"minDate":[8,"min-date"],"minTime":[8,"min-time"],"minuteIncrement":[2,"minute-increment"],"mode":[1],"monthSelectorType":[1,"month-selector-type"],"nextArrow":[1,"next-arrow"],"noCalendar":[4,"no-calendar"],"onChange":[16],"onClose":[16],"onDayCreate":[16],"onDestroy":[16],"onKeyDown":[16],"onMonthChange":[16],"onOpen":[16],"onParseConfig":[16],"onReady":[16],"onValueUpdate":[16],"onYearChange":[16],"dateParser":[16],"position":[1],"positionElement":[16],"prevArrow":[1,"prev-arrow"],"shorthandCurrentMonth":[4,"shorthand-current-month"],"static":[4],"showMonths":[2,"show-months"],"time_24hr":[4,"time_-2-4hr"],"weekNumbers":[4,"week-numbers"],"wrap":[4]}],[0,"salla-file-upload",{"required":[4],"disabled":[4],"allowDrop":[4,"allow-drop"],"allowBrowse":[4,"allow-browse"],"allowPaste":[4,"allow-paste"],"allowMultiple":[4,"allow-multiple"],"allowReplace":[4,"allow-replace"],"allowRevert":[4,"allow-revert"],"allowRemove":[4,"allow-remove"],"allowProcess":[4,"allow-process"],"allowReorder":[4,"allow-reorder"],"storeAsFile":[4,"store-as-file"],"forceRevert":[4,"force-revert"],"maxFilesCount":[2,"max-files-count"],"maxParallelUploads":[2,"max-parallel-uploads"],"checkValidity":[4,"check-validity"],"itemInsertLocation":[1,"item-insert-location"],"itemInsertInterval":[2,"item-insert-interval"],"credits":[4],"dropOnPage":[4,"drop-on-page"],"dropOnElement":[4,"drop-on-element"],"dropValidation":[4,"drop-validation"],"ignoredFiles":[16],"serverConfig":[1,"server-config"],"instantUpload":[4,"instant-upload"],"chunkUploads":[4,"chunk-uploads"],"chunkForce":[4,"chunk-force"],"chunkSize":[2,"chunk-size"],"chunkRetryDelays":[16],"labelDecimalSeparator":[1,"label-decimal-separator"],"labelThousandsSeparator":[1,"label-thousands-separator"],"labelIdle":[1,"label-idle"],"labelInvalidField":[1,"label-invalid-field"],"labelFileWaitingForSize":[1,"label-file-waiting-for-size"],"labelFileSizeNotAvailable":[1,"label-file-size-not-available"],"labelFileLoading":[1,"label-file-loading"],"labelFileLoadError":[1,"label-file-load-error"],"labelFileProcessing":[1,"label-file-processing"],"labelFileProcessingComplete":[1,"label-file-processing-complete"],"labelFileProcessingAborted":[1,"label-file-processing-aborted"],"labelFileProcessingError":[1,"label-file-processing-error"],"labelFileProcessingRevertError":[1,"label-file-processing-revert-error"],"labelFileRemoveError":[1,"label-file-remove-error"],"labelTapToCancel":[1,"label-tap-to-cancel"],"labelTapToRetry":[1,"label-tap-to-retry"],"labelTapToUndo":[1,"label-tap-to-undo"],"labelButtonRemoveItem":[1,"label-button-remove-item"],"labelButtonAbortItemLoad":[1,"label-button-abort-item-load"],"labelButtonRetryItemLoad":[1,"label-button-retry-item-load"],"labelButtonAbortItemProcessing":[1,"label-button-abort-item-processing"],"labelButtonUndoItemProcessing":[1,"label-button-undo-item-processing"],"labelButtonRetryItemProcessing":[1,"label-button-retry-item-processing"],"labelButtonProcessItem":[1,"label-button-process-item"],"iconRemove":[1,"icon-remove"],"iconProcess":[1,"icon-process"],"iconRetry":[1,"icon-retry"],"iconUndo":[1,"icon-undo"],"pond":[32],"files":[32],"appendFile":[64]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}],[4,"salla-swiper",{"loop":[4],"speed":[2],"itemPerView":[8,"item-per-view"],"spaceBetweenItems":[2,"space-between-items"],"currentIndex":[32],"isLastSlideItem":[32],"isFirstSlideItem":[32]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-list-tile",{"href":[1],"target":[1]}],[0,"salla-tel-input",{"phone":[1025],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}]]],["salla-scopes",[[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"hasError":[32],"close":[64],"open":[64],"handleSubmit":[64]}]]],["salla-add-product-button",[[4,"salla-add-product-button",{"channels":[513],"quantity":[514],"donatingAmount":[514,"donating-amount"],"productId":[520,"product-id"],"productStatus":[513,"product-status"],"productType":[513,"product-type"]}]]],["salla-conditional-fields",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-installment",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-loyalty-prize-item",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["salla-select",[[0,"salla-select",{"label":[1],"items":[16],"itemText":[1,"item-text"],"itemValue":[1,"item-value"],"itemDisabled":[1,"item-disabled"],"size":[1],"value":[1032],"autofocus":[4],"clearable":[4],"clearIcon":[1,"clear-icon"],"color":[1],"flat":[4],"disabled":[4],"loading":[4],"loadingColor":[1,"loading-color"],"hint":[1],"persistHint":[4,"persist-hint"],"placeholder":[1],"multiple":[4],"autocomplete":[4],"required":[4],"chips":[4],"shape":[1],"returnObject":[4,"return-object"],"hideDetail":[4,"hide-detail"]}]]]]'),e)}));
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from './esm/index.js';
1
+ export * from './esm-es5/index.js';
@@ -0,0 +1,3 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as t,h as o,H as r}from"./p-ca68752d.js";const a=class{constructor(o){t(this,o),this.tabbyBorderRemoved=!1,this.tabbyRemoveBorderTries=0,this.readyToRender=!1,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),this.tamaraIsActive=!1,this.tabbyIsActive=!1,this.spotiiIsActive=!1,salla.lang.onLoaded((()=>{const t=salla.config.get("store.settings.installments");t&&(this.tamaraIsActive=t.includes("tamara_installment"),this.tabbyIsActive=t.includes("tabby_installment"),this.spotiiIsActive=t.includes("spotii_pay")),this.readyToRender=!0}))}render(){return o(r,null,this.tamaraIsActive?o("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"}):"",this.tabbyIsActive?o("div",{id:"tabbyPromoWrapper"},o("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?o("div",{class:"spotii-wrapper"},o("div",{class:"spotii-promo"})):"")}componentDidRender(){if(this.readyToRender&&(this.tamaraIsActive&&((t=document.createElement("script")).setAttribute("src","https://cdn.tamara.co/widget/product-widget.min.js"),document.head.appendChild(t),t.onload=()=>{window.TamaraProductWidget.init({lang:this.language}),setTimeout((()=>{window.TamaraProductWidget.render()}),300)}),this.tabbyIsActive&&((t=document.createElement("script")).setAttribute("src","https://checkout.tabby.ai/tabby-promo.js"),document.head.appendChild(t),t.onload=()=>{new(0,window.TabbyPromo)({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language}),document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))},this.removeTabbyBorder()),this.spotiiIsActive)){let o=salla.money((Number(this.price)/4).toFixed(2)),r=salla.config.get("theme.is_rtl",!0);var t;window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:4,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+o+"${logo} ${info}",textOne:r?"جزء الدفع على":"Split it into",textTwo:r?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price},(t=document.createElement("script")).setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js")),document.head.appendChild(t)}}removeTabbyBorder(){this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5||(this.tabbyRemoveBorderTries++,setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null,t?(t.style="border: none; margin: 15px 0!important;",this.tabbyBorderRemoved=!0):this.removeTabbyBorder()}),500*this.tabbyRemoveBorderTries))}};a.style="#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";export{a as salla_installment}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as i,h as s,H as l}from"./p-1503d976.js";const e=class{constructor(s){t(this,s),this.prizeItemSelected=i(this,"prizeItemSelected",7)}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return s(l,null,s("div",{onClick:this.onPrizeItemClick.bind(this)},s("img",{class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),s("div",{class:"s-loyalty-prize-item-title"},this.item.name),s("div",{class:"s-loyalty-prize-item-subtitle"},this.item.description),s("div",{class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};e.style="salla-loyalty-prize-item:hover{box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";export{e as salla_loyalty_prize_item}
4
+ import{r as t,c as i,h as s,H as l}from"./p-ca68752d.js";const a=class{constructor(s){t(this,s),this.prizeItemSelected=i(this,"prizeItemSelected",7)}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return s(l,null,s("div",{onClick:this.onPrizeItemClick.bind(this)},s("img",{class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),s("div",{class:"s-loyalty-prize-item-title"},this.item.name),s("div",{class:"s-loyalty-prize-item-subtitle"},this.item.description),s("div",{class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};a.style="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";export{a as salla_loyalty_prize_item}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as i,H as a,g as l}from"./p-1503d976.js";const o=class{constructor(i){t(this,i),this.success=s(this,"success",7),this.failed=s(this,"failed",7),this.hostAttributes={},this.hasLabel=!1,this.channels=null,this.quantity=0,this.donatingAmount=0,this.productStatus="sale",this.productType="product"}getLabel(){return"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("submit"===this.hostAttributes.type)return!1;t.preventDefault();const s=Object.entries({id:this.productId,donating_amount:this.donatingAmount,quantity:this.quantity}).reduce(((t,[s,i])=>i?(t[s]=i,t):t),{});return salla.cart.quickAdd(s).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}componentWillLoad(){this.hasLabel=!!this.host.innerHTML.replace("\x3c!----\x3e","").trim()}render(){return i(a,null,"out-and-notify"===this.productStatus&&this.channels?i("salla-product-availability",Object.assign({},this.getBtnAttributes()),i("slot",null)):i("salla-button",Object.assign({ref:t=>this.btn=t,onClick:t=>this.addProductToCart(t),type:"button",fill:"sale"===this.productStatus?"solid":"outline",color:"sale"===this.productStatus?"primary":"light","loader-position":"center"},this.getBtnAttributes(),{disabled:"sale"!==this.productStatus}),i("slot",null)))}componentDidRender(){this.hasLabel||(this.btn.setText(this.getLabel()||"اضافة للسلة"),salla.lang.onLoaded((()=>{this.btn.setText(this.getLabel()||"اضافة للسلة")})))}get host(){return l(this)}};o.style=":host{display:block}salla-add-product-button[width=wide]{width:100%}";export{o as salla_add_product_button}
4
+ import{r as t,c as s,h as i,H as a,g as l}from"./p-ca68752d.js";const o=class{constructor(i){t(this,i),this.success=s(this,"success",7),this.failed=s(this,"failed",7),this.hostAttributes={},this.hasLabel=!1,this.channels=null,this.quantity=0,this.donatingAmount=0,this.productStatus="sale",this.productType="product"}getLabel(){return"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("submit"===this.hostAttributes.type)return!1;t.preventDefault();const s=Object.entries({id:this.productId,donating_amount:this.donatingAmount,quantity:this.quantity}).reduce(((t,[s,i])=>i?(t[s]=i,t):t),{});return salla.cart.quickAdd(s).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}componentWillLoad(){this.hasLabel=!!this.host.innerHTML.replace("\x3c!----\x3e","").trim()}render(){return i(a,null,"out-and-notify"===this.productStatus&&this.channels?i("salla-product-availability",Object.assign({},this.getBtnAttributes()),i("slot",null)):i("salla-button",Object.assign({ref:t=>this.btn=t,onClick:t=>this.addProductToCart(t),type:"button",fill:"sale"===this.productStatus?"solid":"outline",color:"sale"===this.productStatus?"primary":"light","loader-position":"center"},this.getBtnAttributes(),{disabled:"sale"!==this.productStatus}),i("slot",null)))}componentDidRender(){this.hasLabel||(this.btn.setText(this.getLabel()||"اضافة للسلة"),salla.lang.onLoaded((()=>{this.btn.setText(this.getLabel()||"اضافة للسلة")})))}get host(){return l(this)}};o.style=":host{display:block}salla-add-product-button[width=wide]{width:100%}";export{o as salla_add_product_button}
@@ -0,0 +1,4 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,t,s,o){function n(e){return e instanceof s?e:new s((function(t){t(e)}))}return new(s||(s=Promise))((function(s,i){function l(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o["throw"](e))}catch(e){i(e)}}function c(e){e.done?s(e.value):n(e.value).then(l,a)}c((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(t){return c([e,t])}}function c(l){if(o)throw new TypeError("Generator is already executing.");while(s)try{if(o=1,n&&(i=l[0]&2?n["return"]:l[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;if(n=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:s.label++;return{value:l[1],done:false};case 5:s.label++;n=l[1];l=[0];continue;case 7:l=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){s=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){s.label=l[1];break}if(l[0]===6&&s.label<i[1]){s.label=i[1];i=l;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(l);break}if(i[2])s.ops.pop();s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e];n=0}finally{o=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};
2
+ /*!
3
+ * Crafted with ❤ by Salla
4
+ */System.register(["./p-db0ba553.system.js","./p-fd444b25.system.js"],(function(e){"use strict";var t,s,o,n;return{setters:[function(e){t=e.r;s=e.h;o=e.H},function(e){n=e.S}],execute:function(){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>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';var l;(function(e){e["DEFAULT"]="default";e["AVAILABILITY"]="availability"})(l||(l={}));var a=".s-scopes-availability-content{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.s-scopes-placeholder{-ms-flex:0 0 85%;flex:0 0 85%}";var c=e("salla_scopes",function(){function e(e){var s=this;t(this,e);this.translationLoaded=false;this.mode=l.DEFAULT;this.scopes=[];this.originalScopesList=[];this.isOpenedBefore=salla.storage.get("branch-choosed-before");this.hasError=false;this.selection="optional";this.searchDisplayLimit=6;this.getFormTitle=function(){var e;if(((e=s.originalScopesList)===null||e===void 0?void 0:e.length)<2)return"";return s.mode===l.DEFAULT?salla.lang.get("blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")};salla.event.on("scopes::open",(function(e){var t=e.mode,o=t===void 0?null:t,n=e.product_id,i=n===void 0?null:n;s.open(o,i)}));salla.lang.onLoaded((function(){s.translationLoaded=true}))}e.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,(e=this.modal)===null||e===void 0?void 0:e.close()];case 1:return[2,t.sent()]}}))}))};e.prototype.open=function(e,t){if(e===void 0){e=l.DEFAULT}if(t===void 0){t=null}return __awaiter(this,void 0,void 0,(function(){var s;var o=this;return __generator(this,(function(n){switch(n.label){case 0:this.setScopeValues([]);if(typeof e!=="undefined"&&[l.AVAILABILITY,l.DEFAULT].includes(e)){this.mode=e}else{this.mode=l.DEFAULT}this.modal.open();s=function(){return e==l.AVAILABILITY?salla.scope.getProductAvailability(t):salla.scope.get()};return[4,salla.api.withoutNotifier(s).then((function(t){if(e==l.AVAILABILITY){return o.setScopeValues(t.data)}o.setScopeValues(t.data.scopes)})).catch((function(e){console.log(e);o.hasError=true})).finally((function(){return o.modal.stopLoading()}))];case 1:return[2,n.sent()]}}))}))};e.prototype.handleSubmit=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(s){switch(s.label){case 0:e={id:this.current_scope.id};this.changeBtn.load();return[4,salla.scope.change(e).then((function(){salla.storage.set("branch-choosed-before",true);salla.storage.set("scope",{type:t.current_scope.type,id:t.current_scope.id});var e=new URL(window.location.href);e.searchParams.set("scope",t.current_scope.id);window.location.href=e.toString();window.location.replace(e.toString())})).catch((function(e){return console.log(e)})).finally((function(){t.changeBtn.stop()}))];case 1:return[2,s.sent()]}}))}))};e.prototype.setScopeValues=function(e){this.scopes=e;this.originalScopesList=e;if(e.length==1){this.current_scope=e[0];this.selected_scope=e[0]}else{this.current_scope=e.find((function(e){return e.selected}));this.selected_scope=e.find((function(e){return e.selected}))}};e.prototype.handleSearchFieldTyping=function(e){var t=e.target.value.toLocaleLowerCase();if(!!t){this.scopes=this.originalScopesList.filter((function(e){return e.name.toLowerCase().includes(t)}))}else{this.scopes=this.originalScopesList}};e.prototype.handleScopeSelection=function(e){this.current_scope=this.scopes.find((function(t){return t.id==e.target.value}))};e.prototype.placeholderContent=function(){return s("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},s("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),s("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))};e.prototype.defaultContent=function(){var e=this;return[s("div",{class:"s-scopes-container s-scrollbar"},this.scopes.map((function(t){return s("div",{class:"s-scopes-input-wrap","data-selection":e.selection},s("input",{id:"".concat(e.selection," + '_scope_' + ").concat(t.id),name:"lang",type:"radio",value:t.id,onChange:function(t){return e.handleScopeSelection(t)},class:"s-scopes-input",checked:!!e.current_scope&&e.current_scope.id==t.id}),s("label",{htmlFor:"".concat(e.selection," + '_scope_' + ").concat(t.id),class:"s-scopes-label s-scopes-clickable"},s("span",null,t.name)))}))),this.footerContent()]};e.prototype.availabilityContent=function(){var e=this;return s("div",{class:"s-scopes-container"},this.scopes.map((function(t){var o,n,i,a,c,r;return s("div",{class:"s-scopes-input-wrap","data-selection":e.selection},s("h2",{class:{"s-scopes-label":true,"s-scopes-clickable":e.mode===l.DEFAULT}},s("span",null,t.name)),s("h2",{style:{color:(n=(o=t)===null||o===void 0?void 0:o.availability)===null||n===void 0?void 0:n.color},class:"s-scopes-".concat((a=(i=t)===null||i===void 0?void 0:i.availability)===null||a===void 0?void 0:a.key)},(r=(c=t)===null||c===void 0?void 0:c.availability)===null||r===void 0?void 0:r.label))})))};e.prototype.footerContent=function(){var e=this;return s("div",{class:"s-scopes-footer"},s("slot",{name:"footer"},s("salla-button",{ref:function(t){return e.changeBtn=t},disabled:!this.current_scope,onClick:function(){return e.handleSubmit()},class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))};e.prototype.render=function(){var e=this;return s(o,null,s("salla-modal",{ref:function(t){return e.modal=t},isClosable:!!(this.isOpenedBefore||this.selection=="optional"),class:"s-scopes-modal",isLoading:true,"has-skeleton":true},s("div",{slot:"loading"},s("div",{class:"s-scopes-skeleton"},s("salla-list-tile",{class:"s-scopes-header"},s("div",{slot:"icon",class:"s-scopes-header-icon"},s("salla-skeleton",{type:"circle"})),s("div",{slot:"title",class:"s-scopes-header-title mb-5"},s("salla-skeleton",{height:"15px",width:"50%"})),s("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},s("salla-skeleton",{height:"10px"}),s("salla-skeleton",{height:"10px",width:"75%"}))),s("div",{class:"s-scopes-skeleton-search"},s("salla-skeleton",{height:"10px",width:"50%"}),s("salla-skeleton",{height:"30px",width:"100%"})),s("div",{class:"s-scopes-skeleton-scopes"},s("salla-skeleton",{height:"10px",width:"30%"}),s("salla-skeleton",{height:"10px",width:"25%"}),s("salla-skeleton",{height:"10px",width:"30%"}),s("salla-skeleton",{height:"10px",width:"25%"}),s("salla-skeleton",{height:"10px",width:"30%"}),s("salla-skeleton",{height:"10px",width:"25%"}),s("salla-skeleton",{height:"10px",width:"30%"}),s("salla-skeleton",{height:"10px",width:"25%"})),s("div",{class:"s-scopes-skeleton-btn"},s("salla-skeleton",{height:"40px",width:"100%"})))),s("salla-list-tile",{class:this.originalScopesList.length?"s-scopes-header block":"s-hidden"},s("div",{slot:"icon",class:"s-scopes-header-icon",innerHTML:i}),s("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),s("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},!!this.selected_scope?this.selected_scope.name:"")),s("div",{class:"s-scopes-wrap"},!!this.originalScopesList.length&&s("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList.length>this.searchDisplayLimit?s("div",{class:"s-scopes-search-wrapper"},s("div",{class:"s-scopes-search-icon",innerHTML:n}),s("input",{type:"text",class:"s-scopes-search-input",onInput:function(t){return e.handleSearchFieldTyping(t)},enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||this.scopes.length<2?this.placeholderContent():this.mode===l.DEFAULT?this.defaultContent():this.availabilityContent())))};e.prototype.componentDidLoad=function(){if(!this.isOpenedBefore&&this.selection=="mandatory"){this.open()}};return e}());c.style=a}}}));