@salla.sa/twilight-components 1.0.72 → 1.0.74

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 (36) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/{salla-tel-input.cjs.entry.js → salla-add-product-button_6.cjs.entry.js} +535 -0
  3. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  4. package/dist/cjs/twilight-components.cjs.js +1 -1
  5. package/dist/collection/collection-manifest.json +1 -0
  6. package/dist/collection/components/salla-add-product-button/salla-add-product-button.css +3 -0
  7. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +240 -0
  8. package/dist/collection/components/salla-button/salla-button.css +1 -1
  9. package/dist/collection/components/salla-login-modal/salla-login-modal.js +1 -1
  10. package/dist/collection/components/salla-product-availability/salla-product-availability.css +1 -1
  11. package/dist/collection/components/salla-product-availability/salla-product-availability.js +16 -8
  12. package/dist/components/salla-add-product-button.d.ts +11 -0
  13. package/dist/components/salla-add-product-button.js +131 -0
  14. package/dist/components/salla-button2.js +1 -1
  15. package/dist/components/salla-login-modal.js +1 -1
  16. package/dist/components/salla-product-availability.js +1 -155
  17. package/dist/{esm/salla-product-availability.entry.js → components/salla-product-availability2.js} +68 -15
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/{salla-tel-input.entry.js → salla-add-product-button_6.entry.js} +531 -1
  20. package/dist/esm/salla-login-modal.entry.js +1 -1
  21. package/dist/esm/twilight-components.js +1 -1
  22. package/dist/twilight-components/p-0cd25a03.entry.js +4 -0
  23. package/dist/twilight-components/{p-44b84f44.entry.js → p-20a8492d.entry.js} +1 -1
  24. package/dist/twilight-components/twilight-components.esm.js +1 -1
  25. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +25 -0
  26. package/dist/types/components.d.ts +35 -0
  27. package/package.json +1 -1
  28. package/dist/cjs/salla-button.cjs.entry.js +0 -122
  29. package/dist/cjs/salla-modal_2.cjs.entry.js +0 -239
  30. package/dist/cjs/salla-product-availability.cjs.entry.js +0 -119
  31. package/dist/esm/salla-button.entry.js +0 -118
  32. package/dist/esm/salla-modal_2.entry.js +0 -234
  33. package/dist/twilight-components/p-3aabd1b6.entry.js +0 -4
  34. package/dist/twilight-components/p-960c050e.entry.js +0 -4
  35. package/dist/twilight-components/p-c3b196f3.entry.js +0 -4
  36. package/dist/twilight-components/p-ca4cf691.entry.js +0 -4
@@ -17,7 +17,7 @@ const patchEsm = () => {
17
17
  const defineCustomElements = (win, options) => {
18
18
  if (typeof window === 'undefined') return Promise.resolve();
19
19
  return patchEsm().then(() => {
20
- return index.bootstrapLazy([["salla-modal_2.cjs",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"modalTitle":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-product-availability.cjs",[[0,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32],"isVisitorSubscribed":[32]}]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"show":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-button.cjs",[[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"type":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]],["salla-tel-input.cjs",[[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}]]]], options);
20
+ return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[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"],"disabled":[516]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[0,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32],"isVisitorSubscribed":[32]}],[0,"salla-tel-input",{"mobile":[1025],"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-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"modalTitle":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"show":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"type":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]]], options);
21
21
  });
22
22
  };
23
23
 
@@ -8,6 +8,536 @@ Object.defineProperty(exports, '__esModule', { value: true });
8
8
  const index = require('./index-c0f5bb97.js');
9
9
  const Helper = require('./Helper-8ae6a805.js');
10
10
 
11
+ const sallaAddProductButtonCss = ":host{display:block}";
12
+
13
+ const SallaAddProductButton = class {
14
+ constructor(hostRef) {
15
+ index.registerInstance(this, hostRef);
16
+ this.success = index.createEvent(this, "success", 7);
17
+ this.failed = index.createEvent(this, "failed", 7);
18
+ this.hostAttributes = {};
19
+ this.hasNotText = false;
20
+ this.channels = null;
21
+ this.quantity = 0;
22
+ this.donatingAmount = 0;
23
+ this.productStatus = 'sale';
24
+ this.productType = 'product';
25
+ /**
26
+ * Is the button currently disabled
27
+ */
28
+ this.disabled = false;
29
+ }
30
+ getLabel() {
31
+ if (this.productStatus === 'sale') {
32
+ return salla.lang.get('pages.cart.add_to_cart');
33
+ }
34
+ if (this.productType === 'product') {
35
+ return salla.lang.get('pages.products.out_of_stock');
36
+ }
37
+ // donating
38
+ return salla.lang.get('pages.products.donation_exceed');
39
+ }
40
+ componentWillLoad() {
41
+ this.hasNotText = !this.host.innerHTML || this.host.innerHTML === '' || this.host.innerHTML.trim().replace(/\s/g, '').localeCompare('<!---->') === 0;
42
+ }
43
+ componentDidRender() {
44
+ if (this.buttonLabel && this.hasNotText) {
45
+ salla.event.once('languages::translations.loaded', () => {
46
+ this.buttonLabel.innerHTML = this.getLabel() || 'اضافة للسلة';
47
+ });
48
+ }
49
+ }
50
+ addProductToCart(event) {
51
+ // we want to ignore the click action when the type of button is submit a form
52
+ if (this.hostAttributes['type'] === 'submit') {
53
+ return false;
54
+ }
55
+ event.preventDefault();
56
+ /**
57
+ * by defailt the quick add is just an alias for add item function
58
+ * but its work onlu when the id is the only value is passed via the object
59
+ * so we will filter the object entities to remove null and zero values in case we don't want the normal add item action
60
+ */
61
+ return salla.cart.quickAdd(Object.entries({
62
+ id: this.productId,
63
+ donating_amount: this.donatingAmount,
64
+ quantity: this.quantity
65
+ }).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {}))
66
+ .then((response) => this.success.emit(response))
67
+ .catch((error) => this.failed.emit(error));
68
+ }
69
+ getBtnAttributes() {
70
+ for (let i = 0; i < this.host.attributes.length; i++) {
71
+ if (!['id', 'class'].includes(this.host.attributes[i].name)) {
72
+ this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
73
+ }
74
+ }
75
+ return this.hostAttributes;
76
+ }
77
+ render() {
78
+ return (index.h(index.Host, null, this.productStatus === 'out-and-notify' && this.channels ?
79
+ index.h("salla-product-availability", Object.assign({}, this.getBtnAttributes()), index.h("slot", null)) :
80
+ index.h("salla-button", Object.assign({ 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' }), index.h("slot", null), index.h("span", { ref: (el) => this.buttonLabel = el }))));
81
+ }
82
+ get host() { return index.getElement(this); }
83
+ };
84
+ SallaAddProductButton.style = sallaAddProductButtonCss;
85
+
86
+ const sallaButtonCss = "salla-button{pointer-events:none}salla-button[type=submit],salla-button[type=button],salla-button[type=reset]{-webkit-appearance:none}salla-button[width=wide]{width:100%}.s-button-wrap[loading]{pointer-events:none}.s-button-wrap[loading] .s-button-element{pointer-events:none !important}.s-button-wrap[loading] .s-button-loader-center .s-button-text{opacity:0}.s-button-wrap .s-button-element[loading]{pointer-events:none !important}.s-button-wrap .s-button-element:not(:disabled){pointer-events:auto}.s-button-wrap .s-button-solid .s-button-loader:before{border-color:#fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2)}.s-button-wrap .s-button-outline{border:1px solid currentColor}.s-button-wrap .s-button-outline:hover{border-color:transparent}.s-button-wrap .s-button-outline .s-button-loader:before{border-top-color:currentColor;border-left-color:currentColor}.s-button-wrap .s-button-icon.s-button-large{width:56px;height:56px}.s-button-wrap .s-button-icon.s-button-small{width:24px;height:24px}.s-button-wrap .s-button-icon.s-button-small .s-button-loader:before{width:0.85rem;height:0.85rem}.s-button-wrap .s-button-loader-after .s-button-load{flex-direction:row}.s-button-wrap .s-button-loader-start.s-button-element{padding-left:32px;padding-right:32px}.s-button-wrap .s-button-loader-start .s-button-loader{position:absolute;right:8px}.s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr]{left:8px;right:auto}.s-button-wrap .s-button-loader-end.s-button-element{padding-left:32px;padding-right:32px}.s-button-wrap .s-button-loader-end .s-button-loader{position:absolute;left:8px}.s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr]{right:8px;left:auto}.s-button-wrap .s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);margin:0 !important}";
87
+
88
+ const SallaButton = class {
89
+ constructor(hostRef) {
90
+ index.registerInstance(this, hostRef);
91
+ this.hostAttributes = {};
92
+ /**
93
+ * Button Type
94
+ */
95
+ this.shape = 'btn';
96
+ /**
97
+ * Button Color
98
+ */
99
+ this.color = 'primary';
100
+ /**
101
+ * Button Fill
102
+ */
103
+ this.fill = 'solid';
104
+ /**
105
+ * Button Size
106
+ */
107
+ this.size = 'medium';
108
+ /**
109
+ * Button Width
110
+ */
111
+ this.width = 'normal';
112
+ /**
113
+ * Is the button currently loading
114
+ */
115
+ this.loading = false;
116
+ /**
117
+ * Is the button currently disabled
118
+ */
119
+ this.disabled = false;
120
+ /**
121
+ * If there is need to change loader position, pass the position
122
+ */
123
+ this.loaderPosition = 'after';
124
+ /**
125
+ * Is the button wide
126
+ */
127
+ this.wide = false;
128
+ if (this.wide) {
129
+ this.host.classList.add('s-button-wide');
130
+ }
131
+ }
132
+ /**
133
+ * Run loading animation
134
+ */
135
+ async load() {
136
+ if (this.loaderPosition == 'center')
137
+ this.text.classList.add('s-button-hide');
138
+ this.host.setAttribute('loading', '');
139
+ return this.host;
140
+ }
141
+ /**
142
+ * Stop loading animation
143
+ */
144
+ async stop() {
145
+ this.host.removeAttribute('loading');
146
+ if (this.loaderPosition == 'center')
147
+ this.text.classList.remove('s-button-hide');
148
+ return this.host;
149
+ }
150
+ /**
151
+ * Changing the body of the button
152
+ * @param html
153
+ */
154
+ async setText(html) {
155
+ this.text.innerHTML = html;
156
+ return this.host;
157
+ }
158
+ /**
159
+ * Add `disabled` attribute
160
+ */
161
+ async disable() {
162
+ this.host.setAttribute('disabled', '');
163
+ return this.host;
164
+ }
165
+ /**
166
+ * Remove `disabled` attribute
167
+ */
168
+ async enable() {
169
+ this.host.removeAttribute('disabled');
170
+ return this.host;
171
+ }
172
+ getBtnAttributes() {
173
+ for (let i = 0; i < this.host.attributes.length; i++) {
174
+ if (!['color', 'fill', 'size', 'width', 'id', 'loading'].includes(this.host.attributes[i].name)) {
175
+ this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
176
+ }
177
+ }
178
+ this.hostAttributes.type = this.hostAttributes.type || 'button';
179
+ this.hostAttributes.class +=
180
+ ' s-button-element s-button-' + this.shape
181
+ + ' s-button-' + (this.fill == "none" ? 'fill-none' : this.fill)
182
+ + (this.size != "medium" ? ' s-button-' + this.size : '')
183
+ + (this.width != "normal" ? ' s-button-' + this.width : '')
184
+ + (this.shape == "link" ? ' s-button-' + this.color + '-link' : '')
185
+ + (this.shape != "link" && this.fill != 'outline' ? ' s-button-' + this.color : '')
186
+ + (this.fill == 'outline' ? ' s-button-' + this.color + '-outline' : '')
187
+ + (this.disabled ? ' s-button-disabled ' : '')
188
+ + (this.shape == 'icon' ? ' s-button-loader-center' : ' s-button-loader-' + this.loaderPosition);
189
+ return this.hostAttributes;
190
+ }
191
+ render() {
192
+ return (index.h(index.Host, { class: "s-button-wrap" }, index.h("button", Object.assign({}, this.getBtnAttributes(), { disabled: this.disabled }), index.h("span", { class: "s-button-text", ref: el => this.text = el }, index.h("slot", null)), this.loading ? index.h("span", { class: "s-button-loader" }) : '')));
193
+ }
194
+ get host() { return index.getElement(this); }
195
+ };
196
+ SallaButton.style = sallaButtonCss;
197
+
198
+ const sallaModalCss = "";
199
+
200
+ const SallaModal = class {
201
+ constructor(hostRef) {
202
+ index.registerInstance(this, hostRef);
203
+ this.modalOpened = index.createEvent(this, "modalOpened", 7);
204
+ this.modalClosed = index.createEvent(this, "modalClosed", 7);
205
+ this.isClosable = true; //todo::rename unclude
206
+ /**
207
+ * The size of the modal
208
+ */
209
+ this.width = 'md';
210
+ /**
211
+ * The position of the modal
212
+ */
213
+ this.position = 'middle';
214
+ /**
215
+ * Show the modal on rendering
216
+ */
217
+ this.visible = false;
218
+ /**
219
+ * Show loading in the middle
220
+ */
221
+ this.isLoading = false;
222
+ this.subTitleFirst = false; //todo:: choose better name
223
+ this.noPadding = false; //todo:: choose better name
224
+ this.subTitle = '';
225
+ /**
226
+ * Icon css class, default for types `error` is `sicon-alert-engine`, `success` is `sicon-check-circle2`
227
+ */
228
+ this.icon = '';
229
+ this.iconStyle = '';
230
+ /**
231
+ * url of an image
232
+ */
233
+ this.imageIcon = '';
234
+ Helper.Helper.setHost(this.host);
235
+ salla.event.on('modal::open', btn => btn.dataset.target == this.host.id && this.show());
236
+ salla.event.on('modal::close', btn => btn.dataset.target == this.host.id && this.hide());
237
+ this.modalTitle = this.host.getAttribute('modal-title');
238
+ }
239
+ handleVisible(newValue) {
240
+ if (!newValue) {
241
+ this.toggleModal(false);
242
+ this.modalClosed.emit();
243
+ return;
244
+ }
245
+ this.host.classList.remove('s-hidden');
246
+ setTimeout(() => this.toggleModal(true)); //small amont of time to running toggle After adding hidden
247
+ this.modalOpened.emit();
248
+ }
249
+ /**
250
+ * Show the modal
251
+ */
252
+ async show() {
253
+ this.host.setAttribute('visible', '');
254
+ return this.host;
255
+ }
256
+ /**
257
+ * hide the modal
258
+ */
259
+ async hide() {
260
+ this.host.removeAttribute('visible');
261
+ return this.host;
262
+ }
263
+ /**
264
+ * Change the Modal Title
265
+ * @param {string} modalTitle
266
+ */
267
+ async setTitle(modalTitle) {
268
+ this.modalTitle = modalTitle;
269
+ return this.host;
270
+ }
271
+ /**
272
+ * Start loading
273
+ */
274
+ async loading() {
275
+ this.isLoading = true;
276
+ return this.host;
277
+ }
278
+ /**
279
+ * Stop the loading
280
+ */
281
+ async stopLoading() {
282
+ this.isLoading = false;
283
+ return this.host;
284
+ }
285
+ toggleModal(isOpen) {
286
+ const body = this.host.querySelector('.s-modal-body');
287
+ Helper.Helper.toggleElementClassIf(body, 's-modal-entering', 's-modal-leaving', () => isOpen)
288
+ .toggleElementClassIf(this.overlay, 's-modal-entering', 's-modal-overlay-leaving', () => isOpen)
289
+ .toggleElementClassIf(document.body, 'modal-is-open', 'modal-is-closed', () => isOpen);
290
+ if (!isOpen) {
291
+ setTimeout(() => this.host.classList.add('s-hidden'), 350);
292
+ }
293
+ }
294
+ closeModal() {
295
+ if (!this.isClosable) {
296
+ return;
297
+ }
298
+ this.host.removeAttribute('visible');
299
+ }
300
+ iconBlockClasses() {
301
+ return {
302
+ 's-modal-icon': true,
303
+ 's-modal-bg-error': this.iconStyle == 'error',
304
+ 's-modal-bg-success': this.iconStyle == 'success',
305
+ 's-modal-bg-normal': this.iconStyle != 'error' && this.iconStyle != 'success',
306
+ 's-modal-bg-primary': this.iconStyle == 'primary'
307
+ };
308
+ }
309
+ iconClasses() {
310
+ return {
311
+ [this.icon]: true,
312
+ 'sicon-alert-engine': !this.icon && this.iconStyle == 'error' && !this.imageIcon,
313
+ 'sicon-check-circle2': !this.icon && this.iconStyle == 'success' && !this.imageIcon,
314
+ };
315
+ }
316
+ //todo:: pref for each modal
317
+ render() {
318
+ this.host.id = this.host.id || 'salla-modal';
319
+ return (index.h(index.Host, { class: 'salla-modal s-modal-container s-hidden', "aria-modal": "true", role: "dialog" }, index.h("div", { class: "s-modal-overlay", ref: el => this.overlay = el, onClick: () => this.closeModal() }), index.h("div", { class: "s-modal-wrapper" }, index.h("span", { class: 's-modal-spacer s-modal-align-' + this.position }, "\u200B"), index.h("div", { class: 's-modal-body ' + 's-modal-align-' + this.position + ' s-modal-' + this.width + (this.noPadding ? ' s-modal-nopadding' : ' s-modal-padding') }, this.isLoading ?
320
+ index.h("div", { class: "s-modal-loader-wrap" }, index.h("span", { class: "s-modal-loader" }))
321
+ :
322
+ [
323
+ index.h("div", { class: { 's-modal-header': true, 's-modal-is-center': this.icon != '' || this.imageIcon != '' } }, this.isClosable ?
324
+ index.h("button", { class: "s-modal-close", onClick: () => this.closeModal(), type: "button" }, index.h("span", { class: "sicon-cancel" }))
325
+ : '', this.modalTitle || this.subTitle ?
326
+ index.h("div", { class: "s-modal-header-inner" }, this.iconStyle || this.icon
327
+ ? index.h("div", { class: this.iconBlockClasses() }, index.h("i", { class: this.iconClasses() }))
328
+ : this.imageIcon ? index.h("img", { class: "s-modal-header-img", src: this.imageIcon }) : '', index.h("div", { class: "s-modal-header-content" }, index.h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }), index.h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
329
+ : ''),
330
+ index.h("slot", null),
331
+ index.h("slot", { name: "footer" })
332
+ ]))));
333
+ }
334
+ get host() { return index.getElement(this); }
335
+ static get watchers() { return {
336
+ "visible": ["handleVisible"]
337
+ }; }
338
+ };
339
+ SallaModal.style = sallaModalCss;
340
+
341
+ const sallaProductAvailabilityCss = "";
342
+
343
+ const SallaProductAvailability = class {
344
+ constructor(hostRef) {
345
+ index.registerInstance(this, hostRef);
346
+ this.isUser = Helper.Helper.isUser();
347
+ this.mobileLabel = '555555555';
348
+ this.emailPlaceholder = 'your@email.com';
349
+ /**
350
+ * product id that can visitor subscribe to its availability notification
351
+ */
352
+ this.productId = salla.config.get('page.id');
353
+ /**
354
+ * is current user already subscribed
355
+ */
356
+ this.isSubscribed = false;
357
+ // @Method()
358
+ this.submit = async () => {
359
+ if (this.isUser) {
360
+ return salla.api.product.availabilitySubscribe(this.productId)
361
+ .then(() => this.isSubscribed = true);
362
+ }
363
+ let data = { id: this.productId };
364
+ if (this.channels_.includes('sms')) {
365
+ let { mobile, countryCode } = await this.mobileInput.getValues();
366
+ data['country_code'] = countryCode;
367
+ data['mobile'] = mobile;
368
+ }
369
+ if (this.channels_.includes('email')) {
370
+ this.email.value !== '' && (data['email'] = this.email.value);
371
+ }
372
+ await this.validateform();
373
+ return this.btn.load()
374
+ .then(() => this.btn.disable())
375
+ .then(() => salla.api.product.availabilitySubscribe(data))
376
+ .then(() => {
377
+ this.isSubscribed = true;
378
+ salla.storage.set(`product-${this.productId}-subscribed`, true);
379
+ }) //no need to wait until finishing alert animation
380
+ .then(() => this.btn.stop())
381
+ .then(() => this.modal.hide())
382
+ .catch(() => this.btn.stop() && this.btn.enable());
383
+ };
384
+ // helpers
385
+ this.typing = (e, submitMethod) => {
386
+ const error = e.target.nextElementSibling;
387
+ e.target.classList.remove('s-has-error');
388
+ (error === null || error === void 0 ? void 0 : error.classList.contains('s-product-availability-error-msg')) && (error.innerText = '');
389
+ e.key == 'Enter' && submitMethod();
390
+ };
391
+ salla.event.on('languages::translations.loaded', () => {
392
+ var _a, _b, _c, _d;
393
+ // console.log('translations:', salla.lang);
394
+ this.subscribedMessage = salla.lang.get('pages.products.notify_availability_success');
395
+ this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
396
+ this.subTitle = salla.lang.get('pages.products.notify_availability_subtitle');
397
+ this.mobileLabel = salla.lang.get('common.elements.mobile') || '555555555';
398
+ this.emailLabel = salla.lang.get('common.elements.email');
399
+ this.emailPlaceholder = salla.lang.get('common.elements.email_placeholder') || 'your@email.com';
400
+ this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');
401
+ (_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title_);
402
+ (_b = this.btn) === null || _b === void 0 ? void 0 : _b.setText(salla.lang.get('common.elements.submit'));
403
+ (_c = this.cancelBtn) === null || _c === void 0 ? void 0 : _c.setText(salla.lang.get('common.elements.cancel'));
404
+ (_d = this.inlineBtn) === null || _d === void 0 ? void 0 : _d.setText(salla.lang.get('pages.products.notify_availability'));
405
+ });
406
+ if (this.isUser)
407
+ return;
408
+ this.channelsWatcher(this.channels);
409
+ this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
410
+ this.host.removeAttribute('title');
411
+ this.isVisitorSubscribed = salla.storage.get(`product-${this.productId}-subscribed`);
412
+ }
413
+ channelsWatcher(newValue) {
414
+ this.channels_ = newValue.split(',');
415
+ }
416
+ async validateform() {
417
+ if (this.channels_.includes('email')) {
418
+ const isEmailValid = Helper.Helper.isValidEmail(this.email.value);
419
+ if (isEmailValid)
420
+ return;
421
+ !isEmailValid && this.validateField(this.email, this.emailErrorMsg);
422
+ }
423
+ if (this.channels_.includes('sms')) {
424
+ const isPhoneValid = await this.mobileInput.isValid();
425
+ if (isPhoneValid)
426
+ return;
427
+ }
428
+ throw ('Please insert required fields');
429
+ }
430
+ validateField(field, errorMsg) {
431
+ field.classList.add('s-has-error');
432
+ field.nextElementSibling['innerText'] = '* ' + errorMsg;
433
+ }
434
+ render() {
435
+ return (index.h(index.Host, { class: "s-product-availability-wrap" }, this.isSubscribed || this.isVisitorSubscribed
436
+ ? index.h("div", { class: "s-product-availability-subscribed" }, index.h("i", { class: "sicon-bell-ring s-product-availability-subs-icon" }), " ", this.subscribedMessage)
437
+ :
438
+ index.h("salla-button", { width: "wide", onClick: () => this.isUser ? this.submit() : this.modal.show(), ref: btn => this.inlineBtn = btn }, salla.lang.get('pages.products.notify_availability')), this.isUser || this.isSubscribed || this.isVisitorSubscribed ? '' : this.renderModal()));
439
+ }
440
+ renderModal() {
441
+ return (index.h("salla-modal", { ref: modal => this.modal = modal, "modal-title": this.title_, subTitle: this.subTitle, icon: "sicon-bell-ring", width: "sm" }, index.h("div", { class: "s-product-availability-body" }, this.channels_.includes('email') ? [
442
+ index.h("label", { class: "s-product-availability-label" }, this.emailLabel),
443
+ index.h("input", { class: "s-product-availability-input", onKeyDown: e => this.typing(e, this.submit), placeholder: this.emailPlaceholder, ref: el => this.email = el, type: "email" }),
444
+ index.h("span", { class: "s-product-availability-error-msg" })
445
+ ] : '', this.channels_.includes('sms') ? [
446
+ index.h("label", { class: "s-product-availability-label" }, this.mobileLabel),
447
+ index.h("salla-tel-input", { ref: el => this.mobileInput = el, onKeyDown: e => this.typing(e, this.submit) })
448
+ ] : ''), index.h("div", { slot: "footer", class: "s-product-availability-footer" }, index.h("salla-button", { width: "wide", color: "light", fill: "outline", onClick: () => this.modal.hide(), ref: btn => this.cancelBtn = btn }, salla.lang.get('common.elements.cancel')), index.h("salla-button", { "loader-position": 'center', width: "wide", ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.submit')))));
449
+ }
450
+ get host() { return index.getElement(this); }
451
+ static get watchers() { return {
452
+ "channels": ["channelsWatcher"]
453
+ }; }
454
+ };
455
+ SallaProductAvailability.style = sallaProductAvailabilityCss;
456
+
457
+ const sallaSearchCss = "#s-search-modal .s-search-inline{border:1px solid #eee}#s-search-modal .s-search-no-results .s-search-input,#s-search-modal .s-search-container-open .s-search-input{border-bottom:1px solid #f4f4f5}#s-search-modal .s-search-product-image{font-size:0;position:relative}#s-search-modal .s-search-product-image:before{content:\"\";position:absolute;width:100%;height:100%;left:0;top:0;background:#eee}#s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}#s-search-modal .s-modal-spacer{display:inline}#s-search-modal .s-modal-body{padding:0;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;background:transparent;overflow:visible}#s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}";
458
+
459
+ const SallaSearch = class {
460
+ constructor(hostRef) {
461
+ index.registerInstance(this, hostRef);
462
+ var _a;
463
+ this.inputValue = '';
464
+ this.inline = false;
465
+ this.oval = false;
466
+ this.height = 60;
467
+ Helper.Helper.setHost(this.host);
468
+ this.productSlot = ((_a = Helper.Helper.getElement('[slot="product"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || this.getDefaultProductSlot();
469
+ salla.event.on('search::show', () => this.modal.show());
470
+ salla.event.on('languages::translations.loaded', () => {
471
+ this.placeholder = salla.lang.get('blocks.header.search_placeholder');
472
+ this.noResultsText = salla.lang.get('common.elements.no_options');
473
+ });
474
+ }
475
+ onModalOpen() {
476
+ this.modal.querySelector('.s-search-input').focus();
477
+ }
478
+ onModalClose() {
479
+ this.modal.querySelector('.s-search-input').value = '';
480
+ this.results = undefined;
481
+ this.afterSearching();
482
+ this.container.classList.remove('s-search-no-results');
483
+ }
484
+ getDefaultProductSlot() {
485
+ return '<div class="s-search-product-image-container">' +
486
+ ' <img class="s-search-product-image" src="{image}" alt="{name}"/>' +
487
+ '</div>' +
488
+ '<div class="s-search-product-details">' +
489
+ ' <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div>' +
490
+ '</div>';
491
+ }
492
+ search(e) {
493
+ this.inputValue = e.target.value;
494
+ Helper.Helper.hideElement(this.noResults);
495
+ if (e.target.value.length === 0) {
496
+ this.results = undefined;
497
+ this.afterSearching();
498
+ return;
499
+ }
500
+ if (e.target.value.length <= 2) {
501
+ return;
502
+ }
503
+ //run loading spinner or stop it
504
+ Helper.Helper.toggleElementClassIf(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => true);
505
+ salla.search.api.products(e.target.value)
506
+ .then(response => this.results = response)
507
+ .catch(err => err !== 'Query is same as previous one!' ? this.results = undefined : null)
508
+ .finally(() => this.afterSearching(/*isEmpty*/ false));
509
+ }
510
+ afterSearching(isEmpty = true) {
511
+ var _a;
512
+ this.noResults.style.display = isEmpty || ((_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length) > 0 ? 'none' : 'block';
513
+ Helper.Helper.toggleElementClassIf(this.container, 's-search-container-open', 's-search-no-results', () => { var _a; return (_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length; })
514
+ .toggleElementClassIf(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => false); //stop searching anime
515
+ salla.search.api.previousQuery = ''; //avoid having error 'Query is same as previous one!' after reopen modal;
516
+ this.inputValue.length == 0 ? this.container.classList.remove('s-search-no-results') : '';
517
+ }
518
+ render() {
519
+ var _a;
520
+ const searchContent = index.h("div", { class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => this.container = container, style: this.oval ? { borderRadius: this.height / 2 + 'px' } : {} }, index.h("input", { class: "s-search-input", type: "text", placeholder: this.placeholder, onInput: e => this.search(e), style: { height: this.height + 'px' } }), index.h("span", { class: "s-search-icon-wrap" }, index.h("i", { class: "s-search-icon sicon-search", ref: el => this.searchIcon = el })), index.h("div", { class: "s-search-results" }, (_a = this.results) === null || _a === void 0 ? void 0 :
521
+ _a.data.map(item => index.h("a", { href: item.url, class: { "s-search-product": true, 's-search-product-not-available': !item.is_available }, innerHTML: this.productSlot
522
+ .replace(/\{name\}/g, item.name)
523
+ .replace(/\{price\}/g, salla.money(item.price))
524
+ .replace(/\{regular_price\}/g, item.has_special_price ? salla.money(item.regular_price) : '')
525
+ .replace(/\{image\}/g, item.thumbnail) })), index.h("p", { ref: el => this.noResults = el, class: "s-search-no-results-placeholder" }, this.noResultsText)));
526
+ return (this.inline ?
527
+ index.h("div", { id: "s-search-modal" }, searchContent)
528
+ :
529
+ index.h("salla-modal", { position: "top", id: "s-search-modal", ref: modal => this.modal = modal }, searchContent));
530
+ }
531
+ /**
532
+ * Run it one time after load
533
+ */
534
+ componentDidLoad() {
535
+ this.afterSearching();
536
+ }
537
+ get host() { return index.getElement(this); }
538
+ };
539
+ SallaSearch.style = sallaSearchCss;
540
+
11
541
  function createCommonjsModule(fn, basedir, module) {
12
542
  return module = {
13
543
  path: basedir,
@@ -1475,4 +2005,9 @@ const SallaTelInput = class {
1475
2005
  };
1476
2006
  SallaTelInput.style = sallaTelInputCss;
1477
2007
 
2008
+ exports.salla_add_product_button = SallaAddProductButton;
2009
+ exports.salla_button = SallaButton;
2010
+ exports.salla_modal = SallaModal;
2011
+ exports.salla_product_availability = SallaProductAvailability;
2012
+ exports.salla_search = SallaSearch;
1478
2013
  exports.salla_tel_input = SallaTelInput;
@@ -157,7 +157,7 @@ const SallaLoginModal = class {
157
157
  this.regType = tab === this.mobileTab ? 'phone' : 'email';
158
158
  }
159
159
  let isRegistrationTab = tab == this.registrationTab;
160
- isRegistrationTab && ((_a = this.firstName) === null || _a === void 0 ? void 0 : _a.focus());
160
+ (_a = tab.querySelector('input')) === null || _a === void 0 ? void 0 : _a.focus(); // focus the first input in tab
161
161
  (_b = this.modal) === null || _b === void 0 ? void 0 : _b.setTitle(isRegistrationTab ? salla.lang.get('common.titles.registration') : this.title);
162
162
  if (!isRegistrationTab) {
163
163
  Helper.Helper.toggleElementClassIf(this.regMobileBlock, 's-hidden', 's-show', () => this.regType === 'phone')
@@ -18,5 +18,5 @@ const patchBrowser = () => {
18
18
  };
19
19
 
20
20
  patchBrowser().then(options => {
21
- return index.bootstrapLazy([["salla-modal_2.cjs",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"modalTitle":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-product-availability.cjs",[[0,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32],"isVisitorSubscribed":[32]}]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"show":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-button.cjs",[[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"type":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]],["salla-tel-input.cjs",[[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}]]]], options);
21
+ return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[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"],"disabled":[516]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[0,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32],"isVisitorSubscribed":[32]}],[0,"salla-tel-input",{"mobile":[1025],"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-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"modalTitle":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"show":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"type":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]]], options);
22
22
  });
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "entries": [
3
+ "./components/salla-add-product-button/salla-add-product-button.js",
3
4
  "./components/salla-branches/salla-branches.js",
4
5
  "./components/salla-button/salla-button.js",
5
6
  "./components/salla-conditional-fields/salla-conditional-fields.js",