@ikas/bp-storefront 2.11.1 → 2.13.0

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.
@@ -499,6 +499,28 @@ export declare function getProductCampaigns(product: IkasProduct): Promise<impor
499
499
  * ```
500
500
  */
501
501
  export declare function getProductAvailableStockLocations(product: IkasProduct): Promise<import("../../../storefront-models/src").IkasProductStockLocations[]>;
502
+ /**
503
+ * Re-fetch the latest variant prices of a product and apply them in place.
504
+ * Useful when the page is served from cache but prices change frequently (e.g. gold prices),
505
+ * call it once the product is mounted on the browser.
506
+ *
507
+ * @ai-category Product, Pricing
508
+ * @ai-related updateProductListPrices, getProductVariantFormattedFinalPrice
509
+ *
510
+ * @param product - The product to refresh prices for (modified in place)
511
+ * @returns void
512
+ *
513
+ * @example
514
+ * ```typescript
515
+ * import { updateProductPrices } from "@ikas/bp-storefront";
516
+ *
517
+ * useEffect(() => {
518
+ * updateProductPrices(product);
519
+ * }, [product]);
520
+ * ```
521
+ */
522
+ export declare function updateProductPrices(product: IkasProduct): Promise<void>;
523
+ export declare function refreshProductsPrices(products: IkasProduct[]): Promise<void>;
502
524
  /**
503
525
  * Fetch and attach the product option set if not already loaded.
504
526
  * Loads option set data from the API and sets currency-specific prices for each option.
@@ -1 +1 @@
1
- import{__spreadArray as n,__assign as t,__awaiter as r,__generator as i}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as e}from"../../../packages/storefront-config/src/index.js";import u from'./../../../ext/lodash/sortBy.js';import{_allowStateChangesInsideComputed as a}from'./../../../ext/mobx/dist/mobx.esm.js';import{withRoutePrefix as o,Router as c}from"../../../router/index.js";import{cartStore as s}from"../../../stores/cart/index.js";import{customerStore as d}from"../../../stores/customer/index.js";import{formatCurrency as l}from"../../../utils/currency.js";import{stringToSlug as f,groupBy as v,cloneDeep as p}from"../../../utils/helper.js";import{addProductToFavorites as m,removeProductFromFavorites as y}from"../../stores/customer/index.js";import{getCategoryPath as h}from"../category/index.js";import{initCustomerReviewForm as V}from"../validator/customer-review/index.js";import{getIkasVariantTypeSlug as g}from"../variant-type/index.js";import{getIkasVariantValueSlug as I}from"../variant-type/variant-value/index.js";import{initIkasProductExtraFields as T}from"./init.js";import{hasValidProductOptionSetValues as b}from"./option-set/index.js";import{hasProductVariantStock as S,getProductVariantPrice as P,getProductVariantFinalPrice as w}from"./variant/index.js";import{getIkasProductPriceFinalPrice as j}from"./variant/price/index.js";function x(n){try{var t=new URLSearchParams(window.location.search),r=t.get("vid");if(r){var i=n.variants.find(function(n){return n.id===r});i&&(n.selectedVariantValues=i.variantValues)}else{var e=n.variantTypes.map(function(n){return g(n.variantType)}),a=[];e.forEach(function(r,i){var e=n.variantTypes[i],u=f(t.get(decodeURIComponent(r))||"");if(u){var o=e.variantType.values.find(function(n){return I(n)===u});o&&a.push(o)}}),a.length===n.selectedVariantValues.length&&(n.selectedVariantValues=a)}n.productGroupItems=u(n.productGroupItems,function(n){var t;return(null===(t=n.order)||void 0===t?void 0:t.value)?parseInt(n.order.value,10):0}),T(n),cn(n)}catch(n){console.error(n)}}function O(n,t){return n.productGroup&&!t?n.variants.length>1:!!n.variantTypes.length}function R(n){if(n.groupVariantsByVariantTypeId){var t=n.variants[0].variantValues.find(function(t){return t.variantTypeId==n.groupVariantsByVariantTypeId});if(t)return n.variants.filter(function(n){return n.variantValues.find(function(n){return n.id==t.id})}).some(function(n){return n.stock>0||n.sellIfOutOfStock})}return n.variants.some(function(n){return n.stock>0||n.sellIfOutOfStock})}function E(n){return!n.productOptionSet||b(n.productOptionSet)}function A(n){if(!O(n))return n.variants[0];var t=n.selectedVariantValues.map(function(n){return n.id});return n.variants.find(function(n){return n.variantValues.every(function(n){return t.includes(n.id)})})}function C(n){var t=n.selectedVariantValues;return t.length?t[0]:void 0}function L(n){if(O(n))return n.variantTypes[0].variantType}function k(n){var t=n.metaData;if(!(null==t?void 0:t.slug))return o("");var r=n.variantTypes.map(function(t){var r=t.variantType,i=r.values.find(function(t){return n.selectedVariantValues.some(function(n){return n.id===t.id})});if(i)return"".concat(g(r),"=").concat(I(i))}).filter(function(n){return!!n}).join("&");return o(r?"/".concat(t.slug,"?").concat(r):"/".concat(t.slug))}function G(n){var t=n.metaData;return(null==t?void 0:t.slug)?o("/".concat(t.slug)):""}function q(t){var r=t.selectedVariantValues,i=t.variantTypes.map(function(i,e){var u=i.variantType,a=[],o=e>0?t.variantTypes.slice(0,e):null,c=[];return o&&(c=r.filter(function(n){return o.some(function(t){return t.variantType.id===n.variantTypeId})})),u.values.forEach(function(i){var e=n(n([],c,!0),[i],!1),u=t.variants.find(function(n){return n.isActive&&e.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})}),o=t.variants.find(function(n){return n.isActive&&S(n)&&e.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})}),s=r.some(function(n){return n.id===i.id});u&&a.push({variant:u,variantValue:i,hasStock:!!o,isSelected:s})}),{variantType:u,displayedVariantValues:a}});return 1===i.length&&(i[0].displayedVariantValues=i[0].displayedVariantValues.filter(function(n){return n.variant.isActive})),i}function Q(n){var t=A(n),r=n.productOptionSet;return(!r||b(r))&&(S(t)||t.sellIfOutOfStock)}function _(n){return e.isCustomerReviewEnabled()}function B(n){return e.isCustomerReviewLoginRequired()}function F(n){var t,r=v(n.attributes,"productAttributeId");return(null===(t=n.attributes)||void 0===t?void 0:t.map(function(n){var t=n.productAttributeId;if(t){var i=r[t];return(null==i?void 0:i.length)&&i[0].productAttribute?{attribute:i[0].productAttribute,values:i}:void 0}}).filter(function(n){return!!n}))||[]}function U(t){var r,i=[],e=[];return null===(r=t.productGroupItems)||void 0===r||r.forEach(function(n){n.groupValues.forEach(function(n){i.includes(n.name)||i.push(n.name)})}),i.forEach(function(r){var i,u={name:r,items:[]};null===(i=t.productGroupItems)||void 0===i||i.forEach(function(i){var e,a,c,s=i.groupValues.find(function(n){return n.name===r});if(s&&!u.items.some(function(n){return n.value===s.value})){var d="";if(i.productId===t.id)d=k(t);else{var l=(null===(e=t.productGroup)||void 0===e?void 0:e.values.filter(function(n){return n.name!==r}))||[],f=n(n([],l,!0),[s],!1),v=null===(a=t.productGroupItems)||void 0===a?void 0:a.find(function(n){return f.every(function(t){return n.groupValues.some(function(n){return t.name===n.name&&t.value===n.value})})});d=v?v.href:i.href}u.items.push({image:i.image||null,href:o(d),value:s.value,isSelected:(null===(c=t.productGroupItems)||void 0===c?void 0:c.some(function(n){return n.groupValues.some(function(n){return n.value===s.value})&&n.productId===t.id}))||!1})}}),e.push(u)}),e}function D(r,i,e){var u=r.metaData,a=r.selectedVariantValues.map(function(n){return n.variantTypeId===i.variantTypeId?i:n}),s=r.variants.find(function(n){return n.isActive&&a.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})});if(s)r.selectedVariantValues=a;else{var d=r.variantTypes.findIndex(function(n){return n.variantType.id===i.variantTypeId});if(d>0){var l=r.variantTypes.slice(0,d),f=r.selectedVariantValues.filter(function(n){return l.some(function(t){return t.variantType.id===n.variantTypeId})}),v=n(n([],f,!0),[i],!1);s=r.variants.find(function(n){return n.isActive&&v.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})})}else{var p=a.slice(0,a.length-1);(s=r.variants.find(function(n){return n.isActive&&p.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})}))||(s=r.variants.find(function(n){return n.isActive&&n.variantValues.some(function(n){return n.id===i.id})}))}if(!s)return;r.selectedVariantValues=s.variantValues}var m={};new URLSearchParams(window.location.search).forEach(function(n,r){var i;"vid"!==r&&(m=t(t({},m),((i={})[r]=n,i)))}),r.variantTypes.map(function(n){delete m[g(n.variantType)]});var y=n(n([],r.variantTypes.map(function(n){var t=n.variantType,i=t.values.find(function(n){return r.selectedVariantValues.some(function(t){return t.id===n.id})});if(i)return"".concat(g(t),"=").concat(I(i))}),!0),Object.entries(m).map(function(n){var t=n[0],r=n[1];return"".concat(t,"=").concat(r)}),!0).filter(function(n){return!!n}).join("&");if(cn(r),!e){var h=o("/".concat(u.slug));if(y&&(h=o("/".concat(u.slug,"?").concat(y))),h===window.location.pathname)return;c.navigate(h,!0)}}function z(n){return r(this,void 0,void 0,function(){var t,r,u,a;return i(this,function(i){switch(i.label){case 0:return t=d.customer,r=t?t.customerGroupIds:null,u=n.variants.map(function(n){return n.id}),[4,import("../../api/product/index.js")];case 1:return[4,(0,i.sent().apiGetProductCampaigns)({input:{customerGroupIds:r,salesChannelId:e.salesChannelId||"",variantIds:u}})];case 2:return a=i.sent(),n.campaigns=a.data,n.campaigns?(n.campaigns.map(function(t){n.variants.map(function(n){var r;t.variantIds.some(function(t){return t===n.id})&&(null===(r=n.campaigns)||void 0===r||r.push(t))})}),[2,n.campaigns]):[2]}})})}function H(n){return r(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return t=n.variants.map(function(n){return n.id}),r=e.pickUpStockLocationIds,[4,import("../../api/product/index.js")];case 1:return[4,(0,i.sent().apiGetVariantStockLocations)({stockLocationIdList:r,variantIds:t})];case 2:return[2,i.sent().data||[]]}})})}function J(n){return r(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return n.productOptionSet?[2,!0]:n.productOptionSetId?[4,import("../../api/product/index.js")]:[2,!1];case 1:return[4,(0,i.sent().apiListProductOptionSet)({id:{eq:n.productOptionSetId}},n)];case 2:return(t=i.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)?(n.productOptionSet=t.data[0],function(n){var t,r=n.variants[0];if(!r)return;var i=P(r).currency;null===(t=n.productOptionSet)||void 0===t||t.options.forEach(function(n){var t,e;if(n.selectSettings&&n.selectSettings.values.forEach(function(n){var t,e;if(n.otherPrices)if("RATIO"===n.priceType){var u=(null===(t=n.otherPrices.find(function(n){return n.currencyCode===i}))||void 0===t?void 0:t.price)||n.price||1,a=P(r),o=j(a);n.price=o*u}else n.price=(null===(e=n.otherPrices.find(function(n){return n.currencyCode===i}))||void 0===e?void 0:e.price)||n.price}),n.otherPrices)if("RATIO"===n.priceType){var u=(null===(t=n.otherPrices.find(function(n){return n.currencyCode===i}))||void 0===t?void 0:t.price)||n.price||1,a=P(r),o=j(a);n.price=o*u}else n.price=(null===(e=n.otherPrices.find(function(n){return n.currencyCode===i}))||void 0===e?void 0:e.price)||n.price})}(n),cn(n),[2,!0]):[2,!1]}})})}function K(n){n&&n.options.forEach(function(n){n.initPrice=n.price,n.selectSettings&&n.selectSettings.values.forEach(function(n){n.initPrice=n.price,n.thumbnailImageId&&(n.thumbnailImage={id:n.thumbnailImageId,isVideo:!1})})})}function M(n){return r(this,void 0,void 0,function(){var t,r,e,u,a,o;return i(this,function(i){switch(i.label){case 0:return t="","undefined"!=typeof window&&(r=new URLSearchParams(window.location.search),t=r.get("editLineID")||""),t?(e=null===(a=s.cart)||void 0===a?void 0:a.orderLineItems.find(function(n){return n.id===t}))&&(u=n.variants.find(function(n){return n.id===e.variant.id}))?(n.selectedVariantValues=u.variantValues,[4,N(n,u)]):[3,2]:[3,3];case 1:i.sent(),null===(o=u.bundleSettings)||void 0===o||o.products.forEach(function(n){var t,r,i;try{var u=null===(t=e.variant.bundleProducts)||void 0===t?void 0:t.find(function(t){return t.id===n.id}),a=n.product.variants.find(function(n){return n.id===(null==u?void 0:u.variant.id)});n.product.selectedVariantValues=a.variantValues,n.quantity=(null===(i=null===(r=e.variant.bundleProducts)||void 0===r?void 0:r.find(function(n){return n.variant.id===a.id}))||void 0===i?void 0:i.quantity)||0}catch(n){console.error(n)}}),i.label=2;case 2:return[3,5];case 3:return[4,N(n,A(n))];case 4:i.sent(),i.label=5;case 5:return[2]}})})}function N(n,t){return r(this,void 0,void 0,function(){var r,e,u,o,c;return i(this,function(i){switch(i.label){case 0:return(null==(r=null===(u=t.bundleSettings)||void 0===u?void 0:u.products.map(function(n){return n.productId}).filter(function(t){return-1===Object.keys(n.bundleProductCache).indexOf(t)}))?void 0:r.length)?[4,import("../../api/product/index.js")]:[3,3];case 1:return[4,(0,i.sent().apiSearchProducts)({input:{productIdList:r,perPage:200}})];case 2:(e=i.sent()).isSuccess&&(null===(c=null===(o=e.data)||void 0===o?void 0:o.data)||void 0===c||c.forEach(function(t){n.bundleProductCache[t.id]=t})),i.label=3;case 3:return a(function(){var r;null===(r=t.bundleSettings)||void 0===r||r.products.forEach(function(t){t.initialQuantity=t.quantity;var r=n.bundleProductCache[t.productId];an(t,p(r))})}),[2]}})})}function W(n){return null!==n.maxQuantity||null!==n.minQuantity}function X(n){return!0===n.addToBundleBasePrice}function Y(n){if(!n.product)return 0;var t=A(n.product),r=P(t),i=j(r);return n.addToBundleBasePrice&&n.discountRatio&&(i-=i*(n.discountRatio/100)),i}function Z(n){if(!n.product)return l(0,"","");var t=A(n.product),r=P(t);return l(Y(n),(null==r?void 0:r.currency)||"",(null==r?void 0:r.currencySymbol)||"")}function $(n){return Y(n)*n.quantity}function nn(n){if(!n.product)return l(0,"","");var t=A(n.product),r=P(t);return l($(n),(null==r?void 0:r.currency)||"",(null==r?void 0:r.currencySymbol)||"")}function tn(n){if(!n.product)return 0;var t=A(n.product),r=P(t);return(null==r?void 0:r.sellPrice)||0}function rn(n){if(!n.product)return l(0,"","");var t=A(n.product),r=P(t);return l(tn(n),(null==r?void 0:r.currency)||"",(null==r?void 0:r.currencySymbol)||"")}function en(n){return tn(n)*n.quantity}function un(n){if(!n.product)return l(0,"","");var t=A(n.product),r=P(t);return l(en(n),(null==r?void 0:r.currency)||"",(null==r?void 0:r.currencySymbol)||"")}function an(n,t){t.variants=t.variants.filter(function(t){return n.filteredVariantIds.includes(t.id)}),t.selectedVariantValues=t.variants[0].variantValues,n.product=t,n.quantity=n.initialQuantity||0}function on(n,t){if(!(t<0)&&n.product){var r=A(n.product).stock;null!==n.minQuantity&&t<n.minQuantity?n.quantity=n.minQuantity:null!==n.maxQuantity&&t>n.maxQuantity?n.quantity=n.maxQuantity:n.quantity=r&&t>r?r:t}}function cn(n){var t,r=A(n)||n.variants[0];if(r){var i=P(r),e=w(r),u=null==i?void 0:i.priceListId;null===(t=n.productOptionSet)||void 0===t||t.options.forEach(function(n){var t;if(n.selectSettings)n.selectSettings.values.forEach(function(n){var t;if("RATIO"===n.priceType&&n.initPrice)if(n.otherPrices){var r=(null===(t=n.otherPrices.find(function(n){return n.priceListId===u}))||void 0===t?void 0:t.price)||n.initPrice||1;n.price=e*r/100}else n.price=e*n.initPrice/100});else if("RATIO"===n.priceType&&n.initPrice)if(n.otherPrices){var r=(null===(t=n.otherPrices.find(function(n){return n.priceListId===u}))||void 0===t?void 0:t.price)||n.initPrice||1;n.price=e*r/100}else n.price=e*n.initPrice/100})}}function sn(n){return n.categories.length>0?h(n.categories[0]):[]}function dn(n){return n.categories.length>0?n.categories[0]:null}function ln(n){return d._customerReviewForms[n.id]||(d._customerReviewForms[n.id]={},V(d._customerReviewForms[n.id],n.id)),d._customerReviewForms[n.id]}function fn(n){delete d._customerReviewForms[n.id]}function vn(n){return d._favoriteProducts.some(function(t){return t.productId===n.id})}function pn(n){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,m(d,n.id)];case 1:return[2,t.sent()]}})})}function mn(n){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,y(d,n.id)];case 1:return[2,t.sent()]}})})}export{pn as addIkasProductToFavorites,fn as clearIkasProductCustomerReviewForm,Y as getBundleProductFinalPrice,$ as getBundleProductFinalPriceWithQuantity,Z as getBundleProductFormattedFinalPrice,nn as getBundleProductFormattedFinalPriceWithQuantity,rn as getBundleProductFormattedSellPrice,un as getBundleProductFormattedSellPriceWithQuantity,tn as getBundleProductSellPrice,en as getBundleProductSellPriceWithQuantity,N as getBundleProductsOfVariant,U as getDisplayedProductGroups,q as getDisplayedProductVariantTypes,F as getGroupedAttributeValues,ln as getIkasProductCustomerReviewForm,L as getMainProductVariantType,C as getMainProductVariantValue,H as getProductAvailableStockLocations,z as getProductCampaigns,sn as getProductCategoryPath,dn as getProductFirstCategory,G as getProductHref,J as getProductOptionSet,A as getSelectedProductVariant,k as getSelectedProductVariantHref,R as hasProductStock,E as hasProductValidOptionValues,O as hasProductVariant,M as initBundleProducts,x as initProductOnBrowser,K as initProductOptionSet,Q as isAddToCartEnabled,W as isBundleProductQuantityEditable,_ as isCustomerReviewEnabled,B as isCustomerReviewLoginRequired,vn as isFavoriteIkasProduct,mn as removeIkasProductFromFavorites,D as selectVariantValue,on as setBundleProductQuantity,cn as setOptionRealPrices,an as setProductOfBundleProduct,X as shouldDisplayBundleProductPrice};
1
+ import{__spreadArray as n,__assign as t,__awaiter as r,__generator as i}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as e}from"../../../packages/storefront-config/src/index.js";import u from'./../../../ext/lodash/sortBy.js';import{_allowStateChangesInsideComputed as a}from'./../../../ext/mobx/dist/mobx.esm.js';import{withRoutePrefix as o,Router as c}from"../../../router/index.js";import{cartStore as s}from"../../../stores/cart/index.js";import{customerStore as d}from"../../../stores/customer/index.js";import{formatCurrency as l}from"../../../utils/currency.js";import{stringToSlug as f,groupBy as v,cloneDeep as p}from"../../../utils/helper.js";import{addProductToFavorites as m,removeProductFromFavorites as h}from"../../stores/customer/index.js";import{getCategoryPath as y}from"../category/index.js";import{initCustomerReviewForm as g}from"../validator/customer-review/index.js";import{getIkasVariantTypeSlug as V}from"../variant-type/index.js";import{getIkasVariantValueSlug as I}from"../variant-type/variant-value/index.js";import{initIkasProductExtraFields as b}from"./init.js";import{hasValidProductOptionSetValues as T}from"./option-set/index.js";import{hasProductVariantStock as P,getProductVariantPrice as S,getProductVariantFinalPrice as w}from"./variant/index.js";import{getIkasProductPriceFinalPrice as j}from"./variant/price/index.js";function x(n){try{var t=new URLSearchParams(window.location.search),r=t.get("vid");if(r){var i=n.variants.find(function(n){return n.id===r});i&&(n.selectedVariantValues=i.variantValues)}else{var e=n.variantTypes.map(function(n){return V(n.variantType)}),a=[];e.forEach(function(r,i){var e=n.variantTypes[i],u=f(t.get(decodeURIComponent(r))||"");if(u){var o=e.variantType.values.find(function(n){return I(n)===u});o&&a.push(o)}}),a.length===n.selectedVariantValues.length&&(n.selectedVariantValues=a)}n.productGroupItems=u(n.productGroupItems,function(n){var t;return(null===(t=n.order)||void 0===t?void 0:t.value)?parseInt(n.order.value,10):0}),b(n),ln(n)}catch(n){console.error(n)}}function O(n,t){return n.productGroup&&!t?n.variants.length>1:!!n.variantTypes.length}function E(n){if(n.groupVariantsByVariantTypeId){var t=n.variants[0].variantValues.find(function(t){return t.variantTypeId==n.groupVariantsByVariantTypeId});if(t)return n.variants.filter(function(n){return n.variantValues.find(function(n){return n.id==t.id})}).some(function(n){return n.stock>0||n.sellIfOutOfStock})}return n.variants.some(function(n){return n.stock>0||n.sellIfOutOfStock})}function L(n){return!n.productOptionSet||T(n.productOptionSet)}function R(n){if(!O(n))return n.variants[0];var t=n.selectedVariantValues.map(function(n){return n.id});return n.variants.find(function(n){return n.variantValues.every(function(n){return t.includes(n.id)})})}function C(n){var t=n.selectedVariantValues;return t.length?t[0]:void 0}function A(n){if(O(n))return n.variantTypes[0].variantType}function k(n){var t=n.metaData;if(!(null==t?void 0:t.slug))return o("");var r=n.variantTypes.map(function(t){var r=t.variantType,i=r.values.find(function(t){return n.selectedVariantValues.some(function(n){return n.id===t.id})});if(i)return"".concat(V(r),"=").concat(I(i))}).filter(function(n){return!!n}).join("&");return o(r?"/".concat(t.slug,"?").concat(r):"/".concat(t.slug))}function G(n){var t=n.metaData;return(null==t?void 0:t.slug)?o("/".concat(t.slug)):""}function q(t){var r=t.selectedVariantValues,i=t.variantTypes.map(function(i,e){var u=i.variantType,a=[],o=e>0?t.variantTypes.slice(0,e):null,c=[];return o&&(c=r.filter(function(n){return o.some(function(t){return t.variantType.id===n.variantTypeId})})),u.values.forEach(function(i){var e=n(n([],c,!0),[i],!1),u=t.variants.find(function(n){return n.isActive&&e.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})}),o=t.variants.find(function(n){return n.isActive&&P(n)&&e.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})}),s=r.some(function(n){return n.id===i.id});u&&a.push({variant:u,variantValue:i,hasStock:!!o,isSelected:s})}),{variantType:u,displayedVariantValues:a}});return 1===i.length&&(i[0].displayedVariantValues=i[0].displayedVariantValues.filter(function(n){return n.variant.isActive})),i}function Q(n){var t=R(n),r=n.productOptionSet;return(!r||T(r))&&(P(t)||t.sellIfOutOfStock)}function _(n){return e.isCustomerReviewEnabled()}function B(n){return e.isCustomerReviewLoginRequired()}function F(n){var t,r=v(n.attributes,"productAttributeId");return(null===(t=n.attributes)||void 0===t?void 0:t.map(function(n){var t=n.productAttributeId;if(t){var i=r[t];return(null==i?void 0:i.length)&&i[0].productAttribute?{attribute:i[0].productAttribute,values:i}:void 0}}).filter(function(n){return!!n}))||[]}function U(t){var r,i=[],e=[];return null===(r=t.productGroupItems)||void 0===r||r.forEach(function(n){n.groupValues.forEach(function(n){i.includes(n.name)||i.push(n.name)})}),i.forEach(function(r){var i,u={name:r,items:[]};null===(i=t.productGroupItems)||void 0===i||i.forEach(function(i){var e,a,c,s=i.groupValues.find(function(n){return n.name===r});if(s&&!u.items.some(function(n){return n.value===s.value})){var d="";if(i.productId===t.id)d=k(t);else{var l=(null===(e=t.productGroup)||void 0===e?void 0:e.values.filter(function(n){return n.name!==r}))||[],f=n(n([],l,!0),[s],!1),v=null===(a=t.productGroupItems)||void 0===a?void 0:a.find(function(n){return f.every(function(t){return n.groupValues.some(function(n){return t.name===n.name&&t.value===n.value})})});d=v?v.href:i.href}u.items.push({image:i.image||null,href:o(d),value:s.value,isSelected:(null===(c=t.productGroupItems)||void 0===c?void 0:c.some(function(n){return n.groupValues.some(function(n){return n.value===s.value})&&n.productId===t.id}))||!1})}}),e.push(u)}),e}function D(r,i,e){var u=r.metaData,a=r.selectedVariantValues.map(function(n){return n.variantTypeId===i.variantTypeId?i:n}),s=r.variants.find(function(n){return n.isActive&&a.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})});if(s)r.selectedVariantValues=a;else{var d=r.variantTypes.findIndex(function(n){return n.variantType.id===i.variantTypeId});if(d>0){var l=r.variantTypes.slice(0,d),f=r.selectedVariantValues.filter(function(n){return l.some(function(t){return t.variantType.id===n.variantTypeId})}),v=n(n([],f,!0),[i],!1);s=r.variants.find(function(n){return n.isActive&&v.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})})}else{var p=a.slice(0,a.length-1);(s=r.variants.find(function(n){return n.isActive&&p.every(function(t){return n.variantValues.some(function(n){return n.id===t.id})})}))||(s=r.variants.find(function(n){return n.isActive&&n.variantValues.some(function(n){return n.id===i.id})}))}if(!s)return;r.selectedVariantValues=s.variantValues}var m={};new URLSearchParams(window.location.search).forEach(function(n,r){var i;"vid"!==r&&(m=t(t({},m),((i={})[r]=n,i)))}),r.variantTypes.map(function(n){delete m[V(n.variantType)]});var h=n(n([],r.variantTypes.map(function(n){var t=n.variantType,i=t.values.find(function(n){return r.selectedVariantValues.some(function(t){return t.id===n.id})});if(i)return"".concat(V(t),"=").concat(I(i))}),!0),Object.entries(m).map(function(n){var t=n[0],r=n[1];return"".concat(t,"=").concat(r)}),!0).filter(function(n){return!!n}).join("&");if(ln(r),!e){var y=o("/".concat(u.slug));if(h&&(y=o("/".concat(u.slug,"?").concat(h))),y===window.location.pathname)return;c.navigate(y,!0)}}function M(n){return r(this,void 0,void 0,function(){var t,r,u,a;return i(this,function(i){switch(i.label){case 0:return t=d.customer,r=t?t.customerGroupIds:null,u=n.variants.map(function(n){return n.id}),[4,import("../../api/product/index.js")];case 1:return[4,(0,i.sent().apiGetProductCampaigns)({input:{customerGroupIds:r,salesChannelId:e.salesChannelId||"",variantIds:u}})];case 2:return a=i.sent(),n.campaigns=a.data,n.campaigns?(n.campaigns.map(function(t){n.variants.map(function(n){var r;t.variantIds.some(function(t){return t===n.id})&&(null===(r=n.campaigns)||void 0===r||r.push(t))})}),[2,n.campaigns]):[2]}})})}function z(n){return r(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return t=n.variants.map(function(n){return n.id}),r=e.pickUpStockLocationIds,[4,import("../../api/product/index.js")];case 1:return[4,(0,i.sent().apiGetVariantStockLocations)({stockLocationIdList:r,variantIds:t})];case 2:return[2,i.sent().data||[]]}})})}function H(n){return r(this,void 0,void 0,function(){var t;return i(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,K([n])];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),console.log(t),[3,3];case 3:return[2]}})})}var J=50;function K(n){return r(this,void 0,void 0,function(){var t,r,u,o,c;return i(this,function(i){switch(i.label){case 0:return n.length?[4,import("../../api/product/index.js")]:[2];case 1:for(t=i.sent().apiSearchProducts,r=[],u=0;u<n.length;u+=J)r.push(n.slice(u,u+J));return[4,Promise.all(r.map(function(n){return t({input:{productIdList:n.map(function(n){return n.id}),page:1,perPage:n.length,priceListId:e.priceListId,salesChannelId:e.salesChannelId}})}))];case 2:return o=i.sent(),c=o.flatMap(function(n){var t;return(null===(t=n.data)||void 0===t?void 0:t.data)||[]}),c.length?(a(function(){n.forEach(function(n){var t=c.find(function(t){return t.id===n.id});t&&n.variants.forEach(function(n){var r=t.variants.find(function(t){return t.id===n.id});r&&(n.prices=r.prices,n.baseBundlePrices=r.baseBundlePrices)})})}),[2]):[2]}})})}function N(n){return r(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return n.productOptionSet?[2,!0]:n.productOptionSetId?[4,import("../../api/product/index.js")]:[2,!1];case 1:return[4,(0,i.sent().apiListProductOptionSet)({id:{eq:n.productOptionSetId}},n)];case 2:return(t=i.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)?(n.productOptionSet=t.data[0],function(n){var t,r=n.variants[0];if(!r)return;var i=S(r).currency;null===(t=n.productOptionSet)||void 0===t||t.options.forEach(function(n){var t,e;if(n.selectSettings&&n.selectSettings.values.forEach(function(n){var t,e;if(n.otherPrices)if("RATIO"===n.priceType){var u=(null===(t=n.otherPrices.find(function(n){return n.currencyCode===i}))||void 0===t?void 0:t.price)||n.price||1,a=S(r),o=j(a);n.price=o*u}else n.price=(null===(e=n.otherPrices.find(function(n){return n.currencyCode===i}))||void 0===e?void 0:e.price)||n.price}),n.otherPrices)if("RATIO"===n.priceType){var u=(null===(t=n.otherPrices.find(function(n){return n.currencyCode===i}))||void 0===t?void 0:t.price)||n.price||1,a=S(r),o=j(a);n.price=o*u}else n.price=(null===(e=n.otherPrices.find(function(n){return n.currencyCode===i}))||void 0===e?void 0:e.price)||n.price})}(n),ln(n),[2,!0]):[2,!1]}})})}function W(n){n&&n.options.forEach(function(n){n.initPrice=n.price,n.selectSettings&&n.selectSettings.values.forEach(function(n){n.initPrice=n.price,n.thumbnailImageId&&(n.thumbnailImage={id:n.thumbnailImageId,isVideo:!1})})})}function X(n){return r(this,void 0,void 0,function(){var t,r,e,u,a,o;return i(this,function(i){switch(i.label){case 0:return t="","undefined"!=typeof window&&(r=new URLSearchParams(window.location.search),t=r.get("editLineID")||""),t?(e=null===(a=s.cart)||void 0===a?void 0:a.orderLineItems.find(function(n){return n.id===t}))&&(u=n.variants.find(function(n){return n.id===e.variant.id}))?(n.selectedVariantValues=u.variantValues,[4,Y(n,u)]):[3,2]:[3,3];case 1:i.sent(),null===(o=u.bundleSettings)||void 0===o||o.products.forEach(function(n){var t,r,i;try{var u=null===(t=e.variant.bundleProducts)||void 0===t?void 0:t.find(function(t){return t.id===n.id}),a=n.product.variants.find(function(n){return n.id===(null==u?void 0:u.variant.id)});n.product.selectedVariantValues=a.variantValues,n.quantity=(null===(i=null===(r=e.variant.bundleProducts)||void 0===r?void 0:r.find(function(n){return n.variant.id===a.id}))||void 0===i?void 0:i.quantity)||0}catch(n){console.error(n)}}),i.label=2;case 2:return[3,5];case 3:return[4,Y(n,R(n))];case 4:i.sent(),i.label=5;case 5:return[2]}})})}function Y(n,t){return r(this,void 0,void 0,function(){var r,e,u,o,c;return i(this,function(i){switch(i.label){case 0:return(null==(r=null===(u=t.bundleSettings)||void 0===u?void 0:u.products.map(function(n){return n.productId}).filter(function(t){return-1===Object.keys(n.bundleProductCache).indexOf(t)}))?void 0:r.length)?[4,import("../../api/product/index.js")]:[3,3];case 1:return[4,(0,i.sent().apiSearchProducts)({input:{productIdList:r,perPage:200}})];case 2:(e=i.sent()).isSuccess&&(null===(c=null===(o=e.data)||void 0===o?void 0:o.data)||void 0===c||c.forEach(function(t){n.bundleProductCache[t.id]=t})),i.label=3;case 3:return a(function(){var r;null===(r=t.bundleSettings)||void 0===r||r.products.forEach(function(t){t.initialQuantity=t.quantity;var r=n.bundleProductCache[t.productId];sn(t,p(r))})}),[2]}})})}function Z(n){return null!==n.maxQuantity||null!==n.minQuantity}function $(n){return!0===n.addToBundleBasePrice}function nn(n){if(!n.product)return 0;var t=R(n.product),r=S(t),i=j(r);return n.addToBundleBasePrice&&n.discountRatio&&(i-=i*(n.discountRatio/100)),i}function tn(n){if(!n.product)return l(0,"","");var t=R(n.product),r=S(t);return l(nn(n),(null==r?void 0:r.currency)||"",(null==r?void 0:r.currencySymbol)||"")}function rn(n){return nn(n)*n.quantity}function en(n){if(!n.product)return l(0,"","");var t=R(n.product),r=S(t);return l(rn(n),(null==r?void 0:r.currency)||"",(null==r?void 0:r.currencySymbol)||"")}function un(n){if(!n.product)return 0;var t=R(n.product),r=S(t);return(null==r?void 0:r.sellPrice)||0}function an(n){if(!n.product)return l(0,"","");var t=R(n.product),r=S(t);return l(un(n),(null==r?void 0:r.currency)||"",(null==r?void 0:r.currencySymbol)||"")}function on(n){return un(n)*n.quantity}function cn(n){if(!n.product)return l(0,"","");var t=R(n.product),r=S(t);return l(on(n),(null==r?void 0:r.currency)||"",(null==r?void 0:r.currencySymbol)||"")}function sn(n,t){t.variants=t.variants.filter(function(t){return n.filteredVariantIds.includes(t.id)}),t.selectedVariantValues=t.variants[0].variantValues,n.product=t,n.quantity=n.initialQuantity||0}function dn(n,t){if(!(t<0)&&n.product){var r=R(n.product).stock;null!==n.minQuantity&&t<n.minQuantity?n.quantity=n.minQuantity:null!==n.maxQuantity&&t>n.maxQuantity?n.quantity=n.maxQuantity:n.quantity=r&&t>r?r:t}}function ln(n){var t,r=R(n)||n.variants[0];if(r){var i=S(r),e=w(r),u=null==i?void 0:i.priceListId;null===(t=n.productOptionSet)||void 0===t||t.options.forEach(function(n){var t;if(n.selectSettings)n.selectSettings.values.forEach(function(n){var t;if("RATIO"===n.priceType&&n.initPrice)if(n.otherPrices){var r=(null===(t=n.otherPrices.find(function(n){return n.priceListId===u}))||void 0===t?void 0:t.price)||n.initPrice||1;n.price=e*r/100}else n.price=e*n.initPrice/100});else if("RATIO"===n.priceType&&n.initPrice)if(n.otherPrices){var r=(null===(t=n.otherPrices.find(function(n){return n.priceListId===u}))||void 0===t?void 0:t.price)||n.initPrice||1;n.price=e*r/100}else n.price=e*n.initPrice/100})}}function fn(n){return n.categories.length>0?y(n.categories[0]):[]}function vn(n){return n.categories.length>0?n.categories[0]:null}function pn(n){return d._customerReviewForms[n.id]||(d._customerReviewForms[n.id]={},g(d._customerReviewForms[n.id],n.id)),d._customerReviewForms[n.id]}function mn(n){delete d._customerReviewForms[n.id]}function hn(n){return d._favoriteProducts.some(function(t){return t.productId===n.id})}function yn(n){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,m(d,n.id)];case 1:return[2,t.sent()]}})})}function gn(n){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,h(d,n.id)];case 1:return[2,t.sent()]}})})}export{yn as addIkasProductToFavorites,mn as clearIkasProductCustomerReviewForm,nn as getBundleProductFinalPrice,rn as getBundleProductFinalPriceWithQuantity,tn as getBundleProductFormattedFinalPrice,en as getBundleProductFormattedFinalPriceWithQuantity,an as getBundleProductFormattedSellPrice,cn as getBundleProductFormattedSellPriceWithQuantity,un as getBundleProductSellPrice,on as getBundleProductSellPriceWithQuantity,Y as getBundleProductsOfVariant,U as getDisplayedProductGroups,q as getDisplayedProductVariantTypes,F as getGroupedAttributeValues,pn as getIkasProductCustomerReviewForm,A as getMainProductVariantType,C as getMainProductVariantValue,z as getProductAvailableStockLocations,M as getProductCampaigns,fn as getProductCategoryPath,vn as getProductFirstCategory,G as getProductHref,N as getProductOptionSet,R as getSelectedProductVariant,k as getSelectedProductVariantHref,E as hasProductStock,L as hasProductValidOptionValues,O as hasProductVariant,X as initBundleProducts,x as initProductOnBrowser,W as initProductOptionSet,Q as isAddToCartEnabled,Z as isBundleProductQuantityEditable,_ as isCustomerReviewEnabled,B as isCustomerReviewLoginRequired,hn as isFavoriteIkasProduct,K as refreshProductsPrices,gn as removeIkasProductFromFavorites,D as selectVariantValue,dn as setBundleProductQuantity,ln as setOptionRealPrices,sn as setProductOfBundleProduct,$ as shouldDisplayBundleProductPrice,H as updateProductPrices};
@@ -538,6 +538,27 @@ export declare function getProductListNextPage(list: IkasProductList): Promise<v
538
538
  * ```
539
539
  */
540
540
  export declare function getProductListPage(list: IkasProductList, page: number): Promise<void>;
541
+ /**
542
+ * Re-fetches the latest variant prices of the products in the list and applies them in place.
543
+ * Useful when the page is served from cache but prices change frequently (e.g. gold prices),
544
+ * call it once the list is mounted on the browser.
545
+ *
546
+ * @ai-category ProductList, Pricing
547
+ * @ai-related updateProductPrices, getProductListPage
548
+ *
549
+ * @param list - The product list to refresh prices for
550
+ * @returns void
551
+ *
552
+ * @example
553
+ * ```typescript
554
+ * import { updateProductListPrices } from "@ikas/bp-storefront";
555
+ *
556
+ * useEffect(() => {
557
+ * updateProductListPrices(productList);
558
+ * }, [productList]);
559
+ * ```
560
+ */
561
+ export declare function updateProductListPrices(list: IkasProductList): Promise<void>;
541
562
  /**
542
563
  * Sets the sort type for the product list and re-fetches data with the new sort order applied.
543
564
  *
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as n}from"../../../packages/storefront-config/src/index.js";import i from'./../../../ext/lodash/cloneDeep.js';import{I18n as a}from"../../../i18n/index.js";import{Router as o,withRoutePrefix as s}from"../../../router/index.js";import{customerStore as u}from"../../../stores/customer/index.js";import{isClient as d,isBackNavigation as l,getQueryParams as c,debounce as f,stringToSlug as v,stringifyQueryParams as p}from"../../../utils/helper.js";import{setSavedLastViewedProductsResponse as g,getLastViewedProducts as E,waitForCustomerStoreInit as I}from"../../stores/customer/index.js";import{getIkasFilterCategorySlug as C,getIkasFilterCategoryHref as S}from"../filter-category/index.js";import{getFilterValueList as A,clearFilter as y,selectFilterValue as T,onNumberRangeFilterOptionClick as R,getFilterKeyList as D,applyQueryParamForFilter as h,initIkasProductFilter as _,isCustomValueFilter as m}from"../product/filter/index.js";import{getProductVariantPrice as b,hasProductVariantStock as N}from"../product/variant/index.js";var L;function O(t){var r=e({data:[],limit:10,page:1,count:0,isInitialized:!1,isLoading:!1,type:"ALL",sort:"DEFAULT",searchKeyword:"",pageType:"CATEGORY",category:null,brand:null,productListPropValue:{id:"",productIds:[],initialLimit:10,productListType:"ALL"}},t);return function(e){var t;if((null===(t=e.pageSpecificData)||void 0===t?void 0:t.orderType)&&["ALL"].includes(e.type))switch(e.pageSpecificData.orderType){case"BEST_SELLER":e.sort="SALE_COUNT";break;case"HIGHEST_DISCOUNT_RATIO":e.sort="DECRASING_DISCOUNT";break;case"LOWEST_DISCOUNT_RATIO":e.sort="INCREASING_DISCOUNT";break;case"HIGHEST_PRICE":e.sort="DECREASING_PRICE";break;case"LOWEST_PRICE":e.sort="INCREASING_PRICE";break;case"NEWEST":e.sort="LAST_ADDED";break;case"OLDEST":e.sort="FIRST_ADDED";break;case"MANUALLY":e.sort="FEATURED"}}(r),z(r),J(r),r}function P(e){var t;if(d()&&(!l()||!o.isFromBFCache)){!function(e){var t=c(),r=null==t?void 0:t.get("page");if(r){var n=parseInt(r);isNaN(n)||(e.page=n,e.infiniteScrollPage=n)}}(e);if(["CATEGORY","BRAND","SEARCH"].includes(e.pageType)&&location.search&&U(e)&&((null===(t=e.productListPropValue)||void 0===t?void 0:t.usePageFilter)||"SEARCH"===e.type))le(e,c(),e.page>1);else e.page>1?le(e,void 0,!0):k(e)?le(e):Re(e)}}function G(e,t){t!==e.searchKeyword&&(e.searchKeyword=t,_e(e),me(e))}function U(e){return"ALL"===e.type||"CATEGORY"===e.type}function V(e){var t,r;return(null===(t=e.filters)||void 0===t?void 0:t.some(function(e){return!!A(e).length}))||!!e.searchKeyword||"CATEGORY"!==e.pageType&&(!!e.filterCategoryId||!!(null===(r=e.filterCategories)||void 0===r?void 0:r.some(function(e){return e.isSelected})))}function w(e){return"STATIC"===e.type}function F(e){return"DISCOUNTED"===e.type}function j(e){return"RECOMMENDED"===e.type}function k(e){return"LAST_VIEWED"===e.type}function x(e){return"RELATED_PRODUCTS"===e.type}function H(e){return"VIEWED_TOGETHER"===e.type}function W(e){return"PURCHASED_TOGETHER"===e.type}function B(e){return"SEARCH"===e.type}function K(e){return!(w(e)||F(e)||j(e)||!e.minPage)&&e.minPage>1}function Y(e){return!(w(e)||F(e)||j(e))&&e.page*e.limit<e.count}function Z(e){var t;return(null===(t=e.filterCategories)||void 0===t?void 0:t.filter(function(e){return 0!==e.resultCount}))||[]}function M(e){var t;return!!e.searchKeyword||!!(null===(t=e.filters)||void 0===t?void 0:t.some(function(e){return!!A(e).length}))}function q(e){var t;return"MANUALLY"===(null===(t=e.pageSpecificData)||void 0===t?void 0:t.orderType)&&["ALL","CATEGORY"].includes(e.type)}function z(e){var t=V(e);e.data.forEach(function(e){return e.isFiltered=t||!1})}function J(e){var t=w(e);e.data.forEach(function(e){return e.isFiltered=t||!1})}function X(e){e._enableSuggestions=!0}function Q(e){var t={};return e.categoryId&&(t.categoryId=e.categoryId),e.brandId&&(t.brandId=e.brandId),Object.keys(t).length?s("/search?suggestion=".concat(encodeURIComponent(JSON.stringify(t)))):s("/search")}function $(i,a,o,s){return t(this,void 0,void 0,function(){var t,u,d,l,f,v,p,g,E,I,C,S,y,T,R,D;return r(this,function(r){switch(r.label){case 0:return t=[],u=[],null===(S=i.filters)||void 0===S||S.forEach(function(e){var r=A(e);r.length&&t.push({id:e.id,type:e.type,displayType:e.displayType,valueList:r}),e.isFacetFilter&&u.push({id:e.id,type:e.type,displayType:e.displayType})}),d=c(),(l=null==d?void 0:d.get("suggestion"))&&(f=JSON.parse(decodeURIComponent(l)),(v=f.brandId)&&((p=null===(y=i.filters)||void 0===y?void 0:y.find(function(e){return"brand"===e.id&&"BRAND"===e.type}))&&(g=null===(T=p.values)||void 0===T?void 0:T.find(function(e){return e.id===v}))&&h(p,g.name),t.push({id:"brand",type:"BRAND",displayType:"BOX",valueList:[v]})),f.categoryId&&(i.filterCategoryId=f.categoryId),i.searchKeyword=f.term),E=null===(R=i.filterCategories)||void 0===R?void 0:R.filter(function(e){return e.isSelected}).map(function(e){return e.id}),I=function(e){var t,r;switch(e.sort){case"INCREASING_PRICE":t="ASC",r="PRICE";break;case"DECREASING_PRICE":t="DESC",r="PRICE";break;case"FIRST_ADDED":t="ASC",r="CREATED_AT";break;case"LAST_ADDED":t="DESC",r="CREATED_AT";break;case"INCREASING_DISCOUNT":t="ASC",r="DISCOUNT_RATIO";break;case"DECRASING_DISCOUNT":t="DESC",r="DISCOUNT_RATIO";break;case"FEATURED":if(B(e))return;t="ASC",r="MANUAL_SORT";break;case"DEFAULT":t=void 0,r=void 0;break;case"AVERAGE_RATING":t="DESC",r="AVERAGE_RATING";break;case"REVIEW_COUNT":t="DESC",r="REVIEW_COUNT";break;case"SALE_COUNT":t="DESC",r="SALE_COUNT";break;case"A_Z":t="ASC",r="NAME";break;case"Z_A":t="DESC",r="NAME"}if(t&&r)return{direction:t,type:r}}(i),j(i)&&i.recommendedProductData?[4,import("../../api/product/index.js")]:[3,3];case 1:return[4,(0,r.sent().apiGetSuggestedProducts)({priceListId:n.priceListId,salesChannelId:n.salesChannelId,brandIds:i.recommendedProductData.brandIds,categoryIds:i.recommendedProductData.categoryIds,locale:n.getCurrentLocale()})];case 2:case 5:case 8:case 11:case 14:return[2,r.sent()];case 3:return x(i)&&i.relatedProductData?[4,import("../../api/product/index.js")]:[3,6];case 4:return[4,(0,r.sent().apiGetSuggestedProducts)({priceListId:n.priceListId,salesChannelId:n.salesChannelId,productId:i.relatedProductData.productId,brandIds:i.relatedProductData.brandIds,categoryIds:i.relatedProductData.categoryIds,locale:n.getCurrentLocale()})];case 6:return H(i)&&i.viewedTogetherProductData?[4,import("../../api/product/index.js")]:[3,9];case 7:return[4,(0,r.sent().apiGetSuggestedProducts)({priceListId:n.priceListId,salesChannelId:n.salesChannelId,method:"VIEWED_TOGETHER",productIds:i.viewedTogetherProductData.productIds,locale:n.getCurrentLocale()})];case 9:return W(i)&&i.purchasedTogetherProductData?[4,import("../../api/product/index.js")]:[3,12];case 10:return[4,(0,r.sent().apiGetSuggestedProducts)({priceListId:n.priceListId,salesChannelId:n.salesChannelId,method:"PURCHASED_TOGETHER",productIds:i.purchasedTogetherProductData.productIds,locale:n.getCurrentLocale()})];case 12:return C={input:e(e(e(e({page:a,perPage:o},i._enableSuggestions?{enableSuggestions:i._enableSuggestions}:{}),{productIdList:w(i)?null===(D=i.productListPropValue.productIds)||void 0===D?void 0:D.map(function(e){return e.productId}):s,filterList:t,facetList:u}),i.baseCategoryIdList?{baseCategoryIdList:i.baseCategoryIdList}:{}),{brandId:"BRAND"===i.pageType&&"SEARCH"!==i.type?i.filterBrandId:void 0,categoryIdList:E&&E.length?E:i.filterCategoryId?[i.filterCategoryId]:void 0,priceListId:n.priceListId,salesChannelId:n.salesChannelId,query:i.searchKeyword,order:I?[I]:[],showStockOption:n.stockPreference||"SHOW_ALL"})},[4,import("../../api/product/index.js")];case 13:return[4,(0,r.sent().apiSearchProducts)(C,i.excludedFields||[])]}})})}function ee(e){return t(this,void 0,void 0,function(){var t,i,a,o,s,u;return r(this,function(r){switch(r.label){case 0:return[4,import("../../api/product/index.js")];case 1:return[4,(0,r.sent().apiGetProductFilterData)({categoryId:e.filterCategoryId?e.filterCategoryId:void 0,locale:n.getCurrentLocale()})];case 2:return t=r.sent(),e.filters=null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.filters.map(function(e){return _(e)}),e.filterCategories=null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.categories,ye(e),e.disabledSortTypes=null===(s=t.data)||void 0===s?void 0:s.disabledSortTypes,"CATEGORY"!==e.pageType&&e.filterCategoryId&&(i=null===(u=e.filterCategories)||void 0===u?void 0:u.find(function(t){return t.id===e.filterCategoryId}))&&(i.isSelected=!0),e.filters&&e.filters.sort(function(e,t){return e.order>t.order?1:-1}),[2]}})})}function te(e){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,le(e)];case 1:return t=r.sent(),["CATEGORY","BRAND","SEARCH"].includes(e.pageType)?(t&&ne(e),[2]):[2]}})})}function re(e){var t,r,n,i={};if(null===(t=e.filters)||void 0===t||t.forEach(function(e){var t=D(e);t.length&&(i[v(e.name)]=t)}),e.searchKeyword&&(i.s=e.searchKeyword),e.sort&&(i.o=be[e.sort]),e.baseCategoryIdList&&(i.bc=e.baseCategoryIdList),e.suggestionCategoryId&&(i.suggestionCategoryId=e.suggestionCategoryId),e.infiniteScrollPage?i.page=e.infiniteScrollPage:i.page=e.page,"CATEGORY"!==e.pageType){var a=null===(r=e.filterCategories)||void 0===r?void 0:r.filter(function(e){return e.isSelected});if(!!(null==a?void 0:a.length))i.c=null==a?void 0:a.map(function(e){return C(e)});else if(e.filterCategoryId){var o=null===(n=e.filterCategories)||void 0===n?void 0:n.find(function(t){return t.id===e.filterCategoryId}),s=o?C(o):void 0;s&&(i.c=s)}}return p(i,{arrayFormat:"comma"})}function ne(e){if(d()&&!B(e)&&!n.isEditor){var t=re(e),r=s("".concat(location.pathname).concat(t?"?"+t:""));o.navigate(r,!0)}}function ie(e){var t,r;null===(t=e.filters)||void 0===t||t.forEach(function(e){return y(e)}),e.searchKeyword="","CATEGORY"!==e.pageType&&(e.filterCategoryId=void 0),null===(r=e.filterCategories)||void 0===r||r.forEach(function(e){return e.isSelected=!1}),te(e)}function ae(e,t){y(t),te(e)}function oe(e,t,r){T(t,r),te(e)}function se(e,t,r){R(t,r),te(e)}function ue(e){var t,r=null===(t=e.filters)||void 0===t?void 0:t.filter(function(e){var t;return null===(t=e.values)||void 0===t?void 0:t.some(function(e){return e.isSelected})});return null==r?void 0:r.map(function(e){var t,r;return e.numberRange?{filter:e,values:[e.numberRange.from+"-"+e.numberRange.to],commaSeperatedValues:e.numberRange.from+"-"+e.numberRange.to}:e.numberRangeListOptions?{filter:e,values:e.numberRangeListOptions.filter(function(e){return e.isSelected}).map(function(e){return e.from+"-"+e.to}),commaSeperatedValues:e.numberRangeListOptions.filter(function(e){return e.isSelected}).map(function(e){return e.from+"-"+e.to}).join(",")}:{filter:e,values:(null===(t=e.values)||void 0===t?void 0:t.filter(function(e){return e.isSelected}).map(function(e){return e.name}))||[],commaSeperatedValues:(null===(r=e.values)||void 0===r?void 0:r.filter(function(e){return e.isSelected}).map(function(e){return e.name}).join(","))||""}})}function de(e){return e.variants[0]}function le(e,n,a){return t(this,void 0,void 0,function(){var t,o,s,l,c,f,v,p,S,A,y,T,R,D,_,b,L;return r(this,function(r){switch(r.label){case 0:e.isLoading=!0,t=Date.now(),e.fetchRequestTime=t,r.label=1;case 1:return r.trys.push([1,14,15,16]),o=a?e.page:1,s=e.limit,!U(e)||e.filters?[3,3]:[4,ee(e)];case 2:r.sent(),r.label=3;case 3:return function(e,t){var r;try{null==t||t.forEach(function(t,r){var n,i=null===(n=e.filters)||void 0===n?void 0:n.find(function(e){return e.key===r});i&&h(i,t)});var n=null==t?void 0:t.get("s");n&&(e.searchKeyword=n);var i=null==t?void 0:t.get("o");if(i){var a=parseInt(i),o=Object.entries(be).find(function(e){return e[1]===a});o&&(e.sort=o[0])}if("CATEGORY"!==e.pageType){var s=null==t?void 0:t.get("c"),u=null==s?void 0:s.split(",");u&&u.length&&(null===(r=e.filterCategories)||void 0===r||r.forEach(function(e){e.isSelected=u.some(function(t){return t===C(e)})}))}if("SEARCH"===e.pageType){var d=null==t?void 0:t.get("bc"),l=null==d?void 0:d.split(",");l&&(e.baseCategoryIdList=l);var c=null==t?void 0:t.get("suggestion");if(c){var f=JSON.parse(decodeURIComponent(c)).categoryId;f&&(e.suggestionCategoryId=f)}var v=null==t?void 0:t.get("suggestionCategoryId");v&&(e.suggestionCategoryId=v,e.filterCategoryId=v)}}catch(e){console.log(e)}}(e,n),[4,fe(e)];case 4:return r.sent(),B(e)&&!M(e)?(e.data=[],e.page=1,e.minPage=1,e.count=0,e.isInitialized=!0,[2,!0]):(l=void 0,c=!1,w(e)?(o=void 0,s=200,[3,10]):[3,5]);case 5:return F(e)||j(e)?(o=1,s=10,[3,10]):[3,6];case 6:return k(e)?d()?[4,I(u)]:[3,9]:[3,10];case 7:return r.sent(),[4,E(u)];case 8:return(f=r.sent())&&f.length?(l=f.map(function(e){return e.productId}),c=u.useLastViewedProductResponse,[3,10]):[2];case 9:return[2];case 10:return c?(p=u._savedLastViewedProductsResponse,[3,13]):[3,11];case 11:return[4,$(e,o||1,s||10,l)];case 12:p=r.sent(),r.label=13;case 13:return(v=p)&&e.fetchRequestTime===t?(S=[],!c&&k(e)&&g(u,v),w(e)||k(e)?(A=w(e),y=A?e.productListPropValue.productIds:u._lastViewedProducts,S=(null==y?void 0:y.map(function(e){var t,r,n=null===(r=null===(t=v.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.find(function(t){return t.id===e.productId}),i=null==n?void 0:n.variants.find(function(t){return t.id===e.variantId});if((null==i?void 0:i.isActive)&&N(i)||(i=null==n?void 0:n.variants.find(function(e){return e.isActive&&N(e)}),A&&!i&&(i=(null==n?void 0:n.variants.find(function(e){return e.isActive}))||(null==n?void 0:n.variants[0]))),n&&i)return n.selectedVariantValues=i.variantValues,n}).filter(function(e){return!!e}))||[]):S=(null===(D=null===(R=v.data)||void 0===R?void 0:R.data)||void 0===D?void 0:D.map(function(e){var t=de(e);return e.selectedVariantValues=t.variantValues,e}))||[],null===(_=e.filters)||void 0===_||_.forEach(function(e){var t,r;if(void 0===e.isCollapsed){var n=!1;(!1===(null===(t=e.settings)||void 0===t?void 0:t.showCollapsedOnMobile)&&d()&&window.innerWidth<768||!1===(null===(r=e.settings)||void 0===r?void 0:r.showCollapsedOnDesktop))&&(n=!0),e.isCollapsed=!n}}),function(e,t){var r,n,a=i(e);null===(r=a.filters)||void 0===r||r.forEach(function(e){var r,n,i,a=null==t?void 0:t.find(function(t){return t.id===e.id});a?null===(r=e.values)||void 0===r||r.forEach(function(t){var r=a.values.find(function(e){return e.id===t.id});r?t.resultCount=r.count:m(e)?t.resultCount=null:t.resultCount=0}):m(e)?null===(n=e.values)||void 0===n||n.forEach(function(e){return e.resultCount=null}):null===(i=e.values)||void 0===i||i.forEach(function(e){return e.resultCount=0})});var o=null==t?void 0:t.find(function(e){return"category"===e.id});o&&(null===(n=a.filterCategories)||void 0===n||n.forEach(function(e){var t=o.values.find(function(t){return t.id===e.id});e.resultCount=t?t.count:0})),e.filters=a.filters,e.filterCategories=a.filterCategories,ye(e)}(e,null===(b=v.data)||void 0===b?void 0:b.facets),e.data=S,e.count=(null===(L=v.data)||void 0===L?void 0:L.count)||0,e.isInitialized=!0,e.page=o||1,e.minPage=e.page,v.data&&"suggestions"in v.data&&(e.suggestions=v.data.suggestions),z(e),J(e),a||(e.infiniteScrollPage=null),Re(e),[2,!0]):[2];case 14:return T=r.sent(),console.log(T),[3,16];case 15:return t===e.fetchRequestTime&&(e.isLoading=!1),[7];case 16:return[2]}})})}function ce(e){e.isCollapsed=!e.isCollapsed}function fe(e){return t(this,void 0,void 0,function(){var t,n,i,a,o,s,u,d,l,c;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,13,,14]),e.productListPropValue.category?[4,import("../../api/category/index.js")]:[3,3];case 1:return[4,(0,r.sent().apiListCategory)({id:{eq:e.productListPropValue.category}})];case 2:return t=r.sent(),e.category=(null===(o=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===o?void 0:o[0])||null,[3,7];case 3:return e.productListPropValue.usePageFilter&&"CATEGORY"===e.pageType&&e.pageSpecificData?(e.category=e.pageSpecificData,[3,7]):[3,4];case 4:return e.filterCategoryId?[4,import("../../api/category/index.js")]:[3,7];case 5:return[4,(0,r.sent().apiListCategory)({id:{eq:e.filterCategoryId}})];case 6:t=r.sent(),e.category=(null===(u=null===(s=t.data)||void 0===s?void 0:s.data)||void 0===u?void 0:u[0])||null,r.label=7;case 7:return e.productListPropValue.usePageFilter&&"BRAND"===e.pageType&&e.pageSpecificData?(e.brand=e.pageSpecificData,[3,12]):[3,8];case 8:return e.filterBrandId?e.filterBrandId!==(null===(d=e.pageSpecificData)||void 0===d?void 0:d.id)?[3,9]:(e.brand=e.pageSpecificData,[3,12]):[3,12];case 9:return[4,import("../../api/brand/index.js")];case 10:return[4,(0,r.sent().apiListProductBrand)({id:{eq:e.filterBrandId}})];case 11:n=r.sent(),e.brand=(null===(c=null===(l=n.data)||void 0===l?void 0:l.data)||void 0===c?void 0:c[0])||null,r.label=12;case 12:return[3,14];case 13:return i=r.sent(),console.error(i),[3,14];case 14:return[2]}})})}function ve(e){return t(this,void 0,void 0,function(){var t,n,i,a,o,s,u;return r(this,function(r){switch(r.label){case 0:if(w(e)||F(e)||j(e)||x(e)||H(e)||W(e)||k(e)||e.isLoading||!K(e))return[2];e.isLoading=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),t=e.minPage-1,[4,$(e,t,e.limit)];case 2:return(n=r.sent())?(i=null===(s=null===(o=n.data)||void 0===o?void 0:o.data)||void 0===s?void 0:s.map(function(e){var t=de(e);return e.selectedVariantValues=t.variantValues,e}),e.data=(null==i?void 0:i.concat(e.data))||e.data,e.count=(null===(u=n.data)||void 0===u?void 0:u.count)||e.count,e.minPage=t,z(e),J(e),ne(e),[3,5]):[2];case 3:return a=r.sent(),console.log(a),[3,5];case 4:return e.isLoading=!1,[7];case 5:return[2]}})})}function pe(e){return t(this,void 0,void 0,function(){var t,n,i,a,o,s;return r(this,function(r){switch(r.label){case 0:if(w(e)||F(e)||j(e)||x(e)||H(e)||W(e)||k(e)||e.isLoading||!Y(e))return[2];e.isLoading=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,$(e,e.page+1,e.limit)];case 2:return(t=r.sent())?(n=null===(o=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===o?void 0:o.map(function(e){var t=de(e);return e.selectedVariantValues=t.variantValues,e}),e.data=e.data.concat(n||[]),e.count=(null===(s=t.data)||void 0===s?void 0:s.count)||e.count,e.page=e.page+1,z(e),J(e),ne(e),[3,5]):[2];case 3:return i=r.sent(),console.log(i),[3,5];case 4:return e.isLoading=!1,[7];case 5:return[2]}})})}function ge(e,n){return t(this,void 0,void 0,function(){var t,i,a,o,s,u;return r(this,function(r){switch(r.label){case 0:if(e.isLoading||w(e)||F(e)||j(e)||k(e)||x(e)||H(e)||W(e))return[2];e.isLoading=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,$(e,n,e.limit)];case 2:return(t=r.sent())?(i=null===(s=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===s?void 0:s.map(function(e){var t=de(e);return e.selectedVariantValues=t.variantValues,e}),e.data=i||[],e.count=(null===(u=t.data)||void 0===u?void 0:u.count)||0,e.page=n,e.minPage=n,z(e),J(e),ne(e),[3,5]):[2];case 3:return a=r.sent(),console.log(a),[3,5];case 4:return e.isLoading=!1,[7];case 5:return[2]}})})}function Ee(e,n){return t(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return e.sort=n,[4,le(e)];case 1:return t.sent()&&ne(e),[2]}})})}function Ie(e){return Ce(e,e.sort)}function Ce(e,t){switch(t){case"INCREASING_PRICE":return a.translate("sort_type.increasing_price");case"DECREASING_PRICE":return a.translate("sort_type.decreasing_price");case"LAST_ADDED":return a.translate("sort_type.last_added");case"FIRST_ADDED":return a.translate("sort_type.first_added");case"INCREASING_DISCOUNT":return a.translate("sort_type.increasing_discount");case"DECRASING_DISCOUNT":return a.translate("sort_type.decreasing_discount");case"FEATURED":return a.translate("sort_type.featured");case"DEFAULT":return a.translate("sort_type.default");case"AVERAGE_RATING":return a.translate("sort_type.average_rating");case"REVIEW_COUNT":return a.translate("sort_type.review_count");case"SALE_COUNT":return a.translate("sort_type.sale_count");case"A_Z":return a.translate("sort_type.a_z");case"Z_A":return a.translate("sort_type.z_a")}}function Se(e){var t,r,n,i,a,o,s,u;if(!e)return[];var d=[];return(null===(t=e.disabledSortTypes)||void 0===t?void 0:t.includes("NAME"))||(d.push({label:Ce(0,"A_Z"),value:"A_Z",isSelected:"A_Z"===e.sort}),d.push({label:Ce(0,"Z_A"),value:"Z_A",isSelected:"Z_A"===e.sort})),(null===(r=e.disabledSortTypes)||void 0===r?void 0:r.includes("PRICE"))||(d.push({label:Ce(0,"INCREASING_PRICE"),value:"INCREASING_PRICE",isSelected:"INCREASING_PRICE"===e.sort}),d.push({label:Ce(0,"DECREASING_PRICE"),value:"DECREASING_PRICE",isSelected:"DECREASING_PRICE"===e.sort})),(null===(n=e.disabledSortTypes)||void 0===n?void 0:n.includes("CREATED_AT"))||(d.push({label:Ce(0,"LAST_ADDED"),value:"LAST_ADDED",isSelected:"LAST_ADDED"===e.sort}),d.push({label:Ce(0,"FIRST_ADDED"),value:"FIRST_ADDED",isSelected:"FIRST_ADDED"===e.sort})),(null===(i=e.disabledSortTypes)||void 0===i?void 0:i.includes("DISCOUNT_RATIO"))||(d.push({label:Ce(0,"INCREASING_DISCOUNT"),value:"INCREASING_DISCOUNT",isSelected:"INCREASING_DISCOUNT"===e.sort}),d.push({label:Ce(0,"DECRASING_DISCOUNT"),value:"DECRASING_DISCOUNT",isSelected:"DECRASING_DISCOUNT"===e.sort})),(null===(a=e.disabledSortTypes)||void 0===a?void 0:a.includes("MANUAL_SORT"))||d.push({label:Ce(0,"FEATURED"),value:"FEATURED",isSelected:"FEATURED"===e.sort}),(null===(o=e.disabledSortTypes)||void 0===o?void 0:o.includes("AVERAGE_RATING"))||d.push({label:Ce(0,"AVERAGE_RATING"),value:"AVERAGE_RATING",isSelected:"AVERAGE_RATING"===e.sort}),(null===(s=e.disabledSortTypes)||void 0===s?void 0:s.includes("REVIEW_COUNT"))||d.push({label:Ce(0,"REVIEW_COUNT"),value:"REVIEW_COUNT",isSelected:"REVIEW_COUNT"===e.sort}),(null===(u=e.disabledSortTypes)||void 0===u?void 0:u.includes("SALE_COUNT"))||d.push({label:Ce(0,"SALE_COUNT"),value:"SALE_COUNT",isSelected:"SALE_COUNT"===e.sort}),d}function Ae(e,i,a){return t(this,void 0,void 0,function(){var t,s,u;return r(this,function(r){switch(r.label){case 0:return a?(null===(u=e.filterCategories)||void 0===u||u.forEach(function(e){e.id===i.id&&(e.isSelected=!e.isSelected)}),[4,te(e)]):[3,2];case 1:return r.sent(),[3,3];case 2:n.isEditor||(t=re(e),s=S(i)+(t?"?"+t:""),o.navigate(s)),r.label=3;case 3:return[2]}})})}function ye(e){var t;null===(t=e.filterCategories)||void 0===t||t.forEach(function(e){e.image=e.imageId?{id:e.imageId,isVideo:!1}:null})}function Te(e,t){if(e.infiniteScrollPage!==t){e.infiniteScrollPage=t;var r=re(e);o.navigate("".concat(location.pathname).concat(r?"?"+r:""),!0)}}function Re(e){return t(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return e.searchKeyword&&e.data.length?[4,import("../../../analytics/analytics-functions/viewSearchResults.js")]:[3,2];case 1:return(0,t.sent().anl_viewSearchResults)(e.searchKeyword,e.data),[3,4];case 2:return e.data.length&&"ALL"===e.type?[4,import("../../../analytics/analytics-functions/viewListing.js")]:[3,4];case 3:(0,t.sent().anl_viewListing)(e.data),t.label=4;case 4:return[2]}})})}function De(e){var t=e.data[0];if(!t)return n.getDefaultCurrencyCode()||"";var r=de(t),i=b(r);return(null==i?void 0:i.currency)||n.getDefaultCurrencyCode()||""}function he(e){var t=e.data[0];if(!t)return n.getDefaultCurrencySymbol()||"";var r=de(t),i=b(r);return(null==i?void 0:i.currencySymbol)||n.getDefaultCurrencySymbol()||""}var _e=f(function(e){te(e)},500),me=f(function(e){return t(void 0,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,import("../../../analytics/analytics-functions/search.js")];case 1:return(0,t.sent().anl_search)(e.searchKeyword),[2]}})})},1e3),be=((L={}).INCREASING_PRICE=1,L.DECREASING_PRICE=2,L.LAST_ADDED=3,L.FIRST_ADDED=4,L.INCREASING_DISCOUNT=5,L.DECRASING_DISCOUNT=6,L.FEATURED=7,L.DEFAULT=8,L.AVERAGE_RATING=9,L.REVIEW_COUNT=10,L.SALE_COUNT=11,L.A_Z=12,L.Z_A=13,L);export{ae as clearProductListFilter,ie as clearProductListFilters,X as enableProductListSuggestions,De as getProductListCurrencyCode,he as getProductListCurrencySymbol,Z as getProductListFilterCategories,le as getProductListInitialData,pe as getProductListNextPage,ge as getProductListPage,ve as getProductListPrevPage,Se as getProductListSortOptions,Ie as getProductListSortTypeTranslation,Q as getProductListSuggestionHref,ue as getSelectedFilterValues,oe as handleFilterValueClick,se as handleNumberRangeOptionClick,M as hasProductListAppliedFilters,q as hasProductListFeaturedSortEnabled,Y as hasProductListNextPage,K as hasProductListPrevPage,O as initProductList,ye as initProductListFilterCategories,P as initProductListOnBrowser,F as isProductListDiscounted,U as isProductListFilterable,V as isProductListFiltered,k as isProductListLastViewed,W as isProductListPurchasedTogether,j as isProductListRecommended,x as isProductListRelatedProducts,B as isProductListSearch,w as isProductListStatic,H as isProductListViewedTogether,Ae as onFilterCategoryClick,ce as productListToggleFilterCollapsed,G as searchProductList,z as setProductListIsFilteredForProducts,J as setProductListIsStaticForProducts,Te as setProductListVisiblePage,Ee as setSortType,Ce as translateProductListSortType};
1
+ import{__assign as e,__awaiter as t,__generator as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as n}from"../../../packages/storefront-config/src/index.js";import i from'./../../../ext/lodash/cloneDeep.js';import{I18n as a}from"../../../i18n/index.js";import{Router as o,withRoutePrefix as s}from"../../../router/index.js";import{customerStore as u}from"../../../stores/customer/index.js";import{isClient as d,isBackNavigation as l,getQueryParams as c,debounce as f,stringToSlug as v,stringifyQueryParams as p}from"../../../utils/helper.js";import{setSavedLastViewedProductsResponse as g,getLastViewedProducts as E,waitForCustomerStoreInit as I}from"../../stores/customer/index.js";import{getIkasFilterCategorySlug as C,getIkasFilterCategoryHref as S}from"../filter-category/index.js";import{refreshProductsPrices as A}from"../product/index.js";import{getFilterValueList as y,clearFilter as T,selectFilterValue as R,onNumberRangeFilterOptionClick as h,getFilterKeyList as D,applyQueryParamForFilter as _,initIkasProductFilter as m,isCustomValueFilter as b}from"../product/filter/index.js";import{getProductVariantPrice as N,hasProductVariantStock as L}from"../product/variant/index.js";var O;function P(t){var r=e({data:[],limit:10,page:1,count:0,isInitialized:!1,isLoading:!1,type:"ALL",sort:"DEFAULT",searchKeyword:"",pageType:"CATEGORY",category:null,brand:null,productListPropValue:{id:"",productIds:[],initialLimit:10,productListType:"ALL"}},t);return function(e){var t;if((null===(t=e.pageSpecificData)||void 0===t?void 0:t.orderType)&&["ALL"].includes(e.type))switch(e.pageSpecificData.orderType){case"BEST_SELLER":e.sort="SALE_COUNT";break;case"HIGHEST_DISCOUNT_RATIO":e.sort="DECRASING_DISCOUNT";break;case"LOWEST_DISCOUNT_RATIO":e.sort="INCREASING_DISCOUNT";break;case"HIGHEST_PRICE":e.sort="DECREASING_PRICE";break;case"LOWEST_PRICE":e.sort="INCREASING_PRICE";break;case"NEWEST":e.sort="LAST_ADDED";break;case"OLDEST":e.sort="FIRST_ADDED";break;case"MANUALLY":e.sort="FEATURED"}}(r),J(r),X(r),r}function G(e){var t;if(d()&&(!l()||!o.isFromBFCache)){!function(e){var t=c(),r=null==t?void 0:t.get("page");if(r){var n=parseInt(r);isNaN(n)||(e.page=n,e.infiniteScrollPage=n)}}(e);if(["CATEGORY","BRAND","SEARCH"].includes(e.pageType)&&location.search&&V(e)&&((null===(t=e.productListPropValue)||void 0===t?void 0:t.usePageFilter)||"SEARCH"===e.type))ce(e,c(),e.page>1);else e.page>1?ce(e,void 0,!0):x(e)?ce(e):De(e)}}function U(e,t){t!==e.searchKeyword&&(e.searchKeyword=t,be(e),Ne(e))}function V(e){return"ALL"===e.type||"CATEGORY"===e.type}function w(e){var t,r;return(null===(t=e.filters)||void 0===t?void 0:t.some(function(e){return!!y(e).length}))||!!e.searchKeyword||"CATEGORY"!==e.pageType&&(!!e.filterCategoryId||!!(null===(r=e.filterCategories)||void 0===r?void 0:r.some(function(e){return e.isSelected})))}function F(e){return"STATIC"===e.type}function j(e){return"DISCOUNTED"===e.type}function k(e){return"RECOMMENDED"===e.type}function x(e){return"LAST_VIEWED"===e.type}function H(e){return"RELATED_PRODUCTS"===e.type}function W(e){return"VIEWED_TOGETHER"===e.type}function B(e){return"PURCHASED_TOGETHER"===e.type}function K(e){return"SEARCH"===e.type}function Y(e){return!(F(e)||j(e)||k(e)||!e.minPage)&&e.minPage>1}function Z(e){return!(F(e)||j(e)||k(e))&&e.page*e.limit<e.count}function M(e){var t;return(null===(t=e.filterCategories)||void 0===t?void 0:t.filter(function(e){return 0!==e.resultCount}))||[]}function q(e){var t;return!!e.searchKeyword||!!(null===(t=e.filters)||void 0===t?void 0:t.some(function(e){return!!y(e).length}))}function z(e){var t;return"MANUALLY"===(null===(t=e.pageSpecificData)||void 0===t?void 0:t.orderType)&&["ALL","CATEGORY"].includes(e.type)}function J(e){var t=w(e);e.data.forEach(function(e){return e.isFiltered=t||!1})}function X(e){var t=F(e);e.data.forEach(function(e){return e.isFiltered=t||!1})}function Q(e){e._enableSuggestions=!0}function $(e){var t={};return e.categoryId&&(t.categoryId=e.categoryId),e.brandId&&(t.brandId=e.brandId),Object.keys(t).length?s("/search?suggestion=".concat(encodeURIComponent(JSON.stringify(t)))):s("/search")}function ee(i,a,o,s){return t(this,void 0,void 0,function(){var t,u,d,l,f,v,p,g,E,I,C,S,A,T,R,h;return r(this,function(r){switch(r.label){case 0:return t=[],u=[],null===(S=i.filters)||void 0===S||S.forEach(function(e){var r=y(e);r.length&&t.push({id:e.id,type:e.type,displayType:e.displayType,valueList:r}),e.isFacetFilter&&u.push({id:e.id,type:e.type,displayType:e.displayType})}),d=c(),(l=null==d?void 0:d.get("suggestion"))&&(f=JSON.parse(decodeURIComponent(l)),(v=f.brandId)&&((p=null===(A=i.filters)||void 0===A?void 0:A.find(function(e){return"brand"===e.id&&"BRAND"===e.type}))&&(g=null===(T=p.values)||void 0===T?void 0:T.find(function(e){return e.id===v}))&&_(p,g.name),t.push({id:"brand",type:"BRAND",displayType:"BOX",valueList:[v]})),f.categoryId&&(i.filterCategoryId=f.categoryId),i.searchKeyword=f.term),E=null===(R=i.filterCategories)||void 0===R?void 0:R.filter(function(e){return e.isSelected}).map(function(e){return e.id}),I=function(e){var t,r;switch(e.sort){case"INCREASING_PRICE":t="ASC",r="PRICE";break;case"DECREASING_PRICE":t="DESC",r="PRICE";break;case"FIRST_ADDED":t="ASC",r="CREATED_AT";break;case"LAST_ADDED":t="DESC",r="CREATED_AT";break;case"INCREASING_DISCOUNT":t="ASC",r="DISCOUNT_RATIO";break;case"DECRASING_DISCOUNT":t="DESC",r="DISCOUNT_RATIO";break;case"FEATURED":if(K(e))return;t="ASC",r="MANUAL_SORT";break;case"DEFAULT":t=void 0,r=void 0;break;case"AVERAGE_RATING":t="DESC",r="AVERAGE_RATING";break;case"REVIEW_COUNT":t="DESC",r="REVIEW_COUNT";break;case"SALE_COUNT":t="DESC",r="SALE_COUNT";break;case"A_Z":t="ASC",r="NAME";break;case"Z_A":t="DESC",r="NAME"}if(t&&r)return{direction:t,type:r}}(i),k(i)&&i.recommendedProductData?[4,import("../../api/product/index.js")]:[3,3];case 1:return[4,(0,r.sent().apiGetSuggestedProducts)({priceListId:n.priceListId,salesChannelId:n.salesChannelId,brandIds:i.recommendedProductData.brandIds,categoryIds:i.recommendedProductData.categoryIds,locale:n.getCurrentLocale()})];case 2:case 5:case 8:case 11:case 14:return[2,r.sent()];case 3:return H(i)&&i.relatedProductData?[4,import("../../api/product/index.js")]:[3,6];case 4:return[4,(0,r.sent().apiGetSuggestedProducts)({priceListId:n.priceListId,salesChannelId:n.salesChannelId,productId:i.relatedProductData.productId,brandIds:i.relatedProductData.brandIds,categoryIds:i.relatedProductData.categoryIds,locale:n.getCurrentLocale()})];case 6:return W(i)&&i.viewedTogetherProductData?[4,import("../../api/product/index.js")]:[3,9];case 7:return[4,(0,r.sent().apiGetSuggestedProducts)({priceListId:n.priceListId,salesChannelId:n.salesChannelId,method:"VIEWED_TOGETHER",productIds:i.viewedTogetherProductData.productIds,locale:n.getCurrentLocale()})];case 9:return B(i)&&i.purchasedTogetherProductData?[4,import("../../api/product/index.js")]:[3,12];case 10:return[4,(0,r.sent().apiGetSuggestedProducts)({priceListId:n.priceListId,salesChannelId:n.salesChannelId,method:"PURCHASED_TOGETHER",productIds:i.purchasedTogetherProductData.productIds,locale:n.getCurrentLocale()})];case 12:return C={input:e(e(e(e({page:a,perPage:o},i._enableSuggestions?{enableSuggestions:i._enableSuggestions}:{}),{productIdList:F(i)?null===(h=i.productListPropValue.productIds)||void 0===h?void 0:h.map(function(e){return e.productId}):s,filterList:t,facetList:u}),i.baseCategoryIdList?{baseCategoryIdList:i.baseCategoryIdList}:{}),{brandId:"BRAND"===i.pageType&&"SEARCH"!==i.type?i.filterBrandId:void 0,categoryIdList:E&&E.length?E:i.filterCategoryId?[i.filterCategoryId]:void 0,priceListId:n.priceListId,salesChannelId:n.salesChannelId,query:i.searchKeyword,order:I?[I]:[],showStockOption:n.stockPreference||"SHOW_ALL"})},[4,import("../../api/product/index.js")];case 13:return[4,(0,r.sent().apiSearchProducts)(C,i.excludedFields||[])]}})})}function te(e){return t(this,void 0,void 0,function(){var t,i,a,o,s,u;return r(this,function(r){switch(r.label){case 0:return[4,import("../../api/product/index.js")];case 1:return[4,(0,r.sent().apiGetProductFilterData)({categoryId:e.filterCategoryId?e.filterCategoryId:void 0,locale:n.getCurrentLocale()})];case 2:return t=r.sent(),e.filters=null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.filters.map(function(e){return m(e)}),e.filterCategories=null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.categories,Re(e),e.disabledSortTypes=null===(s=t.data)||void 0===s?void 0:s.disabledSortTypes,"CATEGORY"!==e.pageType&&e.filterCategoryId&&(i=null===(u=e.filterCategories)||void 0===u?void 0:u.find(function(t){return t.id===e.filterCategoryId}))&&(i.isSelected=!0),e.filters&&e.filters.sort(function(e,t){return e.order>t.order?1:-1}),[2]}})})}function re(e){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,ce(e)];case 1:return t=r.sent(),["CATEGORY","BRAND","SEARCH"].includes(e.pageType)?(t&&ie(e),[2]):[2]}})})}function ne(e){var t,r,n,i={};if(null===(t=e.filters)||void 0===t||t.forEach(function(e){var t=D(e);t.length&&(i[v(e.name)]=t)}),e.searchKeyword&&(i.s=e.searchKeyword),e.sort&&(i.o=Le[e.sort]),e.baseCategoryIdList&&(i.bc=e.baseCategoryIdList),e.suggestionCategoryId&&(i.suggestionCategoryId=e.suggestionCategoryId),e.infiniteScrollPage?i.page=e.infiniteScrollPage:i.page=e.page,"CATEGORY"!==e.pageType){var a=null===(r=e.filterCategories)||void 0===r?void 0:r.filter(function(e){return e.isSelected});if(!!(null==a?void 0:a.length))i.c=null==a?void 0:a.map(function(e){return C(e)});else if(e.filterCategoryId){var o=null===(n=e.filterCategories)||void 0===n?void 0:n.find(function(t){return t.id===e.filterCategoryId}),s=o?C(o):void 0;s&&(i.c=s)}}return p(i,{arrayFormat:"comma"})}function ie(e){if(d()&&!K(e)&&!n.isEditor){var t=ne(e),r=s("".concat(location.pathname).concat(t?"?"+t:""));o.navigate(r,!0)}}function ae(e){var t,r;null===(t=e.filters)||void 0===t||t.forEach(function(e){return T(e)}),e.searchKeyword="","CATEGORY"!==e.pageType&&(e.filterCategoryId=void 0),null===(r=e.filterCategories)||void 0===r||r.forEach(function(e){return e.isSelected=!1}),re(e)}function oe(e,t){T(t),re(e)}function se(e,t,r){R(t,r),re(e)}function ue(e,t,r){h(t,r),re(e)}function de(e){var t,r=null===(t=e.filters)||void 0===t?void 0:t.filter(function(e){var t;return null===(t=e.values)||void 0===t?void 0:t.some(function(e){return e.isSelected})});return null==r?void 0:r.map(function(e){var t,r;return e.numberRange?{filter:e,values:[e.numberRange.from+"-"+e.numberRange.to],commaSeperatedValues:e.numberRange.from+"-"+e.numberRange.to}:e.numberRangeListOptions?{filter:e,values:e.numberRangeListOptions.filter(function(e){return e.isSelected}).map(function(e){return e.from+"-"+e.to}),commaSeperatedValues:e.numberRangeListOptions.filter(function(e){return e.isSelected}).map(function(e){return e.from+"-"+e.to}).join(",")}:{filter:e,values:(null===(t=e.values)||void 0===t?void 0:t.filter(function(e){return e.isSelected}).map(function(e){return e.name}))||[],commaSeperatedValues:(null===(r=e.values)||void 0===r?void 0:r.filter(function(e){return e.isSelected}).map(function(e){return e.name}).join(","))||""}})}function le(e){return e.variants[0]}function ce(e,n,a){return t(this,void 0,void 0,function(){var t,o,s,l,c,f,v,p,S,A,y,T,R,h,D,m,N;return r(this,function(r){switch(r.label){case 0:e.isLoading=!0,t=Date.now(),e.fetchRequestTime=t,r.label=1;case 1:return r.trys.push([1,14,15,16]),o=a?e.page:1,s=e.limit,!V(e)||e.filters?[3,3]:[4,te(e)];case 2:r.sent(),r.label=3;case 3:return function(e,t){var r;try{null==t||t.forEach(function(t,r){var n,i=null===(n=e.filters)||void 0===n?void 0:n.find(function(e){return e.key===r});i&&_(i,t)});var n=null==t?void 0:t.get("s");n&&(e.searchKeyword=n);var i=null==t?void 0:t.get("o");if(i){var a=parseInt(i),o=Object.entries(Le).find(function(e){return e[1]===a});o&&(e.sort=o[0])}if("CATEGORY"!==e.pageType){var s=null==t?void 0:t.get("c"),u=null==s?void 0:s.split(",");u&&u.length&&(null===(r=e.filterCategories)||void 0===r||r.forEach(function(e){e.isSelected=u.some(function(t){return t===C(e)})}))}if("SEARCH"===e.pageType){var d=null==t?void 0:t.get("bc"),l=null==d?void 0:d.split(",");l&&(e.baseCategoryIdList=l);var c=null==t?void 0:t.get("suggestion");if(c){var f=JSON.parse(decodeURIComponent(c)).categoryId;f&&(e.suggestionCategoryId=f)}var v=null==t?void 0:t.get("suggestionCategoryId");v&&(e.suggestionCategoryId=v,e.filterCategoryId=v)}}catch(e){console.log(e)}}(e,n),[4,ve(e)];case 4:return r.sent(),K(e)&&!q(e)?(e.data=[],e.page=1,e.minPage=1,e.count=0,e.isInitialized=!0,[2,!0]):(l=void 0,c=!1,F(e)?(o=void 0,s=200,[3,10]):[3,5]);case 5:return j(e)||k(e)?(o=1,s=10,[3,10]):[3,6];case 6:return x(e)?d()?[4,I(u)]:[3,9]:[3,10];case 7:return r.sent(),[4,E(u)];case 8:return(f=r.sent())&&f.length?(l=f.map(function(e){return e.productId}),c=u.useLastViewedProductResponse,[3,10]):[2];case 9:return[2];case 10:return c?(p=u._savedLastViewedProductsResponse,[3,13]):[3,11];case 11:return[4,ee(e,o||1,s||10,l)];case 12:p=r.sent(),r.label=13;case 13:return(v=p)&&e.fetchRequestTime===t?(S=[],!c&&x(e)&&g(u,v),F(e)||x(e)?(A=F(e),y=A?e.productListPropValue.productIds:u._lastViewedProducts,S=(null==y?void 0:y.map(function(e){var t,r,n=null===(r=null===(t=v.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.find(function(t){return t.id===e.productId}),i=null==n?void 0:n.variants.find(function(t){return t.id===e.variantId});if((null==i?void 0:i.isActive)&&L(i)||(i=null==n?void 0:n.variants.find(function(e){return e.isActive&&L(e)}),A&&!i&&(i=(null==n?void 0:n.variants.find(function(e){return e.isActive}))||(null==n?void 0:n.variants[0]))),n&&i)return n.selectedVariantValues=i.variantValues,n}).filter(function(e){return!!e}))||[]):S=(null===(h=null===(R=v.data)||void 0===R?void 0:R.data)||void 0===h?void 0:h.map(function(e){var t=le(e);return e.selectedVariantValues=t.variantValues,e}))||[],null===(D=e.filters)||void 0===D||D.forEach(function(e){var t,r;if(void 0===e.isCollapsed){var n=!1;(!1===(null===(t=e.settings)||void 0===t?void 0:t.showCollapsedOnMobile)&&d()&&window.innerWidth<768||!1===(null===(r=e.settings)||void 0===r?void 0:r.showCollapsedOnDesktop))&&(n=!0),e.isCollapsed=!n}}),function(e,t){var r,n,a=i(e);null===(r=a.filters)||void 0===r||r.forEach(function(e){var r,n,i,a=null==t?void 0:t.find(function(t){return t.id===e.id});a?null===(r=e.values)||void 0===r||r.forEach(function(t){var r=a.values.find(function(e){return e.id===t.id});r?t.resultCount=r.count:b(e)?t.resultCount=null:t.resultCount=0}):b(e)?null===(n=e.values)||void 0===n||n.forEach(function(e){return e.resultCount=null}):null===(i=e.values)||void 0===i||i.forEach(function(e){return e.resultCount=0})});var o=null==t?void 0:t.find(function(e){return"category"===e.id});o&&(null===(n=a.filterCategories)||void 0===n||n.forEach(function(e){var t=o.values.find(function(t){return t.id===e.id});e.resultCount=t?t.count:0})),e.filters=a.filters,e.filterCategories=a.filterCategories,Re(e)}(e,null===(m=v.data)||void 0===m?void 0:m.facets),e.data=S,e.count=(null===(N=v.data)||void 0===N?void 0:N.count)||0,e.isInitialized=!0,e.page=o||1,e.minPage=e.page,v.data&&"suggestions"in v.data&&(e.suggestions=v.data.suggestions),J(e),X(e),a||(e.infiniteScrollPage=null),De(e),[2,!0]):[2];case 14:return T=r.sent(),console.log(T),[3,16];case 15:return t===e.fetchRequestTime&&(e.isLoading=!1),[7];case 16:return[2]}})})}function fe(e){e.isCollapsed=!e.isCollapsed}function ve(e){return t(this,void 0,void 0,function(){var t,n,i,a,o,s,u,d,l,c;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,13,,14]),e.productListPropValue.category?[4,import("../../api/category/index.js")]:[3,3];case 1:return[4,(0,r.sent().apiListCategory)({id:{eq:e.productListPropValue.category}})];case 2:return t=r.sent(),e.category=(null===(o=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===o?void 0:o[0])||null,[3,7];case 3:return e.productListPropValue.usePageFilter&&"CATEGORY"===e.pageType&&e.pageSpecificData?(e.category=e.pageSpecificData,[3,7]):[3,4];case 4:return e.filterCategoryId?[4,import("../../api/category/index.js")]:[3,7];case 5:return[4,(0,r.sent().apiListCategory)({id:{eq:e.filterCategoryId}})];case 6:t=r.sent(),e.category=(null===(u=null===(s=t.data)||void 0===s?void 0:s.data)||void 0===u?void 0:u[0])||null,r.label=7;case 7:return e.productListPropValue.usePageFilter&&"BRAND"===e.pageType&&e.pageSpecificData?(e.brand=e.pageSpecificData,[3,12]):[3,8];case 8:return e.filterBrandId?e.filterBrandId!==(null===(d=e.pageSpecificData)||void 0===d?void 0:d.id)?[3,9]:(e.brand=e.pageSpecificData,[3,12]):[3,12];case 9:return[4,import("../../api/brand/index.js")];case 10:return[4,(0,r.sent().apiListProductBrand)({id:{eq:e.filterBrandId}})];case 11:n=r.sent(),e.brand=(null===(c=null===(l=n.data)||void 0===l?void 0:l.data)||void 0===c?void 0:c[0])||null,r.label=12;case 12:return[3,14];case 13:return i=r.sent(),console.error(i),[3,14];case 14:return[2]}})})}function pe(e){return t(this,void 0,void 0,function(){var t,n,i,a,o,s,u;return r(this,function(r){switch(r.label){case 0:if(F(e)||j(e)||k(e)||H(e)||W(e)||B(e)||x(e)||e.isLoading||!Y(e))return[2];e.isLoading=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),t=e.minPage-1,[4,ee(e,t,e.limit)];case 2:return(n=r.sent())?(i=null===(s=null===(o=n.data)||void 0===o?void 0:o.data)||void 0===s?void 0:s.map(function(e){var t=le(e);return e.selectedVariantValues=t.variantValues,e}),e.data=(null==i?void 0:i.concat(e.data))||e.data,e.count=(null===(u=n.data)||void 0===u?void 0:u.count)||e.count,e.minPage=t,J(e),X(e),ie(e),[3,5]):[2];case 3:return a=r.sent(),console.log(a),[3,5];case 4:return e.isLoading=!1,[7];case 5:return[2]}})})}function ge(e){return t(this,void 0,void 0,function(){var t,n,i,a,o,s;return r(this,function(r){switch(r.label){case 0:if(F(e)||j(e)||k(e)||H(e)||W(e)||B(e)||x(e)||e.isLoading||!Z(e))return[2];e.isLoading=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,ee(e,e.page+1,e.limit)];case 2:return(t=r.sent())?(n=null===(o=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===o?void 0:o.map(function(e){var t=le(e);return e.selectedVariantValues=t.variantValues,e}),e.data=e.data.concat(n||[]),e.count=(null===(s=t.data)||void 0===s?void 0:s.count)||e.count,e.page=e.page+1,J(e),X(e),ie(e),[3,5]):[2];case 3:return i=r.sent(),console.log(i),[3,5];case 4:return e.isLoading=!1,[7];case 5:return[2]}})})}function Ee(e,n){return t(this,void 0,void 0,function(){var t,i,a,o,s,u;return r(this,function(r){switch(r.label){case 0:if(e.isLoading||F(e)||j(e)||k(e)||x(e)||H(e)||W(e)||B(e))return[2];e.isLoading=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,ee(e,n,e.limit)];case 2:return(t=r.sent())?(i=null===(s=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===s?void 0:s.map(function(e){var t=le(e);return e.selectedVariantValues=t.variantValues,e}),e.data=i||[],e.count=(null===(u=t.data)||void 0===u?void 0:u.count)||0,e.page=n,e.minPage=n,J(e),X(e),ie(e),[3,5]):[2];case 3:return a=r.sent(),console.log(a),[3,5];case 4:return e.isLoading=!1,[7];case 5:return[2]}})})}function Ie(e){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,A(e.data)];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),console.log(t),[3,3];case 3:return[2]}})})}function Ce(e,n){return t(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return e.sort=n,[4,ce(e)];case 1:return t.sent()&&ie(e),[2]}})})}function Se(e){return Ae(e,e.sort)}function Ae(e,t){switch(t){case"INCREASING_PRICE":return a.translate("sort_type.increasing_price");case"DECREASING_PRICE":return a.translate("sort_type.decreasing_price");case"LAST_ADDED":return a.translate("sort_type.last_added");case"FIRST_ADDED":return a.translate("sort_type.first_added");case"INCREASING_DISCOUNT":return a.translate("sort_type.increasing_discount");case"DECRASING_DISCOUNT":return a.translate("sort_type.decreasing_discount");case"FEATURED":return a.translate("sort_type.featured");case"DEFAULT":return a.translate("sort_type.default");case"AVERAGE_RATING":return a.translate("sort_type.average_rating");case"REVIEW_COUNT":return a.translate("sort_type.review_count");case"SALE_COUNT":return a.translate("sort_type.sale_count");case"A_Z":return a.translate("sort_type.a_z");case"Z_A":return a.translate("sort_type.z_a")}}function ye(e){var t,r,n,i,a,o,s,u;if(!e)return[];var d=[];return(null===(t=e.disabledSortTypes)||void 0===t?void 0:t.includes("NAME"))||(d.push({label:Ae(0,"A_Z"),value:"A_Z",isSelected:"A_Z"===e.sort}),d.push({label:Ae(0,"Z_A"),value:"Z_A",isSelected:"Z_A"===e.sort})),(null===(r=e.disabledSortTypes)||void 0===r?void 0:r.includes("PRICE"))||(d.push({label:Ae(0,"INCREASING_PRICE"),value:"INCREASING_PRICE",isSelected:"INCREASING_PRICE"===e.sort}),d.push({label:Ae(0,"DECREASING_PRICE"),value:"DECREASING_PRICE",isSelected:"DECREASING_PRICE"===e.sort})),(null===(n=e.disabledSortTypes)||void 0===n?void 0:n.includes("CREATED_AT"))||(d.push({label:Ae(0,"LAST_ADDED"),value:"LAST_ADDED",isSelected:"LAST_ADDED"===e.sort}),d.push({label:Ae(0,"FIRST_ADDED"),value:"FIRST_ADDED",isSelected:"FIRST_ADDED"===e.sort})),(null===(i=e.disabledSortTypes)||void 0===i?void 0:i.includes("DISCOUNT_RATIO"))||(d.push({label:Ae(0,"INCREASING_DISCOUNT"),value:"INCREASING_DISCOUNT",isSelected:"INCREASING_DISCOUNT"===e.sort}),d.push({label:Ae(0,"DECRASING_DISCOUNT"),value:"DECRASING_DISCOUNT",isSelected:"DECRASING_DISCOUNT"===e.sort})),(null===(a=e.disabledSortTypes)||void 0===a?void 0:a.includes("MANUAL_SORT"))||d.push({label:Ae(0,"FEATURED"),value:"FEATURED",isSelected:"FEATURED"===e.sort}),(null===(o=e.disabledSortTypes)||void 0===o?void 0:o.includes("AVERAGE_RATING"))||d.push({label:Ae(0,"AVERAGE_RATING"),value:"AVERAGE_RATING",isSelected:"AVERAGE_RATING"===e.sort}),(null===(s=e.disabledSortTypes)||void 0===s?void 0:s.includes("REVIEW_COUNT"))||d.push({label:Ae(0,"REVIEW_COUNT"),value:"REVIEW_COUNT",isSelected:"REVIEW_COUNT"===e.sort}),(null===(u=e.disabledSortTypes)||void 0===u?void 0:u.includes("SALE_COUNT"))||d.push({label:Ae(0,"SALE_COUNT"),value:"SALE_COUNT",isSelected:"SALE_COUNT"===e.sort}),d}function Te(e,i,a){return t(this,void 0,void 0,function(){var t,s,u;return r(this,function(r){switch(r.label){case 0:return a?(null===(u=e.filterCategories)||void 0===u||u.forEach(function(e){e.id===i.id&&(e.isSelected=!e.isSelected)}),[4,re(e)]):[3,2];case 1:return r.sent(),[3,3];case 2:n.isEditor||(t=ne(e),s=S(i)+(t?"?"+t:""),o.navigate(s)),r.label=3;case 3:return[2]}})})}function Re(e){var t;null===(t=e.filterCategories)||void 0===t||t.forEach(function(e){e.image=e.imageId?{id:e.imageId,isVideo:!1}:null})}function he(e,t){if(e.infiniteScrollPage!==t){e.infiniteScrollPage=t;var r=ne(e);o.navigate("".concat(location.pathname).concat(r?"?"+r:""),!0)}}function De(e){return t(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return e.searchKeyword&&e.data.length?[4,import("../../../analytics/analytics-functions/viewSearchResults.js")]:[3,2];case 1:return(0,t.sent().anl_viewSearchResults)(e.searchKeyword,e.data),[3,4];case 2:return e.data.length&&"ALL"===e.type?[4,import("../../../analytics/analytics-functions/viewListing.js")]:[3,4];case 3:(0,t.sent().anl_viewListing)(e.data),t.label=4;case 4:return[2]}})})}function _e(e){var t=e.data[0];if(!t)return n.getDefaultCurrencyCode()||"";var r=le(t),i=N(r);return(null==i?void 0:i.currency)||n.getDefaultCurrencyCode()||""}function me(e){var t=e.data[0];if(!t)return n.getDefaultCurrencySymbol()||"";var r=le(t),i=N(r);return(null==i?void 0:i.currencySymbol)||n.getDefaultCurrencySymbol()||""}var be=f(function(e){re(e)},500),Ne=f(function(e){return t(void 0,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,import("../../../analytics/analytics-functions/search.js")];case 1:return(0,t.sent().anl_search)(e.searchKeyword),[2]}})})},1e3),Le=((O={}).INCREASING_PRICE=1,O.DECREASING_PRICE=2,O.LAST_ADDED=3,O.FIRST_ADDED=4,O.INCREASING_DISCOUNT=5,O.DECRASING_DISCOUNT=6,O.FEATURED=7,O.DEFAULT=8,O.AVERAGE_RATING=9,O.REVIEW_COUNT=10,O.SALE_COUNT=11,O.A_Z=12,O.Z_A=13,O);export{oe as clearProductListFilter,ae as clearProductListFilters,Q as enableProductListSuggestions,_e as getProductListCurrencyCode,me as getProductListCurrencySymbol,M as getProductListFilterCategories,ce as getProductListInitialData,ge as getProductListNextPage,Ee as getProductListPage,pe as getProductListPrevPage,ye as getProductListSortOptions,Se as getProductListSortTypeTranslation,$ as getProductListSuggestionHref,de as getSelectedFilterValues,se as handleFilterValueClick,ue as handleNumberRangeOptionClick,q as hasProductListAppliedFilters,z as hasProductListFeaturedSortEnabled,Z as hasProductListNextPage,Y as hasProductListPrevPage,P as initProductList,Re as initProductListFilterCategories,G as initProductListOnBrowser,j as isProductListDiscounted,V as isProductListFilterable,w as isProductListFiltered,x as isProductListLastViewed,B as isProductListPurchasedTogether,k as isProductListRecommended,H as isProductListRelatedProducts,K as isProductListSearch,F as isProductListStatic,W as isProductListViewedTogether,Te as onFilterCategoryClick,fe as productListToggleFilterCollapsed,U as searchProductList,J as setProductListIsFilteredForProducts,X as setProductListIsStaticForProducts,he as setProductListVisiblePage,Ce as setSortType,Ae as translateProductListSortType,Ie as updateProductListPrices};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{Analytics}from"./analytics/analytics.js";export{initIkasEvents}from"./analytics/events.js";export{EMPTY_STRING,NULL,UNDEFINED}from"./externals/index.js";export{apiListProductBrand}from"./functions/api/brand/index.js";export{apiListCategory}from"./functions/api/category/index.js";export{apiGetLoyaltyCustomerInfo,apiGetStorefrontWidgetSettings,apiListEarningMethods,apiListLoyaltyProgramPointHistory,apiListLoyaltyProgramTiers,apiListSpendingMethodsByCartId,apiRemoveLoyaltyPointsFromCart,apiUseLoyaltyPoints}from"./functions/api/loyalty/index.js";export{apiListStorefrontPopup}from"./functions/api/popup/index.js";export{apiSearchProducts}from"./functions/api/product/index.js";export{getAttributeDetailValues}from"./functions/models/attribute-detail/index.js";export{getAttributeListValues}from"./functions/models/attribute-list/index.js";export{createIkasBaseModel}from"./functions/models/base/index.js";export{getIkasBlogFormattedDate,getIkasBlogHref}from"./functions/models/blog/index.js";export{createIkasBlogCategory,getIkasBlogCategoryHref}from"./functions/models/blog/category/index.js";export{initIkasBlogCategory}from"./functions/models/blog/category/init.js";export{initIkasBlog}from"./functions/models/blog/init.js";export{getBlogCategoryListInitialData,getBlogCategoryListNextPage,getBlogCategoryListPage,getBlogCategoryListPageCount,getBlogCategoryListPrevPage,hasBlogCategoryListNextPage,hasBlogCategoryListPrevPage,isBlogCategoryListStatic}from"./functions/models/blog-category-list/index.js";export{initBlogCategoryList}from"./functions/models/blog-category-list/init.js";export{getBlogListInitialData,getBlogListNextPage,getBlogListPage,getBlogListPageCount,getBlogListPrevPage,hasBlogListNextPage,hasBlogListPrevPage,isBlogListStatic}from"./functions/models/blog-list/index.js";export{initBlogList}from"./functions/models/blog-list/init.js";export{getIkasBrandHref}from"./functions/models/brand/index.js";export{initIkasBrand}from"./functions/models/brand/init.js";export{getBrandListInitialData,getBrandListNextPage,getBrandListPage,getBrandListPageCount,getBrandListPrevPage,hasBrandListNextPage,hasBrandListPrevPage,isBrandListStatic}from"./functions/models/brand-list/index.js";export{initBrandList}from"./functions/models/brand-list/init.js";export{acceptProductOffer,isAcceptedProductOffer,rejectProductOffer}from"./functions/models/campaign-offer/index.js";export{getCategoryPath,getIkasCategoryHref}from"./functions/models/category/index.js";export{initIkasCategory}from"./functions/models/category/init.js";export{getCategoryListInitialData,getCategoryListNextPage,getCategoryListPage,getCategoryListPageCount,getCategoryListPrevPage,hasCategoryListNextPage,hasCategoryListPrevPage,isCategoryListStatic}from"./functions/models/category-list/index.js";export{initCategoryList}from"./functions/models/category-list/init.js";export{getIkasCategoryPathItemHref,getIkasCategoryPathItemSlug}from"./functions/models/category/path-item/index.js";export{initIkasCategoryPathItem}from"./functions/models/category/path-item/init.js";export{getCheckoutTotalFinalPrice,isCheckoutComplete}from"./functions/models/checkout/index.js";export{initIkasCountry}from"./functions/models/country/init.js";export{getCustomerBasicInfo,isCustomerSubscribed}from"./functions/models/customer/index.js";export{clearIkasCustomerAddressForm,getCustomerAddressText,getCustomerAddressValidationResult,getIkasCustomerAddressForm,isValidCustomerAddress}from"./functions/models/customer/address/index.js";export{getCustomerAttributeAccountPagePermission,getCustomerAttributeRegisterPageRequirement}from"./functions/models/customer/attribute/index.js";export{initIkasCustomerAttribute}from"./functions/models/customer/attribute/init.js";export{getIkasCustomerReviewFormattedDate}from"./functions/models/customer/review/index.js";export{initIkasCustomerReview}from"./functions/models/customer/review/init.js";export{getCustomerReviewListInitialData,getCustomerReviewListNextPage,getCustomerReviewListPage,getCustomerReviewListPageCount,getCustomerReviewListPrev,getProductCustomerReviews,hasCustomerReviewListNextPage,hasCustomerReviewListPrevPage}from"./functions/models/customer-review-list/index.js";export{initCustomerReviewList}from"./functions/models/customer-review-list/init.js";export{getCustomerReviewSummaryListInitialData,getCustomerReviewSummaryListNextPage,getCustomerReviewSummaryListPage,getCustomerReviewSummaryListPrev,hasCustomerReviewSummaryListNextPage,hasCustomerReviewSummaryListPrevPage}from"./functions/models/customer-review-summary-list/index.js";export{initCustomerReviewSummaryList}from"./functions/models/customer-review-summary-list/init.js";export{getIkasFilterCategoryHref,getIkasFilterCategorySlug}from"./functions/models/filter-category/index.js";export{initIkasHTMLMetaData,setHTMLMetaDataTranslations}from"./functions/models/html-meta-data/init.js";export{initThemeDatePicker,themeDatePickerGetDate,themeDatePickerGetDaysOfMonth,themeDatePickerGetDaysOfWeekShort,themeDatePickerGetFullYear,themeDatePickerGetHours,themeDatePickerGetMinutes,themeDatePickerGetMonth,themeDatePickerGetMonthList,themeDatePickerGetMonthName,themeDatePickerGetViewFullYear,themeDatePickerGetViewMonth,themeDatePickerGetWeekFirstDay,themeDatePickerOnChange,themeDatePickerOnDayChange,themeDatePickerOnHoursChange,themeDatePickerOnMinutesChange,themeDatePickerOnViewFullYearChange,themeDatePickerOnViewMonthChange,themeDatePickerSetViewNextMonth,themeDatePickerSetViewPrevMonth}from"./functions/models/ikas-theme/date-picker.js";export{createMediaSrcset,getDefaultSrc,getSrc,getThumbnailSrc}from"./functions/models/image/index.js";export{initIkasMerchantSettings}from"./functions/models/merchant-settings/init.js";export{applyIkasOrderRefundableLines,getIkasOrderCouponAdjustment,getIkasOrderCustomerFullName,getIkasOrderDisplayedAdjustments,getIkasOrderDisplayedPackages,getIkasOrderDistinctItemCount,getIkasOrderFormattedDate,getIkasOrderFormattedOrderedAt,getIkasOrderFormattedShippingTotal,getIkasOrderFormattedTotalFinalPrice,getIkasOrderFormattedTotalPrice,getIkasOrderFormattedTotalTax,getIkasOrderGiftCardTotalPrice,getIkasOrderHref,getIkasOrderNonCouponAdjustments,getIkasOrderPackageStatusTranslation,getIkasOrderProductFiles,getIkasOrderRefundReason,getIkasOrderRefundReasonId,getIkasOrderRefundReasons,getIkasOrderRefundableItems,getIkasOrderRefundedItems,getIkasOrderReturnMethodDescription,getIkasOrderShippingTotal,getIkasOrderTotalItemCount,getIkasOrderTotalTax,getIkasOrderUnfullfilledItems,getIkasOrderVariantNames,hasIkasOrderCustomer,hasValidIkasOrderCustomerEmail,initIkasOrder,isIkasOrderRefundable,setIkasOrderRefundReason,setIkasOrderRefundReasonId}from"./functions/models/order/index.js";export{createOrderAddress,getOrderAddressText,getOrderAddressValidationResult,isValidOrderAddress}from"./functions/models/order/address/index.js";export{getOrderAdjustmentDisplayName,getOrderAdjustmentFormattedAmount,getOrderAdjustmentIsDecrement}from"./functions/models/order/adjustment/index.js";export{getOrderGiftPackageLineFormattedPrice}from"./functions/models/order/gift-package/index.js";export{editOrderLineItem,getOrderLineItemFinalPriceWithQuantity,getOrderLineItemFormattedDiscountPrice,getOrderLineItemFormattedFinalPrice,getOrderLineItemFormattedFinalPriceWithQuantity,getOrderLineItemFormattedFinalUnitPrice,getOrderLineItemFormattedOverridenPriceWithQuantity,getOrderLineItemFormattedPrice,getOrderLineItemFormattedPriceWithQuantity,getOrderLineItemFormattedTax,getOrderLineItemFormattedUnitPrice,getOrderLineItemOverridenPriceWithQuantity,getOrderLineItemPriceWithQuantity,getOrderLineItemRefundQuantity,getOrderLineItemTax,getOrderLineItemUnitPriceText,hasOrderLineItemDiscount,setOrderLineItemRefundQuantity}from"./functions/models/order/line-item/index.js";export{downloadFile,getOrderLineItemOptionValueFormattedPrice,getOrderLineOptionFileName}from"./functions/models/order/line-item/option/value/index.js";export{getIkasOrderLineVariantHref,getIkasOrderLineVariantMainImage}from"./functions/models/order/line-item/variant/index.js";export{getIkasOrderLineBundleVariantMainImage}from"./functions/models/order/line-item/variant/bundle-product/bundle-variant/index.js";export{getIkasOrderLineVariantNameSlug,getIkasOrderLineVariantTypeSlug}from"./functions/models/order/line-item/variant/value/index.js";export{getOrderTransactionFormattedAmount,getOrderTransactionPaymentMethodTranslation}from"./functions/models/order/transaction/index.js";export{getPaymentGatewayCalculatedAdditionalPrices}from"./functions/models/payment-gateway/index.js";export{initIkasPaymentGateway}from"./functions/models/payment-gateway/init.js";export{addIkasProductToFavorites,clearIkasProductCustomerReviewForm,getBundleProductFinalPrice,getBundleProductFinalPriceWithQuantity,getBundleProductFormattedFinalPrice,getBundleProductFormattedFinalPriceWithQuantity,getBundleProductFormattedSellPrice,getBundleProductFormattedSellPriceWithQuantity,getBundleProductSellPrice,getBundleProductSellPriceWithQuantity,getBundleProductsOfVariant,getDisplayedProductGroups,getDisplayedProductVariantTypes,getGroupedAttributeValues,getIkasProductCustomerReviewForm,getMainProductVariantType,getMainProductVariantValue,getProductAvailableStockLocations,getProductCampaigns,getProductCategoryPath,getProductFirstCategory,getProductHref,getProductOptionSet,getSelectedProductVariant,getSelectedProductVariantHref,hasProductStock,hasProductValidOptionValues,hasProductVariant,initBundleProducts,initProductOnBrowser,initProductOptionSet,isAddToCartEnabled,isBundleProductQuantityEditable,isCustomerReviewEnabled,isCustomerReviewLoginRequired,isFavoriteIkasProduct,removeIkasProductFromFavorites,selectVariantValue,setBundleProductQuantity,setOptionRealPrices,setProductOfBundleProduct,shouldDisplayBundleProductPrice}from"./functions/models/product/index.js";export{getProductFromStore,initIkasProduct,initIkasProductExtraFields,productVariantStore}from"./functions/models/product/init.js";export{clearProductListFilter,clearProductListFilters,enableProductListSuggestions,getProductListCurrencyCode,getProductListCurrencySymbol,getProductListFilterCategories,getProductListInitialData,getProductListNextPage,getProductListPage,getProductListPrevPage,getProductListSortOptions,getProductListSortTypeTranslation,getProductListSuggestionHref,getSelectedFilterValues,handleFilterValueClick,handleNumberRangeOptionClick,hasProductListAppliedFilters,hasProductListFeaturedSortEnabled,hasProductListNextPage,hasProductListPrevPage,initProductList,initProductListFilterCategories,initProductListOnBrowser,isProductListDiscounted,isProductListFilterable,isProductListFiltered,isProductListLastViewed,isProductListPurchasedTogether,isProductListRecommended,isProductListRelatedProducts,isProductListSearch,isProductListStatic,isProductListViewedTogether,onFilterCategoryClick,productListToggleFilterCollapsed,searchProductList,setProductListIsFilteredForProducts,setProductListIsStaticForProducts,setProductListVisiblePage,setSortType,translateProductListSortType}from"./functions/models/product-list/index.js";export{getIkasProductAttributeProducts,getIkasProductAttributeTableValue,getIkasProductAttrributeProductIds}from"./functions/models/product/attribute-value/index.js";export{initIkasProductAttributeValue}from"./functions/models/product/attribute-value/init.js";export{applyQueryParamForFilter,clearFilter,filterParseRangeStr,filterRangeToId,filterToInput,getFilterDisplayedValues,getFilterKeyList,getFilterValueList,getIkasFilterHref,getIkasFilterThumbnailImage,initIkasProductFilter,isBoxFilter,isCustomValueFilter,isListFilter,isStockFilter,isSwatchFilter,onNumberRangeFilterChange,onNumberRangeFilterOptionClick,selectFilterValue}from"./functions/models/product/filter/index.js";export{getDisplayedOptions,hasDisplayedOptions,hasValidProductOptionSetValues,initOptionValues,initProductOptionSetValues,setChildOptions}from"./functions/models/product/option-set/index.js";export{initIkasProductOptionSet}from"./functions/models/product/option-set/init.js";export{clearValues,getDisplayedChildOptions,getProductOptionFormattedLabel,getProductOptionFormattedPrice,getTextValue,hasError,hasValidProductOptionValues,initIkasProductOptionValues,isCheckboxOption,isChecked,isChoiceOption,isChoiceOptionBoxType,isChoiceOptionSelectType,isChoiceOptionSwatchType,isColorPickerOption,isDatePickerOption,isFileOption,isImageOption,isProductOptionSelectValueSelected,isTextAreaOption,isTextOption,productOptionFileUpload,selectValue,setCheckboxValue,setTextValue,setValues}from"./functions/models/product/option-set/option/index.js";export{initIkasProductOption}from"./functions/models/product/option-set/option/init.js";export{clearProductVariantBackInStockForm,getGroupedAttributeValuesForVariant,getProductVariantAppliedCampaignAmount,getProductVariantB2bPriceRule,getProductVariantBackInStockForm,getProductVariantBundlePrice,getProductVariantCampaignOffersDiscountPercentage,getProductVariantCampaignPrice,getProductVariantDiscountAmount,getProductVariantDiscountPercentage,getProductVariantDiscountPrice,getProductVariantFinalPrice,getProductVariantFinalPriceWithCampaignOffers,getProductVariantFormattedBuyPrice,getProductVariantFormattedCampaignPrice,getProductVariantFormattedDiscountAmount,getProductVariantFormattedDiscountPrice,getProductVariantFormattedFinalPrice,getProductVariantFormattedFinalPriceWithCampaignOffers,getProductVariantFormattedSellPrice,getProductVariantFormattedSellPriceWithCampaignOffers,getProductVariantIsBackInStockCustomerLoginRequired,getProductVariantIsBackInStockEnabled,getProductVariantMainImage,getProductVariantPrice,getProductVariantSellPrice,getProductVariantSellPriceWithCampaignOffers,getProductVariantTieredDiscountProducts,getProductVariantUnitPriceText,hasBundleSettings,hasProductVariantDiscount,hasProductVariantStock,saveProductVariantBackInStockReminder}from"./functions/models/product/variant/index.js";export{initIkasProductVariant}from"./functions/models/product/variant/init.js";export{getIkasProductDiscountPercentage,getIkasProductPriceDiscountAmount,getIkasProductPriceFinalPrice,hasIkasProductPriceDiscount}from"./functions/models/product/variant/price/index.js";export{isRaffleAvailable}from"./functions/models/raffle/index.js";export{initIkasRaffle}from"./functions/models/raffle/init.js";export{initIkasState}from"./functions/models/state/init.js";export{getIkasVariantTypeSlug,isIkasVariantTypeColorSelection}from"./functions/models/variant-type/index.js";export{initIkasVariantType}from"./functions/models/variant-type/init.js";export{getIkasVariantValueSlug,getIkasVariantValueThumbnailImage,isColorVariantValue,isImageVariantValue,isTextVariantValue}from"./functions/models/variant-type/variant-value/index.js";export{FORM_ITEM_DEFAULT_VALUE,validateValue}from"./functions/models/validator/index.js";export{initAccountInfoForm,setAccountInfoFormFirstName,setAccountInfoFormIsMarketingAccepted,setAccountInfoFormLastName,setAccountInfoFormPhone,submitAccountInfoForm}from"./functions/models/validator/account-info/index.js";export{initAddressForm,setAddressFormAddressLine1,setAddressFormAddressLine2,setAddressFormCity,setAddressFormCompany,setAddressFormCountry,setAddressFormDistrict,setAddressFormFirstName,setAddressFormIdentityNumber,setAddressFormLastName,setAddressFormPhone,setAddressFormPostalCode,setAddressFormRegion,setAddressFormState,setAddressFormTaxNumber,setAddressFormTaxOffice,setAddressFormTitle,submitAddressForm}from"./functions/models/validator/address/index.js";export{initBackInStockNotificationForm,setBackInStockNotificationFormEmail,submitBackInStockNotificationForm}from"./functions/models/validator/back-in-stock-notification/index.js";export{initContactForm,setContactFormEmail,setContactFormFirstName,setContactFormLastName,setContactFormMessage,setContactFormPhone,submitContactForm}from"./functions/models/validator/contact-form/index.js";export{initCouponCodeForm,removeCouponCodeForm,setCouponCodeFormCouponCode,submitCouponCodeForm}from"./functions/models/validator/coupon-code-form/index.js";export{initCustomerReviewForm,setCustomerReviewFormComment,setCustomerReviewFormStar,setCustomerReviewFormTitle,submitCustomerReviewForm}from"./functions/models/validator/customer-review/index.js";export{initDeactivateCustomerForm,setDeactivateCustomerFormPassword,submitDeactivateCustomerForm}from"./functions/models/validator/deactivate-customer/index.js";export{initForgotPasswordForm,setForgotPasswordFormEmail,submitForgotPasswordForm}from"./functions/models/validator/forgot-password/index.js";export{initLoginForm,setLoginFormEmail,setLoginFormPassword,submitLoginForm}from"./functions/models/validator/login/index.js";export{initNewsletterSubscriptionForm,setNewsletterSubscriptionFormEmail,setNewsletterSubscriptionFormIsMarketingAccepted,submitNewsletterSubscriptionForm}from"./functions/models/validator/newsletter-subscription/index.js";export{initOrderTrackingForm,setOrderTrackingFormEmail,setOrderTrackingFormOrderNumber,submitOrderTrackingForm}from"./functions/models/validator/order-tracking/index.js";export{initRecoverPasswordForm,setRecoverPasswordFormPassword,setRecoverPasswordFormPasswordAgain,submitRecoverPasswordForm}from"./functions/models/validator/recover-password/index.js";export{initRegisterForm,setRegisterFormBooleanAttribute,setRegisterFormChoiceAttribute,setRegisterFormDateAttribute,setRegisterFormDateTimeAttribute,setRegisterFormEmail,setRegisterFormFirstName,setRegisterFormIsMarketingAccepted,setRegisterFormIsMembershipAgreementAccepted,setRegisterFormLastName,setRegisterFormMultipleChoiceAttribute,setRegisterFormNumericAttribute,setRegisterFormPassword,setRegisterFormPhone,setRegisterFormTextAttribute,submitRegisterForm}from"./functions/models/validator/register/index.js";export{initSmsLoginForm,resendSmsLoginFormCode,setSmsLoginFormCode,setSmsLoginFormEmail,setSmsLoginFormFirstName,setSmsLoginFormIsMarketingAccepted,setSmsLoginFormIsMembershipAgreementAccepted,setSmsLoginFormLastName,setSmsLoginFormPhone,submitSmsLoginForm}from"./functions/models/validator/sms-login/index.js";export{initVerifyPhoneNumberForm,resendVerifyPhoneNumberFormCode,setVerifyPhoneNumberFormCode,submitVerifyPhoneNumberForm}from"./functions/models/validator/verify-phone-number/index.js";export{collectionToArray}from"./functions/others/index.js";export{bs_searchProductById,bs_searchProductsById,initBaseStore,setLanguage,setLocalization}from"./functions/stores/base/index.js";export{addItemToCart,addSelectedtedVariantToCart,changeCartItemQuantity,changeItemQuantity,createPayWithIkasSession,findExistingCartItem,findExistingCartItemWithProduct,getAcceptedOffers,getCart,getCheckoutUrlFromCartStore,hasCart,isOrderLineItemAutoCreated,removeCart,removeCouponCode,removeGiftCardLine,removeItem,saveCouponCode,setCart,waitForCartStoreInit,windowAddToCart}from"./functions/stores/cart/index.js";export{MILES_SMILES_PAYMENT_GATEWAY_CODE,MILES_SMILES_PAYMENT_GATEWAY_ID,MILES_SMILES_PROVIDER,activateCustomer,addProductToFavorites,canCustomerCreateEmailSubscription,checkEmail,clearAccountInfoForm,clearContactForm,clearCouponCodeForm,clearCustomerSession,clearDeactivateCustomerForm,clearForgotPasswordForm,clearLoginForm,clearNewsletterSubscriptionForm,clearOrderTrackingForm,clearRecoverPasswordForm,clearRegisterForm,closeIkasStorefrontWidget,createEmailSubscription,createRefundRequest,cs_getLoyaltyCustomerInfo,cs_listEarningMethods,cs_listLoyaltyProgramPointHistory,cs_listLoyaltyProgramTiers,cs_listSpendingMethodsByCartId,cs_removeLoyaltyPointsFromCart,cs_useLoyaltyPoints,customerLogin,customerStore_onProductView,customerToAnalyticsCustomer,deactivateCustomer,deleteCustomerAddress,exportCustomerPersonalData,forgotPassword,getAccountInfoForm,getContactForm,getCouponCodeForm,getCustomerAttributes,getCustomerConsentGranted,getDeactivateCustomerForm,getDigitalProductFileDownloadUrl,getEmptyAddressForm,getFavoriteProducts,getFavoriteProductsIds,getForgotPasswordForm,getLastViewedProducts,getLoginForm,getMilesSmilesDetails,getMilesSmilesLink,getNewsletterSubscriptionForm,getOrder,getOrderByEmail,getOrderDetailsOfPage,getOrderProductFiles,getOrderRefundSettings,getOrderTrackingForm,getOrderTransactions,getOrders,getRecoverPasswordForm,getRegisterForm,getSmsLoginForm,getVerifyPhoneNumberForm,handleCustomerConsentGrant,handleMilesSmilesBind,handleSocialLogin,hasCustomer,initCustomerStore,isFavoriteProduct,isMilesSmilesTransaction,logout,milesSmilesBind,openIkasStorefrontWidget,recoverPassword,refundOrder,register,removeCustomerConsent,removeProductFromFavorites,resendCustomerActivationMail,resendCustomerPhoneVerificationCode,saveContactForm,saveCustomer,saveCustomerFormData,seedCustomerSession,sendReview,setCaptchaToken,setSavedLastViewedProductsResponse,socialLogin,socialLoginToken,unlinkMilesSmiles,validateCustomerPhoneVerificationCode,validateOTPCode,waitForCaptchaTokenInit,waitForCustomerStoreInit}from"./functions/stores/customer/index.js";export{I18n,i18n}from"./i18n/index.js";export{Router,router,withRoutePrefix}from"./router/index.js";export{baseStore}from"./stores/base/index.js";export{CART_LS_KEY,cartStore}from"./stores/cart/index.js";export{customerStore}from"./stores/customer/index.js";export{getThemeBreakpoints,getThemeColorSchemes,getThemeColors,getThemeKeyframes,getThemeSetting,getThemeSettingValue,getThemeSettings,getThemeTypography,registerThemeSettingValues}from"./theme/settings/index.js";export{DYNAMIC_STYLE_PROPERTIES,SIZE_PROPERTIES,getFormattedBorder,getFormattedBorderRadiusBottomLeftSize,getFormattedBorderRadiusBottomRightSize,getFormattedBorderRadiusSize,getFormattedBorderRadiusTopLeftSize,getFormattedBorderRadiusTopRightSize,getFormattedBorderWidthSizeSize,getFormattedBottomSize,getFormattedFontSize,getFormattedGapSize,getFormattedGridTemplateColumns,getFormattedHeightSize,getFormattedLeftSize,getFormattedLetterSpacingSize,getFormattedLineHeightSize,getFormattedMarginBottomSize,getFormattedMarginLeftSize,getFormattedMarginRightSize,getFormattedMarginTopSize,getFormattedMaxHeightSize,getFormattedMaxWidthSize,getFormattedMinHeightSize,getFormattedMinWidthSize,getFormattedPaddingBottomSize,getFormattedPaddingLeftSize,getFormattedPaddingMarginSize,getFormattedPaddingRightSize,getFormattedPaddingSize,getFormattedPaddingTopSize,getFormattedRightSize,getFormattedShadow,getFormattedSize,getFormattedStyleVariable,getFormattedTopSize,getFormattedWidthSize}from"./theme/styles/index.js";export{isBrowser,isDefined,isEmpty,isNotEmpty}from"./utils/blueprint.js";export{IkasComponentRenderer}from"./utils/component-renderer.js";export{formatCurrency}from"./utils/currency.js";export{HttpMethod,get,httpRequest,post}from"./utils/fetch.js";export{JsObject}from"./utils/object-wrapper.js";export{PayWithIkas}from"./utils/pay-with-ikas.js";export{normalizeSvg}from"./utils/svg.js";export{setAPIClientConfig}from"./packages/storefront-api/src/index.js";export{IkasStorefrontConfig,escapeForJSON,unescapeFromJSON}from"./packages/storefront-config/src/index.js";import"./packages/storefront-models/src/models/merchant-settings/index.js";export{default as IkasAPIClientConfig}from"./packages/storefront-api-client/src/config/index.js";export{anl_addToCart}from"./analytics/analytics-functions/addToCart.js";export{anl_addToWishlist}from"./analytics/analytics-functions/addToWishlist.js";export{anl_completeRegistration}from"./analytics/analytics-functions/completeRegistration.js";export{anl_contactForm}from"./analytics/analytics-functions/contactForm.js";export{anl_createEmailSubscription}from"./analytics/analytics-functions/createEmailSubscription.js";export{anl_customerLogin}from"./analytics/analytics-functions/customerLogin.js";export{anl_customerLogout}from"./analytics/analytics-functions/customerLogout.js";export{anl_customerVisit}from"./analytics/analytics-functions/customerVisit.js";export{anl_pageView}from"./analytics/analytics-functions/pageView.js";export{anl_productView}from"./analytics/analytics-functions/productView.js";export{anl_removeFromCart}from"./analytics/analytics-functions/removeFromCart.js";export{anl_search}from"./analytics/analytics-functions/search.js";export{anl_viewBrand}from"./analytics/analytics-functions/viewBrand.js";export{anl_viewCart}from"./analytics/analytics-functions/viewCart.js";export{anl_viewCategory}from"./analytics/analytics-functions/viewCategory.js";export{anl_viewListing}from"./analytics/analytics-functions/viewListing.js";export{anl_viewSearchResults}from"./analytics/analytics-functions/viewSearchResults.js";export{anl_viewStorefrontPopup}from"./analytics/analytics-functions/viewStorefrontPopup.js";import*as e from'./ext/animejs/lib/anime.esm.js';export{e as AnimeJS};export{cloneDeep,reaction}from"./utils/helper.js";export{APIErrorCode,APIResponse}from"./packages/storefront-api-client/src/utils/api.js";export{EMPTY_THEME_GLOBALS,breakpointCssToken,cssVarCamelCase,cssVarRef,isReservedVariableId,rawClassRef,resolveBreakpointMediaTokens,serializeThemeGlobals,toResolverBreakpoints}from"./packages/storefront-config/src/theme-globals.js";
1
+ export{Analytics}from"./analytics/analytics.js";export{initIkasEvents}from"./analytics/events.js";export{EMPTY_STRING,NULL,UNDEFINED}from"./externals/index.js";export{apiListProductBrand}from"./functions/api/brand/index.js";export{apiListCategory}from"./functions/api/category/index.js";export{apiGetLoyaltyCustomerInfo,apiGetStorefrontWidgetSettings,apiListEarningMethods,apiListLoyaltyProgramPointHistory,apiListLoyaltyProgramTiers,apiListSpendingMethodsByCartId,apiRemoveLoyaltyPointsFromCart,apiUseLoyaltyPoints}from"./functions/api/loyalty/index.js";export{apiListStorefrontPopup}from"./functions/api/popup/index.js";export{apiSearchProducts}from"./functions/api/product/index.js";export{getAttributeDetailValues}from"./functions/models/attribute-detail/index.js";export{getAttributeListValues}from"./functions/models/attribute-list/index.js";export{createIkasBaseModel}from"./functions/models/base/index.js";export{getIkasBlogFormattedDate,getIkasBlogHref}from"./functions/models/blog/index.js";export{createIkasBlogCategory,getIkasBlogCategoryHref}from"./functions/models/blog/category/index.js";export{initIkasBlogCategory}from"./functions/models/blog/category/init.js";export{initIkasBlog}from"./functions/models/blog/init.js";export{getBlogCategoryListInitialData,getBlogCategoryListNextPage,getBlogCategoryListPage,getBlogCategoryListPageCount,getBlogCategoryListPrevPage,hasBlogCategoryListNextPage,hasBlogCategoryListPrevPage,isBlogCategoryListStatic}from"./functions/models/blog-category-list/index.js";export{initBlogCategoryList}from"./functions/models/blog-category-list/init.js";export{getBlogListInitialData,getBlogListNextPage,getBlogListPage,getBlogListPageCount,getBlogListPrevPage,hasBlogListNextPage,hasBlogListPrevPage,isBlogListStatic}from"./functions/models/blog-list/index.js";export{initBlogList}from"./functions/models/blog-list/init.js";export{getIkasBrandHref}from"./functions/models/brand/index.js";export{initIkasBrand}from"./functions/models/brand/init.js";export{getBrandListInitialData,getBrandListNextPage,getBrandListPage,getBrandListPageCount,getBrandListPrevPage,hasBrandListNextPage,hasBrandListPrevPage,isBrandListStatic}from"./functions/models/brand-list/index.js";export{initBrandList}from"./functions/models/brand-list/init.js";export{acceptProductOffer,isAcceptedProductOffer,rejectProductOffer}from"./functions/models/campaign-offer/index.js";export{getCategoryPath,getIkasCategoryHref}from"./functions/models/category/index.js";export{initIkasCategory}from"./functions/models/category/init.js";export{getCategoryListInitialData,getCategoryListNextPage,getCategoryListPage,getCategoryListPageCount,getCategoryListPrevPage,hasCategoryListNextPage,hasCategoryListPrevPage,isCategoryListStatic}from"./functions/models/category-list/index.js";export{initCategoryList}from"./functions/models/category-list/init.js";export{getIkasCategoryPathItemHref,getIkasCategoryPathItemSlug}from"./functions/models/category/path-item/index.js";export{initIkasCategoryPathItem}from"./functions/models/category/path-item/init.js";export{getCheckoutTotalFinalPrice,isCheckoutComplete}from"./functions/models/checkout/index.js";export{initIkasCountry}from"./functions/models/country/init.js";export{getCustomerBasicInfo,isCustomerSubscribed}from"./functions/models/customer/index.js";export{clearIkasCustomerAddressForm,getCustomerAddressText,getCustomerAddressValidationResult,getIkasCustomerAddressForm,isValidCustomerAddress}from"./functions/models/customer/address/index.js";export{getCustomerAttributeAccountPagePermission,getCustomerAttributeRegisterPageRequirement}from"./functions/models/customer/attribute/index.js";export{initIkasCustomerAttribute}from"./functions/models/customer/attribute/init.js";export{getIkasCustomerReviewFormattedDate}from"./functions/models/customer/review/index.js";export{initIkasCustomerReview}from"./functions/models/customer/review/init.js";export{getCustomerReviewListInitialData,getCustomerReviewListNextPage,getCustomerReviewListPage,getCustomerReviewListPageCount,getCustomerReviewListPrev,getProductCustomerReviews,hasCustomerReviewListNextPage,hasCustomerReviewListPrevPage}from"./functions/models/customer-review-list/index.js";export{initCustomerReviewList}from"./functions/models/customer-review-list/init.js";export{getCustomerReviewSummaryListInitialData,getCustomerReviewSummaryListNextPage,getCustomerReviewSummaryListPage,getCustomerReviewSummaryListPrev,hasCustomerReviewSummaryListNextPage,hasCustomerReviewSummaryListPrevPage}from"./functions/models/customer-review-summary-list/index.js";export{initCustomerReviewSummaryList}from"./functions/models/customer-review-summary-list/init.js";export{getIkasFilterCategoryHref,getIkasFilterCategorySlug}from"./functions/models/filter-category/index.js";export{initIkasHTMLMetaData,setHTMLMetaDataTranslations}from"./functions/models/html-meta-data/init.js";export{initThemeDatePicker,themeDatePickerGetDate,themeDatePickerGetDaysOfMonth,themeDatePickerGetDaysOfWeekShort,themeDatePickerGetFullYear,themeDatePickerGetHours,themeDatePickerGetMinutes,themeDatePickerGetMonth,themeDatePickerGetMonthList,themeDatePickerGetMonthName,themeDatePickerGetViewFullYear,themeDatePickerGetViewMonth,themeDatePickerGetWeekFirstDay,themeDatePickerOnChange,themeDatePickerOnDayChange,themeDatePickerOnHoursChange,themeDatePickerOnMinutesChange,themeDatePickerOnViewFullYearChange,themeDatePickerOnViewMonthChange,themeDatePickerSetViewNextMonth,themeDatePickerSetViewPrevMonth}from"./functions/models/ikas-theme/date-picker.js";export{createMediaSrcset,getDefaultSrc,getSrc,getThumbnailSrc}from"./functions/models/image/index.js";export{initIkasMerchantSettings}from"./functions/models/merchant-settings/init.js";export{applyIkasOrderRefundableLines,getIkasOrderCouponAdjustment,getIkasOrderCustomerFullName,getIkasOrderDisplayedAdjustments,getIkasOrderDisplayedPackages,getIkasOrderDistinctItemCount,getIkasOrderFormattedDate,getIkasOrderFormattedOrderedAt,getIkasOrderFormattedShippingTotal,getIkasOrderFormattedTotalFinalPrice,getIkasOrderFormattedTotalPrice,getIkasOrderFormattedTotalTax,getIkasOrderGiftCardTotalPrice,getIkasOrderHref,getIkasOrderNonCouponAdjustments,getIkasOrderPackageStatusTranslation,getIkasOrderProductFiles,getIkasOrderRefundReason,getIkasOrderRefundReasonId,getIkasOrderRefundReasons,getIkasOrderRefundableItems,getIkasOrderRefundedItems,getIkasOrderReturnMethodDescription,getIkasOrderShippingTotal,getIkasOrderTotalItemCount,getIkasOrderTotalTax,getIkasOrderUnfullfilledItems,getIkasOrderVariantNames,hasIkasOrderCustomer,hasValidIkasOrderCustomerEmail,initIkasOrder,isIkasOrderRefundable,setIkasOrderRefundReason,setIkasOrderRefundReasonId}from"./functions/models/order/index.js";export{createOrderAddress,getOrderAddressText,getOrderAddressValidationResult,isValidOrderAddress}from"./functions/models/order/address/index.js";export{getOrderAdjustmentDisplayName,getOrderAdjustmentFormattedAmount,getOrderAdjustmentIsDecrement}from"./functions/models/order/adjustment/index.js";export{getOrderGiftPackageLineFormattedPrice}from"./functions/models/order/gift-package/index.js";export{editOrderLineItem,getOrderLineItemFinalPriceWithQuantity,getOrderLineItemFormattedDiscountPrice,getOrderLineItemFormattedFinalPrice,getOrderLineItemFormattedFinalPriceWithQuantity,getOrderLineItemFormattedFinalUnitPrice,getOrderLineItemFormattedOverridenPriceWithQuantity,getOrderLineItemFormattedPrice,getOrderLineItemFormattedPriceWithQuantity,getOrderLineItemFormattedTax,getOrderLineItemFormattedUnitPrice,getOrderLineItemOverridenPriceWithQuantity,getOrderLineItemPriceWithQuantity,getOrderLineItemRefundQuantity,getOrderLineItemTax,getOrderLineItemUnitPriceText,hasOrderLineItemDiscount,setOrderLineItemRefundQuantity}from"./functions/models/order/line-item/index.js";export{downloadFile,getOrderLineItemOptionValueFormattedPrice,getOrderLineOptionFileName}from"./functions/models/order/line-item/option/value/index.js";export{getIkasOrderLineVariantHref,getIkasOrderLineVariantMainImage}from"./functions/models/order/line-item/variant/index.js";export{getIkasOrderLineBundleVariantMainImage}from"./functions/models/order/line-item/variant/bundle-product/bundle-variant/index.js";export{getIkasOrderLineVariantNameSlug,getIkasOrderLineVariantTypeSlug}from"./functions/models/order/line-item/variant/value/index.js";export{getOrderTransactionFormattedAmount,getOrderTransactionPaymentMethodTranslation}from"./functions/models/order/transaction/index.js";export{getPaymentGatewayCalculatedAdditionalPrices}from"./functions/models/payment-gateway/index.js";export{initIkasPaymentGateway}from"./functions/models/payment-gateway/init.js";export{addIkasProductToFavorites,clearIkasProductCustomerReviewForm,getBundleProductFinalPrice,getBundleProductFinalPriceWithQuantity,getBundleProductFormattedFinalPrice,getBundleProductFormattedFinalPriceWithQuantity,getBundleProductFormattedSellPrice,getBundleProductFormattedSellPriceWithQuantity,getBundleProductSellPrice,getBundleProductSellPriceWithQuantity,getBundleProductsOfVariant,getDisplayedProductGroups,getDisplayedProductVariantTypes,getGroupedAttributeValues,getIkasProductCustomerReviewForm,getMainProductVariantType,getMainProductVariantValue,getProductAvailableStockLocations,getProductCampaigns,getProductCategoryPath,getProductFirstCategory,getProductHref,getProductOptionSet,getSelectedProductVariant,getSelectedProductVariantHref,hasProductStock,hasProductValidOptionValues,hasProductVariant,initBundleProducts,initProductOnBrowser,initProductOptionSet,isAddToCartEnabled,isBundleProductQuantityEditable,isCustomerReviewEnabled,isCustomerReviewLoginRequired,isFavoriteIkasProduct,refreshProductsPrices,removeIkasProductFromFavorites,selectVariantValue,setBundleProductQuantity,setOptionRealPrices,setProductOfBundleProduct,shouldDisplayBundleProductPrice,updateProductPrices}from"./functions/models/product/index.js";export{getProductFromStore,initIkasProduct,initIkasProductExtraFields,productVariantStore}from"./functions/models/product/init.js";export{clearProductListFilter,clearProductListFilters,enableProductListSuggestions,getProductListCurrencyCode,getProductListCurrencySymbol,getProductListFilterCategories,getProductListInitialData,getProductListNextPage,getProductListPage,getProductListPrevPage,getProductListSortOptions,getProductListSortTypeTranslation,getProductListSuggestionHref,getSelectedFilterValues,handleFilterValueClick,handleNumberRangeOptionClick,hasProductListAppliedFilters,hasProductListFeaturedSortEnabled,hasProductListNextPage,hasProductListPrevPage,initProductList,initProductListFilterCategories,initProductListOnBrowser,isProductListDiscounted,isProductListFilterable,isProductListFiltered,isProductListLastViewed,isProductListPurchasedTogether,isProductListRecommended,isProductListRelatedProducts,isProductListSearch,isProductListStatic,isProductListViewedTogether,onFilterCategoryClick,productListToggleFilterCollapsed,searchProductList,setProductListIsFilteredForProducts,setProductListIsStaticForProducts,setProductListVisiblePage,setSortType,translateProductListSortType,updateProductListPrices}from"./functions/models/product-list/index.js";export{getIkasProductAttributeProducts,getIkasProductAttributeTableValue,getIkasProductAttrributeProductIds}from"./functions/models/product/attribute-value/index.js";export{initIkasProductAttributeValue}from"./functions/models/product/attribute-value/init.js";export{applyQueryParamForFilter,clearFilter,filterParseRangeStr,filterRangeToId,filterToInput,getFilterDisplayedValues,getFilterKeyList,getFilterValueList,getIkasFilterHref,getIkasFilterThumbnailImage,initIkasProductFilter,isBoxFilter,isCustomValueFilter,isListFilter,isStockFilter,isSwatchFilter,onNumberRangeFilterChange,onNumberRangeFilterOptionClick,selectFilterValue}from"./functions/models/product/filter/index.js";export{getDisplayedOptions,hasDisplayedOptions,hasValidProductOptionSetValues,initOptionValues,initProductOptionSetValues,setChildOptions}from"./functions/models/product/option-set/index.js";export{initIkasProductOptionSet}from"./functions/models/product/option-set/init.js";export{clearValues,getDisplayedChildOptions,getProductOptionFormattedLabel,getProductOptionFormattedPrice,getTextValue,hasError,hasValidProductOptionValues,initIkasProductOptionValues,isCheckboxOption,isChecked,isChoiceOption,isChoiceOptionBoxType,isChoiceOptionSelectType,isChoiceOptionSwatchType,isColorPickerOption,isDatePickerOption,isFileOption,isImageOption,isProductOptionSelectValueSelected,isTextAreaOption,isTextOption,productOptionFileUpload,selectValue,setCheckboxValue,setTextValue,setValues}from"./functions/models/product/option-set/option/index.js";export{initIkasProductOption}from"./functions/models/product/option-set/option/init.js";export{clearProductVariantBackInStockForm,getGroupedAttributeValuesForVariant,getProductVariantAppliedCampaignAmount,getProductVariantB2bPriceRule,getProductVariantBackInStockForm,getProductVariantBundlePrice,getProductVariantCampaignOffersDiscountPercentage,getProductVariantCampaignPrice,getProductVariantDiscountAmount,getProductVariantDiscountPercentage,getProductVariantDiscountPrice,getProductVariantFinalPrice,getProductVariantFinalPriceWithCampaignOffers,getProductVariantFormattedBuyPrice,getProductVariantFormattedCampaignPrice,getProductVariantFormattedDiscountAmount,getProductVariantFormattedDiscountPrice,getProductVariantFormattedFinalPrice,getProductVariantFormattedFinalPriceWithCampaignOffers,getProductVariantFormattedSellPrice,getProductVariantFormattedSellPriceWithCampaignOffers,getProductVariantIsBackInStockCustomerLoginRequired,getProductVariantIsBackInStockEnabled,getProductVariantMainImage,getProductVariantPrice,getProductVariantSellPrice,getProductVariantSellPriceWithCampaignOffers,getProductVariantTieredDiscountProducts,getProductVariantUnitPriceText,hasBundleSettings,hasProductVariantDiscount,hasProductVariantStock,saveProductVariantBackInStockReminder}from"./functions/models/product/variant/index.js";export{initIkasProductVariant}from"./functions/models/product/variant/init.js";export{getIkasProductDiscountPercentage,getIkasProductPriceDiscountAmount,getIkasProductPriceFinalPrice,hasIkasProductPriceDiscount}from"./functions/models/product/variant/price/index.js";export{isRaffleAvailable}from"./functions/models/raffle/index.js";export{initIkasRaffle}from"./functions/models/raffle/init.js";export{initIkasState}from"./functions/models/state/init.js";export{getIkasVariantTypeSlug,isIkasVariantTypeColorSelection}from"./functions/models/variant-type/index.js";export{initIkasVariantType}from"./functions/models/variant-type/init.js";export{getIkasVariantValueSlug,getIkasVariantValueThumbnailImage,isColorVariantValue,isImageVariantValue,isTextVariantValue}from"./functions/models/variant-type/variant-value/index.js";export{FORM_ITEM_DEFAULT_VALUE,validateValue}from"./functions/models/validator/index.js";export{initAccountInfoForm,setAccountInfoFormFirstName,setAccountInfoFormIsMarketingAccepted,setAccountInfoFormLastName,setAccountInfoFormPhone,submitAccountInfoForm}from"./functions/models/validator/account-info/index.js";export{initAddressForm,setAddressFormAddressLine1,setAddressFormAddressLine2,setAddressFormCity,setAddressFormCompany,setAddressFormCountry,setAddressFormDistrict,setAddressFormFirstName,setAddressFormIdentityNumber,setAddressFormLastName,setAddressFormPhone,setAddressFormPostalCode,setAddressFormRegion,setAddressFormState,setAddressFormTaxNumber,setAddressFormTaxOffice,setAddressFormTitle,submitAddressForm}from"./functions/models/validator/address/index.js";export{initBackInStockNotificationForm,setBackInStockNotificationFormEmail,submitBackInStockNotificationForm}from"./functions/models/validator/back-in-stock-notification/index.js";export{initContactForm,setContactFormEmail,setContactFormFirstName,setContactFormLastName,setContactFormMessage,setContactFormPhone,submitContactForm}from"./functions/models/validator/contact-form/index.js";export{initCouponCodeForm,removeCouponCodeForm,setCouponCodeFormCouponCode,submitCouponCodeForm}from"./functions/models/validator/coupon-code-form/index.js";export{initCustomerReviewForm,setCustomerReviewFormComment,setCustomerReviewFormStar,setCustomerReviewFormTitle,submitCustomerReviewForm}from"./functions/models/validator/customer-review/index.js";export{initDeactivateCustomerForm,setDeactivateCustomerFormPassword,submitDeactivateCustomerForm}from"./functions/models/validator/deactivate-customer/index.js";export{initForgotPasswordForm,setForgotPasswordFormEmail,submitForgotPasswordForm}from"./functions/models/validator/forgot-password/index.js";export{initLoginForm,setLoginFormEmail,setLoginFormPassword,submitLoginForm}from"./functions/models/validator/login/index.js";export{initNewsletterSubscriptionForm,setNewsletterSubscriptionFormEmail,setNewsletterSubscriptionFormIsMarketingAccepted,submitNewsletterSubscriptionForm}from"./functions/models/validator/newsletter-subscription/index.js";export{initOrderTrackingForm,setOrderTrackingFormEmail,setOrderTrackingFormOrderNumber,submitOrderTrackingForm}from"./functions/models/validator/order-tracking/index.js";export{initRecoverPasswordForm,setRecoverPasswordFormPassword,setRecoverPasswordFormPasswordAgain,submitRecoverPasswordForm}from"./functions/models/validator/recover-password/index.js";export{initRegisterForm,setRegisterFormBooleanAttribute,setRegisterFormChoiceAttribute,setRegisterFormDateAttribute,setRegisterFormDateTimeAttribute,setRegisterFormEmail,setRegisterFormFirstName,setRegisterFormIsMarketingAccepted,setRegisterFormIsMembershipAgreementAccepted,setRegisterFormLastName,setRegisterFormMultipleChoiceAttribute,setRegisterFormNumericAttribute,setRegisterFormPassword,setRegisterFormPhone,setRegisterFormTextAttribute,submitRegisterForm}from"./functions/models/validator/register/index.js";export{initSmsLoginForm,resendSmsLoginFormCode,setSmsLoginFormCode,setSmsLoginFormEmail,setSmsLoginFormFirstName,setSmsLoginFormIsMarketingAccepted,setSmsLoginFormIsMembershipAgreementAccepted,setSmsLoginFormLastName,setSmsLoginFormPhone,submitSmsLoginForm}from"./functions/models/validator/sms-login/index.js";export{initVerifyPhoneNumberForm,resendVerifyPhoneNumberFormCode,setVerifyPhoneNumberFormCode,submitVerifyPhoneNumberForm}from"./functions/models/validator/verify-phone-number/index.js";export{collectionToArray}from"./functions/others/index.js";export{bs_searchProductById,bs_searchProductsById,initBaseStore,setLanguage,setLocalization}from"./functions/stores/base/index.js";export{addItemToCart,addSelectedtedVariantToCart,changeCartItemQuantity,changeItemQuantity,createPayWithIkasSession,findExistingCartItem,findExistingCartItemWithProduct,getAcceptedOffers,getCart,getCheckoutUrlFromCartStore,hasCart,isOrderLineItemAutoCreated,removeCart,removeCouponCode,removeGiftCardLine,removeItem,saveCouponCode,setCart,waitForCartStoreInit,windowAddToCart}from"./functions/stores/cart/index.js";export{MILES_SMILES_PAYMENT_GATEWAY_CODE,MILES_SMILES_PAYMENT_GATEWAY_ID,MILES_SMILES_PROVIDER,activateCustomer,addProductToFavorites,canCustomerCreateEmailSubscription,checkEmail,clearAccountInfoForm,clearContactForm,clearCouponCodeForm,clearCustomerSession,clearDeactivateCustomerForm,clearForgotPasswordForm,clearLoginForm,clearNewsletterSubscriptionForm,clearOrderTrackingForm,clearRecoverPasswordForm,clearRegisterForm,closeIkasStorefrontWidget,createEmailSubscription,createRefundRequest,cs_getLoyaltyCustomerInfo,cs_listEarningMethods,cs_listLoyaltyProgramPointHistory,cs_listLoyaltyProgramTiers,cs_listSpendingMethodsByCartId,cs_removeLoyaltyPointsFromCart,cs_useLoyaltyPoints,customerLogin,customerStore_onProductView,customerToAnalyticsCustomer,deactivateCustomer,deleteCustomerAddress,exportCustomerPersonalData,forgotPassword,getAccountInfoForm,getContactForm,getCouponCodeForm,getCustomerAttributes,getCustomerConsentGranted,getDeactivateCustomerForm,getDigitalProductFileDownloadUrl,getEmptyAddressForm,getFavoriteProducts,getFavoriteProductsIds,getForgotPasswordForm,getLastViewedProducts,getLoginForm,getMilesSmilesDetails,getMilesSmilesLink,getNewsletterSubscriptionForm,getOrder,getOrderByEmail,getOrderDetailsOfPage,getOrderProductFiles,getOrderRefundSettings,getOrderTrackingForm,getOrderTransactions,getOrders,getRecoverPasswordForm,getRegisterForm,getSmsLoginForm,getVerifyPhoneNumberForm,handleCustomerConsentGrant,handleMilesSmilesBind,handleSocialLogin,hasCustomer,initCustomerStore,isFavoriteProduct,isMilesSmilesTransaction,logout,milesSmilesBind,openIkasStorefrontWidget,recoverPassword,refundOrder,register,removeCustomerConsent,removeProductFromFavorites,resendCustomerActivationMail,resendCustomerPhoneVerificationCode,saveContactForm,saveCustomer,saveCustomerFormData,seedCustomerSession,sendReview,setCaptchaToken,setSavedLastViewedProductsResponse,socialLogin,socialLoginToken,unlinkMilesSmiles,validateCustomerPhoneVerificationCode,validateOTPCode,waitForCaptchaTokenInit,waitForCustomerStoreInit}from"./functions/stores/customer/index.js";export{I18n,i18n}from"./i18n/index.js";export{Router,router,withRoutePrefix}from"./router/index.js";export{baseStore}from"./stores/base/index.js";export{CART_LS_KEY,cartStore}from"./stores/cart/index.js";export{customerStore}from"./stores/customer/index.js";export{getThemeBreakpoints,getThemeColorSchemes,getThemeColors,getThemeKeyframes,getThemeSetting,getThemeSettingValue,getThemeSettings,getThemeTypography,registerThemeSettingValues}from"./theme/settings/index.js";export{DYNAMIC_STYLE_PROPERTIES,SIZE_PROPERTIES,getFormattedBorder,getFormattedBorderRadiusBottomLeftSize,getFormattedBorderRadiusBottomRightSize,getFormattedBorderRadiusSize,getFormattedBorderRadiusTopLeftSize,getFormattedBorderRadiusTopRightSize,getFormattedBorderWidthSizeSize,getFormattedBottomSize,getFormattedFontSize,getFormattedGapSize,getFormattedGridTemplateColumns,getFormattedHeightSize,getFormattedLeftSize,getFormattedLetterSpacingSize,getFormattedLineHeightSize,getFormattedMarginBottomSize,getFormattedMarginLeftSize,getFormattedMarginRightSize,getFormattedMarginTopSize,getFormattedMaxHeightSize,getFormattedMaxWidthSize,getFormattedMinHeightSize,getFormattedMinWidthSize,getFormattedPaddingBottomSize,getFormattedPaddingLeftSize,getFormattedPaddingMarginSize,getFormattedPaddingRightSize,getFormattedPaddingSize,getFormattedPaddingTopSize,getFormattedRightSize,getFormattedShadow,getFormattedSize,getFormattedStyleVariable,getFormattedTopSize,getFormattedWidthSize}from"./theme/styles/index.js";export{isBrowser,isDefined,isEmpty,isNotEmpty}from"./utils/blueprint.js";export{IkasComponentRenderer}from"./utils/component-renderer.js";export{formatCurrency}from"./utils/currency.js";export{HttpMethod,get,httpRequest,post}from"./utils/fetch.js";export{JsObject}from"./utils/object-wrapper.js";export{PayWithIkas}from"./utils/pay-with-ikas.js";export{normalizeSvg}from"./utils/svg.js";export{setAPIClientConfig}from"./packages/storefront-api/src/index.js";export{IkasStorefrontConfig,escapeForJSON,unescapeFromJSON}from"./packages/storefront-config/src/index.js";import"./packages/storefront-models/src/models/merchant-settings/index.js";export{default as IkasAPIClientConfig}from"./packages/storefront-api-client/src/config/index.js";export{anl_addToCart}from"./analytics/analytics-functions/addToCart.js";export{anl_addToWishlist}from"./analytics/analytics-functions/addToWishlist.js";export{anl_completeRegistration}from"./analytics/analytics-functions/completeRegistration.js";export{anl_contactForm}from"./analytics/analytics-functions/contactForm.js";export{anl_createEmailSubscription}from"./analytics/analytics-functions/createEmailSubscription.js";export{anl_customerLogin}from"./analytics/analytics-functions/customerLogin.js";export{anl_customerLogout}from"./analytics/analytics-functions/customerLogout.js";export{anl_customerVisit}from"./analytics/analytics-functions/customerVisit.js";export{anl_pageView}from"./analytics/analytics-functions/pageView.js";export{anl_productView}from"./analytics/analytics-functions/productView.js";export{anl_removeFromCart}from"./analytics/analytics-functions/removeFromCart.js";export{anl_search}from"./analytics/analytics-functions/search.js";export{anl_viewBrand}from"./analytics/analytics-functions/viewBrand.js";export{anl_viewCart}from"./analytics/analytics-functions/viewCart.js";export{anl_viewCategory}from"./analytics/analytics-functions/viewCategory.js";export{anl_viewListing}from"./analytics/analytics-functions/viewListing.js";export{anl_viewSearchResults}from"./analytics/analytics-functions/viewSearchResults.js";export{anl_viewStorefrontPopup}from"./analytics/analytics-functions/viewStorefrontPopup.js";import*as e from'./ext/animejs/lib/anime.esm.js';export{e as AnimeJS};export{cloneDeep,reaction}from"./utils/helper.js";export{APIErrorCode,APIResponse}from"./packages/storefront-api-client/src/utils/api.js";export{EMPTY_THEME_GLOBALS,breakpointCssToken,cssVarCamelCase,cssVarRef,isReservedVariableId,rawClassRef,resolveBreakpointMediaTokens,serializeThemeGlobals,toResolverBreakpoints}from"./packages/storefront-config/src/theme-globals.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "2.11.1",
3
+ "version": "2.13.0",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",