@salla.sa/twilight-components 2.11.46 → 2.11.47

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 (40) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/salla-add-product-button.cjs.entry.js +47 -23
  3. package/dist/cjs/salla-button_36.cjs.entry.js +48 -29
  4. package/dist/cjs/salla-product-options.cjs.entry.js +31 -5
  5. package/dist/cjs/twilight.cjs.js +1 -1
  6. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +94 -32
  7. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +5 -0
  8. package/dist/collection/components/salla-product-availability/salla-product-availability.js +62 -31
  9. package/dist/collection/components/salla-product-options/salla-product-options.js +94 -10
  10. package/dist/components/salla-add-product-button.js +53 -24
  11. package/dist/components/salla-localization-modal.js +5 -0
  12. package/dist/components/salla-product-availability2.js +44 -29
  13. package/dist/components/salla-product-options.js +36 -6
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/salla-add-product-button.entry.js +47 -23
  16. package/dist/esm/salla-button_36.entry.js +48 -29
  17. package/dist/esm/salla-product-options.entry.js +31 -5
  18. package/dist/esm/twilight.js +1 -1
  19. package/dist/esm-es5/loader.js +1 -1
  20. package/dist/esm-es5/salla-add-product-button.entry.js +1 -1
  21. package/dist/esm-es5/salla-button_36.entry.js +1 -1
  22. package/dist/esm-es5/salla-product-options.entry.js +2 -2
  23. package/dist/esm-es5/twilight.js +1 -1
  24. package/dist/twilight/p-124d2785.entry.js +4 -0
  25. package/dist/twilight/{p-f09bc68c.system.entry.js → p-14fd987d.system.entry.js} +1 -1
  26. package/dist/twilight/p-8343cda2.system.entry.js +4 -0
  27. package/dist/twilight/p-9fda3312.system.js +1 -1
  28. package/dist/twilight/p-cb64eda8.system.entry.js +4 -0
  29. package/dist/twilight/{p-7c9e5c11.entry.js → p-d2c63efe.entry.js} +1 -1
  30. package/dist/twilight/p-e654d498.entry.js +4 -0
  31. package/dist/twilight/twilight.esm.js +1 -1
  32. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +13 -0
  33. package/dist/types/components/salla-product-availability/salla-product-availability.d.ts +4 -0
  34. package/dist/types/components/salla-product-options/salla-product-options.d.ts +13 -0
  35. package/dist/types/components.d.ts +37 -1
  36. package/package.json +4 -4
  37. package/dist/twilight/p-4bda1676.entry.js +0 -4
  38. package/dist/twilight/p-5a1197bb.system.entry.js +0 -4
  39. package/dist/twilight/p-cc128664.system.entry.js +0 -4
  40. package/dist/twilight/p-dbb379ce.entry.js +0 -4
@@ -18,40 +18,13 @@ const SallaProductAvailability = /*@__PURE__*/ proxyCustomElement(class extends
18
18
  this.isUser = salla.config.isUser();
19
19
  this.translationLoaded = false;
20
20
  /**
21
- * product id that can visitor subscribe to its availability notification
21
+ * Listen to product options availability.
22
22
  */
23
- this.productId = salla.config.get('page.id');
23
+ this.notifyOptionsAvailability = false;
24
24
  /**
25
25
  * is current user already subscribed
26
26
  */
27
27
  this.isSubscribed = false;
28
- // @Method()
29
- this.submit = async () => {
30
- if (this.isUser) {
31
- return salla.api.product.availabilitySubscribe(this.productId)
32
- .then(() => this.isSubscribed = true);
33
- }
34
- let data = { id: this.productId };
35
- if (this.channels_.includes('sms')) {
36
- let { phone, countryCode } = await this.mobileInput.getValues();
37
- data['country_code'] = countryCode;
38
- data['phone'] = phone;
39
- }
40
- if (this.channels_.includes('email')) {
41
- this.email.value !== '' && (data['email'] = this.email.value);
42
- }
43
- await this.validateform();
44
- return this.btn.load()
45
- .then(() => this.btn.disable())
46
- .then(() => salla.api.product.availabilitySubscribe(data))
47
- .then(() => {
48
- this.isSubscribed = true;
49
- salla.storage.set(`product-${this.productId}-subscribed`, true);
50
- }) //no need to wait until finishing alert animation
51
- .then(() => this.btn.stop())
52
- .then(() => this.modal.close())
53
- .catch(() => this.btn.stop() && this.btn.enable());
54
- };
55
28
  // helpers
56
29
  this.typing = (e, submitMethod) => {
57
30
  const error = e.target.nextElementSibling;
@@ -65,6 +38,9 @@ const SallaProductAvailability = /*@__PURE__*/ proxyCustomElement(class extends
65
38
  this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
66
39
  (_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title_);
67
40
  });
41
+ if (!this.productId) {
42
+ this.productId = salla.config.get('page.id');
43
+ }
68
44
  if (this.isUser)
69
45
  return;
70
46
  this.channelsWatcher(this.channels);
@@ -75,6 +51,44 @@ const SallaProductAvailability = /*@__PURE__*/ proxyCustomElement(class extends
75
51
  channelsWatcher(newValue) {
76
52
  this.channels_ = !!newValue ? newValue.split(',') : [];
77
53
  }
54
+ // @Method()
55
+ async submit() {
56
+ var _a;
57
+ let payload = { id: this.productId };
58
+ if (this.notifyOptionsAvailability) {
59
+ payload.options = [];
60
+ let options = await ((_a = document.querySelector(`salla-product-options[product-id="${this.productId}"]`)) === null || _a === void 0 ? void 0 : _a.getSelectedOptionsData());
61
+ Object.values(options).forEach(option => {
62
+ //inject numbers only, without zeros
63
+ if (option && !isNaN(option)) {
64
+ payload.options.push(Number(option));
65
+ }
66
+ });
67
+ }
68
+ if (this.isUser) {
69
+ return salla.api.product.availabilitySubscribe(payload)
70
+ .then(() => this.isSubscribed = true);
71
+ }
72
+ if (this.channels_.includes('sms')) {
73
+ let { phone, countryCode } = await this.mobileInput.getValues();
74
+ payload['country_code'] = countryCode;
75
+ payload['phone'] = phone;
76
+ }
77
+ if (this.channels_.includes('email')) {
78
+ this.email.value !== '' && (payload['email'] = this.email.value);
79
+ }
80
+ await this.validateform();
81
+ return this.btn.load()
82
+ .then(() => this.btn.disable())
83
+ .then(() => salla.api.product.availabilitySubscribe(payload))
84
+ .then(() => {
85
+ this.isSubscribed = true;
86
+ salla.storage.set(`product-${this.productId}-subscribed`, true);
87
+ }) //no need to wait until finishing alert animation
88
+ .then(() => this.btn.stop())
89
+ .then(() => this.modal.close())
90
+ .catch(() => this.btn.stop() && this.btn.enable());
91
+ }
78
92
  async validateform() {
79
93
  try {
80
94
  if (this.channels_.includes('email')) {
@@ -120,6 +134,7 @@ const SallaProductAvailability = /*@__PURE__*/ proxyCustomElement(class extends
120
134
  static get style() { return sallaProductAvailabilityCss; }
121
135
  }, [0, "salla-product-availability", {
122
136
  "channels": [1],
137
+ "notifyOptionsAvailability": [4, "notify-options-availability"],
123
138
  "productId": [2, "product-id"],
124
139
  "isSubscribed": [1028, "is-subscribed"],
125
140
  "translationLoaded": [32],
@@ -70,6 +70,7 @@ const SallaProductOptions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
70
70
  };
71
71
  this.outOfStockText = salla.lang.get("pages.products.out_of_stock");
72
72
  this.donationAmount = salla.lang.get('pages.products.donation_amount');
73
+ this.selectedOptions = [];
73
74
  /**
74
75
  * The id of the product to which the options are going to be fetched for.
75
76
  */
@@ -97,6 +98,29 @@ const SallaProductOptions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
97
98
  });
98
99
  }
99
100
  }
101
+ /**
102
+ * Get the id's of the selected options.
103
+ * */
104
+ async getSelectedOptionsData() {
105
+ let selectedOptions = {};
106
+ let formData = this.host.getElementSallaData();
107
+ formData.forEach(function (value, key) {
108
+ key.startsWith('options[') && (selectedOptions[key.replace('options[', '').replace(']', '')] = value);
109
+ });
110
+ return selectedOptions;
111
+ }
112
+ /**
113
+ * Get selected options.
114
+ * */
115
+ async getSelectedOptions() {
116
+ return this.selectedOptions;
117
+ }
118
+ /**
119
+ * Get a specific option by its id.
120
+ * */
121
+ async getOption(option_id) {
122
+ return this.optionsData.find(option => option.id === option_id);
123
+ }
100
124
  changedHandler(event, option) {
101
125
  let data = { event: event, option: option, detail: null };
102
126
  if (option.details) {
@@ -105,6 +129,8 @@ const SallaProductOptions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
105
129
  });
106
130
  data.detail = detail;
107
131
  }
132
+ const index = this.selectedOptions.findIndex(option => option.option_id === data.option.id);
133
+ index > -1 ? this.selectedOptions[index] = Object.assign(Object.assign({}, data.detail), { option_id: data.option.id }) : this.selectedOptions.push(Object.assign(Object.assign({}, data.detail), { option_id: data.option.id }));
108
134
  this.handleRequiredMultipleOptions(option);
109
135
  this.changed.emit(data);
110
136
  salla.event.emit('product-options::change', data);
@@ -230,7 +256,7 @@ const SallaProductOptions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
230
256
  singleOption(option) {
231
257
  return h("div", null, h("select", { name: `options[${option.id}]`, required: option.required, class: "s-form-control", onChange: e => this.changedHandler(e, option) }, h("option", { value: "" }, option.placeholder), option === null || option === void 0 ? void 0 :
232
258
  option.details.map((detail) => {
233
- return h("option", { value: detail.id, disabled: detail.is_out, selected: detail.is_selected }, this.getOptionDetailName(detail));
259
+ return h("option", { value: detail.id, selected: detail.is_selected }, this.getOptionDetailName(detail));
234
260
  })));
235
261
  }
236
262
  multipleOptions(option) {
@@ -240,14 +266,14 @@ const SallaProductOptions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
240
266
  }
241
267
  //@ts-ignore
242
268
  colorOption(option) {
243
- return h("fieldset", { class: "s-product-options-colors-wrapper" }, option === null || option === void 0 ? void 0 : option.details.map((detail) => h("div", null, h("input", { type: "radio", value: detail.id, disabled: detail.is_out, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, id: `color-${this.productId}-${option.id}-${detail.id}`, onChange: e => this.changedHandler(e, option) }), h("label", { htmlFor: `color-${this.productId}-${option.id}-${detail.id}` }, h("span", { style: { "background-color": detail.color } }), h("p", null, this.getOptionDetailName(detail))))));
269
+ return h("fieldset", { class: "s-product-options-colors-wrapper" }, option === null || option === void 0 ? void 0 : option.details.map((detail) => h("div", null, h("input", { type: "radio", value: detail.id, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, id: `color-${this.productId}-${option.id}-${detail.id}`, onChange: e => this.changedHandler(e, option) }), h("label", { htmlFor: `color-${this.productId}-${option.id}-${detail.id}` }, h("span", { style: { "background-color": detail.color } }), h("p", null, this.getOptionDetailName(detail))))));
244
270
  }
245
271
  //@ts-ignore
246
272
  thumbnailOption(option) {
247
273
  return h("div", { class: "s-product-options-thumbnails-wrapper" }, option.details.map((detail) => {
248
- return h("div", null, h("input", { type: "radio", value: detail.id, "data-itemid": detail.id, disabled: detail.is_out, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, "data-img-id": detail.option_value, id: `option_${this.productId}-${option.id}_${detail.id}`, onChange: (e) => this.changedHandler(e, option) }), h("label", { htmlFor: `option_${this.productId}-${option.id}_${detail.id}`, "data-img-id": detail.option_value, class: "go-to-slide" }, h("img", { "data-src": detail.image, src: detail.image, title: detail.name, alt: detail.name }), h("span", { innerHTML: CheckCircleIcon, class: "s-product-options-thumbnails-icon" })), h("p", null, this.getOptionDetailName(detail, false), " "), detail.is_out ?
249
- [h("small", { class: "s-product-options-thumbnails-stock-badge" }, this.outOfStockText), h("div", { class: "s-product-options-thumbnails-badge-overlay" })]
250
- : '');
274
+ return h("div", null, h("input", { type: "radio", value: detail.id, "data-itemid": detail.id, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, "data-img-id": detail.option_value, id: `option_${this.productId}-${option.id}_${detail.id}`, onChange: (e) => this.changedHandler(e, option) }), h("label", { htmlFor: `option_${this.productId}-${option.id}_${detail.id}`, "data-img-id": detail.option_value, class: "go-to-slide" }, h("img", { "data-src": detail.image, src: detail.image, title: detail.name, alt: detail.name }), h("span", { innerHTML: CheckCircleIcon, class: "s-product-options-thumbnails-icon" }), detail.is_out ?
275
+ h("small", { class: "s-product-options-thumbnails-stock-badge" }, this.outOfStockText)
276
+ : ''), h("p", null, this.getOptionDetailName(detail, false), " "));
251
277
  }));
252
278
  }
253
279
  get host() { return this; }
@@ -257,7 +283,11 @@ const SallaProductOptions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
257
283
  "options": [1],
258
284
  "optionsData": [32],
259
285
  "outOfStockText": [32],
260
- "donationAmount": [32]
286
+ "donationAmount": [32],
287
+ "selectedOptions": [32],
288
+ "getSelectedOptionsData": [64],
289
+ "getSelectedOptions": [64],
290
+ "getOption": [64]
261
291
  }]);
262
292
  function defineCustomElement$1() {
263
293
  if (typeof customElements === "undefined") {
@@ -30,7 +30,7 @@ const defineCustomElements = (win, options) => {
30
30
  if (typeof window === 'undefined') return Promise.resolve();
31
31
  return patchEsm().then(() => {
32
32
  globalScripts();
33
- return bootstrapLazy(JSON.parse("[[\"salla-button_36\",[[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],\"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\":[1544,\"prize-points\"],\"customerPoints\":[1538,\"customer-points\"],\"prizeTitle\":[1537,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1025,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[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],\"dragAndDrop\":[32],\"browseFromFiles\":[32],\"customFields\":[32],\"uploadedImage\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"productID\":[32],\"translationLoaded\":[32],\"addToCartLabel\":[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]}],[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"loading\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[0,\"salla-quick-order\",{\"quickOrderTitle\":[1025,\"quick-order-title\"],\"subTitle\":[1025,\"sub-title\"],\"payButtonTitle\":[1025,\"pay-button-title\"],\"confirmPayButtonTitle\":[1025,\"confirm-pay-button-title\"],\"agreementText\":[1025,\"agreement-text\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"productId\":[1025,\"product-id\"],\"thanksMessage\":[1025,\"thanks-message\"],\"quickOrderStyle\":[1025,\"quick-order-style\"],\"user\":[32],\"isAvailable\":[32],\"oneClick\":[32],\"expanded\":[32],\"isTermsRequired\":[32],\"countryCode\":[32],\"submitSucess\":[32],\"placeHolderEmail\":[32],\"emailOptional\":[32],\"agreementShowText\":[32],\"agreementModalHead\":[32],\"userNameLabel\":[32],\"termsChecked\":[32]}],[0,\"salla-user-settings\",{\"isNotifiable\":[516,\"is-notifiable\"],\"deactivateAccount\":[32],\"promotionalMsgs\":[32],\"deactivateDesc\":[32],\"promotionalMsgsDesc\":[32],\"sorryForLeavingText\":[32],\"warningText\":[32],\"keepAccount\":[32],\"buttonLoading\":[32]}],[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\"]]],[0,\"salla-comment-form\",{\"type\":[1537],\"showAvatar\":[4,\"show-avatar\"],\"itemId\":[1544,\"item-id\"],\"placeholder\":[32],\"submitText\":[32],\"canComment\":[32]}],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[513],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"convertedPlatforms\":[32],\"open\":[64]}],[4,\"salla-cart-summary\",{\"cartSummaryCount\":[32],\"cartSummaryTotal\":[32],\"animateToCart\":[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-user-menu\",{\"inline\":[516],\"avatarOnly\":[516,\"avatar-only\"],\"showHeader\":[516,\"show-header\"],\"relativeDropdown\":[516,\"relative-dropdown\"],\"accountLoading\":[32],\"opened\":[32],\"notifications\":[32],\"orders\":[32],\"pending_orders\":[32],\"wishlist\":[32],\"profile\":[32],\"rating\":[32],\"logout\":[32],\"hello\":[32],\"first_name\":[32],\"last_name\":[32],\"avatar\":[32],\"badges\":[32],\"hasBadges\":[32],\"OrderUpdate\":[32]}],[0,\"salla-product-availability\",{\"channels\":[1],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[4,\"salla-map\",{\"name\":[1],\"required\":[4],\"readonly\":[4],\"searchable\":[1028],\"lat\":[1026],\"lng\":[1026],\"apiKey\":[1025,\"api-key\"],\"modalTitle\":[1,\"modal-title\"],\"zoom\":[1026],\"theme\":[1025],\"modalActivityTitle\":[32],\"confirmButtonTitle\":[32],\"locateButtonTitle\":[32],\"locateButtonEdit\":[32],\"searchPlaceholder\":[32],\"searchInputValue\":[32],\"formattedAddress\":[32],\"geolocationError\":[32],\"searchInput\":[32],\"mapInput\":[32],\"mapElement\":[32],\"selectedLat\":[32],\"selectedLng\":[32],\"open\":[64]}],[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]}],[4,\"salla-color-picker\",{\"name\":[1],\"required\":[4],\"color\":[1],\"format\":[1],\"showCancelButton\":[4,\"show-cancel-button\"],\"showTextField\":[4,\"show-text-field\"],\"enableAlpha\":[4,\"enable-alpha\"],\"widgetColor\":[32],\"setPickerOption\":[64],\"movePopUp\":[64],\"setColorValue\":[64],\"openPicker\":[64],\"closePicker\":[64],\"destroyPicker\":[64]}],[0,\"salla-progress-bar\",{\"donation\":[1],\"target\":[1026],\"value\":[1026],\"height\":[1025],\"header\":[1025],\"stripped\":[1028],\"message\":[1025],\"unit\":[1025],\"color\":[1025]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2],\"reviews\":[2]}],[0,\"salla-datetime-picker\",{\"value\":[1537],\"required\":[4],\"name\":[513],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"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\"],\"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]}],[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\"]]],[0,\"salla-file-upload\",{\"value\":[1537],\"files\":[513],\"height\":[513],\"cartItemId\":[1,\"cart-item-id\"],\"profileImage\":[516,\"profile-image\"],\"name\":[1537],\"payloadName\":[1,\"payload-name\"],\"accept\":[1537],\"fileId\":[2,\"file-id\"],\"url\":[1025],\"method\":[1],\"formData\":[1,\"form-data\"],\"required\":[4],\"maxFileSize\":[1,\"max-file-size\"],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"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],\"instantUpload\":[1028,\"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\":[1025,\"label-idle\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"setOption\":[64]}],[4,\"salla-slider\",{\"blockTitle\":[513,\"block-title\"],\"listenToThumbnailsOption\":[516,\"listen-to-thumbnails-option\"],\"blockSubtitle\":[513,\"block-subtitle\"],\"displayAllUrl\":[513,\"display-all-url\"],\"arrowsCentered\":[516,\"arrows-centered\"],\"verticalThumbs\":[516,\"vertical-thumbs\"],\"vertical\":[516],\"autoHeight\":[516,\"auto-height\"],\"showControls\":[516,\"show-controls\"],\"controlsOuter\":[516,\"controls-outer\"],\"showThumbsControls\":[4,\"show-thumbs-controls\"],\"autoPlay\":[4,\"auto-play\"],\"slidesPerView\":[1,\"slides-per-view\"],\"pagination\":[4],\"centered\":[4],\"loop\":[4],\"type\":[1],\"sliderConfig\":[520,\"slider-config\"],\"thumbsConfig\":[520,\"thumbs-config\"],\"currentIndex\":[32],\"isEnd\":[32],\"isBeginning\":[32],\"isRTL\":[32],\"swiperScript\":[32],\"displayAllTitle\":[32],\"slideTo\":[64],\"slideNext\":[64],\"slidePrev\":[64],\"slideToLoop\":[64],\"slideNextLoop\":[64],\"slidePrevLoop\":[64],\"slideReset\":[64],\"slideToClosest\":[64],\"update\":[64],\"updateAutoHeight\":[64],\"updateSlides\":[64],\"updateProgress\":[64],\"updateSlidesClasses\":[64],\"getSlides\":[64]}],[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]},[[0,\"keyup\",\"handleKeyUp\"]]],[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-product-options\",[[0,\"salla-product-options\",{\"productId\":[2,\"product-id\"],\"options\":[1],\"optionsData\":[32],\"outOfStockText\":[32],\"donationAmount\":[32]}]]],[\"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-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\"]}]]],[\"salla-conditional-fields\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]]]"), options);
33
+ return bootstrapLazy(JSON.parse("[[\"salla-button_36\",[[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],\"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\":[1544,\"prize-points\"],\"customerPoints\":[1538,\"customer-points\"],\"prizeTitle\":[1537,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1025,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[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],\"dragAndDrop\":[32],\"browseFromFiles\":[32],\"customFields\":[32],\"uploadedImage\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"productID\":[32],\"translationLoaded\":[32],\"addToCartLabel\":[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]}],[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"loading\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[0,\"salla-quick-order\",{\"quickOrderTitle\":[1025,\"quick-order-title\"],\"subTitle\":[1025,\"sub-title\"],\"payButtonTitle\":[1025,\"pay-button-title\"],\"confirmPayButtonTitle\":[1025,\"confirm-pay-button-title\"],\"agreementText\":[1025,\"agreement-text\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"productId\":[1025,\"product-id\"],\"thanksMessage\":[1025,\"thanks-message\"],\"quickOrderStyle\":[1025,\"quick-order-style\"],\"user\":[32],\"isAvailable\":[32],\"oneClick\":[32],\"expanded\":[32],\"isTermsRequired\":[32],\"countryCode\":[32],\"submitSucess\":[32],\"placeHolderEmail\":[32],\"emailOptional\":[32],\"agreementShowText\":[32],\"agreementModalHead\":[32],\"userNameLabel\":[32],\"termsChecked\":[32]}],[0,\"salla-user-settings\",{\"isNotifiable\":[516,\"is-notifiable\"],\"deactivateAccount\":[32],\"promotionalMsgs\":[32],\"deactivateDesc\":[32],\"promotionalMsgsDesc\":[32],\"sorryForLeavingText\":[32],\"warningText\":[32],\"keepAccount\":[32],\"buttonLoading\":[32]}],[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\"]]],[0,\"salla-comment-form\",{\"type\":[1537],\"showAvatar\":[4,\"show-avatar\"],\"itemId\":[1544,\"item-id\"],\"placeholder\":[32],\"submitText\":[32],\"canComment\":[32]}],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[513],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"convertedPlatforms\":[32],\"open\":[64]}],[4,\"salla-cart-summary\",{\"cartSummaryCount\":[32],\"cartSummaryTotal\":[32],\"animateToCart\":[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-user-menu\",{\"inline\":[516],\"avatarOnly\":[516,\"avatar-only\"],\"showHeader\":[516,\"show-header\"],\"relativeDropdown\":[516,\"relative-dropdown\"],\"accountLoading\":[32],\"opened\":[32],\"notifications\":[32],\"orders\":[32],\"pending_orders\":[32],\"wishlist\":[32],\"profile\":[32],\"rating\":[32],\"logout\":[32],\"hello\":[32],\"first_name\":[32],\"last_name\":[32],\"avatar\":[32],\"badges\":[32],\"hasBadges\":[32],\"OrderUpdate\":[32]}],[0,\"salla-product-availability\",{\"channels\":[1],\"notifyOptionsAvailability\":[4,\"notify-options-availability\"],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[4,\"salla-map\",{\"name\":[1],\"required\":[4],\"readonly\":[4],\"searchable\":[1028],\"lat\":[1026],\"lng\":[1026],\"apiKey\":[1025,\"api-key\"],\"modalTitle\":[1,\"modal-title\"],\"zoom\":[1026],\"theme\":[1025],\"modalActivityTitle\":[32],\"confirmButtonTitle\":[32],\"locateButtonTitle\":[32],\"locateButtonEdit\":[32],\"searchPlaceholder\":[32],\"searchInputValue\":[32],\"formattedAddress\":[32],\"geolocationError\":[32],\"searchInput\":[32],\"mapInput\":[32],\"mapElement\":[32],\"selectedLat\":[32],\"selectedLng\":[32],\"open\":[64]}],[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]}],[4,\"salla-color-picker\",{\"name\":[1],\"required\":[4],\"color\":[1],\"format\":[1],\"showCancelButton\":[4,\"show-cancel-button\"],\"showTextField\":[4,\"show-text-field\"],\"enableAlpha\":[4,\"enable-alpha\"],\"widgetColor\":[32],\"setPickerOption\":[64],\"movePopUp\":[64],\"setColorValue\":[64],\"openPicker\":[64],\"closePicker\":[64],\"destroyPicker\":[64]}],[0,\"salla-progress-bar\",{\"donation\":[1],\"target\":[1026],\"value\":[1026],\"height\":[1025],\"header\":[1025],\"stripped\":[1028],\"message\":[1025],\"unit\":[1025],\"color\":[1025]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2],\"reviews\":[2]}],[0,\"salla-datetime-picker\",{\"value\":[1537],\"required\":[4],\"name\":[513],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"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\"],\"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]}],[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\"]]],[0,\"salla-file-upload\",{\"value\":[1537],\"files\":[513],\"height\":[513],\"cartItemId\":[1,\"cart-item-id\"],\"profileImage\":[516,\"profile-image\"],\"name\":[1537],\"payloadName\":[1,\"payload-name\"],\"accept\":[1537],\"fileId\":[2,\"file-id\"],\"url\":[1025],\"method\":[1],\"formData\":[1,\"form-data\"],\"required\":[4],\"maxFileSize\":[1,\"max-file-size\"],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"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],\"instantUpload\":[1028,\"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\":[1025,\"label-idle\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"setOption\":[64]}],[4,\"salla-slider\",{\"blockTitle\":[513,\"block-title\"],\"listenToThumbnailsOption\":[516,\"listen-to-thumbnails-option\"],\"blockSubtitle\":[513,\"block-subtitle\"],\"displayAllUrl\":[513,\"display-all-url\"],\"arrowsCentered\":[516,\"arrows-centered\"],\"verticalThumbs\":[516,\"vertical-thumbs\"],\"vertical\":[516],\"autoHeight\":[516,\"auto-height\"],\"showControls\":[516,\"show-controls\"],\"controlsOuter\":[516,\"controls-outer\"],\"showThumbsControls\":[4,\"show-thumbs-controls\"],\"autoPlay\":[4,\"auto-play\"],\"slidesPerView\":[1,\"slides-per-view\"],\"pagination\":[4],\"centered\":[4],\"loop\":[4],\"type\":[1],\"sliderConfig\":[520,\"slider-config\"],\"thumbsConfig\":[520,\"thumbs-config\"],\"currentIndex\":[32],\"isEnd\":[32],\"isBeginning\":[32],\"isRTL\":[32],\"swiperScript\":[32],\"displayAllTitle\":[32],\"slideTo\":[64],\"slideNext\":[64],\"slidePrev\":[64],\"slideToLoop\":[64],\"slideNextLoop\":[64],\"slidePrevLoop\":[64],\"slideReset\":[64],\"slideToClosest\":[64],\"update\":[64],\"updateAutoHeight\":[64],\"updateSlides\":[64],\"updateProgress\":[64],\"updateSlidesClasses\":[64],\"getSlides\":[64]}],[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]},[[0,\"keyup\",\"handleKeyUp\"]]],[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-product-options\",[[0,\"salla-product-options\",{\"productId\":[2,\"product-id\"],\"options\":[1],\"optionsData\":[32],\"outOfStockText\":[32],\"donationAmount\":[32],\"selectedOptions\":[32],\"getSelectedOptionsData\":[64],\"getSelectedOptions\":[64],\"getOption\":[64]}]]],[\"salla-add-product-button\",[[4,\"salla-add-product-button\",{\"channels\":[513],\"subscribedOptions\":[1,\"subscribed-options\"],\"quantity\":[514],\"donatingAmount\":[514,\"donating-amount\"],\"notifyOptionsAvailability\":[516,\"notify-options-availability\"],\"productId\":[520,\"product-id\"],\"productStatus\":[513,\"product-status\"],\"productType\":[513,\"product-type\"],\"hasOutOfStockOption\":[32],\"hasSubscribedOptions\":[32],\"selectedOptions\":[32]}]]],[\"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\"]}]]],[\"salla-conditional-fields\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]]]"), options);
34
34
  });
35
35
  };
36
36
 
@@ -11,19 +11,6 @@ const SallaAddProductButton = class {
11
11
  this.success = createEvent(this, "success", 7);
12
12
  this.failed = createEvent(this, "failed", 7);
13
13
  this.hostAttributes = {};
14
- this.hasLabel = false;
15
- /**
16
- * Channels.
17
- */
18
- this.channels = null;
19
- /**
20
- * Product Quantity
21
- */
22
- this.quantity = 0;
23
- /**
24
- * Donating amount.
25
- */
26
- this.donatingAmount = 0;
27
14
  /**
28
15
  * Product Status.Defaults to `sale`
29
16
  */
@@ -32,6 +19,7 @@ const SallaAddProductButton = class {
32
19
  * Product type. Defaults to `product`
33
20
  */
34
21
  this.productType = 'product';
22
+ this.selectedOptions = [];
35
23
  }
36
24
  getLabel() {
37
25
  if (this.productStatus === 'sale') {
@@ -65,7 +53,10 @@ const SallaAddProductButton = class {
65
53
  endpoint: 'quickAdd'
66
54
  }).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
67
55
  return salla.cart.addItem(data)
68
- .then(response => this.success.emit(response))
56
+ .then(response => {
57
+ this.selectedOptions = [];
58
+ this.success.emit(response);
59
+ })
69
60
  .catch(error => this.failed.emit(error));
70
61
  }
71
62
  addBookingProduct() {
@@ -86,27 +77,60 @@ const SallaAddProductButton = class {
86
77
  }
87
78
  return this.hostAttributes;
88
79
  }
80
+ pushSelectedOption(data) {
81
+ const index = this.selectedOptions.findIndex(option => option.option_id === data.option.id);
82
+ if (index > -1) {
83
+ this.selectedOptions[index] = Object.assign(Object.assign({}, data.detail), { option_id: data.option.id });
84
+ }
85
+ else {
86
+ this.selectedOptions.push(Object.assign(Object.assign({}, data.detail), { option_id: data.option.id }));
87
+ }
88
+ this.hasOutOfStockOption = this.selectedOptions.some(option => option.is_out);
89
+ }
89
90
  componentWillLoad() {
90
91
  this.hasLabel = !!this.host.innerHTML.replace('<!---->', '').trim();
91
92
  }
92
93
  render() {
93
94
  var _a;
94
95
  //TODO:: find a better fix, this is a patch for issue that duplicates the buttons more than twice @see the screenshot inside this folder
95
- return ((_a = this.host.closest('.swiper-slide')) === null || _a === void 0 ? void 0 : _a.classList.contains('swiper-slide-duplicate'))
96
- ? ''
97
- : (h(Host, null, this.productStatus === 'out-and-notify' && this.channels ?
98
- h("salla-product-availability", Object.assign({}, this.getBtnAttributes()), h("slot", null)) :
99
- h("salla-button", Object.assign({ ref: el => this.btn = el, onClick: event => this.addProductToCart(event), type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', color: this.productStatus === 'sale' ? 'primary' : 'light', "loader-position": "center" }, this.getBtnAttributes(), { disabled: this.productStatus !== 'sale' }), h("slot", null))));
96
+ if ((_a = this.host.closest('.swiper-slide')) === null || _a === void 0 ? void 0 : _a.classList.contains('swiper-slide-duplicate')) {
97
+ return '';
98
+ }
99
+ if (this.hasSubscribedOptions) {
100
+ return h(Host, null, h("salla-product-availability", Object.assign({}, this.getBtnAttributes(), { "is-subscribed": true })));
101
+ }
102
+ if ((this.productStatus === 'out-and-notify' && this.channels) || this.hasOutOfStockOption) {
103
+ return h(Host, null, h("salla-product-availability", Object.assign({}, this.getBtnAttributes())));
104
+ }
105
+ return h(Host, null, h("salla-button", Object.assign({ color: this.productStatus === 'sale' ? 'primary' : 'light', fill: this.productStatus === 'sale' ? 'solid' : 'outline', ref: el => this.btn = el, onClick: event => this.addProductToCart(event), disabled: this.productStatus !== 'sale' }, this.getBtnAttributes(), { "loader-position": "center", type: "button" }), h("slot", null)));
106
+ }
107
+ componentDidLoad() {
108
+ if (!this.notifyOptionsAvailability) {
109
+ return;
110
+ }
111
+ salla.event.on('product-options::change', data => {
112
+ if (!['thumbnail', 'color', 'single-option'].includes(data.option.type)) {
113
+ return;
114
+ }
115
+ this.pushSelectedOption(data);
116
+ this.hasLabel = false;
117
+ if (!this.subscribedOptions) {
118
+ return;
119
+ }
120
+ //check if subscribedOptions are the selected now
121
+ this.hasSubscribedOptions = JSON.parse(this.subscribedOptions)
122
+ .filter(ids => ids.every(id => this.selectedOptions.some(option => option.id === id)))
123
+ .length > 0;
124
+ });
100
125
  }
101
126
  componentDidRender() {
127
+ var _a;
102
128
  //if label not passed, get label
103
129
  if (this.hasLabel) {
104
130
  return;
105
131
  }
106
- this.btn.setText(this.getLabel() || 'اضافة للسلة');
107
- salla.lang.onLoaded(() => {
108
- this.btn.setText(this.getLabel() || 'اضافة للسلة');
109
- });
132
+ (_a = this.btn) === null || _a === void 0 ? void 0 : _a.setText(this.getLabel());
133
+ salla.lang.onLoaded(() => { var _a; return (_a = this.btn) === null || _a === void 0 ? void 0 : _a.setText(this.getLabel()); });
110
134
  }
111
135
  get host() { return getElement(this); }
112
136
  };
@@ -21474,6 +21474,11 @@ const SallaLocalizationModal = class {
21474
21474
  this.modal.open();
21475
21475
  return await salla.api.withoutNotifier(() => this.getLanguages())
21476
21476
  .then(() => this.getCurrencies())
21477
+ .then(() => {
21478
+ if (this.languages.length < 2 && this.currencies.length < 2) {
21479
+ this.modal.close();
21480
+ }
21481
+ })
21477
21482
  .catch(e => {
21478
21483
  var _a, _b, _c, _d;
21479
21484
  console.log(e);
@@ -23124,40 +23129,13 @@ const SallaProductAvailability = class {
23124
23129
  this.isUser = salla.config.isUser();
23125
23130
  this.translationLoaded = false;
23126
23131
  /**
23127
- * product id that can visitor subscribe to its availability notification
23132
+ * Listen to product options availability.
23128
23133
  */
23129
- this.productId = salla.config.get('page.id');
23134
+ this.notifyOptionsAvailability = false;
23130
23135
  /**
23131
23136
  * is current user already subscribed
23132
23137
  */
23133
23138
  this.isSubscribed = false;
23134
- // @Method()
23135
- this.submit = async () => {
23136
- if (this.isUser) {
23137
- return salla.api.product.availabilitySubscribe(this.productId)
23138
- .then(() => this.isSubscribed = true);
23139
- }
23140
- let data = { id: this.productId };
23141
- if (this.channels_.includes('sms')) {
23142
- let { phone, countryCode } = await this.mobileInput.getValues();
23143
- data['country_code'] = countryCode;
23144
- data['phone'] = phone;
23145
- }
23146
- if (this.channels_.includes('email')) {
23147
- this.email.value !== '' && (data['email'] = this.email.value);
23148
- }
23149
- await this.validateform();
23150
- return this.btn.load()
23151
- .then(() => this.btn.disable())
23152
- .then(() => salla.api.product.availabilitySubscribe(data))
23153
- .then(() => {
23154
- this.isSubscribed = true;
23155
- salla.storage.set(`product-${this.productId}-subscribed`, true);
23156
- }) //no need to wait until finishing alert animation
23157
- .then(() => this.btn.stop())
23158
- .then(() => this.modal.close())
23159
- .catch(() => this.btn.stop() && this.btn.enable());
23160
- };
23161
23139
  // helpers
23162
23140
  this.typing = (e, submitMethod) => {
23163
23141
  const error = e.target.nextElementSibling;
@@ -23171,6 +23149,9 @@ const SallaProductAvailability = class {
23171
23149
  this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
23172
23150
  (_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title_);
23173
23151
  });
23152
+ if (!this.productId) {
23153
+ this.productId = salla.config.get('page.id');
23154
+ }
23174
23155
  if (this.isUser)
23175
23156
  return;
23176
23157
  this.channelsWatcher(this.channels);
@@ -23181,6 +23162,44 @@ const SallaProductAvailability = class {
23181
23162
  channelsWatcher(newValue) {
23182
23163
  this.channels_ = !!newValue ? newValue.split(',') : [];
23183
23164
  }
23165
+ // @Method()
23166
+ async submit() {
23167
+ var _a;
23168
+ let payload = { id: this.productId };
23169
+ if (this.notifyOptionsAvailability) {
23170
+ payload.options = [];
23171
+ let options = await ((_a = document.querySelector(`salla-product-options[product-id="${this.productId}"]`)) === null || _a === void 0 ? void 0 : _a.getSelectedOptionsData());
23172
+ Object.values(options).forEach(option => {
23173
+ //inject numbers only, without zeros
23174
+ if (option && !isNaN(option)) {
23175
+ payload.options.push(Number(option));
23176
+ }
23177
+ });
23178
+ }
23179
+ if (this.isUser) {
23180
+ return salla.api.product.availabilitySubscribe(payload)
23181
+ .then(() => this.isSubscribed = true);
23182
+ }
23183
+ if (this.channels_.includes('sms')) {
23184
+ let { phone, countryCode } = await this.mobileInput.getValues();
23185
+ payload['country_code'] = countryCode;
23186
+ payload['phone'] = phone;
23187
+ }
23188
+ if (this.channels_.includes('email')) {
23189
+ this.email.value !== '' && (payload['email'] = this.email.value);
23190
+ }
23191
+ await this.validateform();
23192
+ return this.btn.load()
23193
+ .then(() => this.btn.disable())
23194
+ .then(() => salla.api.product.availabilitySubscribe(payload))
23195
+ .then(() => {
23196
+ this.isSubscribed = true;
23197
+ salla.storage.set(`product-${this.productId}-subscribed`, true);
23198
+ }) //no need to wait until finishing alert animation
23199
+ .then(() => this.btn.stop())
23200
+ .then(() => this.modal.close())
23201
+ .catch(() => this.btn.stop() && this.btn.enable());
23202
+ }
23184
23203
  async validateform() {
23185
23204
  try {
23186
23205
  if (this.channels_.includes('email')) {
@@ -60,6 +60,7 @@ const SallaProductOptions = class {
60
60
  };
61
61
  this.outOfStockText = salla.lang.get("pages.products.out_of_stock");
62
62
  this.donationAmount = salla.lang.get('pages.products.donation_amount');
63
+ this.selectedOptions = [];
63
64
  /**
64
65
  * The id of the product to which the options are going to be fetched for.
65
66
  */
@@ -87,6 +88,29 @@ const SallaProductOptions = class {
87
88
  });
88
89
  }
89
90
  }
91
+ /**
92
+ * Get the id's of the selected options.
93
+ * */
94
+ async getSelectedOptionsData() {
95
+ let selectedOptions = {};
96
+ let formData = this.host.getElementSallaData();
97
+ formData.forEach(function (value, key) {
98
+ key.startsWith('options[') && (selectedOptions[key.replace('options[', '').replace(']', '')] = value);
99
+ });
100
+ return selectedOptions;
101
+ }
102
+ /**
103
+ * Get selected options.
104
+ * */
105
+ async getSelectedOptions() {
106
+ return this.selectedOptions;
107
+ }
108
+ /**
109
+ * Get a specific option by its id.
110
+ * */
111
+ async getOption(option_id) {
112
+ return this.optionsData.find(option => option.id === option_id);
113
+ }
90
114
  changedHandler(event, option) {
91
115
  let data = { event: event, option: option, detail: null };
92
116
  if (option.details) {
@@ -95,6 +119,8 @@ const SallaProductOptions = class {
95
119
  });
96
120
  data.detail = detail;
97
121
  }
122
+ const index = this.selectedOptions.findIndex(option => option.option_id === data.option.id);
123
+ index > -1 ? this.selectedOptions[index] = Object.assign(Object.assign({}, data.detail), { option_id: data.option.id }) : this.selectedOptions.push(Object.assign(Object.assign({}, data.detail), { option_id: data.option.id }));
98
124
  this.handleRequiredMultipleOptions(option);
99
125
  this.changed.emit(data);
100
126
  salla.event.emit('product-options::change', data);
@@ -220,7 +246,7 @@ const SallaProductOptions = class {
220
246
  singleOption(option) {
221
247
  return h("div", null, h("select", { name: `options[${option.id}]`, required: option.required, class: "s-form-control", onChange: e => this.changedHandler(e, option) }, h("option", { value: "" }, option.placeholder), option === null || option === void 0 ? void 0 :
222
248
  option.details.map((detail) => {
223
- return h("option", { value: detail.id, disabled: detail.is_out, selected: detail.is_selected }, this.getOptionDetailName(detail));
249
+ return h("option", { value: detail.id, selected: detail.is_selected }, this.getOptionDetailName(detail));
224
250
  })));
225
251
  }
226
252
  multipleOptions(option) {
@@ -230,14 +256,14 @@ const SallaProductOptions = class {
230
256
  }
231
257
  //@ts-ignore
232
258
  colorOption(option) {
233
- return h("fieldset", { class: "s-product-options-colors-wrapper" }, option === null || option === void 0 ? void 0 : option.details.map((detail) => h("div", null, h("input", { type: "radio", value: detail.id, disabled: detail.is_out, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, id: `color-${this.productId}-${option.id}-${detail.id}`, onChange: e => this.changedHandler(e, option) }), h("label", { htmlFor: `color-${this.productId}-${option.id}-${detail.id}` }, h("span", { style: { "background-color": detail.color } }), h("p", null, this.getOptionDetailName(detail))))));
259
+ return h("fieldset", { class: "s-product-options-colors-wrapper" }, option === null || option === void 0 ? void 0 : option.details.map((detail) => h("div", null, h("input", { type: "radio", value: detail.id, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, id: `color-${this.productId}-${option.id}-${detail.id}`, onChange: e => this.changedHandler(e, option) }), h("label", { htmlFor: `color-${this.productId}-${option.id}-${detail.id}` }, h("span", { style: { "background-color": detail.color } }), h("p", null, this.getOptionDetailName(detail))))));
234
260
  }
235
261
  //@ts-ignore
236
262
  thumbnailOption(option) {
237
263
  return h("div", { class: "s-product-options-thumbnails-wrapper" }, option.details.map((detail) => {
238
- return h("div", null, h("input", { type: "radio", value: detail.id, "data-itemid": detail.id, disabled: detail.is_out, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, "data-img-id": detail.option_value, id: `option_${this.productId}-${option.id}_${detail.id}`, onChange: (e) => this.changedHandler(e, option) }), h("label", { htmlFor: `option_${this.productId}-${option.id}_${detail.id}`, "data-img-id": detail.option_value, class: "go-to-slide" }, h("img", { "data-src": detail.image, src: detail.image, title: detail.name, alt: detail.name }), h("span", { innerHTML: CheckCircleIcon, class: "s-product-options-thumbnails-icon" })), h("p", null, this.getOptionDetailName(detail, false), " "), detail.is_out ?
239
- [h("small", { class: "s-product-options-thumbnails-stock-badge" }, this.outOfStockText), h("div", { class: "s-product-options-thumbnails-badge-overlay" })]
240
- : '');
264
+ return h("div", null, h("input", { type: "radio", value: detail.id, "data-itemid": detail.id, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, "data-img-id": detail.option_value, id: `option_${this.productId}-${option.id}_${detail.id}`, onChange: (e) => this.changedHandler(e, option) }), h("label", { htmlFor: `option_${this.productId}-${option.id}_${detail.id}`, "data-img-id": detail.option_value, class: "go-to-slide" }, h("img", { "data-src": detail.image, src: detail.image, title: detail.name, alt: detail.name }), h("span", { innerHTML: CheckCircleIcon, class: "s-product-options-thumbnails-icon" }), detail.is_out ?
265
+ h("small", { class: "s-product-options-thumbnails-stock-badge" }, this.outOfStockText)
266
+ : ''), h("p", null, this.getOptionDetailName(detail, false), " "));
241
267
  }));
242
268
  }
243
269
  get host() { return getElement(this); }