@ikas/bp-storefront 1.4.0-beta.23 → 1.4.0-beta.230

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/analytics/analytics-functions/addToCart.js +1 -1
  2. package/dist/analytics/analytics-functions/addToWishlist.js +1 -1
  3. package/dist/analytics/analytics-functions/completeRegistration.js +1 -1
  4. package/dist/analytics/analytics-functions/contactForm.js +1 -1
  5. package/dist/analytics/analytics-functions/createEmailSubscription.js +1 -1
  6. package/dist/analytics/analytics-functions/customerLogin.js +1 -1
  7. package/dist/analytics/analytics-functions/customerLogout.js +1 -1
  8. package/dist/analytics/analytics-functions/customerVisit.js +1 -1
  9. package/dist/analytics/analytics-functions/pageView.js +1 -1
  10. package/dist/analytics/analytics-functions/productView.js +1 -1
  11. package/dist/analytics/analytics-functions/removeFromCart.js +1 -1
  12. package/dist/analytics/analytics-functions/search.js +1 -1
  13. package/dist/analytics/analytics-functions/viewBrand.js +1 -1
  14. package/dist/analytics/analytics-functions/viewCart.js +1 -1
  15. package/dist/analytics/analytics-functions/viewCategory.js +1 -1
  16. package/dist/analytics/analytics-functions/viewListing.js +1 -1
  17. package/dist/analytics/analytics-functions/viewSearchResults.js +1 -1
  18. package/dist/analytics/analytics-functions/viewStorefrontPopup.js +1 -1
  19. package/dist/analytics/events.d.ts +8 -0
  20. package/dist/analytics/events.js +1 -1
  21. package/dist/analytics/ikas/analytics.js +1 -1
  22. package/dist/analytics/openai/addToCart.d.ts +2 -0
  23. package/dist/analytics/openai/addToCart.js +1 -0
  24. package/dist/analytics/openai/completeRegistration.d.ts +1 -0
  25. package/dist/analytics/openai/completeRegistration.js +1 -0
  26. package/dist/analytics/openai/contactForm.d.ts +1 -0
  27. package/dist/analytics/openai/contactForm.js +1 -0
  28. package/dist/analytics/openai/initAdvancedMatching.d.ts +12 -0
  29. package/dist/analytics/openai/initAdvancedMatching.js +1 -0
  30. package/dist/analytics/openai/pageView.d.ts +1 -0
  31. package/dist/analytics/openai/pageView.js +1 -0
  32. package/dist/analytics/openai/productView.d.ts +2 -0
  33. package/dist/analytics/openai/productView.js +1 -0
  34. package/dist/analytics/openai/utils.d.ts +26 -0
  35. package/dist/analytics/openai/utils.js +1 -0
  36. package/dist/analytics/utils.d.ts +1 -0
  37. package/dist/analytics/utils.js +1 -1
  38. package/dist/functions/api/cart/index.d.ts +2 -0
  39. package/dist/functions/api/cart/index.js +1 -1
  40. package/dist/functions/api/customer/index.d.ts +12 -2
  41. package/dist/functions/api/customer/index.js +1 -1
  42. package/dist/functions/api/loyalty/index.d.ts +2 -1
  43. package/dist/functions/api/loyalty/index.js +1 -1
  44. package/dist/functions/api/product/index.js +1 -1
  45. package/dist/functions/models/attribute-detail/index.d.ts +3 -0
  46. package/dist/functions/models/attribute-list/index.d.ts +3 -0
  47. package/dist/functions/models/image/index.d.ts +71 -21
  48. package/dist/functions/models/image/index.js +1 -1
  49. package/dist/functions/models/index.d.ts +1 -0
  50. package/dist/functions/models/order/index.d.ts +139 -4
  51. package/dist/functions/models/order/index.js +1 -1
  52. package/dist/functions/models/product/attribute-value/index.d.ts +5 -0
  53. package/dist/functions/models/product/index.d.ts +22 -0
  54. package/dist/functions/models/product/index.js +1 -1
  55. package/dist/functions/models/product/variant/index.d.ts +96 -6
  56. package/dist/functions/models/product/variant/index.js +1 -1
  57. package/dist/functions/models/product-list/index.d.ts +21 -0
  58. package/dist/functions/models/product-list/index.js +1 -1
  59. package/dist/functions/models/validator/address/index.d.ts +70 -2
  60. package/dist/functions/models/validator/deactivate-customer/index.d.ts +54 -0
  61. package/dist/functions/models/validator/deactivate-customer/index.js +1 -0
  62. package/dist/functions/stores/base/index.d.ts +75 -0
  63. package/dist/functions/stores/base/index.js +1 -1
  64. package/dist/functions/stores/cart/index.d.ts +46 -2
  65. package/dist/functions/stores/cart/index.js +1 -1
  66. package/dist/functions/stores/customer/index.d.ts +349 -29
  67. package/dist/functions/stores/customer/index.js +1 -1
  68. package/dist/i18n/ikas-texts.d.ts +425 -0
  69. package/dist/i18n/index.d.ts +19 -0
  70. package/dist/index.d.ts +5 -1
  71. package/dist/index.js +1 -1
  72. package/dist/packages/storefront-api/src/__api/mutations/removeGiftCardFromCart.js +1 -0
  73. package/dist/packages/storefront-api/src/__api/mutations/unlinkExternalAccount.js +1 -0
  74. package/dist/packages/storefront-api/src/__api/queries/getExternalAccountLink.js +1 -0
  75. package/dist/packages/storefront-api/src/__api/queries/getLoyaltyProgram.js +1 -0
  76. package/dist/packages/storefront-api/src/__api/queries/getMilesSmilesDetails.js +1 -0
  77. package/dist/packages/storefront-api/src/__api/queries/getRefundableLines.js +1 -0
  78. package/dist/packages/storefront-api/src/__api/queries/listOrderTransactionsWithPrices.js +1 -0
  79. package/dist/packages/storefront-api-client/src/utils/api.js +1 -1
  80. package/dist/packages/storefront-config/src/index.js +1 -1
  81. package/dist/packages/storefront-config/src/theme-globals.js +1 -0
  82. package/dist/router/index.d.ts +28 -0
  83. package/dist/router/index.js +1 -1
  84. package/dist/storefront-api/src/__api/mutations/removeGiftCardFromCart.d.ts +7 -0
  85. package/dist/storefront-api/src/__api/mutations/unlinkExternalAccount.d.ts +6 -0
  86. package/dist/storefront-api/src/__api/queries/getExternalAccountLink.d.ts +6 -0
  87. package/dist/storefront-api/src/__api/queries/getLoyaltyProgram.d.ts +3 -0
  88. package/dist/storefront-api/src/__api/queries/getMilesSmilesDetails.d.ts +3 -0
  89. package/dist/storefront-api/src/__api/queries/getRefundableLines.d.ts +6 -0
  90. package/dist/storefront-api/src/__api/queries/listOrderTransactionsWithPrices.d.ts +6 -0
  91. package/dist/storefront-api/src/__api/types/index.d.ts +101 -6
  92. package/dist/storefront-api-client/src/utils/api.d.ts +7 -0
  93. package/dist/storefront-config/src/index.d.ts +32 -0
  94. package/dist/storefront-config/src/theme-globals.d.ts +349 -0
  95. package/dist/storefront-models/src/index.d.ts +8 -0
  96. package/dist/storefront-models/src/models/blueprint/prop-value/attribute-list.d.ts +2 -0
  97. package/dist/storefront-models/src/models/blueprint/prop-value/attribute.d.ts +2 -0
  98. package/dist/storefront-models/src/models/blueprint/prop-value/color.d.ts +2 -0
  99. package/dist/storefront-models/src/models/blueprint/prop-value/index.d.ts +1 -0
  100. package/dist/storefront-models/src/models/blueprint/prop-value/link.d.ts +10 -0
  101. package/dist/storefront-models/src/models/blueprint/prop-value/variable-binding.d.ts +16 -0
  102. package/dist/storefront-models/src/models/image/index.d.ts +7 -0
  103. package/dist/storefront-models/src/models/loyalty-program/customer-info/index.d.ts +2 -0
  104. package/dist/storefront-models/src/models/loyalty-program/earning-method/index.d.ts +1 -0
  105. package/dist/storefront-models/src/models/loyalty-program/index.d.ts +1 -0
  106. package/dist/storefront-models/src/models/loyalty-program/point-history/index.d.ts +1 -0
  107. package/dist/storefront-models/src/models/order/gift-card-line/index.d.ts +15 -0
  108. package/dist/storefront-models/src/models/order/index.d.ts +10 -0
  109. package/dist/storefront-models/src/models/order/line-item/index.d.ts +6 -1
  110. package/dist/storefront-models/src/models/order/package/index.d.ts +1 -1
  111. package/dist/storefront-models/src/models/order/refund/reason/index.d.ts +6 -0
  112. package/dist/storefront-models/src/models/order/refund/reason/translation/index.d.ts +4 -0
  113. package/dist/storefront-models/src/models/order/refund/refundable-line/index.d.ts +8 -0
  114. package/dist/storefront-models/src/models/order/refund/refundable-lines/index.d.ts +8 -0
  115. package/dist/storefront-models/src/models/order/refund/settings/translation/index.d.ts +4 -0
  116. package/dist/storefront-models/src/models/payment-gateway/index.d.ts +3 -1
  117. package/dist/storefront-models/src/models/product/attribute/index.d.ts +6 -1
  118. package/dist/storefront-models/src/models/product/campaign/data/index.d.ts +2 -0
  119. package/dist/storefront-models/src/models/product/campaign/filter/index.d.ts +1 -1
  120. package/dist/storefront-models/src/models/product/campaign/product-tiered-discount/index.d.ts +13 -0
  121. package/dist/storefront-models/src/models/product/image/index.d.ts +5 -0
  122. package/dist/storefront-models/src/models/product/variant/index.d.ts +17 -0
  123. package/dist/storefront-models/src/models/storefront/index.d.ts +1 -0
  124. package/dist/storefront-models/src/models/validator/deactivate-customer/index.d.ts +4 -0
  125. package/dist/stores/customer/index.d.ts +2 -1
  126. package/dist/stores/customer/index.js +1 -1
  127. package/dist/theme/settings/index.d.ts +51 -0
  128. package/dist/theme/settings/index.js +1 -0
  129. package/dist/utils/component-renderer.js +1 -1
  130. package/dist/utils/currency.d.ts +36 -3
  131. package/dist/utils/helper.d.ts +1 -0
  132. package/dist/utils/helper.js +1 -1
  133. package/dist/utils/pay-with-ikas.d.ts +552 -0
  134. package/dist/utils/pay-with-ikas.js +1 -0
  135. package/dist/utils/svg.d.ts +15 -0
  136. package/dist/utils/svg.js +1 -0
  137. package/package.json +2 -2
@@ -10,4 +10,9 @@ export type IkasProductAttribute = {
10
10
  tableTemplate: IkasProductAttributeTableTemplate | null;
11
11
  translations?: IkasProductAttributeTranslation[] | null;
12
12
  };
13
- export type IkasProductAttributeType = "CHOICE" | "MULTIPLE_CHOICE" | "TEXT" | "BOOLEAN" | "NUMERIC" | "DATETIME" | "HTML" | "TABLE" | "IMAGE" | "PRODUCT";
13
+ /**
14
+ * Mirror of the API's `ProductAttributeTypeEnum` (see storefront-api `__api/types`). The API value is
15
+ * force-cast into this union when products are mapped (`functions/api/product`), so a value missing
16
+ * here still arrives at runtime — it just stops being visible to the compiler. Keep both lists in sync.
17
+ */
18
+ export type IkasProductAttributeType = "CHOICE" | "MULTIPLE_CHOICE" | "COLOR_THUMBNAIL_MULTIPLE_CHOICE" | "TEXT" | "BOOLEAN" | "NUMERIC" | "DATE" | "DATETIME" | "HTML" | "TABLE" | "IMAGE" | "PRODUCT";
@@ -1,6 +1,7 @@
1
1
  import { IkasProductBuyXThenGetY } from "../product-buyx-then-gety";
2
2
  import { IkasProductCampaignDateRangeField } from "../product-campaign-date-range-field";
3
3
  import { IkasProductFixedDiscount } from "../product-fixed-discount";
4
+ import { IkasProductTieredDiscount } from "../product-tiered-discount";
4
5
  export type IkasProductCampaignData = {
5
6
  applicableCustomerGroupIds: string[] | null;
6
7
  applicableCustomerIds: string[] | null;
@@ -21,6 +22,7 @@ export type IkasProductCampaignData = {
21
22
  usageCount: number;
22
23
  usageLimit: number | null;
23
24
  usageLimitPerCustomer: number | null;
25
+ tieredDiscount: IkasProductTieredDiscount | null;
24
26
  };
25
27
  export type IkasCampaignApplicablePrice = "DISCOUNT_PRICE" | "SELL_PRICE";
26
28
  export type IkasCampaignCreatedFor = "ABANDONED_CHECKOUT" | "CART" | "CUSTOMER_REVIEW";
@@ -2,4 +2,4 @@ export type IkasProductCampaignFilter = {
2
2
  idList: string[];
3
3
  type: IkasCampaignFilterType;
4
4
  };
5
- export type IkasCampaignFilterType = "CATEGORY" | "PRODUCT" | "PRODUCT_BRAND" | "PRODUCT_TAG" | "VARIANT";
5
+ export type IkasCampaignFilterType = "CATEGORY" | "PRODUCT" | "PRODUCT_BRAND" | "PRODUCT_TAG" | "VARIANT" | "PRODUCT_AND_VARIANT";
@@ -0,0 +1,13 @@
1
+ import { IkasProductCampaignFilter } from "../filter";
2
+ import { IkasCampaignMinMaxRangeField } from "../product-fixed-discount";
3
+ export type IkasProductTieredDiscountRule = {
4
+ amount: number | null;
5
+ lineItemQuantityRange: IkasCampaignMinMaxRangeField | null;
6
+ priceRange: IkasCampaignMinMaxRangeField | null;
7
+ };
8
+ export type IkasProductTieredDiscount = {
9
+ filters: IkasProductCampaignFilter[] | null;
10
+ isApplyByCartAmount: boolean | null;
11
+ rules: IkasProductTieredDiscountRule[];
12
+ shouldMatchAllConditions: boolean | null;
13
+ };
@@ -3,6 +3,11 @@ export type IkasProductImage = {
3
3
  fileName: string | null;
4
4
  imageId: string | null;
5
5
  isMain: boolean;
6
+ /**
7
+ * True when this media item is a VIDEO, not an image. Product galleries, cards, swatches and
8
+ * line items must branch on it: render <video src={getDefaultSrc(item.image)}> instead of an
9
+ * <img>, otherwise the .mp4 URL lands in an <img> and the media breaks.
10
+ */
6
11
  isVideo: boolean | null;
7
12
  order: number;
8
13
  image?: IkasImage | null;
@@ -29,3 +29,20 @@ export type IkasAppliedCampaignAmount = {
29
29
  formattedPrice: string | null;
30
30
  discountPercentage: string | null;
31
31
  };
32
+ export type IkasTieredDiscountProduct = {
33
+ amount: number | null;
34
+ lineItemQuantityRange: {
35
+ min: number;
36
+ max: number;
37
+ };
38
+ type: IkasCampaignType;
39
+ sellPrice: number;
40
+ finalPrice: number;
41
+ sellPriceWithQuantity: number;
42
+ finalPriceWithQuantity: number;
43
+ formattedSellPrice: string;
44
+ formattedSellPriceWithQuantity: string;
45
+ formattedFinalPrice: string;
46
+ formattedFinalPriceWithQuantity: string;
47
+ salesChannelIds: string[] | null;
48
+ };
@@ -20,6 +20,7 @@ export type IkasStorefront = {
20
20
  analytics4Id: string | null;
21
21
  universalAnalyticsId: string | null;
22
22
  tiktokPixelId: string | null;
23
+ openAiPixelId?: string | null;
23
24
  token: string | null;
24
25
  type: IkasStorefrontType;
25
26
  metaTemplates: IkasStorefontMetaTemplates[] | null;
@@ -0,0 +1,4 @@
1
+ import { IkasForm, IkasFormItem } from "..";
2
+ export type DeactivateCustomerForm = {
3
+ password: IkasFormItem;
4
+ } & IkasForm;
@@ -1,6 +1,6 @@
1
1
  import { ProductFacetCount, SearchProduct } from "../../storefront-api/src";
2
2
  import { APIResponse } from "../../storefront-api-client/src";
3
- import { AccountInfoForm, AddressForm, BackInStockNotificationForm, ContactForm, CouponCodeForm, CustomerReviewForm, ForgotPasswordForm, IkasCustomer, IkasFavoriteProduct, IkasLastViewedProduct, IkasOrderRefundSettings, IkasProduct, LoginForm, NewsletterSubscriptionForm, OrderTrackingForm, RecoverPasswordForm, RegisterForm, SmsLoginForm, VerifyPhoneNumberForm } from "../../storefront-models/src";
3
+ import { AccountInfoForm, AddressForm, BackInStockNotificationForm, ContactForm, CouponCodeForm, CustomerReviewForm, DeactivateCustomerForm, ForgotPasswordForm, IkasCustomer, IkasFavoriteProduct, IkasLastViewedProduct, IkasOrderRefundSettings, IkasProduct, LoginForm, NewsletterSubscriptionForm, OrderTrackingForm, RecoverPasswordForm, RegisterForm, SmsLoginForm, VerifyPhoneNumberForm } from "../../storefront-models/src";
4
4
  export type IkasCustomerStore = {
5
5
  customer: IkasCustomer | null;
6
6
  _token: string | null;
@@ -19,6 +19,7 @@ export type IkasCustomerStore = {
19
19
  _contactForm: ContactForm | null;
20
20
  _couponCodeForm: CouponCodeForm | null;
21
21
  _customerReviewForms: Record<string, CustomerReviewForm>;
22
+ _deactivateCustomerForm: DeactivateCustomerForm | null;
22
23
  _forgotPasswordForm: ForgotPasswordForm | null;
23
24
  _loginForm: LoginForm | null;
24
25
  _smsLoginForm: SmsLoginForm | null;
@@ -1 +1 @@
1
- import{observable as o}from'./../../ext/mobx/dist/mobx.esm.js';var r=o({customer:null,_token:null,_tokenExpiry:null,_initialized:!1,_visitorSubscribedEmail:!1,_lastViewedProducts:[],_customerConsentGranted:!1,_refundSettings:null,_captchaToken:null,_savedLastViewedProducts:[],_savedLastViewedProductsResponse:null,_accountInfoForm:null,_addressForms:{},_backInStockForms:{},_contactForm:null,_couponCodeForm:null,_customerReviewForms:{},_forgotPasswordForm:null,_loginForm:null,_smsLoginForm:null,_verifyPhoneNumberForm:null,_newsletterSubscriptionForm:null,_orderTrackingForm:null,_recoverPasswordForm:null,_registerForm:null,_favoriteProducts:[],_isFavoriteProductsLoaded:!1});export{r as customerStore};
1
+ import{observable as o}from'./../../ext/mobx/dist/mobx.esm.js';var r=o({customer:null,_token:null,_tokenExpiry:null,_initialized:!1,_visitorSubscribedEmail:!1,_lastViewedProducts:[],_customerConsentGranted:!1,_refundSettings:null,_captchaToken:null,_savedLastViewedProducts:[],_savedLastViewedProductsResponse:null,_accountInfoForm:null,_addressForms:{},_backInStockForms:{},_contactForm:null,_couponCodeForm:null,_customerReviewForms:{},_deactivateCustomerForm:null,_forgotPasswordForm:null,_loginForm:null,_smsLoginForm:null,_verifyPhoneNumberForm:null,_newsletterSubscriptionForm:null,_orderTrackingForm:null,_recoverPasswordForm:null,_registerForm:null,_favoriteProducts:[],_isFavoriteProductsLoaded:!1});export{r as customerStore};
@@ -0,0 +1,51 @@
1
+ import { RuntimeBreakpointToken, RuntimeDesignToken, RuntimeKeyframeToken, RuntimeThemeColorSchemes, RuntimeTypographyToken, ThemeSetting } from "../../storefront-config/src";
2
+ /**
3
+ * Register the live global-variable object (`_g_`) so `getThemeSetting`/`getThemeSettings`
4
+ * return actual runtime values (constants, computed getters, and in-editor edits) instead
5
+ * of the serialized design-time defaults. Called by generated code, not by component authors.
6
+ */
7
+ export declare function registerThemeSettingValues(values: Record<string, any> | null): void;
8
+ /** All global variables (Theme Settings) defined for the theme. */
9
+ export declare function getThemeSettings(): ThemeSetting[];
10
+ /**
11
+ * A single global variable by its stable key (`variableName`, e.g. `_6Q0KV7VGGM`).
12
+ * Discover keys via {@link getThemeSettings} (each item carries a human `displayName`).
13
+ * The returned `value` is the live blueprint value when available, else the default.
14
+ * Its shape is discriminated by `type` (see {@link ThemeSetting.value}); note an
15
+ * IMAGE setting's value is an image REFERENCE (no `.url`) — resolve with
16
+ * `getDefaultSrc`/`getSrc`. An ENUM setting's `value` is one of its enum's option VALUES
17
+ * (or null) and the setting also carries `enumTypeId` and `options` (`{ label: value }`);
18
+ * in a code component prefer the typed `themeValue("_key")` from `./global-types`, which
19
+ * narrows the value to the enum's union.
20
+ */
21
+ export declare function getThemeSetting(name: string): ThemeSetting | undefined;
22
+ /** Convenience: the resolved value of a global variable, or `undefined` if not found. */
23
+ export declare function getThemeSettingValue(name: string): any;
24
+ /** Theme color tokens. Each carries a resolved value and a `var(--id)` CSS reference. */
25
+ export declare function getThemeColors(): RuntimeDesignToken[];
26
+ /** Theme typography tokens (text styles). Apply `className` or read `resolved` CSS values. */
27
+ export declare function getThemeTypography(): RuntimeTypographyToken[];
28
+ /** Theme responsive breakpoints (`{ id, width }`). */
29
+ export declare function getThemeBreakpoints(): RuntimeBreakpointToken[];
30
+ /** Theme keyframe/transition animations. Use `ref` as the CSS animation name. */
31
+ export declare function getThemeKeyframes(): RuntimeKeyframeToken[];
32
+ /**
33
+ * Theme color schemes (palettes). Returns two PARALLEL lists with different jobs:
34
+ * - `schemes`: the color SLOTS as `{ id }` only — no colors and no display label live here at
35
+ * runtime. A slot's human name is authoring-only (read it via the CLI/MCP `list-theme-globals`
36
+ * or the editor); at runtime identify a slot solely by its `id`.
37
+ * - `values`: the actual palettes. A palette's colors live in its `colorsByScheme`
38
+ * map, keyed by slot id → `{ resolved, cssVar }`.
39
+ *
40
+ * To render swatches, iterate `values[].colorsByScheme` (the source of truth for
41
+ * colors), NOT the top-level `schemes` array — `schemes` carries slot ids only, so
42
+ * iterating it renders empty:
43
+ *
44
+ * const { values } = getThemeColorSchemes();
45
+ * values.forEach(palette =>
46
+ * Object.entries(palette.colorsByScheme).forEach(([slotId, { resolved, cssVar }]) => {
47
+ * // slotId → stable slot key, cssVar → live var() ref (prefer this), resolved → hex snapshot
48
+ * })
49
+ * );
50
+ */
51
+ export declare function getThemeColorSchemes(): RuntimeThemeColorSchemes;
@@ -0,0 +1 @@
1
+ import{__assign as o}from'./../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as l}from"../../packages/storefront-config/src/index.js";var n=null;function e(o){n=o}function i(l){return n&&l.name in n?o(o({},l),{value:n[l.name]}):l}function r(){var o,n;return Object.values(null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.settings)&&void 0!==n?n:{}).map(i)}function t(o){var n,e,r=null===(e=null===(n=l.themeGlobals)||void 0===n?void 0:n.settings)||void 0===e?void 0:e[o];return r?i(r):void 0}function u(o){var l;return null===(l=t(o))||void 0===l?void 0:l.value}function v(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.colors)&&void 0!==n?n:[]}function s(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.typography)&&void 0!==n?n:[]}function a(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.breakpoints)&&void 0!==n?n:[]}function d(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.keyframes)&&void 0!==n?n:[]}function m(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.colorSchemes)&&void 0!==n?n:{schemes:[],values:[]}}export{a as getThemeBreakpoints,m as getThemeColorSchemes,v as getThemeColors,d as getThemeKeyframes,t as getThemeSetting,u as getThemeSettingValue,r as getThemeSettings,s as getThemeTypography,e as registerThemeSettingValues};
@@ -1 +1 @@
1
- import{__assign as r}from'./../ext/tslib/tslib.es6.mjs.js';import{createElement as t}from'./../ext/preact/dist/preact.mjs.js';import{useRef as n,useEffect as e,useMemo as o}from'./../ext/preact/hooks/dist/hooks.mjs.js';var c={};function u(r,t){for(var n=[],e=r;e;){var o=e.getAttribute("id");o&&n.unshift(o),e=e.parentElement}var c=n.map(function(r){return'[id="'.concat(r,'"]')}).join(" ");return c?"".concat(c,' [id="').concat(t,'"]'):'[id="'.concat(t,'"]')}function a(a){var s=a.id,i=a.components,f=a.style,l=a.className,m=a.parentProps,d=void 0===m?c:m,p=a.map,v=void 0===p?c:p,h=n([]),j=n(d),y=n(v),g=n(null);j.current=d,y.current=v,e(function(){if(i&&0!==i.length){h.current.forEach(function(r){return r()}),h.current=[];for(var t=0;t<i.length;t++){var n=i[t];if(n.l){var e="".concat(s,"-").concat(t),o=u(g.current,e),c=n.l(o,r(r({},j.current),y.current),{},{id:e,key:e});"function"==typeof c&&h.current.push(c)}}return function(){h.current.forEach(function(r){return r()}),h.current=[]}}},[i,s]);var E=o(function(){return i&&0!==i.length?i.map(function(t,n){var e="".concat(s,"-").concat(n);return t.r(r(r({},j.current),y.current),{},{id:e,key:e})}).join(""):""},[i,s]);return i&&0!==i.length?t("div",{id:s,ref:g,dangerouslySetInnerHTML:{__html:E},style:r({display:"contents"},f),className:l}):null}export{a as IkasComponentRenderer};
1
+ import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{createElement as r}from'./../ext/preact/dist/preact.mjs.js';import{useRef as n,useMemo as e,useEffect as c}from'./../ext/preact/hooks/dist/hooks.mjs.js';var o={},a="data-ikas-ccr",u=0;function i(t,r){if(!t)return function(t,r){for(var n=[],e=t;e;){var c=e.getAttribute("id");c&&n.unshift(c),e=e.parentElement}var o=n.map(function(t){return'[id="'.concat(t,'"]')}).join(" ");return o?"".concat(o,' [id="').concat(r,'"]'):'[id="'.concat(r,'"]')}(t,r);var n=t.getAttribute(a);return n||(n="r".concat(++u),t.setAttribute(a,n)),"[".concat(a,'="').concat(n,'"] > [id="').concat(r,'"]')}function s(a){var u=a.id,s=a.components,f=a.style,l=a.className,d=a.parentProps,m=void 0===d?o:d,p=a.map,v=void 0===p?o:p,h=n([]),y=n(m),j=n(v),g=n(null);y.current=m,j.current=v;var b=e(function(){return(Array.isArray(s)?s:s?[s]:[]).flat().filter(Boolean)},[s]);c(function(){if(0!==b.length){h.current.forEach(function(t){return t()}),h.current=[];for(var r=0;r<b.length;r++){var n=b[r];if(n.l){var e="".concat(u,"-").concat(r),c=i(g.current,e),o=n.l(c,t(t({},y.current),j.current),{},{id:e,key:e});"function"==typeof o&&h.current.push(o)}}return function(){h.current.forEach(function(t){return t()}),h.current=[]}}},[b,u]);var k=e(function(){return 0===b.length?"":b.map(function(r,n){var e="".concat(u,"-").concat(n);return r.r(t(t({},y.current),j.current),{},{id:e,key:e})}).join("")},[b,u]);return 0===b.length?null:r("div",{id:u,ref:g,dangerouslySetInnerHTML:{__html:k},style:t({display:"contents"},f),className:l})}export{s as IkasComponentRenderer};
@@ -1,7 +1,40 @@
1
1
  /**
2
+ * Format a free-standing amount with the merchant's currency format settings. Use this for
3
+ * amounts that are NOT tied to a model (remaining amount to free shipping, gift wrap threshold,
4
+ * bulk discount limits, cart limit warnings). For model-bound prices, prefer the
5
+ * `get*FormattedPrice` helpers — they call this function internally.
2
6
  *
3
- * @param price Price to format
4
- * @param currencyCode Currency code
5
- * @param currencySymbol Symbol for the currency
7
+ * Applies the merchant's `currencyFormats` entry for the given currency code (symbol,
8
+ * symbolPosition, thousandSeparator, decimalSeparator, omitZeroDecimal). Behavior details:
9
+ * always two decimal places, and a space between the symbol and the number. `omitZeroDecimal`
10
+ * drops the fraction only when it is exactly `00`.
11
+ *
12
+ * Do NOT use `Intl.NumberFormat` for currency — it falls back to the browser locale and
13
+ * produces a format that conflicts with platform-formatted prices on the same screen.
14
+ *
15
+ * @ai-category Pricing
16
+ * @ai-related getProductVariantFormattedFinalPrice, getOrderLineItemFormattedFinalPrice, getIkasOrderFormattedTotalFinalPrice
17
+ *
18
+ * @param price - The amount to format
19
+ * @param currencyCode - Currency code used to look up the merchant format settings (e.g. "TRY", "USD")
20
+ * @param currencySymbol - Fallback symbol used when the merchant has no format entry for the code.
21
+ * Always pass the symbol from the model you took the amount from (e.g. `cart.currencySymbol`) —
22
+ * passing `null` can render the amount with no symbol at all.
23
+ * @returns The amount formatted with the merchant's currency format (e.g. "₺ 1,950.00")
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * import { cartStore, formatCurrency } from "@ikas/bp-storefront";
28
+ *
29
+ * function FreeShippingBar({ threshold }: { threshold: number }) {
30
+ * const cart = cartStore.cart;
31
+ * if (!cart) return null;
32
+ *
33
+ * const remaining = threshold - cart.totalFinalPrice;
34
+ * if (remaining <= 0) return <span>Free shipping unlocked!</span>;
35
+ *
36
+ * return <span>Add {formatCurrency(remaining, cart.currencyCode, cart.currencySymbol)} more for free shipping</span>;
37
+ * }
38
+ * ```
6
39
  */
7
40
  export declare const formatCurrency: (price: number, currencyCode: string, currencySymbol: string | null) => string;
@@ -7,6 +7,7 @@ export declare function capitalize(value: string): string;
7
7
  export declare function tryForEach(items: any[], callback: (item: any, index: number) => void, printErrors?: boolean): void;
8
8
  export declare function formatDate(date: Date): string;
9
9
  export declare function getCookieValue(cookieName: string): string | null;
10
+ export declare function getOpenAiAttributionMetadata(): Record<string, string>;
10
11
  export declare function isClient(): boolean;
11
12
  export declare function isServer(): boolean;
12
13
  export declare function getQueryParams(): URLSearchParams | undefined;
@@ -1 +1 @@
1
- import{__spreadArray as r}from'./../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as n}from"../packages/storefront-config/src/index.js";import{reaction as t}from'./../ext/mobx/dist/mobx.esm.js';var e=function(r){return/^\+?\d+$/.test(r)},o=function(r){r=(r=r.replace(/^\s+|\s+$/g,"")).toLocaleLowerCase("tr-TR");for(var n="àáäâèéëêìíïîıòóöôùúüûñçşğ·/_,:;",t=0;t<31;t++)r=r.replace(new RegExp(n.charAt(t),"g"),"aaaaeeeeiiiiioooouuuuncsg------".charAt(t));return r=r.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},a=function(r){return!(r.length>320)&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(r)};function i(r){return!!new Intl.DateTimeFormat(r,{hour:"numeric"}).format(0).match(/\s/)}function u(r,n,t){void 0===t&&(t=!1),r.forEach(function(r,e){try{n(r,e)}catch(r){t&&console.error(r)}})}function c(r){var t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},e=n.getCurrentLocale();return"undefined"!=typeof navigator?t.hour12=i(navigator.language):t.hour12=i(e),new Intl.DateTimeFormat(e,t).format(r)}function f(r){var n=document.cookie.split(";").find(function(n){return n.trim().startsWith("".concat(r,"="))});return n?n.split("=")[1]:null}function s(){return"undefined"!=typeof window}function l(){return!s()}function m(){if(s())return new URLSearchParams(location.search)}function p(){return!!s()&&(performance.getEntriesByType?"back_forward"===performance.getEntriesByType("navigation")[0].type:performance.navigation.type===performance.navigation.TYPE_BACK_FORWARD)}function g(r,n){void 0===n&&(n={arrayFormat:"comma"});for(var t=[],e=function(r,e){if(null==e)return"continue";Array.isArray(e)?"comma"===n.arrayFormat&&e.length>0?t.push("".concat(r,"=").concat(e.join(","))):e.forEach(function(n){return t.push("".concat(r,"=").concat(n))}):t.push("".concat(r,"=").concat(e))},o=0,a=Object.entries(r);o<a.length;o++){var i=a[o];e(i[0],i[1])}return t.length>0?"".concat(t.join("&")):""}function h(r){return null==r?r:JSON.parse(JSON.stringify(r))}function y(r,n){if(!r||!Array.isArray(r))return{};for(var t={},e=0,o=r;e<o.length;e++){var a=o[e],i=void 0;t[i=String("string"==typeof n?a[n]:"function"==typeof n?n(a):a)]||(t[i]=[]),t[i].push(a)}return t}function v(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return n&&Array.isArray(n)?(0===t.length&&(t=[function(r){return r}]),r([],n,!0).sort(function(r,n){for(var e=0,o=t;e<o.length;e++){var a=o[e],i=void 0,u=void 0;if("string"==typeof a?(i=r[a],u=n[a]):"function"==typeof a?(i=a(r),u=a(n)):(i=r,u=n),null!=i||null!=u){if(null==i)return 1;if(null==u)return-1;if(i<u)return-1;if(i>u)return 1}}return 0})):[]}function d(r,n){var t;return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];clearTimeout(t),t=setTimeout(function(){return r.apply(void 0,e)},n)}}function A(r,n){return t(r,n)}export{h as cloneDeep,d as debounce,c as formatDate,f as getCookieValue,m as getQueryParams,y as groupBy,p as isBackNavigation,s as isClient,l as isServer,A as reaction,v as sortBy,o as stringToSlug,g as stringifyQueryParams,u as tryForEach,a as validateEmail,e as validatePhoneNumber};
1
+ import{__spreadArray as r,__assign as n}from'./../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as t}from"../packages/storefront-config/src/index.js";import{reaction as e}from'./../ext/mobx/dist/mobx.esm.js';var o=function(r){return/^\+?\d+$/.test(r)},a=function(r){r=(r=r.replace(/^\s+|\s+$/g,"")).toLocaleLowerCase("tr-TR");for(var n="àáäâèéëêìíïîıòóöôùúüûñçşğ·/_,:;",t=0;t<31;t++)r=r.replace(new RegExp(n.charAt(t),"g"),"aaaaeeeeiiiiioooouuuuncsg------".charAt(t));return r=r.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},i=function(r){return!(r.length>320)&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(r)};function u(r){return!!new Intl.DateTimeFormat(r,{hour:"numeric"}).format(0).match(/\s/)}function c(r,n,t){void 0===t&&(t=!1),r.forEach(function(r,e){try{n(r,e)}catch(r){t&&console.error(r)}})}function f(r){var n={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},e=t.getCurrentLocale();return"undefined"!=typeof navigator?n.hour12=u(navigator.language):n.hour12=u(e),new Intl.DateTimeFormat(e,n).format(r)}function s(r){var n=document.cookie.split(";").find(function(n){return n.trim().startsWith("".concat(r,"="))});return n?n.split("=")[1]:null}function l(){var r=s("__oppref"),t=s("__obref");return n(n({},r?{oppref:r}:{}),t?{obref:t}:{})}function m(){return"undefined"!=typeof window}function p(){return!m()}function g(){if(m())return new URLSearchParams(location.search)}function h(){return!!m()&&(performance.getEntriesByType?"back_forward"===performance.getEntriesByType("navigation")[0].type:performance.navigation.type===performance.navigation.TYPE_BACK_FORWARD)}function v(r,n){void 0===n&&(n={arrayFormat:"comma"});for(var t=[],e=function(r,e){if(null==e)return"continue";Array.isArray(e)?"comma"===n.arrayFormat&&e.length>0?t.push("".concat(r,"=").concat(e.join(","))):e.forEach(function(n){return t.push("".concat(r,"=").concat(n))}):t.push("".concat(r,"=").concat(e))},o=0,a=Object.entries(r);o<a.length;o++){var i=a[o];e(i[0],i[1])}return t.length>0?"".concat(t.join("&")):""}function y(r){return null==r?r:JSON.parse(JSON.stringify(r))}function d(r,n){if(!r||!Array.isArray(r))return{};for(var t={},e=0,o=r;e<o.length;e++){var a=o[e],i=void 0;t[i=String("string"==typeof n?a[n]:"function"==typeof n?n(a):a)]||(t[i]=[]),t[i].push(a)}return t}function A(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return n&&Array.isArray(n)?(0===t.length&&(t=[function(r){return r}]),r([],n,!0).sort(function(r,n){for(var e=0,o=t;e<o.length;e++){var a=o[e],i=void 0,u=void 0;if("string"==typeof a?(i=r[a],u=n[a]):"function"==typeof a?(i=a(r),u=a(n)):(i=r,u=n),null!=i||null!=u){if(null==i)return 1;if(null==u)return-1;if(i<u)return-1;if(i>u)return 1}}return 0})):[]}function _(r,n){var t;return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];clearTimeout(t),t=setTimeout(function(){return r.apply(void 0,e)},n)}}function b(r,n){return e(r,n)}export{y as cloneDeep,_ as debounce,f as formatDate,s as getCookieValue,l as getOpenAiAttributionMetadata,g as getQueryParams,d as groupBy,h as isBackNavigation,m as isClient,p as isServer,b as reaction,A as sortBy,a as stringToSlug,v as stringifyQueryParams,c as tryForEach,i as validateEmail,o as validatePhoneNumber};