@ikas/storefront 5.0.0-beta.9 → 5.0.1

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 (244) hide show
  1. package/build/analytics/analytics.d.ts +4 -0
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/facebookPixel.d.ts +1 -0
  4. package/build/analytics/facebookPixel.js +1 -1
  5. package/build/analytics/googleAnalytics.d.ts +1 -0
  6. package/build/analytics/googleAnalytics.js +1 -1
  7. package/build/analytics/googleTagManager.d.ts +12 -21
  8. package/build/analytics/googleTagManager.js +1 -1
  9. package/build/analytics/head/index.js +1 -1
  10. package/build/analytics/ikas.d.ts +2 -1
  11. package/build/analytics/ikas.js +1 -1
  12. package/build/analytics/tiktokPixel.d.ts +1 -0
  13. package/build/analytics/tiktokPixel.js +1 -1
  14. package/build/components/checkout/components/address-form/index.js +1 -1
  15. package/build/components/checkout/components/address-form/model.d.ts +13 -2
  16. package/build/components/checkout/components/address-form/model.js +1 -1
  17. package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/index.d.ts +7 -0
  18. package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/index.js +1 -0
  19. package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/style.module.scss.js +1 -0
  20. package/build/components/checkout/components/cart-summary/cart-item/index.d.ts +1 -0
  21. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  22. package/build/components/checkout/components/cart-summary/cart-item/style.module.scss.js +1 -1
  23. package/build/components/checkout/components/cart-summary/cart-item/svg/arrow-down.d.ts +2 -0
  24. package/build/components/checkout/components/cart-summary/cart-item/svg/arrow-down.js +1 -0
  25. package/build/components/checkout/components/cart-summary/index.d.ts +11 -0
  26. package/build/components/checkout/components/cart-summary/index.js +1 -1
  27. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  28. package/build/components/checkout/components/credit-card-form/model.js +1 -1
  29. package/build/components/checkout/components/customer-addresses/index.js +1 -1
  30. package/build/components/checkout/components/customer-addresses/model.js +1 -1
  31. package/build/components/checkout/components/customer-addresses/style.module.scss.js +1 -1
  32. package/build/components/checkout/components/epaykolay-button/index.d.ts +5 -0
  33. package/build/components/checkout/components/epaykolay-button/index.js +1 -0
  34. package/build/components/checkout/components/epaykolay-button/style.module.scss.js +1 -0
  35. package/build/components/checkout/components/error/customer-account-disabled-error/index.d.ts +8 -0
  36. package/build/components/checkout/components/error/customer-account-disabled-error/index.js +1 -0
  37. package/build/components/checkout/components/error/customer-login-required-error/index.js +1 -1
  38. package/build/components/checkout/components/error/index.js +1 -1
  39. package/build/components/checkout/components/form-item/index.js +1 -1
  40. package/build/components/checkout/components/form-item/model.js +1 -1
  41. package/build/components/checkout/components/notification-box/index.d.ts +2 -0
  42. package/build/components/checkout/components/notification-box/index.js +1 -1
  43. package/build/components/checkout/components/offer-product/index.js +1 -1
  44. package/build/components/checkout/components/paypal/index.d.ts +7 -0
  45. package/build/components/checkout/components/paypal/index.js +1 -0
  46. package/build/components/checkout/components/paypal/style.module.scss.js +1 -0
  47. package/build/components/checkout/components/product-files/index.d.ts +7 -0
  48. package/build/components/checkout/components/product-files/index.js +1 -0
  49. package/build/components/checkout/components/product-files/style.module.scss.js +1 -0
  50. package/build/components/checkout/components/quick-registration/model.js +1 -1
  51. package/build/components/checkout/components/select-box/index.d.ts +1 -0
  52. package/build/components/checkout/components/select-box/index.js +1 -1
  53. package/build/components/checkout/components/stripe/index.js +1 -1
  54. package/build/components/checkout/components/svg/epaykolay.d.ts +6 -0
  55. package/build/components/checkout/components/svg/epaykolay.js +1 -0
  56. package/build/components/checkout/components/toggle/index.d.ts +1 -0
  57. package/build/components/checkout/components/toggle/index.js +1 -1
  58. package/build/components/checkout/components/toggle/style.module.scss.js +1 -1
  59. package/build/components/checkout/index.d.ts +2 -0
  60. package/build/components/checkout/index.js +1 -1
  61. package/build/components/checkout/model.d.ts +44 -17
  62. package/build/components/checkout/model.js +1 -1
  63. package/build/components/checkout/steps/step-payment/index.js +1 -1
  64. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  65. package/build/components/checkout/steps/step-payment/style.module.scss.js +1 -1
  66. package/build/components/checkout/steps/step-shipping/index.js +1 -1
  67. package/build/components/checkout/steps/step-success/index.js +1 -1
  68. package/build/components/checkout/steps/step-success/style.module.scss.js +1 -1
  69. package/build/components/checkout/style.module.scss.js +1 -1
  70. package/build/components/google-captcha/index.js +1 -1
  71. package/build/components/link/index.js +1 -1
  72. package/build/components/page/head.js +1 -1
  73. package/build/components/page/index.js +1 -1
  74. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  75. package/build/components/page-editor/model.d.ts +1 -0
  76. package/build/components/page-editor/model.js +1 -1
  77. package/build/hooks/useCustomerReviews.js +1 -1
  78. package/build/hooks/useStore.js +1 -1
  79. package/build/index.js +1 -1
  80. package/build/models/data/cart/available-shipping-method/estimated-delivery-time/index.d.ts +6 -0
  81. package/build/models/data/cart/available-shipping-method/estimated-delivery-time/index.js +1 -0
  82. package/build/models/data/cart/available-shipping-method/index.d.ts +2 -0
  83. package/build/models/data/cart/available-shipping-method/index.js +1 -1
  84. package/build/models/data/category/conditions/index.d.ts +21 -0
  85. package/build/models/data/category/conditions/index.js +1 -0
  86. package/build/models/data/category/index.d.ts +3 -0
  87. package/build/models/data/category/index.js +1 -1
  88. package/build/models/data/checkout/index.d.ts +2 -2
  89. package/build/models/data/checkout-settings/index.d.ts +2 -1
  90. package/build/models/data/checkout-settings/index.js +1 -1
  91. package/build/models/data/checkout-settings/price/index.d.ts +2 -1
  92. package/build/models/data/checkout-settings/price/index.js +1 -1
  93. package/build/models/data/contact-form/index.d.ts +1 -0
  94. package/build/models/data/contact-form/index.js +1 -1
  95. package/build/models/data/customer/address/ikas-localized-customer-address.d.ts +26 -12
  96. package/build/models/data/customer/address/ikas-localized-customer-address.js +1 -1
  97. package/build/models/data/customer/address/index.d.ts +5 -0
  98. package/build/models/data/customer/address/index.js +1 -1
  99. package/build/models/data/customer/address/region/index.d.ts +6 -0
  100. package/build/models/data/customer/address/region/index.js +1 -0
  101. package/build/models/data/customer/index.d.ts +7 -0
  102. package/build/models/data/customer/index.js +1 -1
  103. package/build/models/data/customer/price-list-rule/filter/index.d.ts +7 -0
  104. package/build/models/data/customer/price-list-rule/filter/index.js +1 -0
  105. package/build/models/data/customer/price-list-rule/index.d.ts +10 -0
  106. package/build/models/data/customer/price-list-rule/index.js +1 -0
  107. package/build/models/data/customer/review/index.d.ts +1 -0
  108. package/build/models/data/customer/review/index.js +1 -1
  109. package/build/models/data/favorite-product/index.d.ts +2 -0
  110. package/build/models/data/favorite-product/index.js +1 -1
  111. package/build/models/data/filter-category/index.d.ts +4 -0
  112. package/build/models/data/filter-category/index.js +1 -1
  113. package/build/models/data/html-meta-data/translations/index.d.ts +1 -0
  114. package/build/models/data/html-meta-data/translations/index.js +1 -1
  115. package/build/models/data/image/index.d.ts +1 -0
  116. package/build/models/data/image/index.js +1 -1
  117. package/build/models/data/index.d.ts +15 -1
  118. package/build/models/data/order/address/ikas-localized-order-address.d.ts +48 -18
  119. package/build/models/data/order/address/ikas-localized-order-address.js +1 -1
  120. package/build/models/data/order/address/index.d.ts +5 -0
  121. package/build/models/data/order/address/index.js +1 -1
  122. package/build/models/data/order/address/region/index.d.ts +6 -0
  123. package/build/models/data/order/address/region/index.js +1 -0
  124. package/build/models/data/order/index.d.ts +3 -0
  125. package/build/models/data/order/index.js +1 -1
  126. package/build/models/data/order/line-item/index.d.ts +5 -0
  127. package/build/models/data/order/line-item/index.js +1 -1
  128. package/build/models/data/order/line-item/variant/bundle-product/bundle-variant/index.d.ts +33 -0
  129. package/build/models/data/order/line-item/variant/bundle-product/bundle-variant/index.js +1 -0
  130. package/build/models/data/order/line-item/variant/bundle-product/index.d.ts +15 -0
  131. package/build/models/data/order/line-item/variant/bundle-product/index.js +1 -0
  132. package/build/models/data/order/line-item/variant/index.d.ts +4 -0
  133. package/build/models/data/order/line-item/variant/index.js +1 -1
  134. package/build/models/data/order/transaction/index.d.ts +1 -0
  135. package/build/models/data/order/transaction/index.js +1 -1
  136. package/build/models/data/order/transaction/payment-method-detail/index.d.ts +1 -0
  137. package/build/models/data/order/transaction/payment-method-detail/index.js +1 -1
  138. package/build/models/data/product/campaign-offer/index.d.ts +15 -0
  139. package/build/models/data/product/campaign-offer/index.js +1 -0
  140. package/build/models/data/product/filter/index.d.ts +2 -0
  141. package/build/models/data/product/filter/index.js +1 -1
  142. package/build/models/data/product/group/index.d.ts +11 -0
  143. package/build/models/data/product/group/index.js +1 -0
  144. package/build/models/data/product/group/translation/index.d.ts +13 -0
  145. package/build/models/data/product/group/translation/index.js +1 -0
  146. package/build/models/data/product/group/value/index.d.ts +7 -0
  147. package/build/models/data/product/group/value/index.js +1 -0
  148. package/build/models/data/product/image/index.d.ts +1 -0
  149. package/build/models/data/product/image/index.js +1 -1
  150. package/build/models/data/product/index.d.ts +34 -1
  151. package/build/models/data/product/index.js +1 -1
  152. package/build/models/data/product/variant/bundle-settings/bundle-product/index.d.ts +28 -0
  153. package/build/models/data/product/variant/bundle-settings/bundle-product/index.js +1 -0
  154. package/build/models/data/product/variant/bundle-settings/index.d.ts +8 -0
  155. package/build/models/data/product/variant/bundle-settings/index.js +1 -0
  156. package/build/models/data/product/variant/index.d.ts +35 -3
  157. package/build/models/data/product/variant/index.js +1 -1
  158. package/build/models/data/product/variant/price/index.d.ts +26 -0
  159. package/build/models/data/product/variant/price/index.js +1 -1
  160. package/build/models/data/product/variant/price/product-campaign-price/index.d.ts +6 -0
  161. package/build/models/data/product/variant/price/product-campaign-price/index.js +1 -0
  162. package/build/models/data/product-file/index.d.ts +8 -0
  163. package/build/models/data/product-file/index.js +1 -0
  164. package/build/models/data/shipping-zone/index.d.ts +9 -0
  165. package/build/models/data/shipping-zone/index.js +1 -0
  166. package/build/models/data/shipping-zone/state/city/district/index.d.ts +7 -0
  167. package/build/models/data/shipping-zone/state/city/district/index.js +1 -0
  168. package/build/models/data/shipping-zone/state/city/district/region/index.d.ts +6 -0
  169. package/build/models/data/shipping-zone/state/city/district/region/index.js +1 -0
  170. package/build/models/data/shipping-zone/state/city/index.d.ts +8 -0
  171. package/build/models/data/shipping-zone/state/city/index.js +1 -0
  172. package/build/models/data/shipping-zone/state/index.d.ts +9 -0
  173. package/build/models/data/shipping-zone/state/index.js +1 -0
  174. package/build/models/data/storefront/b2b-settings/index.d.ts +8 -0
  175. package/build/models/data/storefront/b2b-settings/index.js +1 -0
  176. package/build/models/data/storefront/index-page-seo-setting/index.d.ts +17 -0
  177. package/build/models/data/storefront/index-page-seo-setting/index.js +1 -0
  178. package/build/models/data/storefront/index.d.ts +6 -1
  179. package/build/models/data/storefront/index.js +1 -1
  180. package/build/models/data/theme-json/component/index.d.ts +2 -0
  181. package/build/models/data/theme-json/component/index.js +1 -1
  182. package/build/models/data/theme-json/component/prop/index.d.ts +2 -0
  183. package/build/models/data/theme-json/component/prop/index.js +1 -1
  184. package/build/models/data/theme-json/custom-data/index.d.ts +2 -0
  185. package/build/models/data/theme-json/custom-data/index.js +1 -1
  186. package/build/models/data/theme-json/index.js +1 -1
  187. package/build/models/data/video/index.d.ts +11 -0
  188. package/build/models/data/video/index.js +1 -0
  189. package/build/models/ui/blog-category-list/index.js +1 -1
  190. package/build/models/ui/brand-list/index.js +1 -1
  191. package/build/models/ui/category-list/index.js +1 -1
  192. package/build/models/ui/customer-review-list/index.js +1 -1
  193. package/build/models/ui/customer-review-summary-list/index.js +1 -1
  194. package/build/models/ui/index.d.ts +1 -1
  195. package/build/models/ui/product-attribute-list/index.js +1 -1
  196. package/build/models/ui/product-list/index.d.ts +25 -3
  197. package/build/models/ui/product-list/index.js +1 -1
  198. package/build/models/ui/raffle-list/index.js +1 -1
  199. package/build/models/ui/validator/form/account-info.js +1 -1
  200. package/build/models/ui/validator/form/address.js +1 -1
  201. package/build/models/ui/validator/form/contact-form.d.ts +6 -0
  202. package/build/models/ui/validator/form/contact-form.js +1 -1
  203. package/build/models/ui/validator/form/ikas-address.d.ts +46 -20
  204. package/build/models/ui/validator/form/ikas-address.js +1 -1
  205. package/build/models/ui/validator/form/login.d.ts +7 -4
  206. package/build/models/ui/validator/form/login.js +1 -1
  207. package/build/models/ui/validator/form/register.d.ts +10 -1
  208. package/build/models/ui/validator/form/register.js +1 -1
  209. package/build/page-data-init/index.d.ts +9 -1
  210. package/build/page-data-init/index.js +1 -1
  211. package/build/pages/account/activate.d.ts +4 -0
  212. package/build/pages/account/activate.js +1 -0
  213. package/build/pages/checkout.js +1 -1
  214. package/build/pages/home.js +1 -1
  215. package/build/pages/index.d.ts +1 -0
  216. package/build/store/base.d.ts +1 -0
  217. package/build/store/base.js +1 -1
  218. package/build/store/blog/index.js +1 -1
  219. package/build/store/brand/index.js +1 -1
  220. package/build/store/cart/index.d.ts +6 -2
  221. package/build/store/cart/index.js +1 -1
  222. package/build/store/category/index.js +1 -1
  223. package/build/store/checkout/index.d.ts +7 -2
  224. package/build/store/checkout/index.js +1 -1
  225. package/build/store/customer/api.d.ts +5 -1
  226. package/build/store/customer/api.js +1 -1
  227. package/build/store/customer/index.d.ts +25 -5
  228. package/build/store/customer/index.js +1 -1
  229. package/build/store/html-meta-data/index.js +1 -1
  230. package/build/store/index.d.ts +1 -1
  231. package/build/store/location/index.d.ts +2 -1
  232. package/build/store/location/index.js +1 -1
  233. package/build/store/product/index.d.ts +4 -1
  234. package/build/store/product/index.js +1 -1
  235. package/build/utils/constants.js +1 -1
  236. package/build/utils/helper.d.ts +1 -0
  237. package/build/utils/helper.js +1 -1
  238. package/package.json +18 -14
  239. package/build/analytics/googleUniversal.d.ts +0 -9
  240. package/build/analytics/googleUniversal.js +0 -1
  241. package/build/ext/@builder.io/partytown/integration/index.mjs.js +0 -1
  242. package/build/ext/@builder.io/partytown/react/index.mjs.js +0 -1
  243. package/build/models/data/checkout/country-settings-model.d.ts +0 -141
  244. package/build/models/data/checkout/country-settings-model.js +0 -1
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as o}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{listHTMLMetaData as d}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout/country-settings-model.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import{IkasHTMLMetaData as a}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";var i=function(){function i(){}return i.listHTMLMetaData=function(i){var s;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,d(i)];case 1:return t=e.sent(),[2,new o(null===(s=t.data)||void 0===s?void 0:s.map((function(t){return new a(t)})),t.graphQLErrors)]}}))}))},i}();export{i as default};
1
+ import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as d}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{listHTMLMetaData as o}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import{IkasHTMLMetaData as a}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";var i=function(){function i(){}return i.listHTMLMetaData=function(i){var s;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new d(null===(s=t.data)||void 0===s?void 0:s.map((function(t){return new a(t)})),t.graphQLErrors)]}}))}))},i}();export{i as default};
@@ -1,4 +1,4 @@
1
1
  export { IkasBaseStore } from "./base";
2
2
  export type { IkasLocaleOption } from "./base";
3
- export { IkasCustomerStore } from "./customer";
3
+ export { IkasCustomerStore, type SocialLoginProvider } from "./customer";
4
4
  export { IkasCartStore } from "./cart";
@@ -1,4 +1,4 @@
1
- import { ListCountryQueryParams, APIResponse, ListCityQueryParams, ListDistrictQueryParams, ListStateQueryParams } from "@ikas/storefront-api";
1
+ import { ListCountryQueryParams, APIResponse, ListCityQueryParams, ListDistrictQueryParams, ListStateQueryParams, GetAvailableShippingZonesQueryParams } from "@ikas/storefront-api";
2
2
  import { IkasCity, IkasCountry, IkasDistrict, IkasState } from "../../models/data";
3
3
  export default class LocationStore {
4
4
  static getMyCountry(): Promise<APIResponse<string> | APIResponse<undefined>>;
@@ -6,4 +6,5 @@ export default class LocationStore {
6
6
  static listCity(params: ListCityQueryParams): Promise<APIResponse<IkasCity[]>>;
7
7
  static listDistrict(params: ListDistrictQueryParams): Promise<APIResponse<IkasDistrict[]>>;
8
8
  static listState(params: ListStateQueryParams): Promise<APIResponse<IkasState[]>>;
9
+ static getAvailableShippingZones(params: GetAvailableShippingZonesQueryParams): Promise<APIResponse<import("@ikas/storefront-models").IkasShippingZone[]>>;
9
10
  }
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{getMyCountry as o,APIResponse as r,listCountry as i,listCity as a,listDistrict as d,listState as s}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout/country-settings-model.js";import"../../models/data/checkout-settings/index.js";import{IkasCity as n}from"../../models/data/city/index.js";import{IkasCountry as m}from"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import{IkasDistrict as l}from"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import{IkasState as p}from"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";var u=function(){function u(){}return u.getMyCountry=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,o()];case 1:return[2,t.sent()]}}))}))},u.listCountry=function(o){var a;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new r(null===(a=t.data)||void 0===a?void 0:a.map((function(t){return new m(t)})),t.graphQLErrors)]}}))}))},u.listCity=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new n(t)})),t.graphQLErrors)]}}))}))},u.listDistrict=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,d(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new l(t)})),t.graphQLErrors)]}}))}))},u.listState=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,s(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new p(t)})),t.graphQLErrors)]}}))}))},u}();export{u as default};
1
+ import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{getMyCountry as o,APIResponse as i,listCountry as r,listCity as a,listDistrict as d,listState as s,getAvailableShippingZones as n}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import{IkasCity as m}from"../../models/data/city/index.js";import{IkasCountry as l}from"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import{IkasDistrict as p}from"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import{IkasState as u}from"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";var c=function(){function c(){}return c.getMyCountry=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,o()];case 1:return[2,t.sent()]}}))}))},c.listCountry=function(o){var a;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,r(o)];case 1:return t=e.sent(),[2,new i(null===(a=t.data)||void 0===a?void 0:a.map((function(t){return new l(t)})),t.graphQLErrors)]}}))}))},c.listCity=function(o){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(o)];case 1:return t=e.sent(),[2,new i(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new m(t)})),t.graphQLErrors)]}}))}))},c.listDistrict=function(o){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,d(o)];case 1:return t=e.sent(),[2,new i(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new p(t)})),t.graphQLErrors)]}}))}))},c.listState=function(o){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,s(o)];case 1:return t=e.sent(),[2,new i(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new u(t)})),t.graphQLErrors)]}}))}))},c.getAvailableShippingZones=function(o){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n(o)];case 1:return t=e.sent(),[2,new i(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return t})),t.graphQLErrors)]}}))}))},c}();export{c as default};
@@ -6,10 +6,11 @@ import { IkasProductFilter } from "../../models/data/product/filter";
6
6
  import { IkasProductOptionSet } from "../../models/data/product/option-set";
7
7
  import { IkasFilterCategory } from "../../models/data/filter-category";
8
8
  import { IkasProductStockLocations } from "../../models/data/product/stock-location";
9
+ import { IkasCampaignOffer } from "../../models";
9
10
  export default class ProductStore {
10
11
  static listProductBackInStockRemind(params: ListProductBackInStockRemindQueryParams): Promise<APIResponse<import("@ikas/storefront-api/build/__api/types").ProductBackInStockRemind[]> | APIResponse<undefined>>;
11
12
  static saveProductBackInStockRemind(params: SaveProductBackInStockRemindQueryParams): Promise<APIResponse<undefined> | APIResponse<import("@ikas/storefront-api/build/__api/types").ProductBackInStockRemind>>;
12
- static searchProducts(params: SearchProductsQueryParams): Promise<APIResponse<{
13
+ static searchProducts(params: SearchProductsQueryParams, excludedFields?: string[] | null): Promise<APIResponse<{
13
14
  data: IkasProduct[] | undefined;
14
15
  count?: number | undefined;
15
16
  facets?: import("@ikas/storefront-api/build/__api/types").ProductFacetCount[] | null | undefined;
@@ -22,6 +23,7 @@ export default class ProductStore {
22
23
  static getProductFilterData(params: GetProductFilterDataQueryParams): Promise<APIResponse<{
23
24
  filters: IkasProductFilter[];
24
25
  categories: IkasFilterCategory[] | undefined;
26
+ disabledSortTypes: import("@ikas/storefront-api").SortByTypeEnum[] | null;
25
27
  } | null>>;
26
28
  static getRelatedProducts(params: GetRelatedProductsQueryParams): Promise<APIResponse<{
27
29
  data: IkasProduct[] | undefined;
@@ -44,4 +46,5 @@ export default class ProductStore {
44
46
  static getVariantStockLocations(params: GetVariantStockLocationsQueryParams): Promise<APIResponse<IkasProductStockLocations[]>>;
45
47
  static getOrderLineFile(params: GetOrderLineFileQueryParams): Promise<APIResponse<undefined> | APIResponse<string>>;
46
48
  static listProductOptionSet(params: ListProductOptionSetQueryParams): Promise<APIResponse<IkasProductOptionSet[]>>;
49
+ static listCampaignOffer(params: ListProductOptionSetQueryParams): Promise<APIResponse<IkasCampaignOffer[]>>;
47
50
  }
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as r,__assign as n}from'./../../ext/tslib/tslib.es6.js';import{listProductBackInStockRemind as e,saveProductBackInStockRemind as i,APIResponse as o,searchProducts as a,getProductFilterData as u,getRelatedProducts as s,getSuggestedProducts as c,listProductAttribute as d,getProductCampaigns as l,getVariantStockLocations as f,getOrderLineFile as v,listProductOptionSet as h}from"@ikas/storefront-api";import{IkasProduct as m}from"../../models/data/product/index.js";import{IkasProductAttribute as p}from"../../models/data/product/attribute/index.js";import{IkasProductCampaign as w}from"../../models/data/product/campaign/index.js";import{IkasProductFilter as g}from"../../models/data/product/filter/index.js";import{IkasProductOptionSet as b}from"../../models/data/product/option-set/index.js";import{IkasFilterCategory as L}from"../../models/data/filter-category/index.js";import{IkasStorefrontConfig as P}from"@ikas/storefront-config";import{IkasProductStockLocations as j}from"../../models/data/product/stock-location/index.js";var k=function(){function k(){}return k.listProductBackInStockRemind=function(n){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,e(n)];case 1:return[2,t.sent()]}}))}))},k.saveProductBackInStockRemind=function(n){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,i(n)];case 1:return[2,t.sent()]}}))}))},k.searchProducts=function(e){var i,u;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,a(e)];case 1:return t=r.sent(),[2,new o(n(n({locale:P.getCurrentLocale()},t.data),{data:null===(u=null===(i=t.data)||void 0===i?void 0:i.data)||void 0===u?void 0:u.map((function(t){return new m(t)}))}))]}}))}))},k.getProductFilterData=function(n){var e;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,u(n)];case 1:return t=r.sent(),[2,new o(t.data?{filters:t.data.filters.map((function(t){return new g(t)})),categories:null===(e=t.data.categories)||void 0===e?void 0:e.map((function(t){return new L(t)}))}:null,t.graphQLErrors)]}}))}))},k.getRelatedProducts=function(e){var i,a;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,s(e)];case 1:return t=r.sent(),[2,new o(n(n({},t.data),{data:null===(a=null===(i=t.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.map((function(t){return new m(t)}))}),t.graphQLErrors)]}}))}))},k.getSuggestedProducts=function(e){var i,a;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,c(e)];case 1:return t=r.sent(),[2,new o(n(n({},t.data),{data:null===(a=null===(i=t.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.map((function(t){return new m(t)}))}),t.graphQLErrors)]}}))}))},k.listProductAttribute=function(n){var e;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,d(n)];case 1:return t=r.sent(),[2,new o(null===(e=t.data)||void 0===e?void 0:e.map((function(t){return new p(t)})),t.graphQLErrors)]}}))}))},k.getProductCampaigns=function(n){var e;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,l(n)];case 1:return t=r.sent(),[2,new o(null===(e=t.data)||void 0===e?void 0:e.map((function(t){return new w(t)})),t.graphQLErrors)]}}))}))},k.getVariantStockLocations=function(n){var e;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,f(n)];case 1:return t=r.sent(),[2,new o(null===(e=t.data)||void 0===e?void 0:e.map((function(t){return new j(t)})),t.graphQLErrors)]}}))}))},k.getOrderLineFile=function(n){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,v(n)];case 1:return[2,t.sent()]}}))}))},k.listProductOptionSet=function(n){var e;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,h(n)];case 1:return t=r.sent(),[2,new o(null===(e=t.data)||void 0===e?void 0:e.map((function(t){return new b(t)})),t.graphQLErrors)]}}))}))},k}();export{k as default};
1
+ import{__awaiter as t,__generator as r,__assign as e}from'./../../ext/tslib/tslib.es6.js';import{listProductBackInStockRemind as o,saveProductBackInStockRemind as i,APIResponse as a,searchProducts as d,getProductFilterData as s,getRelatedProducts as n,getSuggestedProducts as m,listProductAttribute as u,getProductCampaigns as l,getVariantStockLocations as c,getOrderLineFile as p,listProductOptionSet as v,listCampaignOffer as f}from"@ikas/storefront-api";import{IkasProduct as j}from"../../models/data/product/index.js";import{IkasProductAttribute as x}from"../../models/data/product/attribute/index.js";import{IkasProductCampaign as h}from"../../models/data/product/campaign/index.js";import{IkasProductFilter as g}from"../../models/data/product/filter/index.js";import{IkasProductOptionSet as w}from"../../models/data/product/option-set/index.js";import{IkasFilterCategory as b}from"../../models/data/filter-category/index.js";import{IkasStorefrontConfig as y}from"@ikas/storefront-config";import{IkasProductStockLocations as k}from"../../models/data/product/stock-location/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import{IkasCampaignOffer as L}from"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";var P=function(){function P(){}return P.listProductBackInStockRemind=function(e){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,o(e)];case 1:return[2,t.sent()]}}))}))},P.saveProductBackInStockRemind=function(e){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,i(e)];case 1:return[2,t.sent()]}}))}))},P.searchProducts=function(o,i){var s,n;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,d(o,i)];case 1:return t=r.sent(),[2,new a(e(e({locale:y.getCurrentLocale()},t.data),{data:null===(n=null===(s=t.data)||void 0===s?void 0:s.data)||void 0===n?void 0:n.map((function(t){return new j(t)}))}))]}}))}))},P.getProductFilterData=function(e){var o;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,s(e)];case 1:return t=r.sent(),[2,new a(t.data?{filters:t.data.filters.map((function(t){return new g(t)})),categories:null===(o=t.data.categories)||void 0===o?void 0:o.map((function(t){return new b(t)})),disabledSortTypes:t.data.disabledSortTypes}:null,t.graphQLErrors)]}}))}))},P.getRelatedProducts=function(o){var i,d;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,n(o)];case 1:return t=r.sent(),[2,new a(e(e({},t.data),{data:null===(d=null===(i=t.data)||void 0===i?void 0:i.data)||void 0===d?void 0:d.map((function(t){return new j(t)}))}),t.graphQLErrors)]}}))}))},P.getSuggestedProducts=function(o){var i,d;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,m(o)];case 1:return t=r.sent(),[2,new a(e(e({},t.data),{data:null===(d=null===(i=t.data)||void 0===i?void 0:i.data)||void 0===d?void 0:d.map((function(t){return new j(t)}))}),t.graphQLErrors)]}}))}))},P.listProductAttribute=function(e){var o;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,u(e)];case 1:return t=r.sent(),[2,new a(null===(o=t.data)||void 0===o?void 0:o.map((function(t){return new x(t)})),t.graphQLErrors)]}}))}))},P.getProductCampaigns=function(e){var o;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,l(e)];case 1:return t=r.sent(),[2,new a(null===(o=t.data)||void 0===o?void 0:o.map((function(t){return new h(t)})),t.graphQLErrors)]}}))}))},P.getVariantStockLocations=function(e){var o;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,c(e)];case 1:return t=r.sent(),[2,new a(null===(o=t.data)||void 0===o?void 0:o.map((function(t){return new k(t)})),t.graphQLErrors)]}}))}))},P.getOrderLineFile=function(e){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,p(e)];case 1:return[2,t.sent()]}}))}))},P.listProductOptionSet=function(e){var o;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,v(e)];case 1:return t=r.sent(),[2,new a(null===(o=t.data)||void 0===o?void 0:o.map((function(t){return new w(t)})),t.graphQLErrors)]}}))}))},P.listCampaignOffer=function(e){var o;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,f(e)];case 1:return t=r.sent(),[2,new a(null===(o=t.data)||void 0===o?void 0:o.map((function(t){return new L(t)})),t.graphQLErrors)]}}))}))},P}();export{P as default};
@@ -1 +1 @@
1
- var r=["DE","US","AT"],e=["US"],t=["tr","de","en","it","es","fr","ru"];export{t as COUNTRY_FORMS_LOCALES,e as DISTRICT_HIDDEN_COUNTRY_LIST,r as FREE_TEXT_CITY_COUNTRY_LIST};
1
+ var r=["DE","US","AT"],S=["US"];export{S as DISTRICT_HIDDEN_COUNTRY_LIST,r as FREE_TEXT_CITY_COUNTRY_LIST};
@@ -3,3 +3,4 @@ export declare function stringSorter(atitle: string, btitle: string): number;
3
3
  export declare function capitalize(value: string): string;
4
4
  export declare function tryForEach(items: Array<any>, callback: (item: any, index: number) => void, printErrors?: boolean): void;
5
5
  export declare function formatDate(date: Date): string;
6
+ export declare function getCookieValue(cookieName: string): string | null;
@@ -1 +1 @@
1
- import{IkasStorefrontConfig as r}from"@ikas/storefront-config";function e(r,e){var n=[];if(!r||!e)return[];for(var t=0;t<r.length;){var o=r.indexOf(e,t);if(-1===o)break;t=o+1,n.push(o)}return n}function n(r,e){var n="0123456789AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz",t=r||"",o=e||"";if(0===t.length||0===o.length)return t.length-o.length;for(var a=0;a<t.length&&a<o.length;a++){var u=n.indexOf(t[a].toUpperCase()),i=n.indexOf(o[a].toUpperCase());if(u!==i)return u-i}return 0}function t(e){var n=e.toLocaleLowerCase(r.getCurrentLocale());return n.charAt(0).toLocaleUpperCase(r.getCurrentLocale())+n.slice(1)}function o(r){return!!new Intl.DateTimeFormat(r,{hour:"numeric"}).format(0).match(/\s/)}function a(r,e,n){void 0===n&&(n=!1),r.forEach((function(r,t){try{e(r,t)}catch(r){n&&console.error(r)}}))}function u(e){var n={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},t=r.getCurrentLocale();return"undefined"!=typeof navigator?n.hour12=o(navigator.language):n.hour12=o(t),new Intl.DateTimeFormat(t,n).format(e)}export{t as capitalize,e as findAllIndexes,u as formatDate,n as stringSorter,a as tryForEach};
1
+ import{IkasStorefrontConfig as r}from"@ikas/storefront-config";function n(r,n){var t=[];if(!r||!n)return[];for(var e=0;e<r.length;){var o=r.indexOf(n,e);if(-1===o)break;e=o+1,t.push(o)}return t}function t(r,n){var t="0123456789AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz",e=r||"",o=n||"";if(0===e.length||0===o.length)return e.length-o.length;for(var a=0;a<e.length&&a<o.length;a++){var i=t.indexOf(e[a].toUpperCase()),u=t.indexOf(o[a].toUpperCase());if(i!==u)return i-u}return 0}function e(n){var t=n.toLocaleLowerCase(r.getCurrentLocale());return t.charAt(0).toLocaleUpperCase(r.getCurrentLocale())+t.slice(1)}function o(r){return!!new Intl.DateTimeFormat(r,{hour:"numeric"}).format(0).match(/\s/)}function a(r,n,t){void 0===t&&(t=!1),r.forEach((function(r,e){try{n(r,e)}catch(r){t&&console.error(r)}}))}function i(n){var t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},e=r.getCurrentLocale();return"undefined"!=typeof navigator?t.hour12=o(navigator.language):t.hour12=o(e),new Intl.DateTimeFormat(e,t).format(n)}function u(r){var n=document.cookie.split(";").find((function(n){return n.trim().startsWith("".concat(r,"="))}));return n?n.split("=")[1]:null}export{e as capitalize,n as findAllIndexes,i as formatDate,u as getCookieValue,t as stringSorter,a as tryForEach};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "5.0.0-beta.9",
3
+ "version": "5.0.1",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -17,11 +17,12 @@
17
17
  "build": "rm -rf build && rollup -c"
18
18
  },
19
19
  "devDependencies": {
20
- "@ikas/storefront-api": "^5.0.0-beta.9",
21
- "@ikas/storefront-config": "^5.0.0-beta.9",
22
- "@ikas/storefront-model-functions": "^5.0.0-beta.9",
23
- "@ikas/storefront-models": "^5.0.0-beta.9",
24
- "@ikas/storefront-providers": "^5.0.0-beta.9",
20
+ "@ikas/storefront-api": "^5.0.1",
21
+ "@ikas/storefront-config": "^5.0.1",
22
+ "@ikas/storefront-model-functions": "^5.0.1",
23
+ "@ikas/storefront-models": "^5.0.1",
24
+ "@ikas/storefront-providers": "^5.0.1",
25
+ "@ikas/localized-address": "1.0.0-beta.3",
25
26
  "@adyen/adyen-web": "^5.28.2",
26
27
  "@rollup/plugin-commonjs": "^22.0.0",
27
28
  "@rollup/plugin-json": "^4.1.0",
@@ -40,7 +41,7 @@
40
41
  "rollup-plugin-terser": "^7.0.2",
41
42
  "rollup-plugin-typescript2": "^0.32.1",
42
43
  "sass": "^1.44.0",
43
- "ttypescript": "^1.5.12",
44
+ "ttypescript": "^1.5.15",
44
45
  "typescript": "^4.7.2",
45
46
  "typescript-transform-paths": "^2.2.2",
46
47
  "lodash": "^4.17.21",
@@ -49,14 +50,16 @@
49
50
  "@stripe/react-stripe-js": "^1.10.0",
50
51
  "@stripe/stripe-js": "^1.29.0",
51
52
  "react-tooltip": "^4.2.21",
52
- "libphonenumber-js": "^1.10.6"
53
+ "libphonenumber-js": "^1.10.6",
54
+ "@paypal/react-paypal-js": "^7.8.2"
53
55
  },
54
56
  "peerDependencies": {
55
- "@ikas/storefront-api": "^5.0.0-beta.9",
56
- "@ikas/storefront-config": "^5.0.0-beta.9",
57
- "@ikas/storefront-model-functions": "^5.0.0-beta.9",
58
- "@ikas/storefront-models": "^5.0.0-beta.9",
59
- "@ikas/storefront-providers": "^5.0.0-beta.9",
57
+ "@ikas/localized-address": "1.0.0-beta.3",
58
+ "@ikas/storefront-api": "^5.0.1",
59
+ "@ikas/storefront-config": "^5.0.1",
60
+ "@ikas/storefront-model-functions": "^5.0.1",
61
+ "@ikas/storefront-models": "^5.0.1",
62
+ "@ikas/storefront-providers": "^5.0.1",
60
63
  "mobx": "^6.1.3",
61
64
  "mobx-react-lite": "^3.1.5",
62
65
  "next": "12.2.0",
@@ -69,6 +72,7 @@
69
72
  "@stripe/stripe-js": "^1.29.0",
70
73
  "react-tooltip": "^4.2.21",
71
74
  "libphonenumber-js": "^1.10.6",
72
- "@adyen/adyen-web": "^5.28.2"
75
+ "@adyen/adyen-web": "^5.28.2",
76
+ "@paypal/react-paypal-js": "^7.8.2"
73
77
  }
74
78
  }
@@ -1,9 +0,0 @@
1
- import { IkasCheckout, IkasProduct, IkasOrderLineItem } from "../models";
2
- export declare class GoogleUniversal {
3
- constructor();
4
- static pageView(url: string): void;
5
- static productView(productDetail: IkasProduct): void;
6
- static addToCart(item: IkasProduct | IkasOrderLineItem, quantity: number): void;
7
- static removeFromCart(item: IkasProduct | IkasOrderLineItem, quantity: number): void;
8
- static purchase(checkout: IkasCheckout, orderId: string): void;
9
- }
@@ -1 +0,0 @@
1
- import{makeAutoObservable as t}from"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout/country-settings-model.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as o}from"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/state/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";var e="undefined"==typeof window,i=function(){function i(){t(this)}return i.pageView=function(t){try{return void(!e&&window.ga&&(window.ga("set","page",t),window.ga("send","pageview")))}catch(t){console.error(t)}},i.productView=function(t){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",function(t,o){var e;return{id:t.selectedVariant.id,name:t.name,brand:(null===(e=t.brand)||void 0===e?void 0:e.name)||"",category:t.categories.map((function(t){return t.name})).join(" / "),variant:t.selectedVariant.variantValues.map((function(t){return t.name})).join(" / ")}}(t)),window.ga("ec:setAction","detail")))}catch(t){console.error(t)}},i.addToCart=function(t,i){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",t instanceof o?a(t,i):d(t,i)),window.ga("ec:setAction","add"),window.ga("send","event","UX","click","add to cart")))}catch(t){console.error(t)}},i.removeFromCart=function(t,i){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",t instanceof o?a(t,i):d(t,i)),window.ga("ec:setAction","remove"),window.ga("send","event","UX","click","add to cart")))}catch(t){console.error(t)}},i.purchase=function(t,o){try{return void(!e&&window.ga&&(window.ga("set","currencyCode",t.currencyCode),t.items.map((function(t){return window.ga("ec:addProduct",d(t,t.quantity))})),window.ga("ec:setAction","purchase",{id:o,affiliation:window.location.hostname,revenue:""+t.totalFinalPrice,tax:""+t.totalTax,shipping:""+t.shippingTotal,coupon:t.couponCode})))}catch(t){console.error(t)}},i}();function a(t,o){var e;return void 0===o&&(o=1),{id:t.selectedVariant.id,name:t.name,brand:(null===(e=t.brand)||void 0===e?void 0:e.name)||"",category:t.categories.map((function(t){return t.name})).join(" / "),variant:t.selectedVariant.variantValues.map((function(t){return t.name})).join(" / "),price:t.selectedVariant.price.finalPrice,quantity:o}}function d(t,o){var e;return void 0===o&&(o=1),{name:t.variant.name,id:t.variant.id,price:""+t.finalPrice,brand:"",category:"",variant:null===(e=t.variant.variantValues)||void 0===e?void 0:e.map((function(t){return t.variantValueName})).join(" / "),quantity:o}}export{i as GoogleUniversal};
@@ -1 +0,0 @@
1
- const t=t=>((t,e)=>{const{forward:n=[],...i}=t||{},o=JSON.stringify(i,((t,e)=>("function"==typeof e&&(e=String(e)).startsWith(t+"(")&&(e="function "+e),e)));return["!(function(w,p,f,c){",Object.keys(i).length>0?`c=w[p]=Object.assign(w[p]||{},${o});`:"c=w[p]=w[p]||{};","c[f]=(c[f]||[])",n.length>0?`.concat(${JSON.stringify(n)})`:"","})(window,'partytown','forward');",e].join("")})(t,'/* Partytown 0.7.3 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,"/"==(a=(o.lib||"/~partytown/")+(o.debug?"debug/":""))[0]&&(s=e.querySelectorAll(\'script[type="text/partytown"]\'),i!=t?i.dispatchEvent(new CustomEvent("pt1",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener("pt0",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||"partytown-sw.js"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener("statechange",(function(t){"activated"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?"script":"iframe"),t||(c.setAttribute("style","display:block;width:0;height:0;border:0;visibility:hidden"),c.setAttribute("aria-hidden",!0)),c.src=a+"partytown-"+(t?"atomics.js?v=0.7.3":"sandbox-sw.html?"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement("script")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(".").map((function(e,n,i){p=p[i[n]]=n+1<i.length?"push"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),"complete"==e.readyState?u():(t.addEventListener("DOMContentLoaded",u),t.addEventListener("load",u))}(window,document,navigator,top,window.crossOriginIsolated);');export{t as partytownSnippet};
@@ -1 +0,0 @@
1
- import t from"react";import{partytownSnippet as e}from"../integration/index.mjs.js";const n=(n={})=>{if("undefined"!=typeof document&&!document._partytown){if(!document.querySelector("script[data-partytown]")){const t=document.createElement("script");t.dataset.partytown="",t.innerHTML=e(n),document.head.appendChild(t)}document._partytown=!0}const r=e(n)+'document.currentScript.dataset.partytown="";';return t.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r}})};export{n as Partytown};
@@ -1,141 +0,0 @@
1
- import { IkasCheckoutRequirement, IkasCheckoutSettings, IkasOrderAddress } from "@ikas/storefront-models";
2
- export interface CountrySettingsModelConstructorData {
3
- checkoutSettings?: IkasCheckoutSettings;
4
- }
5
- export default class CountrySettingsModel {
6
- private _initialized;
7
- private _addressFormCountrySettings;
8
- private _addressFormCountryLabels;
9
- private checkoutSettings?;
10
- constructor(data?: CountrySettingsModelConstructorData);
11
- init(): Promise<void>;
12
- get initialized(): boolean;
13
- waitUntilInitialized(): Promise<unknown>;
14
- getCountrySettings(country: string): IkasAddressFormCountrySettings;
15
- getCountryLabels(country: string): IkasAddressFormCountryLabels;
16
- getFieldSettings(country: string): {
17
- firstName: AddressFormField;
18
- lastName: AddressFormField;
19
- identityNumber: AddressFormField;
20
- phone: AddressFormField;
21
- addressLine1: AddressFormField;
22
- addressLine2: AddressFormField;
23
- postalCode: AddressFormField;
24
- country: AddressFormField;
25
- state: AddressFormField;
26
- city: AddressFormField;
27
- district: AddressFormField;
28
- company?: AddressFormField | undefined;
29
- taxOffice?: AddressFormField | undefined;
30
- taxNumber?: AddressFormField | undefined;
31
- };
32
- getFieldLabels(country: string): IkasAddressFormLabels | undefined;
33
- getAddressFormatView(addressFormat: string): AddressFormItem[][];
34
- getBillingFormatView(billingFormat: string): BillingAddressFormItem[][];
35
- getAddressFormat(country: string): AddressFormItem[][];
36
- getBillingFormat(country: string): BillingAddressFormItem[][];
37
- getAddressFormatIgnoreCountry(country: string): AddressFormItem[][];
38
- getValidationResult(address: IkasOrderAddress): {
39
- firstName: ErrorType;
40
- lastName: ErrorType;
41
- addressLine1: ErrorType;
42
- addressLine2: ErrorType;
43
- country: ErrorType;
44
- state: ErrorType;
45
- city: ErrorType;
46
- district: ErrorType;
47
- phone: ErrorType;
48
- postalCode: ErrorType;
49
- identityNumber: ErrorType;
50
- } | undefined;
51
- isValidAddress(address: IkasOrderAddress): boolean;
52
- isValidField(field: string, fieldSettings: AddressFormField | undefined, checkoutRequirement?: IkasCheckoutRequirement | null): ErrorType;
53
- isFreeTextCity(country: string): boolean;
54
- isFreeTextDistrict(country: string): boolean;
55
- getAddressFormCountrySettings(): Promise<void>;
56
- getAddressFormCountryLabels(): Promise<void>;
57
- validatePhoneNumber(str: string): boolean;
58
- validateByRegexString(str: string, regexStr: string): boolean;
59
- }
60
- export declare type ErrorType = {
61
- hasError: boolean;
62
- isInvalid: boolean;
63
- isEmpty: boolean;
64
- };
65
- export declare type IkasAddressFormCountrySettings = {
66
- id: string;
67
- addressFormat: string;
68
- billingFormat: string;
69
- code: string;
70
- iso2: string;
71
- iso3: string;
72
- phoneCode: string;
73
- fields: IkasAddressFormFields;
74
- };
75
- export declare type IkasAddressFormFields = {
76
- firstName?: AddressFormField;
77
- lastName?: AddressFormField;
78
- identityNumber?: AddressFormField;
79
- addressLine1?: AddressFormField;
80
- addressLine2?: AddressFormField;
81
- postalCode?: AddressFormField;
82
- country?: AddressFormField;
83
- state?: AddressFormField;
84
- city?: AddressFormField;
85
- district?: AddressFormField;
86
- phone?: AddressFormField;
87
- company?: AddressFormField;
88
- taxOffice?: AddressFormField;
89
- taxNumber?: AddressFormField;
90
- };
91
- export declare type AddressFormField = {
92
- required?: boolean;
93
- type?: IkasAddressFormInputType;
94
- regex?: string;
95
- };
96
- export declare enum IkasAddressFormInputType {
97
- TEXT = "text",
98
- DROPDOWN = "dropdown"
99
- }
100
- export declare type IkasAddressFormCountryLabels = {
101
- name: string;
102
- fields: IkasAddressFormLabels;
103
- };
104
- export declare type IkasAddressFormLabels = {
105
- firstName?: AddressFormLabel;
106
- lastName?: AddressFormLabel;
107
- identityNumber?: AddressFormLabel;
108
- addressLine1?: AddressFormLabel;
109
- addressLine2?: AddressFormLabel;
110
- postalCode?: AddressFormLabel;
111
- country?: AddressFormLabel;
112
- state?: AddressFormLabel;
113
- city?: AddressFormLabel;
114
- district?: AddressFormLabel;
115
- phone?: AddressFormLabel;
116
- company?: AddressFormLabel;
117
- taxOffice?: AddressFormLabel;
118
- taxNumber?: AddressFormLabel;
119
- };
120
- export declare type AddressFormLabel = {
121
- placeholder?: string;
122
- label?: string;
123
- };
124
- export declare enum AddressFormItem {
125
- FIRSTNAME = "firstName",
126
- LASTNAME = "lastName",
127
- IDENTITY_NUMBER = "identityNumber",
128
- ADDRESS_LINE_1 = "addressLine1",
129
- ADDRESS_LINE_2 = "addressLine2",
130
- POSTAL_CODE = "postalCode",
131
- COUNTRY = "country",
132
- STATE = "state",
133
- CITY = "city",
134
- DISTRICT = "district",
135
- PHONE = "phone"
136
- }
137
- export declare enum BillingAddressFormItem {
138
- COMPANY = "company",
139
- TAX_OFFICE = "taxOffice",
140
- TAX_NUMBER = "taxNumber"
141
- }
@@ -1 +0,0 @@
1
- import{__awaiter as t,__assign as e,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import{IkasStorefrontConfig as n}from"@ikas/storefront-config";import{IkasCheckoutRequirement as s}from"@ikas/storefront-models";import o from"lodash/difference";import{COUNTRY_FORMS_LOCALES as d}from"../../../utils/constants.js";var u,a,l,c=function(){function l(t){void 0===t&&(t={}),this._initialized=!1,this.checkoutSettings=t.checkoutSettings,this.init(),r(this)}return l.prototype.init=function(){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.getAddressFormCountrySettings()];case 1:return t.sent(),[4,this.getAddressFormCountryLabels()];case 2:return t.sent(),this._initialized=!0,[2]}}))}))},Object.defineProperty(l.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),l.prototype.waitUntilInitialized=function(){var t=this;return new Promise((function(e){var i=setInterval((function(){t.initialized&&(clearInterval(i),e(null))}),100)}))},l.prototype.getCountrySettings=function(t){return this._addressFormCountrySettings.countrySettings[t]},l.prototype.getCountryLabels=function(t){return this._addressFormCountryLabels.countryLabels[t]},l.prototype.getFieldSettings=function(t){var i,r,n,o,d,u,a,l,c=this.getCountrySettings(t),h=e(e({},c.fields),{firstName:{required:!0},lastName:{required:!0},identityNumber:e(e({},c.fields.identityNumber),{required:(null===(i=c.fields.identityNumber)||void 0===i?void 0:i.required)||!1}),phone:e(e({},c.fields.phone),{required:(null===(r=c.fields.phone)||void 0===r?void 0:r.required)||!1}),addressLine1:{required:!0},addressLine2:e(e({},c.fields.addressLine2),{required:(null===(n=c.fields.addressLine2)||void 0===n?void 0:n.required)||!1}),postalCode:e(e({},c.fields.postalCode),{required:(null===(o=c.fields.postalCode)||void 0===o?void 0:o.required)||!1}),country:e(e({},c.fields.country),{required:(null===(d=c.fields.country)||void 0===d?void 0:d.required)||!1}),state:e(e({},c.fields.state),{required:(null===(u=c.fields.state)||void 0===u?void 0:u.required)||!1}),city:e(e({},c.fields.city),{required:(null===(a=c.fields.city)||void 0===a?void 0:a.required)||!1}),district:e(e({},c.fields.district),{required:(null===(l=c.fields.district)||void 0===l?void 0:l.required)||!1})});return this.checkoutSettings&&(this.checkoutSettings.phoneRequirement&&(h.phone.required=this.checkoutSettings.phoneRequirement===s.MANDATORY),this.checkoutSettings.postalCodeRequirement&&(h.postalCode.required=this.checkoutSettings.postalCodeRequirement===s.MANDATORY),this.checkoutSettings.identityNumberRequirement&&(h.identityNumber.required=this.checkoutSettings.identityNumberRequirement===s.MANDATORY)),h},l.prototype.getFieldLabels=function(t){var e=this.getCountryLabels(t);if(e)return e.fields},l.prototype.getAddressFormatView=function(t){return this._addressFormCountrySettings.addressFormats[t]},l.prototype.getBillingFormatView=function(t){return this._addressFormCountrySettings.billingFormats[t]},l.prototype.getAddressFormat=function(t){var e=this.getCountrySettings(t),i=this.getAddressFormatView(e.addressFormat);if(this.checkoutSettings&&i){var r=[];return this.checkoutSettings.identityNumberRequirement===s.INVISIBLE&&r.push(a.IDENTITY_NUMBER),this.checkoutSettings.postalCodeRequirement===s.INVISIBLE&&r.push(a.POSTAL_CODE),this.checkoutSettings.phoneRequirement===s.INVISIBLE&&r.push(a.PHONE),i.map((function(t){return o(t,r)}))||[]}return i},l.prototype.getBillingFormat=function(t){var e=this.getCountrySettings(t);return this.getBillingFormatView(e.billingFormat)},l.prototype.getAddressFormatIgnoreCountry=function(t){return this.getAddressFormat(t).map((function(t){return o(t,[a.COUNTRY])}))},l.prototype.getValidationResult=function(t){var e,i,r,n,o,d,u,a,l=this.getFieldSettings((null===(e=t.country)||void 0===e?void 0:e.iso2)||"TR");if(l){var c=!!t.phone&&t.phone.length>=10&&this.validatePhoneNumber(t.phone);return{firstName:this.isValidField(t.firstName,l.firstName),lastName:this.isValidField(t.lastName,l.lastName),addressLine1:this.isValidField(t.addressLine1,l.addressLine1),addressLine2:this.isValidField(t.addressLine2||"",l.addressLine2),country:this.isValidField((null===(i=t.country)||void 0===i?void 0:i.name)||"",l.country),state:this.isValidField((null===(r=t.state)||void 0===r?void 0:r.name)||"",l.state),city:this.isValidField((null===(n=t.city)||void 0===n?void 0:n.name)||"",l.city),district:this.isValidField((null===(o=t.district)||void 0===o?void 0:o.name)||"",l.district),phone:(null===(d=l.phone)||void 0===d?void 0:d.regex)?this.isValidField(t.phone||"",l.phone,this.checkoutSettings?this.checkoutSettings.phoneRequirement:void 0):(null===(u=this.checkoutSettings)||void 0===u?void 0:u.phoneRequirement)===s.MANDATORY||(null===(a=this.checkoutSettings)||void 0===a?void 0:a.phoneRequirement)===s.OPTIONAL&&t.phone?{hasError:!c,isInvalid:!c,isEmpty:!t.phone}:{hasError:!1,isInvalid:!1,isEmpty:!1},postalCode:this.isValidField(t.postalCode||"",l.postalCode,this.checkoutSettings?this.checkoutSettings.postalCodeRequirement:void 0),identityNumber:this.isValidField(t.identityNumber||"",l.identityNumber,this.checkoutSettings?this.checkoutSettings.identityNumberRequirement:void 0)}}},l.prototype.isValidAddress=function(t){var e=this.getValidationResult(t);return!!e&&Object.values(e).every((function(t){return!t.hasError}))},l.prototype.isValidField=function(t,e,i){var r=!1,n=!1,o=i?i===s.MANDATORY:(null==e?void 0:e.required)||!1,d=!!(null==e?void 0:e.regex)||!1;return o&&!d&&(n=!t),o&&d&&(n=!t,r=!this.validateByRegexString(t,e.regex)),!o&&d&&t&&(r=!this.validateByRegexString(t,e.regex)),{hasError:r||n,isInvalid:r,isEmpty:n}},l.prototype.isFreeTextCity=function(t){var e=this.getFieldSettings(t);return e&&e.city&&e.city.type===u.TEXT},l.prototype.isFreeTextDistrict=function(t){var e=this.getFieldSettings(t);return e&&e.district&&e.district.type===u.TEXT},l.prototype.getAddressFormCountrySettings=function(){return t(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return"https://cdn.myikas.com/sf/static/location/settings.json",[4,fetch("https://cdn.myikas.com/sf/static/location/settings.json")];case 1:return[4,e.sent().json()];case 2:return t=e.sent(),this._addressFormCountrySettings=t,[2]}}))}))},l.prototype.getAddressFormCountryLabels=function(){return t(this,void 0,void 0,(function(){var t,e,r;return i(this,(function(i){switch(i.label){case 0:return t=n.getCurrentLocale(),d.find((function(e){return e===t}))||(t="en"),e="https://cdn.myikas.com/sf/static/location/".concat(t,".json"),[4,fetch(e)];case 1:return[4,i.sent().json()];case 2:return r=i.sent(),this._addressFormCountryLabels=r,[2]}}))}))},l.prototype.validatePhoneNumber=function(t){return/^\+?\d+$/.test(t)},l.prototype.validateByRegexString=function(t,e){return new RegExp(e).test(t)},l}();!function(t){t.TEXT="text",t.DROPDOWN="dropdown"}(u||(u={})),function(t){t.FIRSTNAME="firstName",t.LASTNAME="lastName",t.IDENTITY_NUMBER="identityNumber",t.ADDRESS_LINE_1="addressLine1",t.ADDRESS_LINE_2="addressLine2",t.POSTAL_CODE="postalCode",t.COUNTRY="country",t.STATE="state",t.CITY="city",t.DISTRICT="district",t.PHONE="phone"}(a||(a={})),function(t){t.COMPANY="company",t.TAX_OFFICE="taxOffice",t.TAX_NUMBER="taxNumber"}(l||(l={}));export{a as AddressFormItem,l as BillingAddressFormItem,u as IkasAddressFormInputType,c as default};