@dropins/storefront-wishlist 3.3.0 → 3.4.0-alpha-20260616153611
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.
- package/CHANGELOG.md +6 -0
- package/api/constants.d.ts +19 -0
- package/api/getWishlistById/getWishlistById.d.ts +1 -1
- package/api/getWishlists/getWishlists.d.ts +1 -1
- package/api/index.d.ts +1 -0
- package/api/initialize/initialize.d.ts +1 -0
- package/api/initializeWishlist/initializeWishlist.d.ts +6 -2
- package/api.js +39 -23
- package/api.js.map +1 -1
- package/components/Wishlist/Wishlist.d.ts +34 -0
- package/containers/WishlistToggle.js +2 -2
- package/containers/WishlistToggle.js.map +1 -1
- package/data/models/wishlist.d.ts +6 -0
- package/lib/state.d.ts +2 -0
- package/package.json +1 -1
- package/render.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @dropins/storefront-wishlist
|
|
2
2
|
|
|
3
|
+
## 3.4.0-alpha-20260616153611
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 53ab3b8: Added `pageSize` option to the `initialize` config to control how many wishlist items are fetched and displayed per page. Defaults to 9. Set a custom value to enable page-by-page navigation with pagination controls. Pagination UI renders automatically when total pages exceed one.
|
|
8
|
+
|
|
3
9
|
## 3.3.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2026 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export declare const DEFAULT_PAGE_SIZE = 9;
|
|
18
|
+
export declare const DEFAULT_CURRENT_PAGE = 1;
|
|
19
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Wishlist } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export declare const getWishlistById: (wishlistId: string) => Promise<void | Wishlist | null>;
|
|
3
|
+
export declare const getWishlistById: (wishlistId: string, pageSize?: number, currentPage?: number) => Promise<void | Wishlist | null>;
|
|
4
4
|
//# sourceMappingURL=getWishlistById.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Wishlist } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export declare const getWishlists: () => Promise<void | Wishlist[] | null>;
|
|
3
|
+
export declare const getWishlists: (pageSize?: number, currentPage?: number) => Promise<void | Wishlist[] | null>;
|
|
4
4
|
//# sourceMappingURL=getWishlists.d.ts.map
|
package/api/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
+
export * from './constants';
|
|
17
18
|
export * from './initialize';
|
|
18
19
|
export * from './fetch-graphql';
|
|
19
20
|
export * from './getStoreConfig';
|
|
@@ -5,6 +5,7 @@ type ConfigProps = {
|
|
|
5
5
|
langDefinitions?: Lang;
|
|
6
6
|
isGuestWishlistEnabled?: boolean;
|
|
7
7
|
storeCode?: string;
|
|
8
|
+
pageSize?: number;
|
|
8
9
|
};
|
|
9
10
|
export declare const initialize: Initializer<ConfigProps>;
|
|
10
11
|
export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Wishlist } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export interface InitializeWishlistOptions {
|
|
4
|
+
pageSize?: number;
|
|
5
|
+
currentPage?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const initializeWishlist: (options?: InitializeWishlistOptions) => Promise<Wishlist | null>;
|
|
8
|
+
export declare function getDefaultWishlist(options?: InitializeWishlistOptions): Promise<Wishlist | null>;
|
|
5
9
|
export declare function getGuestWishlist(): Promise<{} | Wishlist>;
|
|
6
10
|
//# sourceMappingURL=initializeWishlist.d.ts.map
|
package/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{events as
|
|
3
|
+
import{events as u}from"@dropins/tools/event-bus.js";import{Initializer as A}from"@dropins/tools/lib.js";import{FetchGraphQL as C}from"@dropins/tools/fetch-graphql.js";const E=9,W=1;function v(t){const e=document.cookie.split(";");for(const s of e)if(s.trim().startsWith(`${t}=`))return s.trim().substring(t.length+1);return null}const g={wishlistId:null,authenticated:!1,isLoading:!0},D=()=>g.storeCode&&g.storeCode!=="default"?`DROPIN__WISHLIST__WISHLIST-ID__${g.storeCode}`:"DROPIN__WISHLIST__WISHLIST-ID",r=new Proxy(g,{set(t,e,s){if(t[e]=s,e==="wishlistId"){const i=D();if(s===r.wishlistId)return!0;if(s===null)return document.cookie=`${i}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`,!0;const n=new Date;n.setDate(n.getDate()+30),document.cookie=`${i}=${s}; expires=${n.toUTCString()}; path=/`}return Reflect.set(t,e,s)},get(t,e){return e==="wishlistId"?v(D()):t[e]}});function f(t,e){var n;if(t.product.sku!==e.sku)return!1;const s=((n=t.selectedOptions)==null?void 0:n.map(o=>o.uid).filter(o=>!!o).sort())||[],i=(e.optionUIDs||[]).filter(o=>!!o).sort();return JSON.stringify(s)===JSON.stringify(i)}const P="DROPIN__WISHLIST__WISHLIST__DATA",S=()=>r.storeCode&&r.storeCode!=="default"?`${P}__${r.storeCode}`:P;function b(t){const e=r.authenticated?sessionStorage:localStorage,s=S();if(t)try{e.setItem(s,JSON.stringify(t))}catch(i){G(i)?console.error("Storage quota exceeded:",i):console.error("Error saving wishlist:",i)}else e.removeItem(s)}const G=t=>t instanceof DOMException&&t.name==="QuotaExceededError";function h(t=!1){const e=r.authenticated&&!t?sessionStorage:localStorage,s=S();try{const i=e.getItem(s);return i?JSON.parse(i):{id:"",items:[]}}catch(i){return console.error("Error retrieving wishlist:",i),{id:"",items:[]}}}function z(){localStorage.removeItem(S())}function dt(t,e=[]){var l;const s=r.authenticated?sessionStorage:localStorage,i=S(),n=s.getItem(i),o=n?JSON.parse(n):{items:[]};return(l=o==null?void 0:o.items)==null?void 0:l.find(_=>f(_,{sku:t,optionUIDs:e}))}const w=new A({init:async t=>{const e={isGuestWishlistEnabled:!1,...t};w.config.setConfig(e),r.storeCode=t.storeCode||void 0,r.pageSize=t.pageSize,$({pageSize:t.pageSize}).catch(console.error)},listeners:()=>[u.on("wishlist/data",t=>{b(t)},{eager:!0}),u.on("authenticated",async t=>{var e;if(r.authenticated&&!t&&u.emit("wishlist/reset",void 0),t&&!r.authenticated){r.authenticated=t;const s=await $({pageSize:(e=w.config.getConfig())==null?void 0:e.pageSize}).catch(console.error);s&<(s)}},{eager:!0}),u.on("wishlist/reset",()=>{rt().catch(console.error),u.emit("wishlist/data",null)})]}),It=w.config,{setEndpoint:ht,setFetchGraphQlHeader:pt,removeFetchGraphQlHeader:mt,setFetchGraphQlHeaders:gt,fetchGraphQl:p,getConfig:ft}=new C().getMethods();function F(t){return t?{wishlistIsEnabled:t.storeConfig.magento_wishlist_general_is_enabled,wishlistMultipleListIsEnabled:t.storeConfig.enable_multiple_wishlists,wishlistMaxNumber:t.storeConfig.maximum_number_of_wishlists}:null}function T(t,e){return t?{id:t.id,updated_at:t.updated_at,sharing_code:t.sharing_code,items_count:t.items_count,items:k(t,e??[]),page_info:H(t)}:null}function H(t){var s;const e=(s=t==null?void 0:t.items_v2)==null?void 0:s.page_info;if(e)return{currentPage:e.current_page,pageSize:e.page_size,totalPages:e.total_pages}}function k(t,e){var s,i;return(i=(s=t==null?void 0:t.items_v2)==null?void 0:s.items)!=null&&i.length?t.items_v2.items.map(n=>{const o=x(n);return{id:n.id,quantity:n.quantity,description:n.description,added_at:n.added_at,enteredOptions:e,selectedOptions:o,product:{sku:n.product.sku}}}):[]}function x(t){return t.__typename==="ConfigurableWishlistItem"?t.configurable_options?t.configurable_options.map(e=>({uid:e.configurable_product_option_value_uid})):[]:t.__typename==="BundleWishlistItem"?(t.bundle_options??[]).flatMap(s=>s.values??[]).map(s=>({uid:s.uid})):[]}const m=t=>{const e=t.map(s=>s.message).join(" ");throw Error(e)},q=`
|
|
4
4
|
query STORE_CONFIG_QUERY {
|
|
5
5
|
storeConfig {
|
|
6
6
|
magento_wishlist_general_is_enabled
|
|
@@ -8,7 +8,7 @@ query STORE_CONFIG_QUERY {
|
|
|
8
8
|
maximum_number_of_wishlists
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,Q=async()=>p(q,{method:"GET",cache:"force-cache"}).then(({errors:t,data:e})=>t?m(t):F(e)),B=`
|
|
12
12
|
fragment CUSTOMIZABLE_OPTIONS_FRAGMENT on SelectedCustomizableOption {
|
|
13
13
|
type
|
|
14
14
|
customizable_option_uid
|
|
@@ -24,7 +24,7 @@ query STORE_CONFIG_QUERY {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,Y=`
|
|
28
28
|
... on ConfigurableWishlistItem {
|
|
29
29
|
configurable_options {
|
|
30
30
|
option_label
|
|
@@ -36,7 +36,7 @@ query STORE_CONFIG_QUERY {
|
|
|
36
36
|
canonical_url
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`,J=`
|
|
40
40
|
... on DownloadableWishlistItem {
|
|
41
41
|
added_at
|
|
42
42
|
description
|
|
@@ -48,7 +48,7 @@ query STORE_CONFIG_QUERY {
|
|
|
48
48
|
}
|
|
49
49
|
quantity
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Z=`
|
|
52
52
|
... on GiftCardWishlistItem {
|
|
53
53
|
added_at
|
|
54
54
|
description
|
|
@@ -68,7 +68,7 @@ query STORE_CONFIG_QUERY {
|
|
|
68
68
|
sender_name
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`,
|
|
71
|
+
`,K=`
|
|
72
72
|
... on BundleWishlistItem {
|
|
73
73
|
bundle_options {
|
|
74
74
|
label
|
|
@@ -91,33 +91,40 @@ fragment WISHLIST_ITEM_FRAGMENT on WishlistItemInterface {
|
|
|
91
91
|
product {
|
|
92
92
|
sku
|
|
93
93
|
}
|
|
94
|
-
${Q}
|
|
95
|
-
${B}
|
|
96
|
-
${z}
|
|
97
94
|
${Y}
|
|
95
|
+
${J}
|
|
96
|
+
${Z}
|
|
97
|
+
${K}
|
|
98
98
|
customizable_options {
|
|
99
99
|
...CUSTOMIZABLE_OPTIONS_FRAGMENT
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
${
|
|
104
|
-
`,
|
|
103
|
+
${B}
|
|
104
|
+
`,O=`
|
|
105
105
|
fragment WISHLIST_FRAGMENT on Wishlist {
|
|
106
106
|
id
|
|
107
107
|
updated_at
|
|
108
108
|
sharing_code
|
|
109
109
|
items_count
|
|
110
|
-
items_v2 {
|
|
110
|
+
items_v2(pageSize: $pageSize, currentPage: $currentPage) {
|
|
111
111
|
items {
|
|
112
112
|
...WISHLIST_ITEM_FRAGMENT
|
|
113
113
|
}
|
|
114
|
+
page_info {
|
|
115
|
+
current_page
|
|
116
|
+
page_size
|
|
117
|
+
total_pages
|
|
118
|
+
}
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
${M}
|
|
118
|
-
`,
|
|
123
|
+
`,V=`
|
|
119
124
|
query GET_WISHLIST_BY_ID_QUERY(
|
|
120
125
|
$wishlistId: ID!,
|
|
126
|
+
$pageSize: Int = 9,
|
|
127
|
+
$currentPage: Int = 1,
|
|
121
128
|
) {
|
|
122
129
|
customer {
|
|
123
130
|
wishlist_v2(id: $wishlistId) {
|
|
@@ -125,18 +132,23 @@ ${M}
|
|
|
125
132
|
updated_at
|
|
126
133
|
sharing_code
|
|
127
134
|
items_count
|
|
128
|
-
items_v2 {
|
|
135
|
+
items_v2(pageSize: $pageSize, currentPage: $currentPage) {
|
|
129
136
|
items {
|
|
130
137
|
...WISHLIST_ITEM_FRAGMENT
|
|
131
138
|
}
|
|
139
|
+
page_info {
|
|
140
|
+
current_page
|
|
141
|
+
page_size
|
|
142
|
+
total_pages
|
|
143
|
+
}
|
|
132
144
|
}
|
|
133
145
|
}
|
|
134
146
|
}
|
|
135
147
|
}
|
|
136
148
|
|
|
137
149
|
${M}
|
|
138
|
-
`,
|
|
139
|
-
query GET_WISHLISTS_QUERY {
|
|
150
|
+
`,j=async(t,e=E,s=W)=>{if(!r.authenticated)return h();if(!t)throw Error("Wishlist ID is not set");return p(V,{variables:{wishlistId:t,pageSize:e,currentPage:s}}).then(({errors:i,data:n})=>{var l;if(i)return m(i);if(!((l=n==null?void 0:n.customer)!=null&&l.wishlist_v2))return null;const o=T(n.customer.wishlist_v2);return u.emit("wishlist/data",o),o})},X=`
|
|
151
|
+
query GET_WISHLISTS_QUERY($pageSize: Int = 9, $currentPage: Int = 1) {
|
|
140
152
|
customer {
|
|
141
153
|
wishlists {
|
|
142
154
|
...WISHLIST_FRAGMENT
|
|
@@ -144,11 +156,13 @@ ${M}
|
|
|
144
156
|
}
|
|
145
157
|
}
|
|
146
158
|
|
|
147
|
-
${
|
|
148
|
-
`,
|
|
159
|
+
${O}
|
|
160
|
+
`,tt=async(t=E,e=W)=>r.authenticated?p(X,{variables:{pageSize:t,currentPage:e}}).then(({errors:s,data:i})=>{var n;return s?m(s):(n=i==null?void 0:i.customer)!=null&&n.wishlists?i.customer.wishlists.map(o=>T(o)):null}):h(),et=`
|
|
149
161
|
mutation ADD_PRODUCTS_TO_WISHLIST_MUTATION(
|
|
150
162
|
$wishlistId: ID!,
|
|
151
163
|
$wishlistItems: [WishlistItemInput!]!,
|
|
164
|
+
$pageSize: Int = 9,
|
|
165
|
+
$currentPage: Int = 1,
|
|
152
166
|
) {
|
|
153
167
|
addProductsToWishlist(
|
|
154
168
|
wishlistId: $wishlistId
|
|
@@ -163,8 +177,8 @@ ${M}
|
|
|
163
177
|
}
|
|
164
178
|
}
|
|
165
179
|
}
|
|
166
|
-
${
|
|
167
|
-
`,
|
|
180
|
+
${O}
|
|
181
|
+
`,st=async t=>{var i,n,o,l,_;if(!t)return null;const e=h();let s={id:(e==null?void 0:e.id)??"",updated_at:"",sharing_code:"",items_count:0,items:(e==null?void 0:e.items)??[]};for(const a of t){if((i=s.items)==null?void 0:i.some(I=>f(I,{sku:a.sku,optionUIDs:a.optionsUIDs})))continue;const d=a.optionsUIDs?(n=a.optionsUIDs)==null?void 0:n.map(I=>({uid:I})):[];s.items=[...s.items,{id:crypto.randomUUID(),quantity:a.quantity,selectedOptions:d,enteredOptions:a.enteredOptions??[],product:{sku:a.sku}}]}if(s.items_count=(o=s.items)==null?void 0:o.length,u.emit("wishlist/data",s),r.authenticated){if(!r.wishlistId)throw u.emit("wishlist/data",e),Error("Wishlist ID is not set");const a={wishlistId:r.wishlistId,wishlistItems:t.map(({sku:L,quantity:N,optionsUIDs:R,enteredOptions:U})=>({sku:L,quantity:N,selected_options:R,entered_options:U})),pageSize:r.pageSize,currentPage:r.currentPage},{errors:c,data:d}=await p(et,{variables:a}),I=[...((l=d==null?void 0:d.addProductsToWishlist)==null?void 0:l.user_errors)??[],...c??[]];if(I.length>0)return u.emit("wishlist/data",e),m(I);const y=T(d.addProductsToWishlist.wishlist,((_=t[0])==null?void 0:_.enteredOptions)??[]);u.emit("wishlist/data",y)}return null},it=`
|
|
168
182
|
mutation REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION(
|
|
169
183
|
$wishlistId: ID!,
|
|
170
184
|
$wishlistItemsIds: [ID!]!,
|
|
@@ -179,10 +193,12 @@ ${w}
|
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
195
|
}
|
|
182
|
-
`,
|
|
196
|
+
`,St=async t=>{var i,n,o;const e=h(),s={...e,items:(i=e.items)==null?void 0:i.filter(l=>!t.some(_=>{var a;return f(l,{sku:_.product.sku,optionUIDs:(a=_.selectedOptions)==null?void 0:a.map(c=>c.uid)})}))};if(r.authenticated){if(!r.wishlistId)throw Error("Wishlist ID is not set");const l=t.map(d=>d.id),{errors:_,data:a}=await p(it,{variables:{wishlistId:r.wishlistId,wishlistItemsIds:l}}),c=[...((n=a==null?void 0:a.removeProductsFromWishlist)==null?void 0:n.user_errors)??[],..._??[]];return c.length>0?(u.emit("wishlist/data",e),m(c)):(await j(r.wishlistId,r.pageSize,r.currentPage),null)}return s.items_count=(o=s.items)==null?void 0:o.length,u.emit("wishlist/data",s),null},nt=`
|
|
183
197
|
mutation UPDATE_PRODUCTS_IN_WISHLIST_MUTATION(
|
|
184
198
|
$wishlistId: ID!,
|
|
185
199
|
$wishlistItems: [WishlistItemUpdateInput!]!,
|
|
200
|
+
$pageSize: Int = 9,
|
|
201
|
+
$currentPage: Int = 1,
|
|
186
202
|
) {
|
|
187
203
|
updateProductsInWishlist(
|
|
188
204
|
wishlistId: $wishlistId
|
|
@@ -198,6 +214,6 @@ ${w}
|
|
|
198
214
|
}
|
|
199
215
|
}
|
|
200
216
|
|
|
201
|
-
${
|
|
202
|
-
`,
|
|
217
|
+
${O}
|
|
218
|
+
`,Tt=async t=>{const e=r.wishlistId;if(!e)throw Error("Wishlist ID is not set");return p(nt,{variables:{wishlistId:e,pageSize:r.pageSize,currentPage:r.currentPage,wishlistItems:t.map(({wishlistItemId:s,quantity:i,description:n,selectedOptions:o,enteredOptions:l})=>({wishlistItemId:s,quantity:i,description:n,selected_options:o,entered_options:l}))}}).then(({errors:s,data:i})=>{var o;const n=[...((o=i==null?void 0:i.updateProductsInWishlist)==null?void 0:o.user_errors)??[],...s??[]];return n.length>0?m(n):T(i.updateProductsInWishlist.wishlist)})},rt=()=>(r.wishlistId=null,r.authenticated=!1,Promise.resolve(null)),$=async(t={})=>{if(r.initializing)return null;r.initializing=!0,r.config||(r.config=await Q());const e=r.authenticated?await ot(t):await at();return u.emit("wishlist/initialized",e),u.emit("wishlist/data",e),r.initializing=!1,e};async function ot(t={}){const{pageSize:e=E,currentPage:s=W}=t,i=await tt(e,s),n=i?i[0]:null;return n?(r.wishlistId=n.id,n):null}async function at(){try{return await h()}catch(t){throw console.error(t),t}}const lt=async t=>{var n;if(!t)return null;const e=h(!0),s=[];if((n=e==null?void 0:e.items)==null||n.forEach(o=>{var a;const l=((a=o.selectedOptions)==null?void 0:a.map(c=>c.uid))||[];if(!t.items.some(c=>f(c,{sku:o.product.sku,optionUIDs:l}))){const c={sku:o.product.sku,quantity:1,optionsUIDs:l,enteredOptions:o.enteredOptions||void 0};s.push(c)}}),s.length===0)return null;const i=await st(s);return z(),i};export{W as DEFAULT_CURRENT_PAGE,E as DEFAULT_PAGE_SIZE,st as addProductsToWishlist,z as clearPersistedLocalStorage,It as config,p as fetchGraphQl,ft as getConfig,ot as getDefaultWishlist,at as getGuestWishlist,h as getPersistedWishlistData,Q as getStoreConfig,j as getWishlistById,dt as getWishlistItemFromStorage,tt as getWishlists,f as i,w as initialize,$ as initializeWishlist,lt as mergeWishlists,mt as removeFetchGraphQlHeader,St as removeProductsFromWishlist,rt as resetWishlist,r as s,ht as setEndpoint,pt as setFetchGraphQlHeader,gt as setFetchGraphQlHeaders,b as setPersistedWishlistData,Tt as updateProductsInWishlist};
|
|
203
219
|
//# sourceMappingURL=api.js.map
|
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["/@dropins/storefront-wishlist/src/lib/cookies.ts","/@dropins/storefront-wishlist/src/lib/state.ts","/@dropins/storefront-wishlist/src/lib/wishlist-item-comparator.ts","/@dropins/storefront-wishlist/src/lib/persisted-data.ts","/@dropins/storefront-wishlist/src/api/initialize/initialize.ts","/@dropins/storefront-wishlist/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-wishlist/src/data/transforms/transform-store-config.ts","/@dropins/storefront-wishlist/src/data/transforms/transform-wishlist.ts","/@dropins/storefront-wishlist/src/lib/fetch-error.ts","/@dropins/storefront-wishlist/src/api/getStoreConfig/graphql/StoreConfigQuery.ts","/@dropins/storefront-wishlist/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-wishlist/src/api/graphql/CustomizableOptionsFragment.graphql.ts","/@dropins/storefront-wishlist/src/api/graphql/WishlistItemFragment.graphql.ts","/@dropins/storefront-wishlist/src/api/graphql/WishlistFragment.graphql.ts","/@dropins/storefront-wishlist/src/api/getWishlistById/graphql/getWishlistById.graphql.ts","/@dropins/storefront-wishlist/src/api/getWishlistById/getWishlistById.ts","/@dropins/storefront-wishlist/src/api/getWishlists/graphql/getWishlists.graphql.ts","/@dropins/storefront-wishlist/src/api/getWishlists/getWishlists.ts","/@dropins/storefront-wishlist/src/api/addProductsToWishlist/graphql/addProductsToWishlistMutation.ts","/@dropins/storefront-wishlist/src/api/addProductsToWishlist/addProductsToWishlist.ts","/@dropins/storefront-wishlist/src/api/removeProductsFromWishlist/graphql/removeProductsFromWishlistMutation.ts","/@dropins/storefront-wishlist/src/api/removeProductsFromWishlist/removeProductsFromWishlist.ts","/@dropins/storefront-wishlist/src/api/updateProductsInWishlist/graphql/updateProductsInWishlistMutation.ts","/@dropins/storefront-wishlist/src/api/updateProductsInWishlist/updateProductsInWishlist.ts","/@dropins/storefront-wishlist/src/api/resetWishlist/resetWishlist.ts","/@dropins/storefront-wishlist/src/api/initializeWishlist/initializeWishlist.ts","/@dropins/storefront-wishlist/src/api/mergeWishlists/mergeWishlists.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport function getCookie(cookieName: string) {\n // Split the cookie string into an array of individual cookies\n const cookies = document.cookie.split(';');\n\n // Loop through the cookies to find the one with the specified name\n for (const cookie of cookies) {\n // Check if this cookie starts with the name you're looking for\n if (cookie.trim().startsWith(`${cookieName}=`)) {\n // Extract and return the cookie's value\n return cookie.trim().substring(cookieName.length + 1);\n }\n }\n\n // If the cookie is not found, return null\n return null;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { StoreConfigModel } from '@/wishlist/data/models/store-config';\nimport { getCookie } from '@/wishlist/lib/cookies';\n\ntype State = {\n wishlistId: string | null;\n initializing?: boolean;\n isLoading?: boolean;\n locale?: string;\n config?: StoreConfigModel | null;\n authenticated: boolean;\n storeCode?: string;\n};\n\nconst _state: State = (() => {\n return {\n wishlistId: null,\n authenticated: false,\n isLoading: true,\n };\n})();\n\nconst getWishlistCookieName = (): string =>\n _state.storeCode && _state.storeCode !== 'default'\n ? `DROPIN__WISHLIST__WISHLIST-ID__${_state.storeCode}`\n : 'DROPIN__WISHLIST__WISHLIST-ID';\n\n// Proxy state to allow reactivity\nexport const state = new Proxy(_state, {\n set(target, key, value) {\n // @ts-ignore\n target[key] = value;\n\n if (key === 'wishlistId') {\n const cookieName = getWishlistCookieName();\n\n // only update cookie if value has changed\n if (value === state.wishlistId) return true;\n\n if (value === null) {\n document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`;\n return true;\n }\n\n // set expiration date\n const expires = new Date();\n expires.setDate(expires.getDate() + 30);\n document.cookie = `${cookieName}=${value}; expires=${expires.toUTCString()}; path=/`;\n }\n\n return Reflect.set(target, key, value);\n },\n get(target, key) {\n if (key === 'wishlistId') {\n return getCookie(getWishlistCookieName());\n }\n\n return target[key as keyof State];\n },\n});\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Item } from '@/wishlist/data/models/wishlist';\n\ninterface ProductLike {\n sku: string;\n optionUIDs?: string[];\n}\n\n/**\n * Helper function to compare wishlist items by their SKU and selected options\n */\nexport function isMatchingWishlistItem(\n wishlistItem: Item,\n product: ProductLike\n): boolean {\n // Compare SKUs first for early return\n if (wishlistItem.product.sku !== product.sku) {\n return false;\n }\n\n // Compare selected options\n const wishlistItemOptions =\n wishlistItem.selectedOptions\n ?.map((option: any) => option.uid)\n .filter((uid: any) => !!uid)\n .sort() || [];\n const productOptionUIDs = (product.optionUIDs || [])\n .filter((uid: any) => !!uid)\n .sort();\n\n // If options match (or both are empty), items are considered matching\n return (\n JSON.stringify(wishlistItemOptions) === JSON.stringify(productOptionUIDs)\n );\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Wishlist } from '@/wishlist/data/models';\nimport { state } from '@/wishlist/lib/state';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nconst WISHLIST_KEY_BASE = 'DROPIN__WISHLIST__WISHLIST__DATA';\n\nconst getWishlistKey = (): string =>\n state.storeCode && state.storeCode !== 'default'\n ? `${WISHLIST_KEY_BASE}__${state.storeCode}`\n : WISHLIST_KEY_BASE;\n\nexport function setPersistedWishlistData(data: Wishlist | null) {\n const $storage = state.authenticated ? sessionStorage : localStorage;\n const key = getWishlistKey();\n if (data) {\n try {\n $storage.setItem(key, JSON.stringify(data));\n } catch (error) {\n if (isQuotaExceededError(error)) {\n console.error('Storage quota exceeded:', error);\n } else {\n console.error('Error saving wishlist:', error);\n }\n }\n } else {\n $storage.removeItem(key);\n }\n}\n\nconst isQuotaExceededError = (error: unknown) => {\n //https://mmazzarolo.com/blog/2022-06-25-local-storage-status/\n return error instanceof DOMException && error.name === 'QuotaExceededError';\n};\n\nexport function getPersistedWishlistData(\n guest: boolean = false\n): Wishlist | {} {\n const $storage =\n state.authenticated && !guest ? sessionStorage : localStorage;\n const key = getWishlistKey();\n try {\n const wishlist = $storage.getItem(key);\n return wishlist ? JSON.parse(wishlist) : { id: '', items: [] };\n } catch (error) {\n console.error('Error retrieving wishlist:', error);\n return { id: '', items: [] };\n }\n}\n\nexport function clearPersistedLocalStorage() {\n localStorage.removeItem(getWishlistKey());\n}\n\nexport function getWishlistItemFromStorage(\n productSku: string,\n optionUIDs: string[] = []\n) {\n const storage = state.authenticated ? sessionStorage : localStorage;\n const key = getWishlistKey();\n const raw = storage.getItem(key);\n const wishlist = raw ? JSON.parse(raw) : { id: '', items: [] };\n\n return wishlist?.items?.find((item: any) =>\n isMatchingWishlistItem(item, {\n sku: productSku,\n optionUIDs,\n })\n );\n}\n","import { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/wishlist/lib/state';\nimport {\n initializeWishlist,\n resetWishlist,\n mergeWishlists,\n} from '@/wishlist/api';\nimport { setPersistedWishlistData } from '@/wishlist/lib/persisted-data';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n isGuestWishlistEnabled?: boolean;\n storeCode?: string;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = { isGuestWishlistEnabled: false, ...config };\n\n initialize.config.setConfig(defaultConfig);\n\n state.storeCode = config.storeCode || undefined;\n\n initializeWishlist().catch(console.error);\n },\n\n listeners: () => [\n events.on(\n 'wishlist/data',\n (payload) => {\n setPersistedWishlistData(payload);\n },\n { eager: true }\n ),\n events.on(\n 'authenticated',\n async (authenticated) => {\n if (state.authenticated && !authenticated) {\n // Reset wishlist if the user is no longer authenticated\n events.emit('wishlist/reset', undefined);\n }\n // Login event occurred\n if (authenticated && !state.authenticated) {\n state.authenticated = authenticated;\n const wishlist = await initializeWishlist().catch(console.error);\n if (wishlist) {\n mergeWishlists(wishlist);\n }\n }\n },\n { eager: true }\n ),\n events.on('wishlist/reset', () => {\n resetWishlist().catch(console.error);\n events.emit('wishlist/data', null);\n }),\n ],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { StoreConfigModel } from '@/wishlist/data/models';\n\nexport function transformStoreConfig(data: any): StoreConfigModel | null {\n if (!data) return null;\n\n return {\n wishlistIsEnabled: data.storeConfig.magento_wishlist_general_is_enabled,\n wishlistMultipleListIsEnabled: data.storeConfig.enable_multiple_wishlists,\n wishlistMaxNumber: data.storeConfig.maximum_number_of_wishlists,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { Wishlist, Item, Option } from '@/wishlist/data/models/wishlist';\n\nexport function transformWishlist(\n data: any,\n enteredOptions?: { uid: string; value: string }[]\n): Wishlist | null {\n if (!data) return null;\n\n return {\n id: data.id,\n updated_at: data.updated_at,\n sharing_code: data.sharing_code,\n items_count: data.items_count,\n items: transformItems(data, enteredOptions ?? []),\n };\n}\n\nfunction transformItems(\n data: any,\n enteredOptions: { uid: string; value: string }[]\n): Item[] {\n if (!data?.items_v2?.items?.length) return [];\n\n return data.items_v2.items.map((item: any) => {\n const selectedOptions = getSelectedOptions(item);\n return {\n id: item.id,\n quantity: item.quantity,\n description: item.description,\n added_at: item.added_at,\n enteredOptions,\n selectedOptions,\n product: { sku: item.product.sku },\n };\n });\n}\n\nfunction getSelectedOptions(item: Item): Option[] {\n if (item.__typename === 'ConfigurableWishlistItem') {\n return item.configurable_options\n ? item.configurable_options.map((option: any) => ({\n uid: option.configurable_product_option_value_uid,\n }))\n : [];\n }\n if (item.__typename === 'BundleWishlistItem') {\n const values = (item.bundle_options ?? []).flatMap(\n (option: any) => option.values ?? []\n );\n return values.map((value: any) => ({ uid: value.uid }));\n }\n return [];\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n magento_wishlist_general_is_enabled\n enable_multiple_wishlists\n maximum_number_of_wishlists\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/wishlist/api';\nimport { StoreConfigModel } from '@/wishlist/data/models';\nimport { transformStoreConfig } from '@/wishlist/data/transforms';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\n\nimport { STORE_CONFIG_QUERY } from './graphql/StoreConfigQuery';\n\nexport const getStoreConfig = async (): Promise<StoreConfigModel | null> => {\n return fetchGraphQl(STORE_CONFIG_QUERY, {\n method: 'GET',\n cache: 'force-cache',\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n return transformStoreConfig(data);\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CUSTOMIZABLE_OPTIONS_FRAGMENT = `\n fragment CUSTOMIZABLE_OPTIONS_FRAGMENT on SelectedCustomizableOption {\n type\n customizable_option_uid\n label\n is_required\n values {\n label\n value\n price{\n type\n units\n value\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CUSTOMIZABLE_OPTIONS_FRAGMENT } from './CustomizableOptionsFragment.graphql';\n\nconst CONFIGURABLE_WISHLIST_ITEM_FRAGMENT = `\n ... on ConfigurableWishlistItem {\n configurable_options {\n option_label\n value_label\n configurable_product_option_value_uid\n configurable_product_option_uid\n }\n configured_variant {\n canonical_url\n }\n }\n`;\n\nconst DOWNLOADABLE_WISHLIST_ITEM_FRAGMENT = `\n ... on DownloadableWishlistItem {\n added_at\n description\n links_v2 {\n sample_url\n sort_order\n title\n uid\n }\n quantity\n }\n`;\n\nconst GIFT_CARD_WISHLIST_ITEM_FRAGMENT = `\n ... on GiftCardWishlistItem {\n added_at\n description\n gift_card_options {\n amount {\n value\n currency\n }\n custom_giftcard_amount {\n value\n currency\n }\n message\n recipient_email\n recipient_name\n sender_email\n sender_name\n }\n }\n`;\n\nconst BUNDLE_WISHLIST_ITEM_FRAGMENT = `\n ... on BundleWishlistItem {\n bundle_options {\n label\n type\n uid\n values {\n uid\n label\n quantity\n }\n }\n }\n`;\n\nexport const WISHLIST_ITEM_FRAGMENT = `\nfragment WISHLIST_ITEM_FRAGMENT on WishlistItemInterface {\n __typename\n id\n quantity\n description\n added_at\n product {\n sku\n }\n ${CONFIGURABLE_WISHLIST_ITEM_FRAGMENT}\n ${DOWNLOADABLE_WISHLIST_ITEM_FRAGMENT}\n ${GIFT_CARD_WISHLIST_ITEM_FRAGMENT}\n ${BUNDLE_WISHLIST_ITEM_FRAGMENT}\n customizable_options {\n ...CUSTOMIZABLE_OPTIONS_FRAGMENT\n }\n }\n \n ${CUSTOMIZABLE_OPTIONS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_ITEM_FRAGMENT } from '@/wishlist/api/fragments';\n\nexport const WISHLIST_FRAGMENT = `\nfragment WISHLIST_FRAGMENT on Wishlist {\n id\n updated_at\n sharing_code\n items_count\n items_v2 {\n items {\n ...WISHLIST_ITEM_FRAGMENT\n }\n }\n }\n\n${WISHLIST_ITEM_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_ITEM_FRAGMENT } from '@/wishlist/api/fragments';\n\nexport const GET_WISHLIST_BY_ID_QUERY = `\n query GET_WISHLIST_BY_ID_QUERY(\n $wishlistId: ID!,\n ) {\n customer {\n wishlist_v2(id: $wishlistId) {\n id\n updated_at\n sharing_code\n items_count\n items_v2 {\n items {\n ...WISHLIST_ITEM_FRAGMENT\n }\n }\n }\n }\n }\n\n${WISHLIST_ITEM_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_WISHLIST_BY_ID_QUERY } from '@/wishlist/api/getWishlistById/graphql/getWishlistById.graphql';\nimport { Wishlist } from '@/wishlist/data/models';\nimport { transformWishlist } from '@/wishlist/data/transforms';\nimport { state } from '@/wishlist/lib/state';\nimport { fetchGraphQl, getPersistedWishlistData } from '@/wishlist/api';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getWishlistById = async (\n wishlistId: string\n): Promise<void | Wishlist | null> => {\n // When the user is not authenticated, we just have a single wishlist\n // There is no necessity to check any IDs\n if (!state.authenticated) {\n return getPersistedWishlistData();\n }\n\n if (!wishlistId) {\n throw Error('Wishlist ID is not set');\n }\n\n // @ts-ignore\n return fetchGraphQl(GET_WISHLIST_BY_ID_QUERY, {\n variables: {\n wishlistId,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.wishlist_v2) {\n return null;\n }\n\n const payload = transformWishlist(data.customer.wishlist_v2);\n events.emit('wishlist/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_FRAGMENT } from '@/wishlist/api/fragments';\n\nexport const GET_WISHLISTS_QUERY = `\n query GET_WISHLISTS_QUERY {\n customer {\n wishlists {\n ...WISHLIST_FRAGMENT\n }\n }\n }\n\n ${WISHLIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_WISHLISTS_QUERY } from '@/wishlist/api/getWishlists/graphql/getWishlists.graphql';\nimport { Wishlist } from '@/wishlist/data/models';\nimport { transformWishlist } from '@/wishlist/data/transforms';\nimport { state } from '@/wishlist/lib/state';\nimport { fetchGraphQl, getPersistedWishlistData } from '@/wishlist/api';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\n\nexport const getWishlists = async (): Promise<void | Wishlist[] | null> => {\n // When the user is not authenticated, we just have a single wishlist\n // There is no necessity to check any IDs\n if (!state.authenticated) {\n return getPersistedWishlistData();\n }\n\n return fetchGraphQl(GET_WISHLISTS_QUERY).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.wishlists) {\n return null;\n }\n\n return data.customer.wishlists.map((wishlist: any) =>\n transformWishlist(wishlist)\n );\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_FRAGMENT } from '@/wishlist/api/fragments';\n\nexport const ADD_PRODUCTS_TO_WISHLIST_MUTATION = `\n mutation ADD_PRODUCTS_TO_WISHLIST_MUTATION(\n $wishlistId: ID!, \n $wishlistItems: [WishlistItemInput!]!,\n ) {\n addProductsToWishlist(\n wishlistId: $wishlistId\n wishlistItems: $wishlistItems\n ) {\n wishlist {\n ...WISHLIST_FRAGMENT\n }\n user_errors {\n code\n message\n }\n }\n }\n${WISHLIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl, getPersistedWishlistData } from '@/wishlist/api';\nimport { state } from '@/wishlist/lib/state';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\nimport { ADD_PRODUCTS_TO_WISHLIST_MUTATION } from './graphql/addProductsToWishlistMutation';\nimport { Wishlist } from '@/wishlist/data/models/wishlist';\nimport { transformWishlist } from '@/wishlist/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nexport const addProductsToWishlist = async (\n items: [\n {\n sku: string;\n quantity: number;\n optionsUIDs?: string[]; // should be the options available for the product\n enteredOptions?: { uid: string; value: string }[]; // refer to both selected and entered options\n }\n ]\n): Promise<Wishlist | null> => {\n if (!items) return null;\n\n const wishlist = getPersistedWishlistData();\n let updatedWishlist = {\n id: wishlist?.id ?? '',\n updated_at: '',\n sharing_code: '',\n items_count: 0,\n items: wishlist?.items ?? [],\n };\n\n for (const item of items) {\n const skuExists = updatedWishlist.items?.some((wishlistItem: any) =>\n isMatchingWishlistItem(wishlistItem, {\n sku: item.sku,\n optionUIDs: item.optionsUIDs,\n })\n );\n\n if (skuExists) {\n continue;\n }\n\n const selectedOptions: { uid: string }[] = item.optionsUIDs\n ? item.optionsUIDs?.map((option: any) => ({\n uid: option,\n }))\n : [];\n\n updatedWishlist.items = [\n ...updatedWishlist.items,\n {\n id: crypto.randomUUID(),\n quantity: item.quantity,\n selectedOptions,\n enteredOptions: item.enteredOptions ?? [],\n product: { sku: item.sku },\n },\n ];\n }\n\n updatedWishlist.items_count = updatedWishlist.items?.length;\n events.emit('wishlist/data', updatedWishlist);\n\n if (state.authenticated) {\n if (!state.wishlistId) {\n events.emit('wishlist/data', wishlist);\n throw Error('Wishlist ID is not set');\n }\n\n const variables = {\n wishlistId: state.wishlistId,\n wishlistItems: items.map(\n ({ sku, quantity, optionsUIDs, enteredOptions }) => ({\n sku,\n quantity,\n selected_options: optionsUIDs,\n entered_options: enteredOptions,\n })\n ),\n };\n\n const { errors, data }: { errors: any; data: any } = await fetchGraphQl(\n ADD_PRODUCTS_TO_WISHLIST_MUTATION,\n { variables }\n );\n\n const _errors = [\n ...(data?.addProductsToWishlist?.user_errors ?? []),\n ...(errors ?? []),\n ];\n\n // if saving item to wishlist for logged user failed, we need to restore original wishlist in storage:\n if (_errors.length > 0) {\n events.emit('wishlist/data', wishlist);\n return handleFetchError(_errors);\n }\n\n const updatedWishlist = transformWishlist(\n data.addProductsToWishlist.wishlist,\n items[0]?.enteredOptions ?? []\n );\n events.emit('wishlist/data', updatedWishlist);\n }\n\n return null;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION = `\n mutation REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION(\n $wishlistId: ID!, \n $wishlistItemsIds: [ID!]!,\n ) {\n removeProductsFromWishlist(\n wishlistId: $wishlistId\n wishlistItemsIds: $wishlistItemsIds\n ) {\n user_errors {\n code\n message\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/wishlist/api';\nimport { state } from '@/wishlist/lib/state';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\nimport { REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION } from './graphql/removeProductsFromWishlistMutation';\nimport { Item, Wishlist } from '@/wishlist/data/models/wishlist';\nimport { events } from '@adobe-commerce/event-bus';\nimport { getPersistedWishlistData } from '@/wishlist/lib/persisted-data';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nexport const removeProductsFromWishlist = async (\n items: Array<Item>\n): Promise<Wishlist | null> => {\n const wishlist = getPersistedWishlistData();\n const updatedWishlist = {\n ...wishlist,\n items: wishlist.items?.filter((wishlistItem: any) => {\n return !items.some((item) =>\n isMatchingWishlistItem(wishlistItem, {\n sku: item.product.sku,\n optionUIDs: item.selectedOptions?.map((option: any) => option.uid),\n })\n );\n }),\n };\n\n if (state.authenticated) {\n if (!state.wishlistId) {\n throw Error('Wishlist ID is not set');\n }\n\n const itemIds = items.map((item) => item.id);\n const { errors, data } = await fetchGraphQl(\n REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION,\n {\n variables: { wishlistId: state.wishlistId, wishlistItemsIds: itemIds },\n }\n );\n\n const _errors = [\n ...(data?.removeProductsFromWishlist?.user_errors ?? []),\n ...(errors ?? []),\n ];\n\n // restore wishlist if removing item failed:\n if (_errors.length > 0) {\n events.emit('wishlist/data', wishlist);\n return handleFetchError(_errors);\n }\n }\n\n updatedWishlist.items_count = updatedWishlist.items?.length;\n events.emit('wishlist/data', updatedWishlist);\n\n return null;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_FRAGMENT } from '@/wishlist/api/graphql/WishlistFragment.graphql';\n\nexport const UPDATE_PRODUCTS_IN_WISHLIST_MUTATION = `\n mutation UPDATE_PRODUCTS_IN_WISHLIST_MUTATION(\n $wishlistId: ID!, \n $wishlistItems: [WishlistItemUpdateInput!]!,\n ) {\n updateProductsInWishlist(\n wishlistId: $wishlistId\n wishlistItems: $wishlistItems\n ) {\n wishlist {\n ...WISHLIST_FRAGMENT\n }\n user_errors {\n code\n message\n }\n }\n }\n \n ${WISHLIST_FRAGMENT} \n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/wishlist/api';\nimport { state } from '@/wishlist/lib/state';\nimport { handleFetchError } from '@/wishlist//lib/fetch-error';\n\nimport { UPDATE_PRODUCTS_IN_WISHLIST_MUTATION } from './graphql/updateProductsInWishlistMutation';\nimport { Wishlist } from '@/wishlist/data/models/wishlist';\nimport { transformWishlist } from '@/wishlist/data/transforms';\n\nexport const updateProductsInWishlist = async (\n items: {\n wishlistItemId: string;\n quantity: number;\n description: string;\n selectedOptions?: string[];\n enteredOptions?: { uid: string; value: string }[];\n }[]\n): Promise<Wishlist | null> => {\n const wishlistId = state.wishlistId;\n\n if (!wishlistId) {\n throw Error('Wishlist ID is not set');\n }\n\n return fetchGraphQl(UPDATE_PRODUCTS_IN_WISHLIST_MUTATION, {\n variables: {\n wishlistId,\n wishlistItems: items.map(\n ({\n wishlistItemId,\n quantity,\n description,\n selectedOptions: selected_options,\n enteredOptions: entered_options,\n }) => ({\n wishlistItemId,\n quantity,\n description,\n selected_options,\n entered_options,\n })\n ),\n },\n }).then(({ errors, data }) => {\n // handle errors\n const _errors = [\n ...(data?.updateProductsInWishlist?.user_errors ?? []),\n ...(errors ?? []),\n ];\n\n if (_errors.length > 0) return handleFetchError(_errors);\n\n return transformWishlist(data.updateProductsInWishlist.wishlist);\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { state } from '@/wishlist/lib/state';\nimport { Wishlist } from '@/wishlist/data/models';\n\nexport const resetWishlist = (): Promise<Wishlist | null> => {\n state.wishlistId = null;\n state.authenticated = false;\n\n return Promise.resolve(null);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/wishlist/lib/state';\nimport { getStoreConfig, getWishlists } from '@/wishlist/api';\nimport { getPersistedWishlistData } from '@/wishlist/lib/persisted-data';\nimport { Wishlist } from '@/wishlist/data/models';\n\nexport const initializeWishlist = async (): Promise<Wishlist | null> => {\n if (state.initializing) return null;\n\n state.initializing = true;\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n }\n\n const payload = state.authenticated\n ? await getDefaultWishlist()\n : await getGuestWishlist();\n\n events.emit('wishlist/initialized', payload);\n events.emit('wishlist/data', payload);\n\n state.initializing = false;\n\n return payload;\n};\n\nexport async function getDefaultWishlist() {\n const wishlists = await getWishlists();\n const wishlist = wishlists ? wishlists[0] : null;\n if (!wishlist) return null;\n\n state.wishlistId = wishlist.id;\n\n return wishlist;\n}\n\nexport async function getGuestWishlist() {\n try {\n return await getPersistedWishlistData();\n } catch (error) {\n console.error(error);\n throw error;\n }\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Wishlist, Item } from '@/wishlist/data/models';\nimport { addProductsToWishlist } from '@/wishlist/api';\nimport {\n getPersistedWishlistData,\n clearPersistedLocalStorage,\n} from '@/wishlist/lib/persisted-data';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nexport const mergeWishlists = async (\n wishlist: Wishlist\n): Promise<Wishlist | null> => {\n if (!wishlist) {\n return null;\n }\n\n const guestWishlist: {\n id?: string;\n items?: Item[];\n } = getPersistedWishlistData(true);\n const itemsToMerge: any[] = [];\n\n guestWishlist?.items?.forEach((item: any) => {\n const optionUIDs =\n item.selectedOptions?.map((option: any) => option.uid) || [];\n\n const exists = wishlist.items.some((wishlistItem: any) =>\n isMatchingWishlistItem(wishlistItem, {\n sku: item.product.sku,\n optionUIDs,\n })\n );\n\n if (!exists) {\n const mergeItem = {\n sku: item.product.sku,\n quantity: 1,\n optionsUIDs: optionUIDs,\n enteredOptions: item.enteredOptions || undefined,\n };\n\n itemsToMerge.push(mergeItem);\n }\n });\n\n if (itemsToMerge.length === 0) {\n return null;\n }\n\n const result = await addProductsToWishlist(itemsToMerge);\n clearPersistedLocalStorage();\n return result;\n};\n"],"names":["getCookie","cookieName","cookies","cookie","_state","getWishlistCookieName","state","target","key","value","expires","isMatchingWishlistItem","wishlistItem","product","wishlistItemOptions","_a","option","uid","productOptionUIDs","WISHLIST_KEY_BASE","getWishlistKey","setPersistedWishlistData","data","$storage","error","isQuotaExceededError","getPersistedWishlistData","guest","wishlist","clearPersistedLocalStorage","getWishlistItemFromStorage","productSku","optionUIDs","storage","raw","item","initialize","Initializer","config","defaultConfig","initializeWishlist","events","payload","authenticated","mergeWishlists","resetWishlist","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","transformStoreConfig","transformWishlist","enteredOptions","transformItems","_b","selectedOptions","getSelectedOptions","handleFetchError","errors","errorMessage","STORE_CONFIG_QUERY","getStoreConfig","CUSTOMIZABLE_OPTIONS_FRAGMENT","CONFIGURABLE_WISHLIST_ITEM_FRAGMENT","DOWNLOADABLE_WISHLIST_ITEM_FRAGMENT","GIFT_CARD_WISHLIST_ITEM_FRAGMENT","BUNDLE_WISHLIST_ITEM_FRAGMENT","WISHLIST_ITEM_FRAGMENT","WISHLIST_FRAGMENT","GET_WISHLIST_BY_ID_QUERY","getWishlistById","wishlistId","GET_WISHLISTS_QUERY","getWishlists","ADD_PRODUCTS_TO_WISHLIST_MUTATION","addProductsToWishlist","items","updatedWishlist","_c","variables","sku","quantity","optionsUIDs","_errors","_d","_e","REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION","removeProductsFromWishlist","itemIds","UPDATE_PRODUCTS_IN_WISHLIST_MUTATION","updateProductsInWishlist","wishlistItemId","description","selected_options","entered_options","getDefaultWishlist","getGuestWishlist","wishlists","guestWishlist","itemsToMerge","mergeItem","result"],"mappings":"wKAiBO,SAASA,EAAUC,EAAoB,CAE5C,MAAMC,EAAU,SAAS,OAAO,MAAM,GAAG,EAGzC,UAAWC,KAAUD,EAEnB,GAAIC,EAAO,OAAO,WAAW,GAAGF,CAAU,GAAG,EAE3C,OAAOE,EAAO,KAAK,EAAE,UAAUF,EAAW,OAAS,CAAC,EAKjD,OAAA,IACT,CCFA,MAAMG,EACG,CACL,WAAY,KACZ,cAAe,GACf,UAAW,EACb,EAGIC,EAAwB,IAC5BD,EAAO,WAAaA,EAAO,YAAc,UACrC,kCAAkCA,EAAO,SAAS,GAClD,gCAGOE,EAAQ,IAAI,MAAMF,EAAQ,CACrC,IAAIG,EAAQC,EAAKC,EAAO,CAItB,GAFAF,EAAOC,CAAG,EAAIC,EAEVD,IAAQ,aAAc,CACxB,MAAMP,EAAaI,EAAsB,EAGrC,GAAAI,IAAUH,EAAM,WAAmB,MAAA,GAEvC,GAAIG,IAAU,KACH,gBAAA,OAAS,GAAGR,CAAU,mDACxB,GAIH,MAAAS,MAAc,KACpBA,EAAQ,QAAQA,EAAQ,QAAQ,EAAI,EAAE,EAC7B,SAAA,OAAS,GAAGT,CAAU,IAAIQ,CAAK,aAAaC,EAAQ,YAAa,CAAA,UAAA,CAG5E,OAAO,QAAQ,IAAIH,EAAQC,EAAKC,CAAK,CACvC,EACA,IAAIF,EAAQC,EAAK,CACf,OAAIA,IAAQ,aACHR,EAAUK,GAAuB,EAGnCE,EA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Y,MAAMxB,EAAa,EAC/BhD,EAAWwE,EAAYA,EAAU,CAAC,EAAI,KACxC,OAACxE,GAELtB,EAAM,WAAasB,EAAS,GAErBA,GAJe,IAKxB,CAEA,eAAsBuE,IAAmB,CACnC,GAAA,CACF,OAAO,MAAMzE,EAAyB,QAC/BF,EAAO,CACd,cAAQ,MAAMA,CAAK,EACbA,CAAA,CAEV,CCrCa,MAAAoB,GAAiB,MAC5BhB,GAC6B,OAC7B,GAAI,CAACA,EACI,OAAA,KAGH,MAAAyE,EAGF3E,EAAyB,EAAI,EAC3B4E,EAAsB,CAAC,EAyBzB,IAvBWvF,EAAAsF,GAAA,YAAAA,EAAA,QAAA,MAAAtF,EAAO,QAASoB,GAAc,OACrC,MAAAH,IACJjB,EAAAoB,EAAK,kBAAL,YAAApB,EAAsB,IAAKC,GAAgBA,EAAO,OAAQ,CAAC,EAS7D,GAAI,CAPWY,EAAS,MAAM,KAAMhB,GAClCD,EAAuBC,EAAc,CACnC,IAAKuB,EAAK,QAAQ,IAClB,WAAAH,CACD,CAAA,CACH,EAEa,CACX,MAAMuE,EAAY,CAChB,IAAKpE,EAAK,QAAQ,IAClB,SAAU,EACV,YAAaH,EACb,eAAgBG,EAAK,gBAAkB,MACzC,EAEAmE,EAAa,KAAKC,CAAS,CAAA,CAC7B,GAGED,EAAa,SAAW,EACnB,OAAA,KAGH,MAAAE,EAAS,MAAM1B,EAAsBwB,CAAY,EAC5B,OAAAzE,EAAA,EACpB2E,CACT"}
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-wishlist/src/api/constants.ts","/@dropins/storefront-wishlist/src/lib/cookies.ts","/@dropins/storefront-wishlist/src/lib/state.ts","/@dropins/storefront-wishlist/src/lib/wishlist-item-comparator.ts","/@dropins/storefront-wishlist/src/lib/persisted-data.ts","/@dropins/storefront-wishlist/src/api/initialize/initialize.ts","/@dropins/storefront-wishlist/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-wishlist/src/data/transforms/transform-store-config.ts","/@dropins/storefront-wishlist/src/data/transforms/transform-wishlist.ts","/@dropins/storefront-wishlist/src/lib/fetch-error.ts","/@dropins/storefront-wishlist/src/api/getStoreConfig/graphql/StoreConfigQuery.ts","/@dropins/storefront-wishlist/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-wishlist/src/api/graphql/CustomizableOptionsFragment.graphql.ts","/@dropins/storefront-wishlist/src/api/graphql/WishlistItemFragment.graphql.ts","/@dropins/storefront-wishlist/src/api/graphql/WishlistFragment.graphql.ts","/@dropins/storefront-wishlist/src/api/getWishlistById/graphql/getWishlistById.graphql.ts","/@dropins/storefront-wishlist/src/api/getWishlistById/getWishlistById.ts","/@dropins/storefront-wishlist/src/api/getWishlists/graphql/getWishlists.graphql.ts","/@dropins/storefront-wishlist/src/api/getWishlists/getWishlists.ts","/@dropins/storefront-wishlist/src/api/addProductsToWishlist/graphql/addProductsToWishlistMutation.ts","/@dropins/storefront-wishlist/src/api/addProductsToWishlist/addProductsToWishlist.ts","/@dropins/storefront-wishlist/src/api/removeProductsFromWishlist/graphql/removeProductsFromWishlistMutation.ts","/@dropins/storefront-wishlist/src/api/removeProductsFromWishlist/removeProductsFromWishlist.ts","/@dropins/storefront-wishlist/src/api/updateProductsInWishlist/graphql/updateProductsInWishlistMutation.ts","/@dropins/storefront-wishlist/src/api/updateProductsInWishlist/updateProductsInWishlist.ts","/@dropins/storefront-wishlist/src/api/resetWishlist/resetWishlist.ts","/@dropins/storefront-wishlist/src/api/initializeWishlist/initializeWishlist.ts","/@dropins/storefront-wishlist/src/api/mergeWishlists/mergeWishlists.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const DEFAULT_PAGE_SIZE = 9;\nexport const DEFAULT_CURRENT_PAGE = 1;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport function getCookie(cookieName: string) {\n // Split the cookie string into an array of individual cookies\n const cookies = document.cookie.split(';');\n\n // Loop through the cookies to find the one with the specified name\n for (const cookie of cookies) {\n // Check if this cookie starts with the name you're looking for\n if (cookie.trim().startsWith(`${cookieName}=`)) {\n // Extract and return the cookie's value\n return cookie.trim().substring(cookieName.length + 1);\n }\n }\n\n // If the cookie is not found, return null\n return null;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { StoreConfigModel } from '@/wishlist/data/models/store-config';\nimport { getCookie } from '@/wishlist/lib/cookies';\n\ntype State = {\n wishlistId: string | null;\n initializing?: boolean;\n isLoading?: boolean;\n locale?: string;\n config?: StoreConfigModel | null;\n authenticated: boolean;\n storeCode?: string;\n pageSize?: number;\n currentPage?: number;\n};\n\nconst _state: State = (() => {\n return {\n wishlistId: null,\n authenticated: false,\n isLoading: true,\n };\n})();\n\nconst getWishlistCookieName = (): string =>\n _state.storeCode && _state.storeCode !== 'default'\n ? `DROPIN__WISHLIST__WISHLIST-ID__${_state.storeCode}`\n : 'DROPIN__WISHLIST__WISHLIST-ID';\n\n// Proxy state to allow reactivity\nexport const state = new Proxy(_state, {\n set(target, key, value) {\n // @ts-ignore\n target[key] = value;\n\n if (key === 'wishlistId') {\n const cookieName = getWishlistCookieName();\n\n // only update cookie if value has changed\n if (value === state.wishlistId) return true;\n\n if (value === null) {\n document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`;\n return true;\n }\n\n // set expiration date\n const expires = new Date();\n expires.setDate(expires.getDate() + 30);\n document.cookie = `${cookieName}=${value}; expires=${expires.toUTCString()}; path=/`;\n }\n\n return Reflect.set(target, key, value);\n },\n get(target, key) {\n if (key === 'wishlistId') {\n return getCookie(getWishlistCookieName());\n }\n\n return target[key as keyof State];\n },\n});\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Item } from '@/wishlist/data/models/wishlist';\n\ninterface ProductLike {\n sku: string;\n optionUIDs?: string[];\n}\n\n/**\n * Helper function to compare wishlist items by their SKU and selected options\n */\nexport function isMatchingWishlistItem(\n wishlistItem: Item,\n product: ProductLike\n): boolean {\n // Compare SKUs first for early return\n if (wishlistItem.product.sku !== product.sku) {\n return false;\n }\n\n // Compare selected options\n const wishlistItemOptions =\n wishlistItem.selectedOptions\n ?.map((option: any) => option.uid)\n .filter((uid: any) => !!uid)\n .sort() || [];\n const productOptionUIDs = (product.optionUIDs || [])\n .filter((uid: any) => !!uid)\n .sort();\n\n // If options match (or both are empty), items are considered matching\n return (\n JSON.stringify(wishlistItemOptions) === JSON.stringify(productOptionUIDs)\n );\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Wishlist } from '@/wishlist/data/models';\nimport { state } from '@/wishlist/lib/state';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nconst WISHLIST_KEY_BASE = 'DROPIN__WISHLIST__WISHLIST__DATA';\n\nconst getWishlistKey = (): string =>\n state.storeCode && state.storeCode !== 'default'\n ? `${WISHLIST_KEY_BASE}__${state.storeCode}`\n : WISHLIST_KEY_BASE;\n\nexport function setPersistedWishlistData(data: Wishlist | null) {\n const $storage = state.authenticated ? sessionStorage : localStorage;\n const key = getWishlistKey();\n if (data) {\n try {\n $storage.setItem(key, JSON.stringify(data));\n } catch (error) {\n if (isQuotaExceededError(error)) {\n console.error('Storage quota exceeded:', error);\n } else {\n console.error('Error saving wishlist:', error);\n }\n }\n } else {\n $storage.removeItem(key);\n }\n}\n\nconst isQuotaExceededError = (error: unknown) => {\n //https://mmazzarolo.com/blog/2022-06-25-local-storage-status/\n return error instanceof DOMException && error.name === 'QuotaExceededError';\n};\n\nexport function getPersistedWishlistData(\n guest: boolean = false\n): Wishlist | {} {\n const $storage =\n state.authenticated && !guest ? sessionStorage : localStorage;\n const key = getWishlistKey();\n try {\n const wishlist = $storage.getItem(key);\n return wishlist ? JSON.parse(wishlist) : { id: '', items: [] };\n } catch (error) {\n console.error('Error retrieving wishlist:', error);\n return { id: '', items: [] };\n }\n}\n\nexport function clearPersistedLocalStorage() {\n localStorage.removeItem(getWishlistKey());\n}\n\nexport function getWishlistItemFromStorage(\n productSku: string,\n optionUIDs: string[] = []\n) {\n const storage = state.authenticated ? sessionStorage : localStorage;\n const key = getWishlistKey();\n const raw = storage.getItem(key);\n const wishlist = raw ? JSON.parse(raw) : { id: '', items: [] };\n\n return wishlist?.items?.find((item: any) =>\n isMatchingWishlistItem(item, {\n sku: productSku,\n optionUIDs,\n })\n );\n}\n","import { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/wishlist/lib/state';\nimport {\n initializeWishlist,\n resetWishlist,\n mergeWishlists,\n} from '@/wishlist/api';\nimport { setPersistedWishlistData } from '@/wishlist/lib/persisted-data';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n isGuestWishlistEnabled?: boolean;\n storeCode?: string;\n pageSize?: number;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = { isGuestWishlistEnabled: false, ...config };\n\n initialize.config.setConfig(defaultConfig);\n\n state.storeCode = config.storeCode || undefined;\n state.pageSize = config.pageSize;\n\n initializeWishlist({ pageSize: config.pageSize }).catch(console.error);\n },\n\n listeners: () => [\n events.on(\n 'wishlist/data',\n (payload) => {\n setPersistedWishlistData(payload);\n },\n { eager: true }\n ),\n events.on(\n 'authenticated',\n async (authenticated) => {\n if (state.authenticated && !authenticated) {\n // Reset wishlist if the user is no longer authenticated\n events.emit('wishlist/reset', undefined);\n }\n // Login event occurred\n if (authenticated && !state.authenticated) {\n state.authenticated = authenticated;\n const wishlist = await initializeWishlist({\n pageSize: initialize.config.getConfig()?.pageSize,\n }).catch(console.error);\n if (wishlist) {\n mergeWishlists(wishlist);\n }\n }\n },\n { eager: true }\n ),\n events.on('wishlist/reset', () => {\n resetWishlist().catch(console.error);\n events.emit('wishlist/data', null);\n }),\n ],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { StoreConfigModel } from '@/wishlist/data/models';\n\nexport function transformStoreConfig(data: any): StoreConfigModel | null {\n if (!data) return null;\n\n return {\n wishlistIsEnabled: data.storeConfig.magento_wishlist_general_is_enabled,\n wishlistMultipleListIsEnabled: data.storeConfig.enable_multiple_wishlists,\n wishlistMaxNumber: data.storeConfig.maximum_number_of_wishlists,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { Wishlist, Item, PageInfo } from '@/wishlist/data/models/wishlist';\n\nexport function transformWishlist(\n data: any,\n enteredOptions?: { uid: string; value: string }[]\n): Wishlist | null {\n if (!data) return null;\n\n return {\n id: data.id,\n updated_at: data.updated_at,\n sharing_code: data.sharing_code,\n items_count: data.items_count,\n items: transformItems(data, enteredOptions ?? []),\n page_info: transformPageInfo(data),\n };\n}\n\nfunction transformPageInfo(data: any): PageInfo | undefined {\n const pageInfo = data?.items_v2?.page_info;\n if (!pageInfo) return undefined;\n\n return {\n currentPage: pageInfo.current_page,\n pageSize: pageInfo.page_size,\n totalPages: pageInfo.total_pages,\n };\n}\n\nfunction transformItems(\n data: any,\n enteredOptions: { uid: string; value: string }[]\n): Item[] {\n if (!data?.items_v2?.items?.length) return [];\n\n return data.items_v2.items.map((item: any) => {\n const selectedOptions = getSelectedOptions(item);\n return {\n id: item.id,\n quantity: item.quantity,\n description: item.description,\n added_at: item.added_at,\n enteredOptions,\n selectedOptions,\n product: { sku: item.product.sku },\n };\n });\n}\n\nfunction getSelectedOptions(item: any): { uid: string }[] {\n if (item.__typename === 'ConfigurableWishlistItem') {\n return item.configurable_options\n ? item.configurable_options.map((option: any) => ({\n uid: option.configurable_product_option_value_uid,\n }))\n : [];\n }\n if (item.__typename === 'BundleWishlistItem') {\n const values = (item.bundle_options ?? []).flatMap(\n (option: any) => option.values ?? []\n );\n return values.map((value: any) => ({ uid: value.uid }));\n }\n return [];\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n magento_wishlist_general_is_enabled\n enable_multiple_wishlists\n maximum_number_of_wishlists\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/wishlist/api';\nimport { StoreConfigModel } from '@/wishlist/data/models';\nimport { transformStoreConfig } from '@/wishlist/data/transforms';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\n\nimport { STORE_CONFIG_QUERY } from './graphql/StoreConfigQuery';\n\nexport const getStoreConfig = async (): Promise<StoreConfigModel | null> => {\n return fetchGraphQl(STORE_CONFIG_QUERY, {\n method: 'GET',\n cache: 'force-cache',\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n return transformStoreConfig(data);\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CUSTOMIZABLE_OPTIONS_FRAGMENT = `\n fragment CUSTOMIZABLE_OPTIONS_FRAGMENT on SelectedCustomizableOption {\n type\n customizable_option_uid\n label\n is_required\n values {\n label\n value\n price{\n type\n units\n value\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CUSTOMIZABLE_OPTIONS_FRAGMENT } from './CustomizableOptionsFragment.graphql';\n\nconst CONFIGURABLE_WISHLIST_ITEM_FRAGMENT = `\n ... on ConfigurableWishlistItem {\n configurable_options {\n option_label\n value_label\n configurable_product_option_value_uid\n configurable_product_option_uid\n }\n configured_variant {\n canonical_url\n }\n }\n`;\n\nconst DOWNLOADABLE_WISHLIST_ITEM_FRAGMENT = `\n ... on DownloadableWishlistItem {\n added_at\n description\n links_v2 {\n sample_url\n sort_order\n title\n uid\n }\n quantity\n }\n`;\n\nconst GIFT_CARD_WISHLIST_ITEM_FRAGMENT = `\n ... on GiftCardWishlistItem {\n added_at\n description\n gift_card_options {\n amount {\n value\n currency\n }\n custom_giftcard_amount {\n value\n currency\n }\n message\n recipient_email\n recipient_name\n sender_email\n sender_name\n }\n }\n`;\n\nconst BUNDLE_WISHLIST_ITEM_FRAGMENT = `\n ... on BundleWishlistItem {\n bundle_options {\n label\n type\n uid\n values {\n uid\n label\n quantity\n }\n }\n }\n`;\n\nexport const WISHLIST_ITEM_FRAGMENT = `\nfragment WISHLIST_ITEM_FRAGMENT on WishlistItemInterface {\n __typename\n id\n quantity\n description\n added_at\n product {\n sku\n }\n ${CONFIGURABLE_WISHLIST_ITEM_FRAGMENT}\n ${DOWNLOADABLE_WISHLIST_ITEM_FRAGMENT}\n ${GIFT_CARD_WISHLIST_ITEM_FRAGMENT}\n ${BUNDLE_WISHLIST_ITEM_FRAGMENT}\n customizable_options {\n ...CUSTOMIZABLE_OPTIONS_FRAGMENT\n }\n }\n \n ${CUSTOMIZABLE_OPTIONS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_ITEM_FRAGMENT } from '@/wishlist/api/fragments';\n\nexport const WISHLIST_FRAGMENT = `\nfragment WISHLIST_FRAGMENT on Wishlist {\n id\n updated_at\n sharing_code\n items_count\n items_v2(pageSize: $pageSize, currentPage: $currentPage) {\n items {\n ...WISHLIST_ITEM_FRAGMENT\n }\n page_info {\n current_page\n page_size\n total_pages\n }\n }\n }\n\n${WISHLIST_ITEM_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_ITEM_FRAGMENT } from '@/wishlist/api/fragments';\n\nexport const GET_WISHLIST_BY_ID_QUERY = `\n query GET_WISHLIST_BY_ID_QUERY(\n $wishlistId: ID!,\n $pageSize: Int = 9,\n $currentPage: Int = 1,\n ) {\n customer {\n wishlist_v2(id: $wishlistId) {\n id\n updated_at\n sharing_code\n items_count\n items_v2(pageSize: $pageSize, currentPage: $currentPage) {\n items {\n ...WISHLIST_ITEM_FRAGMENT\n }\n page_info {\n current_page\n page_size\n total_pages\n }\n }\n }\n }\n }\n\n${WISHLIST_ITEM_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_WISHLIST_BY_ID_QUERY } from '@/wishlist/api/getWishlistById/graphql/getWishlistById.graphql';\nimport { Wishlist } from '@/wishlist/data/models';\nimport { transformWishlist } from '@/wishlist/data/transforms';\nimport { state } from '@/wishlist/lib/state';\nimport { fetchGraphQl, getPersistedWishlistData } from '@/wishlist/api';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n DEFAULT_PAGE_SIZE,\n DEFAULT_CURRENT_PAGE,\n} from '@/wishlist/api/constants';\n\nexport const getWishlistById = async (\n wishlistId: string,\n pageSize: number = DEFAULT_PAGE_SIZE,\n currentPage: number = DEFAULT_CURRENT_PAGE\n): Promise<void | Wishlist | null> => {\n // When the user is not authenticated, we just have a single wishlist\n // There is no necessity to check any IDs\n if (!state.authenticated) {\n return getPersistedWishlistData();\n }\n\n if (!wishlistId) {\n throw Error('Wishlist ID is not set');\n }\n\n // @ts-ignore\n return fetchGraphQl(GET_WISHLIST_BY_ID_QUERY, {\n variables: {\n wishlistId,\n pageSize,\n currentPage,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.wishlist_v2) {\n return null;\n }\n\n const payload = transformWishlist(data.customer.wishlist_v2);\n events.emit('wishlist/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_FRAGMENT } from '@/wishlist/api/fragments';\n\nexport const GET_WISHLISTS_QUERY = `\n query GET_WISHLISTS_QUERY($pageSize: Int = 9, $currentPage: Int = 1) {\n customer {\n wishlists {\n ...WISHLIST_FRAGMENT\n }\n }\n }\n\n ${WISHLIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_WISHLISTS_QUERY } from '@/wishlist/api/getWishlists/graphql/getWishlists.graphql';\nimport { Wishlist } from '@/wishlist/data/models';\nimport { transformWishlist } from '@/wishlist/data/transforms';\nimport { state } from '@/wishlist/lib/state';\nimport { fetchGraphQl, getPersistedWishlistData } from '@/wishlist/api';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\nimport {\n DEFAULT_PAGE_SIZE,\n DEFAULT_CURRENT_PAGE,\n} from '@/wishlist/api/constants';\n\nexport const getWishlists = async (\n pageSize: number = DEFAULT_PAGE_SIZE,\n currentPage: number = DEFAULT_CURRENT_PAGE\n): Promise<void | Wishlist[] | null> => {\n // When the user is not authenticated, we just have a single wishlist\n // There is no necessity to check any IDs\n if (!state.authenticated) {\n return getPersistedWishlistData();\n }\n\n return fetchGraphQl(GET_WISHLISTS_QUERY, {\n variables: { pageSize, currentPage },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.wishlists) {\n return null;\n }\n\n return data.customer.wishlists.map((wishlist: any) =>\n transformWishlist(wishlist)\n );\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_FRAGMENT } from '@/wishlist/api/fragments';\n\nexport const ADD_PRODUCTS_TO_WISHLIST_MUTATION = `\n mutation ADD_PRODUCTS_TO_WISHLIST_MUTATION(\n $wishlistId: ID!, \n $wishlistItems: [WishlistItemInput!]!,\n $pageSize: Int = 9,\n $currentPage: Int = 1,\n ) {\n addProductsToWishlist(\n wishlistId: $wishlistId\n wishlistItems: $wishlistItems\n ) {\n wishlist {\n ...WISHLIST_FRAGMENT\n }\n user_errors {\n code\n message\n }\n }\n }\n${WISHLIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl, getPersistedWishlistData } from '@/wishlist/api';\nimport { state } from '@/wishlist/lib/state';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\nimport { ADD_PRODUCTS_TO_WISHLIST_MUTATION } from './graphql/addProductsToWishlistMutation';\nimport { Wishlist } from '@/wishlist/data/models/wishlist';\nimport { transformWishlist } from '@/wishlist/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nexport const addProductsToWishlist = async (\n items: [\n {\n sku: string;\n quantity: number;\n optionsUIDs?: string[]; // should be the options available for the product\n enteredOptions?: { uid: string; value: string }[]; // refer to both selected and entered options\n }\n ]\n): Promise<Wishlist | null> => {\n if (!items) return null;\n\n const wishlist = getPersistedWishlistData();\n let updatedWishlist = {\n id: wishlist?.id ?? '',\n updated_at: '',\n sharing_code: '',\n items_count: 0,\n items: wishlist?.items ?? [],\n };\n\n for (const item of items) {\n const skuExists = updatedWishlist.items?.some((wishlistItem: any) =>\n isMatchingWishlistItem(wishlistItem, {\n sku: item.sku,\n optionUIDs: item.optionsUIDs,\n })\n );\n\n if (skuExists) {\n continue;\n }\n\n const selectedOptions: { uid: string }[] = item.optionsUIDs\n ? item.optionsUIDs?.map((option: any) => ({\n uid: option,\n }))\n : [];\n\n updatedWishlist.items = [\n ...updatedWishlist.items,\n {\n id: crypto.randomUUID(),\n quantity: item.quantity,\n selectedOptions,\n enteredOptions: item.enteredOptions ?? [],\n product: { sku: item.sku },\n },\n ];\n }\n\n updatedWishlist.items_count = updatedWishlist.items?.length;\n events.emit('wishlist/data', updatedWishlist);\n\n if (state.authenticated) {\n if (!state.wishlistId) {\n events.emit('wishlist/data', wishlist);\n throw Error('Wishlist ID is not set');\n }\n\n const variables = {\n wishlistId: state.wishlistId,\n wishlistItems: items.map(\n ({ sku, quantity, optionsUIDs, enteredOptions }) => ({\n sku,\n quantity,\n selected_options: optionsUIDs,\n entered_options: enteredOptions,\n })\n ),\n pageSize: state.pageSize,\n currentPage: state.currentPage,\n };\n\n const { errors, data }: { errors: any; data: any } = await fetchGraphQl(\n ADD_PRODUCTS_TO_WISHLIST_MUTATION,\n { variables }\n );\n\n const _errors = [\n ...(data?.addProductsToWishlist?.user_errors ?? []),\n ...(errors ?? []),\n ];\n\n // if saving item to wishlist for logged user failed, we need to restore original wishlist in storage:\n if (_errors.length > 0) {\n events.emit('wishlist/data', wishlist);\n return handleFetchError(_errors);\n }\n\n const updatedWishlist = transformWishlist(\n data.addProductsToWishlist.wishlist,\n items[0]?.enteredOptions ?? []\n );\n events.emit('wishlist/data', updatedWishlist);\n }\n\n return null;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION = `\n mutation REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION(\n $wishlistId: ID!, \n $wishlistItemsIds: [ID!]!,\n ) {\n removeProductsFromWishlist(\n wishlistId: $wishlistId\n wishlistItemsIds: $wishlistItemsIds\n ) {\n user_errors {\n code\n message\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/wishlist/api';\nimport { state } from '@/wishlist/lib/state';\nimport { handleFetchError } from '@/wishlist/lib/fetch-error';\nimport { REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION } from './graphql/removeProductsFromWishlistMutation';\nimport { Item, Wishlist } from '@/wishlist/data/models/wishlist';\nimport { events } from '@adobe-commerce/event-bus';\nimport { getPersistedWishlistData } from '@/wishlist/lib/persisted-data';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\nimport { getWishlistById } from '@/wishlist/api/getWishlistById';\n\nexport const removeProductsFromWishlist = async (\n items: Array<Item>\n): Promise<Wishlist | null> => {\n const wishlist = getPersistedWishlistData();\n const updatedWishlist = {\n ...wishlist,\n items: wishlist.items?.filter((wishlistItem: any) => {\n return !items.some((item) =>\n isMatchingWishlistItem(wishlistItem, {\n sku: item.product.sku,\n optionUIDs: item.selectedOptions?.map((option: any) => option.uid),\n })\n );\n }),\n };\n\n if (state.authenticated) {\n if (!state.wishlistId) {\n throw Error('Wishlist ID is not set');\n }\n\n const itemIds = items.map((item) => item.id);\n const { errors, data } = await fetchGraphQl(\n REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION,\n {\n variables: { wishlistId: state.wishlistId, wishlistItemsIds: itemIds },\n }\n );\n\n const _errors = [\n ...(data?.removeProductsFromWishlist?.user_errors ?? []),\n ...(errors ?? []),\n ];\n\n // restore wishlist if removing item failed:\n if (_errors.length > 0) {\n events.emit('wishlist/data', wishlist);\n return handleFetchError(_errors);\n }\n\n // Re-fetch the current page from the server so the pagination state remains\n // accurate. The locally-filtered data only contains the current page's items,\n // so emitting it directly can show an empty panel when items remain on other pages.\n await getWishlistById(state.wishlistId, state.pageSize, state.currentPage);\n return null;\n }\n\n updatedWishlist.items_count = updatedWishlist.items?.length;\n events.emit('wishlist/data', updatedWishlist);\n\n return null;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { WISHLIST_FRAGMENT } from '@/wishlist/api/graphql/WishlistFragment.graphql';\n\nexport const UPDATE_PRODUCTS_IN_WISHLIST_MUTATION = `\n mutation UPDATE_PRODUCTS_IN_WISHLIST_MUTATION(\n $wishlistId: ID!, \n $wishlistItems: [WishlistItemUpdateInput!]!,\n $pageSize: Int = 9,\n $currentPage: Int = 1,\n ) {\n updateProductsInWishlist(\n wishlistId: $wishlistId\n wishlistItems: $wishlistItems\n ) {\n wishlist {\n ...WISHLIST_FRAGMENT\n }\n user_errors {\n code\n message\n }\n }\n }\n \n ${WISHLIST_FRAGMENT} \n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/wishlist/api';\nimport { state } from '@/wishlist/lib/state';\nimport { handleFetchError } from '@/wishlist//lib/fetch-error';\n\nimport { UPDATE_PRODUCTS_IN_WISHLIST_MUTATION } from './graphql/updateProductsInWishlistMutation';\nimport { Wishlist } from '@/wishlist/data/models/wishlist';\nimport { transformWishlist } from '@/wishlist/data/transforms';\n\nexport const updateProductsInWishlist = async (\n items: {\n wishlistItemId: string;\n quantity: number;\n description: string;\n selectedOptions?: string[];\n enteredOptions?: { uid: string; value: string }[];\n }[]\n): Promise<Wishlist | null> => {\n const wishlistId = state.wishlistId;\n\n if (!wishlistId) {\n throw Error('Wishlist ID is not set');\n }\n\n return fetchGraphQl(UPDATE_PRODUCTS_IN_WISHLIST_MUTATION, {\n variables: {\n wishlistId,\n pageSize: state.pageSize,\n currentPage: state.currentPage,\n wishlistItems: items.map(\n ({\n wishlistItemId,\n quantity,\n description,\n selectedOptions: selected_options,\n enteredOptions: entered_options,\n }) => ({\n wishlistItemId,\n quantity,\n description,\n selected_options,\n entered_options,\n })\n ),\n },\n }).then(({ errors, data }) => {\n // handle errors\n const _errors = [\n ...(data?.updateProductsInWishlist?.user_errors ?? []),\n ...(errors ?? []),\n ];\n\n if (_errors.length > 0) return handleFetchError(_errors);\n\n return transformWishlist(data.updateProductsInWishlist.wishlist);\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { state } from '@/wishlist/lib/state';\nimport { Wishlist } from '@/wishlist/data/models';\n\nexport const resetWishlist = (): Promise<Wishlist | null> => {\n state.wishlistId = null;\n state.authenticated = false;\n\n return Promise.resolve(null);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/wishlist/lib/state';\nimport { getStoreConfig, getWishlists } from '@/wishlist/api';\nimport { getPersistedWishlistData } from '@/wishlist/lib/persisted-data';\nimport { Wishlist } from '@/wishlist/data/models';\nimport {\n DEFAULT_PAGE_SIZE,\n DEFAULT_CURRENT_PAGE,\n} from '@/wishlist/api/constants';\n\nexport interface InitializeWishlistOptions {\n pageSize?: number;\n currentPage?: number;\n}\n\nexport const initializeWishlist = async (\n options: InitializeWishlistOptions = {}\n): Promise<Wishlist | null> => {\n if (state.initializing) return null;\n\n state.initializing = true;\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n }\n\n const payload = state.authenticated\n ? await getDefaultWishlist(options)\n : await getGuestWishlist();\n\n events.emit('wishlist/initialized', payload);\n events.emit('wishlist/data', payload);\n\n state.initializing = false;\n\n return payload;\n};\n\nexport async function getDefaultWishlist(\n options: InitializeWishlistOptions = {}\n) {\n const { pageSize = DEFAULT_PAGE_SIZE, currentPage = DEFAULT_CURRENT_PAGE } =\n options;\n const wishlists = await getWishlists(pageSize, currentPage);\n const wishlist = wishlists ? wishlists[0] : null;\n if (!wishlist) return null;\n\n state.wishlistId = wishlist.id;\n\n return wishlist;\n}\n\nexport async function getGuestWishlist() {\n try {\n return await getPersistedWishlistData();\n } catch (error) {\n console.error(error);\n throw error;\n }\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Wishlist, Item } from '@/wishlist/data/models';\nimport { addProductsToWishlist } from '@/wishlist/api';\nimport {\n getPersistedWishlistData,\n clearPersistedLocalStorage,\n} from '@/wishlist/lib/persisted-data';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nexport const mergeWishlists = async (\n wishlist: Wishlist\n): Promise<Wishlist | null> => {\n if (!wishlist) {\n return null;\n }\n\n const guestWishlist: {\n id?: string;\n items?: Item[];\n } = getPersistedWishlistData(true);\n const itemsToMerge: any[] = [];\n\n guestWishlist?.items?.forEach((item: any) => {\n const optionUIDs =\n item.selectedOptions?.map((option: any) => option.uid) || [];\n\n const exists = wishlist.items.some((wishlistItem: any) =>\n isMatchingWishlistItem(wishlistItem, {\n sku: item.product.sku,\n optionUIDs,\n })\n );\n\n if (!exists) {\n const mergeItem = {\n sku: item.product.sku,\n quantity: 1,\n optionsUIDs: optionUIDs,\n enteredOptions: item.enteredOptions || undefined,\n };\n\n itemsToMerge.push(mergeItem);\n }\n });\n\n if (itemsToMerge.length === 0) {\n return null;\n }\n\n const result = await addProductsToWishlist(itemsToMerge);\n clearPersistedLocalStorage();\n return result;\n};\n"],"names":["DEFAULT_PAGE_SIZE","DEFAULT_CURRENT_PAGE","getCookie","cookieName","cookies","cookie","_state","getWishlistCookieName","state","target","key","value","expires","isMatchingWishlistItem","wishlistItem","product","wishlistItemOptions","_a","option","uid","productOptionUIDs","WISHLIST_KEY_BASE","getWishlistKey","setPersistedWishlistData","data","$storage","error","isQuotaExceededError","getPersistedWishlistData","guest","wishlist","clearPersistedLocalStorage","getWishlistItemFromStorage","productSku","optionUIDs","storage","raw","item","initialize","Initializer","config","defaultConfig","initializeWishlist","events","payload","authenticated","mergeWishlists","resetWishlist","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","transformStoreConfig","transformWishlist","enteredOptions","transformItems","transformPageInfo","pageInfo","_b","selectedOptions","getSelectedOptions","handleFetchError","errors","errorMessage","e","STORE_CONFIG_QUERY","getStoreConfig","CUSTOMIZABLE_OPTIONS_FRAGMENT","CONFIGURABLE_WISHLIST_ITEM_FRAGMENT","DOWNLOADABLE_WISHLIST_ITEM_FRAGMENT","GIFT_CARD_WISHLIST_ITEM_FRAGMENT","BUNDLE_WISHLIST_ITEM_FRAGMENT","WISHLIST_ITEM_FRAGMENT","WISHLIST_FRAGMENT","GET_WISHLIST_BY_ID_QUERY","getWishlistById","wishlistId","pageSize","currentPage","GET_WISHLISTS_QUERY","getWishlists","ADD_PRODUCTS_TO_WISHLIST_MUTATION","addProductsToWishlist","items","updatedWishlist","_c","variables","sku","quantity","optionsUIDs","_errors","_d","_e","REMOVE_PRODUCTS_FROM_WISHLIST_MUTATION","removeProductsFromWishlist","itemIds","UPDATE_PRODUCTS_IN_WISHLIST_MUTATION","updateProductsInWishlist","wishlistItemId","description","selected_options","entered_options","options","getDefaultWishlist","getGuestWishlist","wishlists","guestWishlist","itemsToMerge","mergeItem","result"],"mappings":"wKAiBO,MAAMA,EAAoB,EACpBC,EAAuB,ECD7B,SAASC,EAAUC,EAAoB,CAE5C,MAAMC,EAAU,SAAS,OAAO,MAAM,GAAG,EAGzC,UAAWC,KAAUD,EAEnB,GAAIC,EAAO,OAAO,WAAW,GAAGF,CAAU,GAAG,EAE3C,OAAOE,EAAO,KAAK,EAAE,UAAUF,EAAW,OAAS,CAAC,EAKjD,OAAA,IACT,CCAA,MAAMG,EACG,CACL,WAAY,KACZ,cAAe,GACf,UAAW,EACb,EAGIC,EAAwB,IAC5BD,EAAO,WAAaA,EAAO,YAAc,UACrC,kCAAkCA,EAAO,SAAS,GAClD,gCAGOE,EAAQ,IAAI,MAAMF,EAAQ,CACrC,IAAIG,EAAQC,EAAKC,EAAO,CAItB,GAFAF,EAAOC,CAAG,EAAIC,EAEVD,IAAQ,aAAc,CACxB,MAAMP,EAAaI,EAAsB,EAGrC,GAAAI,IAAUH,EAAM,WAAmB,MAAA,GAEvC,GAAIG,IAAU,KACH,gB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